Skip to content

feat: kas bridge #1883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Jun 13, 2025
Merged

feat: kas bridge #1883

merged 48 commits into from
Jun 13, 2025

Conversation

danwt
Copy link
Contributor

@danwt danwt commented Jun 3, 2025

Description

https://www.notion.so/dymension/ADR-Kaspa-Bridge-Theory-203a4a51f86a806bb7b3d08bada58297?v=2558aaa9b1724690b4fa752695f26eb7
https://www.notion.so/dymension/ADR-Kaspa-Bridge-Implementation-206a4a51f86a803980aec7099c826fb4

Please review sibiling PR dymensionxyz/hyperlane-cosmos#10 too!

  • (hub) O on hub
  • (hub) withdrawal set on hub
  • (hub) update to O and withdrawals set
  • (hub) query to O and withdrawals set
  • (hub - hyperlane module) message id multisig without the merkle stuff
  • (hub) bootstrap proposal to declare initial outpoint and link to mailbox and ism
  • (hub) validator kas multisig reg (another PR see feat: kas bridge bookkeeping - Kas Multisig Registrations #1887)
  • (hub) tweaks required for having transaction outpoint inside hyperlane message metadata (and therefore also warp route metadata) (another PR see feat: robust hyperlane metadata parsing #1888)
  • (validator) validators must produce hyperlane message which has the kaspa outpoint in the warp payload

Closes #1886

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here


For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

@omritoptix omritoptix changed the title feat: kas bridge feat: kaspa bridge Jun 4, 2025
@omritoptix omritoptix changed the title feat: kaspa bridge feat: kas bridge Jun 4, 2025
omritoptix
omritoptix previously approved these changes Jun 5, 2025
Copy link
Contributor

@omritoptix omritoptix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@danwt danwt requested a review from omritoptix June 12, 2025 10:48
}

func (k *Keeper) SetProcessedWithdrawal(ctx sdk.Context, withdrawal types.WithdrawalID) error {
// see https://github.com/dymensionxyz/hyperlane-cosmos/blob/fb914a5ba702f70a428a475968b886891cb1ad77/x/core/keeper/logic_message.go#L50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u be more informative with the comment, beside the reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried my best

Copy link
Contributor

@keruch keruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

Copy link

codecov bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 4.33688% with 3419 lines in your changes missing coverage. Please review.

Project coverage is 21.78%. Comparing base (767afa7) to head (dbabff6).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
x/kas/types/tx.pb.go 2.71% 817 Missing and 6 partials ⚠️
x/kas/types/query.pb.go 3.04% 727 Missing and 6 partials ⚠️
x/kas/types/d.pb.go 1.07% 643 Missing ⚠️
x/kas/types/genesis.pb.go 0.97% 407 Missing ⚠️
x/kas/types/events.pb.go 1.54% 318 Missing ⚠️
x/kas/types/query.pb.gw.go 0.00% 133 Missing ⚠️
x/kas/types/d.go 0.00% 53 Missing ⚠️
x/kas/keeper/prop.go 0.00% 49 Missing ⚠️
x/kas/keeper/grpc_query.go 0.00% 47 Missing ⚠️
x/kas/keeper/keeper.go 43.03% 44 Missing and 1 partial ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1883      +/-   ##
==========================================
- Coverage   22.09%   21.78%   -0.32%     
==========================================
  Files         601      619      +18     
  Lines      141821   146022    +4201     
==========================================
+ Hits        31339    31808     +469     
- Misses     105693   109356    +3663     
- Partials     4789     4858      +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danwt danwt requested review from mtsitrin and keruch June 13, 2025 11:50
@omritoptix omritoptix merged commit 1d2176c into main Jun 13, 2025
5 of 7 checks passed
@omritoptix omritoptix deleted the danwt/kaspa-bridge branch June 13, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: kas bridge bookkeeping + queries
4 participants