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

feat(genesis): add singularity height to slashing module #259

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/x/evmstaking/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (

DefaultMinPartialWithdrawalAmount uint64 = 600_000

DefaultSingularityHeight uint64 = 1209600 // 42 days with 35 seconds block time
DefaultSingularityHeight uint64 = 1209600 // 42 days with 3 seconds block time
)

// NewParams creates a new Params instance.
Expand Down
2 changes: 1 addition & 1 deletion client/x/mint/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (k Keeper) BeginBlocker(ctx context.Context, ic types.InflationCalculationF
}

sdkCtx := sdk.UnwrapSDKContext(ctx)
if sdkCtx.BlockHeight() <= int64(params.SingularityHeight) {
if sdkCtx.BlockHeight() < int64(params.SingularityHeight) {
log.Debug(ctx, "Skip minting during singularity")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ replace (
cosmossdk.io/core v0.12.0 => cosmossdk.io/core v0.11.0

// Direct cosmos-sdk branch link: https://github.com/piplabs/cosmos-sdk/tree/piplabs/v0.50.7, current branch: piplabs/v0.50.7
github.com/cosmos/cosmos-sdk => github.com/piplabs/cosmos-sdk v0.50.7-piplabs-v0.14
github.com/cosmos/cosmos-sdk => github.com/piplabs/cosmos-sdk v0.50.8-0.20241020215712-ca039d442878

// See https://github.com/cosmos/cosmos-sdk/pull/14952
// Also https://github.com/cosmos/cosmos-db/blob/main/go.mod#L11-L12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,8 @@ github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/piplabs/cosmos-sdk v0.50.7-piplabs-v0.14 h1:Ks4P6BZOAHs4Nhr3hX5uMhcK8KitVUajAr1RVXvz448=
github.com/piplabs/cosmos-sdk v0.50.7-piplabs-v0.14/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s=
github.com/piplabs/cosmos-sdk v0.50.8-0.20241020215712-ca039d442878 h1:a49PS8MHEtZKtO/UoolwXEQl2QwKC+hZkVbmOFMPMaI=
github.com/piplabs/cosmos-sdk v0.50.8-0.20241020215712-ca039d442878/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
Expand Down
3 changes: 2 additions & 1 deletion lib/netconf/local/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"min_signed_per_window": "0.050000000000000000",
"downtime_jail_duration": "60s",
"slash_fraction_double_sign": "0.050000000000000000",
"slash_fraction_downtime": "0.010000000000000000"
"slash_fraction_downtime": "0.010000000000000000",
"singularity_height": "30"
},
"signing_infos": [],
"missed_blocks": []
Expand Down
3 changes: 2 additions & 1 deletion lib/netconf/odyssey/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@
"min_signed_per_window": "0.050000000000000000",
"downtime_jail_duration": "600s",
"slash_fraction_double_sign": "0.050000000000000000",
"slash_fraction_downtime": "0.000200000000000000"
"slash_fraction_downtime": "0.000200000000000000",
"singularity_height": "1209600"
},
"signing_infos": [],
"missed_blocks": []
Expand Down
Loading