-
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
Disable recovered_fp_btc_sk validation in SlashedBtcDelegation #63
Conversation
Isn't this needed for the consumer chain to verify the corresponding FP is indeed slashed? |
No if we trust Babylon. |
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.
If we remove this, which I'm OK with, let's just remove the commented code, and the field from the struct as well.
// if self.recovered_fp_btc_sk.is_empty() { | ||
// return Err(StakingApiError::EmptyBtcSk); | ||
// } |
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.
Nit: remove commented code.
Then how about we make this field optional, and then only deal with it when Asking because by default, Babylon cannot make assumption on whether the consumer side trusts itself, so Babylon has to send over the extracted secret key in any case |
@SebastianElvis you are right, just found this is used here babylon-contract/contracts/btc-staking/src/validation/mod.rs Lines 493 to 518 in 6ab5929
now qq - I was thinking keeping this field optional on the contract side still wouldn't help much as we can't turn on/off this field from Babylon side based on feature flag. Babylon would always need to send this field. Why don't we simply send slashing evidence from Babylon, if the full-validation ff is turned on contract is responsible to extract the SK from evidence, this would avoid the extraction logic in Babylon (which in my understanding is bit slow)? |
Yup this works as well, and it seems better as Babylon does less work 👍 |
This is a good idea in principle. Ah, you mean, sending the evidence along with the extracted SK, so that the Consumer can verify it. That makes sense. |
Hi guys as per today's (17 Sept) integration meeting it was discussed Babylon will send SK in the IBC packet. I will request to merge this PR as it is b/c in my cascading slashing PR I am not sending SK in IBC packet and I need the contract to disable this validation so e2e tests pass. I'll prefer to do the discussed change in a separate PR, have made a ticket for this. |
The Slashed Delegation IBC packet from Babylon -> Consumer expects to have FP SK, imo this is not needed in the contract side as it has nothing to do with the extracted key.
For now i have disabled the validation which happens on packet receive, in later pr i'll need to fix the proto files both in babylon side and contract side.
Ref https://github.com/babylonlabs-io/babylon/blob/7942dae93db7f61539e4f84ecc3ff67f32299f44/proto/babylon/btcstaking/v1/packet.proto#L136