-
Notifications
You must be signed in to change notification settings - Fork 7
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
EPIC: Add full validations #7
Labels
Comments
2 tasks
SebastianElvis
added a commit
that referenced
this issue
Sep 5, 2024
…46) First step of #7 This PR adds verification on the relationship between staking/slashing tx in staking requests using `babylon_btcstaking::tx_verify::check_transactions`. This also involves further refactoring of datagen library, and a bug fix in taproot pk script generation where we mistakenly used secp256k1 FFI that bloats contract size. NOTE: this PR still results in a wasm contract slightly bigger than the standard 800 KB. There are two ways to go ahead before optimisation is in place: 1. merge it into a feature branch for full validation for now, optimise in subsequent PRs, or 2. merge it into `main`, but before that add a Rust feature to allow to enable/disable the full validation I'm inclined to 2 but open to other ideas cc @maurolacy @gusin13 --- TODOs before ready: - [x] fixing size of BTC staking contract (current it's 1.9MB) - [x] making all tests use corresponding parameters in [datagen](https://github.com/babylonlabs-io/babylon-contract/blob/647b1f4f16a8b37f3d5a11a543cdb093f2d7d830/datagen/utils/btcstaking.go)
After #46 and #56, most of the reality checks are done (feature flag for lite/full version, correctness of BTC staking library, etc..). The following includes the missing verification rules. Those will be picked up later. Finality provider registration request
BTC delegation request
BTC undelegation request
Slashed BTC delegation
|
SebastianElvis
added a commit
that referenced
this issue
Sep 9, 2024
Part of #7 This PR adds verifications on staker's signature over the slashing tx in BTC delegation requests. This includes: - replacing rust secp256k1 with k256 for verifying Schnorr signatures and key pairs. This prevents bloating wasm binary size - adding an assertion ensuring the full validation version of btc staking contract is less than 1 MB. This checks whether rust-bitcoin stuff bloats the contract size or not. - verifying staker's Schnorr signature over its slashing tx in `handle_btc_delegation` (the version with `full-validation` feature) - fixing `datagen` to use 1st FP's secret key for generating pub rand commit and finality sig
SebastianElvis
added a commit
that referenced
this issue
Sep 9, 2024
This was referenced Sep 12, 2024
SebastianElvis
added a commit
that referenced
this issue
Sep 16, 2024
Part of #7 This PR implements the full validation of unbonded/slashed BTC delegations.
SebastianElvis
added a commit
that referenced
this issue
Sep 16, 2024
Part of #7 This PR adds more verification rules to a newly active BTC delegation: - ensure that all covenant signatures over {slashing, unbonding, unbonding slashing} txs are valid - ensure that the unbonding tx is spending the staking tx - ensure that the unbonding tx and unbonding slashing tx are consistent
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@maurolacy cloned issue babylonchain/babylon-contract#84 on 2024-05-03:
The text was updated successfully, but these errors were encountered: