Skip to content
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

backport: Insert inclusion height to early unbonding event #230

Merged

Conversation

gitferry
Copy link
Member

No description provided.

Closes #225.

* added unbonding start height to early unbonding event
* changed that early unbonding event is emitted  as a tx event
@gitferry gitferry requested a review from a team as a code owner October 25, 2024 01:18
@gitferry gitferry requested review from Lazar955, RafilxTenfen, KonradStaniec and jrwbabylonlab and removed request for a team, Lazar955 and RafilxTenfen October 25, 2024 01:18
Copy link

@jrwbabylonlab jrwbabylonlab left a comment

Choose a reason for hiding this comment

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

@gitferry could we get this released on current devnet?

@gitferry gitferry changed the base branch from main to release/v0.14.x October 25, 2024 10:10
@gitferry gitferry merged commit e12d0ef into release/v0.14.x Oct 25, 2024
20 checks passed
@gitferry gitferry deleted the backport/insuer-inclusion-height-early-unbonding branch October 25, 2024 10:10
@@ -215,8 +215,10 @@ message EventBTCDelgationUnbondedEarly {
// staking_tx_hash is the hash of the staking tx.
// It uniquely identifies a BTC delegation
string staking_tx_hash = 1 [(amino.dont_omitempty) = true];
// start_height is the start BTC height of the early unbonding
string start_height = 2 [(amino.dont_omitempty) = true];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not a uint32 or uint64? Just curious.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for easier parsing for subscribers of the event

Comment on lines +192 to +194
if !btcDel.IsUnbondedEarly() {
types.EmitExpiredDelegationEvent(sdkCtx, delEvent.StakingTxHash)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What if it's an early unbond? No event emitted?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is now emitted during processing undelegate message https://github.com/babylonlabs-io/babylon/pull/228/files#diff-0490899e13cee0223ce9b01147d9ad2753112c4e8118443e1b54684738fc4969R585. The reason we changed the emitting there is because we don't want to save the inclusion height in db considering re-org could happen on Bitcoin. Discussions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants