diff --git a/module/go.mod b/module/go.mod index 4437b431d..9d68a3c29 100644 --- a/module/go.mod +++ b/module/go.mod @@ -10,8 +10,8 @@ require ( ) replace ( - // Lock us into the v0.45 line - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.16 + // Use cosmos-sdk of Oraichain fork + github.com/cosmos/cosmos-sdk => github.com/oraichain/cosmos-sdk v0.45.17-0.20240822154747-4cc2e82d6f68 // Althea-net fork removes ibc-go v3 dep, tendermint->cometbft issue github.com/evmos/ethermint => github.com/althea-net/ethermint v0.19.5 diff --git a/module/go.sum b/module/go.sum index 3e659b4fd..65aa29e7c 100644 --- a/module/go.sum +++ b/module/go.sum @@ -240,8 +240,6 @@ github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 h1:zlCp9n3uwQieEL github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32/go.mod h1:kwMlEC4wWvB48zAShGKVqboJL6w4zCLesaNQ3YLU2BQ= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.45.16 h1:5ba/Bh5/LE55IwHQuCU4fiG4eXeDKtSWzehXRpaKDcw= -github.com/cosmos/cosmos-sdk v0.45.16/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -816,6 +814,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/oraichain/cosmos-sdk v0.45.17-0.20240822154747-4cc2e82d6f68 h1:zXer3jRPWbrC9jl7w2cEx4nCY19QWKNRdQ7l8xF7/+U= +github.com/oraichain/cosmos-sdk v0.45.17-0.20240822154747-4cc2e82d6f68/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= diff --git a/module/x/gravity/abci.go b/module/x/gravity/abci.go index 4188f6407..a8eca1d06 100644 --- a/module/x/gravity/abci.go +++ b/module/x/gravity/abci.go @@ -278,7 +278,7 @@ func valsetSlashing(ctx sdk.Context, k keeper.Keeper, params types.Params, evmCh // refresh validator before slashing/jailing val = updateValidator(ctx, k, val.GetOperator()) if !val.IsJailed() { - k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionValset) + k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionValset, 0) if err := ctx.EventManager().EmitTypedEvent( &types.EventSignatureSlashing{ Type: types.AttributeKeyValsetSignatureSlashing, @@ -325,7 +325,7 @@ func valsetSlashing(ctx sdk.Context, k keeper.Keeper, params types.Params, evmCh // refresh validator before slashing/jailing validator = updateValidator(ctx, k, validator.GetOperator()) if !validator.IsJailed() { - k.StakingKeeper.Slash(ctx, valConsAddr, ctx.BlockHeight(), validator.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionValset) + k.StakingKeeper.Slash(ctx, valConsAddr, ctx.BlockHeight(), validator.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionValset, 0) if err := ctx.EventManager().EmitTypedEvent( &types.EventSignatureSlashing{ Type: types.AttributeKeyValsetSignatureSlashing, @@ -434,7 +434,7 @@ func batchSlashing(ctx sdk.Context, k keeper.Keeper, params types.Params, evmCha // refresh validator before slashing/jailing val = updateValidator(ctx, k, val.GetOperator()) if !val.IsJailed() { - k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionBatch) + k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionBatch, 0) if err := ctx.EventManager().EmitTypedEvent( &types.EventSignatureSlashing{ Type: types.AttributeKeyBatchSignatureSlashing, @@ -513,7 +513,7 @@ func logicCallSlashing(ctx sdk.Context, k keeper.Keeper, params types.Params, ev // refresh validator before slashing/jailing val = updateValidator(ctx, k, val.GetOperator()) if !val.IsJailed() { - k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionLogicCall) + k.StakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionLogicCall, 0) if err := ctx.EventManager().EmitTypedEvent( &types.EventSignatureSlashing{ Type: types.AttributeKeyLogicCallSignatureSlashing, diff --git a/module/x/gravity/keeper/evidence.go b/module/x/gravity/keeper/evidence.go index 42ecbf97b..966328051 100644 --- a/module/x/gravity/keeper/evidence.go +++ b/module/x/gravity/keeper/evidence.go @@ -74,7 +74,7 @@ func (k Keeper) checkBadSignatureEvidenceInternal(ctx sdk.Context, evmChainPrefi params := k.GetParams(ctx) if !val.IsJailed() { k.StakingKeeper.Jail(ctx, cons) - k.StakingKeeper.Slash(ctx, cons, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionBadEthSignature) + k.StakingKeeper.Slash(ctx, cons, ctx.BlockHeight(), val.ConsensusPower(sdk.DefaultPowerReduction), params.SlashFractionBadEthSignature, 0) } return nil diff --git a/module/x/gravity/types/expected_keepers.go b/module/x/gravity/types/expected_keepers.go index 444a0075b..4284cc86b 100644 --- a/module/x/gravity/types/expected_keepers.go +++ b/module/x/gravity/types/expected_keepers.go @@ -23,7 +23,7 @@ type StakingKeeper interface { IterateLastValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI - Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) + Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec, stakingtypes.InfractionType) Jail(sdk.Context, sdk.ConsAddress) }