-
Notifications
You must be signed in to change notification settings - Fork 8
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
staking: verify staking/slashing tx relationship in staking requests #46
Conversation
ff1cb01
to
8cf2f3f
Compare
2d71351
to
94967db
Compare
Some debugging on the contract size: the contract size bloats due to taproot script utilities in Bitcoin library, specifically two things:
This is further due to that the process involves secp256k1 operations which are all implemented in C++. That's also the reason why
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
i'd prefer opt2 as well i.e "merge in main", qq regarding that though - why do we need to enable/disable the validation, shouldn't it always be enabled? |
There is a trade-off between
If we enable all verifications, then all operations on Babylon contracts will be quite expensive, but the integration is trustless. If we disable it, operations become cheaper but the consumer side trusts information sent from Babylon. |
OK make sense, updated the CI to include a new feature
Please take a look to see if this approach makes sense |
After some offline discussions, it's better to have a single compiled wasm binary rather than compiling all of them. This is not trivial and created #55 for now. Merging this PR |
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:
main
, but before that add a Rust feature to allow to enable/disable the full validationI'm inclined to 2 but open to other ideas cc @maurolacy @gusin13
TODOs before ready: