-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: Implement ADR-29 - generalized unbonding #215
Changes from all commits
46d2fa9
2bf8971
c8830b1
86b8d3c
7a8fe5d
f83f1e2
74db17e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,19 @@ message BTCDelegation { | |
uint32 params_version = 16; | ||
} | ||
|
||
// DelegatorUnbondingInfo contains the information about transaction which spent | ||
// the staking output. It contains: | ||
// - spend_stake_tx: the transaction which spent the staking output | ||
// - spend_stake_tx_inclusion_block_hash: the block hash of the block in which | ||
// spend_stake_tx was included | ||
// - spend_stake_tx_sig_inclusion_index: the index of spend_stake_tx in the block | ||
message DelegatorUnbondingInfo { | ||
// spend_stake_tx is the transaction which spent the staking output. It is | ||
// filled only if spend_stake_tx is different than unbonding_tx registered | ||
// on the Babylon chain. | ||
bytes spend_stake_tx = 1; | ||
} | ||
Comment on lines
+118
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this struct given that it only contains 1 field? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, this signals whether unbonding actually happened i.e
delegation is considered unbonded. And if
then unbonding happened through unexpected unbonding transaction i.e the transaction different that Assuming most of unbondings will happen through unbonding transaction committed to Babylon, this modelling enables us to save space i.e we do not store stake spending transaction if it happens to be already known unbonding transaction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK sounds good. Probably we can wrap some functions for |
||
|
||
// BTCUndelegation contains the information about the early unbonding path of the BTC delegation | ||
message BTCUndelegation { | ||
// unbonding_tx is the transaction which will transfer the funds from staking | ||
|
@@ -119,24 +132,21 @@ message BTCUndelegation { | |
// It is partially signed by SK corresponding to btc_pk, but not signed by | ||
// finality provider or covenant yet. | ||
bytes slashing_tx = 2 [ (gogoproto.customtype) = "BTCSlashingTx" ]; | ||
// delegator_unbonding_sig is the signature on the unbonding tx | ||
// by the delegator (i.e., SK corresponding to btc_pk). | ||
// It effectively proves that the delegator wants to unbond and thus | ||
// Babylon will consider this BTC delegation unbonded. Delegator's BTC | ||
// on Bitcoin will be unbonded after timelock | ||
bytes delegator_unbonding_sig = 3 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/types.BIP340Signature" ]; | ||
// delegator_slashing_sig is the signature on the slashing tx | ||
// by the delegator (i.e., SK corresponding to btc_pk). | ||
// It will be a part of the witness for the unbonding tx output. | ||
bytes delegator_slashing_sig = 4 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/types.BIP340Signature" ]; | ||
bytes delegator_slashing_sig = 3 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/types.BIP340Signature" ]; | ||
// covenant_slashing_sigs is a list of adaptor signatures on the slashing tx | ||
// by each covenant member | ||
// It will be a part of the witness for the staking tx output. | ||
repeated CovenantAdaptorSignatures covenant_slashing_sigs = 5; | ||
repeated CovenantAdaptorSignatures covenant_slashing_sigs = 4; | ||
// covenant_unbonding_sig_list is the list of signatures on the unbonding tx | ||
// by covenant members | ||
// It must be provided after processing undelegate message by Babylon | ||
repeated SignatureInfo covenant_unbonding_sig_list = 6; | ||
repeated SignatureInfo covenant_unbonding_sig_list = 5; | ||
// delegator_unbonding_info is the information about transaction which spent | ||
// the staking output | ||
DelegatorUnbondingInfo delegator_unbonding_info = 6; | ||
} | ||
|
||
// BTCDelegatorDelegations is a collection of BTC delegations from the same delegator. | ||
|
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 outdated documentation.