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

chore: Allow unbonding time to be min unbonding value #278

Merged
merged 6 commits into from
Nov 20, 2024

Conversation

gitferry
Copy link
Member

@gitferry gitferry commented Nov 19, 2024

Closes #263. In particular,

  • ensure checkpointFinalizationTimeout can never be changed in the update params handler of the btccheckpoint module
  • ensure minUnbondingTime can not be set to a value less than or equal to checkpointFinalizationTimeout in the update params handler of the btcstaking module
  • allows unbondingTime of a delegation to be set to a value equals to minUnbondingTime

@gitferry gitferry force-pushed the gai/allow-min-unbonding-time branch from 481e2b2 to b152dea Compare November 19, 2024 12:23
@gitferry gitferry marked this pull request as ready for review November 19, 2024 14:13
@gitferry gitferry requested a review from a team as a code owner November 19, 2024 14:13
@gitferry gitferry requested review from Lazar955, RafilxTenfen, KonradStaniec and jrwbabylonlab and removed request for a team November 19, 2024 14:13
@@ -110,6 +111,10 @@ func (ms msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdatePara
}

ctx := sdk.UnwrapSDKContext(goCtx)
if req.Params.CheckpointFinalizationTimeout != ms.k.GetParams(ctx).CheckpointFinalizationTimeout {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a comment here on why it can't be changed?

Copy link
Collaborator

@KonradStaniec KonradStaniec left a comment

Choose a reason for hiding this comment

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

just minor comment

@@ -206,6 +201,6 @@ func ValidateParsedMessageAgainstTheParams(
return &ParamsValidationResult{
StakingOutputIdx: stakingOutputIdx,
UnbondingOutputIdx: 0, // unbonding output always has only 1 output
MinUnbondingTime: minUnbondingTime,
MinUnbondingTime: parameters.MinUnbondingTimeBlocks,
Copy link
Collaborator

Choose a reason for hiding this comment

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

as we no longer calculate valid MinUnbondingTime in this functions, we can probably remove this field from ParamsValidationResult . (the caller has access to parameters.MinUnbondingTimeBlocks eitherway)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Fixed in 6b4abc7

@gitferry gitferry merged commit 4b17a1e into main Nov 20, 2024
19 checks passed
@gitferry gitferry deleted the gai/allow-min-unbonding-time branch November 20, 2024 07:22
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.

Allow choosing min_unbonding_time in the params as unbonding time
4 participants