diff --git a/app/ante/ante.go b/app/ante/ante.go index b7f4d7af..3a1ba0a3 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -19,7 +19,7 @@ import ( "fmt" "runtime/debug" - tmlog "github.com/cometbft/cometbft/libs/log" + tmlog "cosmossdk.io/log" errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" @@ -31,6 +31,7 @@ import ( "swisstronik/crypto/ethsecp256k1" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" ) @@ -115,7 +116,7 @@ var _ authante.SignatureVerificationGasConsumer = DefaultSigVerificationGasConsu // for signature verification based upon the public key type. The cost is fetched from the given params and is matched // by the concrete type. func DefaultSigVerificationGasConsumer( - meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, + meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error { pubkey := sig.PubKey switch pubkey := pubkey.(type) { @@ -141,7 +142,7 @@ func DefaultSigVerificationGasConsumer( // ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature func ConsumeMultisignatureVerificationGas( - meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, + meter storetypes.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, params authtypes.Params, accSeq uint64, ) error { size := sig.BitArray.Count() diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 51f55ca0..dfab539b 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -20,7 +20,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "swisstronik/app" + storetypes "cosmossdk.io/store/types" + "swisstronik/app/ante" "swisstronik/crypto/ethsecp256k1" "swisstronik/encoding" @@ -30,12 +31,13 @@ import ( "github.com/ethereum/go-ethereum/core/types" ethparams "github.com/ethereum/go-ethereum/params" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func (suite AnteTestSuite) TestAnteHandler() { - var acc authtypes.AccountI + var acc sdk.AccountI addr, privKey := tests.RandomEthAddressWithPrivateKey() to := tests.RandomEthAddress() @@ -355,14 +357,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSingleSignedTx( privKey, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, suite.ctx.ChainID(), 2000000, @@ -385,14 +387,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, suite.ctx.ChainID(), 2000000, @@ -415,14 +417,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, suite.ctx.ChainID(), 2000000, @@ -447,7 +449,7 @@ func (suite AnteTestSuite) TestAnteHandler() { txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, suite.ctx.ChainID(), 2000000, @@ -470,14 +472,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, "ethermint_9005-1", 2000000, @@ -500,14 +502,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_DIRECT, msg, suite.ctx.ChainID(), 2000000, @@ -530,14 +532,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, msg, suite.ctx.ChainID(), 2000, @@ -560,21 +562,21 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_DIRECT, msg, suite.ctx.ChainID(), 2000, "EIP-712", ) - msg.Amount[0].Amount = sdk.NewInt(5) + msg.Amount[0].Amount = sdkmath.NewInt(5) txBuilder.SetMsgs(msg) return txBuilder.GetTx() @@ -593,14 +595,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSignedMultisigTx( privKeys, - signing.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_DIRECT, msg, suite.ctx.ChainID(), 2000, @@ -622,14 +624,14 @@ func (suite AnteTestSuite) TestAnteHandler() { sdk.NewCoins( sdk.NewCoin( "uswtr", - sdk.NewInt(1), + sdkmath.NewInt(1), ), ), ) txBuilder := suite.CreateTestSingleSignedTx( privKey, - signing.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_DIRECT, msg, suite.ctx.ChainID(), 2000, @@ -1075,7 +1077,7 @@ func (suite AnteTestSuite) TestAnteHandlerWithParams() { func (suite *AnteTestSuite) TestConsumeSignatureVerificationGas() { params := authtypes.DefaultParams() msg := []byte{1, 2, 3, 4} - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() cdc := encodingConfig.Amino p := authtypes.DefaultParams() @@ -1096,7 +1098,7 @@ func (suite *AnteTestSuite) TestConsumeSignatureVerificationGas() { } type args struct { - meter sdk.GasMeter + meter storetypes.GasMeter sig signing.SignatureData pubkey cryptotypes.PubKey params authtypes.Params @@ -1107,11 +1109,11 @@ func (suite *AnteTestSuite) TestConsumeSignatureVerificationGas() { gasConsumed uint64 shouldErr bool }{ - {"PubKeyEd25519", args{sdk.NewInfiniteGasMeter(), nil, ed25519.GenPrivKey().PubKey(), params}, p.SigVerifyCostED25519, true}, - {"PubKeyEthSecp256k1", args{sdk.NewInfiniteGasMeter(), nil, pkSet1[0], params}, 21_000, false}, - {"PubKeySecp256r1", args{sdk.NewInfiniteGasMeter(), nil, skR1.PubKey(), params}, p.SigVerifyCostSecp256r1(), true}, - {"Multisig", args{sdk.NewInfiniteGasMeter(), multisignature1, multisigKey1, params}, expectedCost1, false}, - {"unknown key", args{sdk.NewInfiniteGasMeter(), nil, nil, params}, 0, true}, + {"PubKeyEd25519", args{storetypes.NewInfiniteGasMeter(), nil, ed25519.GenPrivKey().PubKey(), params}, p.SigVerifyCostED25519, true}, + {"PubKeyEthSecp256k1", args{storetypes.NewInfiniteGasMeter(), nil, pkSet1[0], params}, 21_000, false}, + {"PubKeySecp256r1", args{storetypes.NewInfiniteGasMeter(), nil, skR1.PubKey(), params}, p.SigVerifyCostSecp256r1(), true}, + {"Multisig", args{storetypes.NewInfiniteGasMeter(), multisignature1, multisigKey1, params}, expectedCost1, false}, + {"unknown key", args{storetypes.NewInfiniteGasMeter(), nil, nil, params}, 0, true}, } for _, tt := range tests { sigV2 := signing.SignatureV2{ diff --git a/app/ante/eip712.go b/app/ante/eip712.go index a8489cce..d1874bcd 100644 --- a/app/ante/eip712.go +++ b/app/ante/eip712.go @@ -28,11 +28,10 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" "swisstronik/crypto/ethsecp256k1" "swisstronik/ethereum/eip712" - ethermint "swisstronik/types" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/secp256k1" @@ -40,6 +39,9 @@ import ( evmtypes "swisstronik/x/evm/types" + swisstroniktypes "swisstronik/types" + + txsigning "cosmossdk.io/x/tx/signing" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -47,7 +49,7 @@ var ethermintCodec codec.ProtoCodecMarshaler func init() { registry := codectypes.NewInterfaceRegistry() - ethermint.RegisterInterfaces(registry) + swisstroniktypes.RegisterInterfaces(registry) ethermintCodec = codec.NewProtoCodec(registry) } @@ -87,13 +89,13 @@ func NewLegacyCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler { // CONTRACT: Tx must implement SigVerifiableTx interface type LegacyEip712SigVerificationDecorator struct { ak evmtypes.AccountKeeper - signModeHandler authsigning.SignModeHandler + signModeHandler *txsigning.HandlerMap } // Deprecated: NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator func NewLegacyEip712SigVerificationDecorator( ak evmtypes.AccountKeeper, - signModeHandler authsigning.SignModeHandler, + signModeHandler *txsigning.HandlerMap, ) LegacyEip712SigVerificationDecorator { return LegacyEip712SigVerificationDecorator{ ak: ak, @@ -130,7 +132,10 @@ func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, return ctx, err } - signerAddrs := sigTx.GetSigners() + signerAddrs, err := sigTx.GetSigners() + if err != nil { + return ctx, err + } // EIP712 allows just one signature if len(sigs) != 1 { @@ -202,7 +207,7 @@ func VerifySignature( pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, - _ authsigning.SignModeHandler, + _ *txsigning.HandlerMap, tx authsigning.Tx, ) error { switch data := sigData.(type) { @@ -233,10 +238,10 @@ func VerifySignature( Amount: tx.GetFee(), Gas: tx.GetGas(), }, - msgs, tx.GetMemo(), tx.GetTip(), + msgs, tx.GetMemo(), ) - signerChainID, err := ethermint.ParseChainID(signerData.ChainID) + signerChainID, err := swisstroniktypes.ParseChainID(signerData.ChainID) if err != nil { return errorsmod.Wrapf(err, "failed to parse chain-id: %s", signerData.ChainID) } @@ -250,7 +255,7 @@ func VerifySignature( return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx doesnt contain expected amount of extension options") } - extOpt, ok := opts[0].GetCachedValue().(*ethermint.ExtensionOptionsWeb3Tx) + extOpt, ok := opts[0].GetCachedValue().(*swisstroniktypes.ExtensionOptionsWeb3Tx) if !ok { return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "unknown extension option") } diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index a208e2ad..1b1954cb 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -12,6 +12,7 @@ import ( types "swisstronik/types" evmtypes "swisstronik/x/evm/types" + storetypes "cosmossdk.io/store/types" ethtypes "github.com/ethereum/go-ethereum/core/types" ) @@ -260,7 +261,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { func() { // TODO: fix // vmdb.AddBalance(addr, big.NewInt(1000000)) - suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1)) + suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1)) }, false, true, 0, @@ -273,7 +274,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { // TODO: Fix // vmdb.AddBalance(addr, big.NewInt(1001000000000000)) suite.app.EvmKeeper.SetBalance(suite.ctx, addr, big.NewInt(1001000000000000)) - suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(10000000000000000000)) + suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(10000000000000000000)) }, true, false, tx2Priority, @@ -286,7 +287,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { // TODO: Fix // vmdb.AddBalance(addr, big.NewInt(1001000000000000)) suite.app.EvmKeeper.SetBalance(suite.ctx, addr, big.NewInt(1001000000000000)) - suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(10000000000000000000)) + suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(10000000000000000000)) }, true, false, dynamicFeeTxPriority, @@ -314,12 +315,12 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { if tc.expPanic { suite.Require().Panics(func() { - _, _ = dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(sdk.NewGasMeter(1)), tc.tx, false, NextFn) + _, _ = dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(storetypes.NewGasMeter(1)), tc.tx, false, NextFn) }) return } - ctx, err := dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(sdk.NewInfiniteGasMeter()), tc.tx, false, NextFn) + ctx, err := dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(storetypes.NewInfiniteGasMeter()), tc.tx, false, NextFn) if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(tc.expPriority, ctx.Priority()) diff --git a/app/ante/fee_checker.go b/app/ante/fee_checker.go index 3d567e40..21d6319f 100644 --- a/app/ante/fee_checker.go +++ b/app/ante/fee_checker.go @@ -22,9 +22,10 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - ethermint "swisstronik/types" "swisstronik/x/evm/types" + swisstroniktypes "swisstronik/types" + sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -66,7 +67,7 @@ func NewDynamicFeeChecker(k DynamicFeeEVMKeeper) authante.TxFeeChecker { // get the priority tip cap from the extension option. if hasExtOptsTx, ok := tx.(authante.HasExtensionOptionsTx); ok { for _, opt := range hasExtOptsTx.GetExtensionOptions() { - if extOpt, ok := opt.GetCachedValue().(*ethermint.ExtensionOptionDynamicFeeTx); ok { + if extOpt, ok := opt.GetCachedValue().(*swisstroniktypes.ExtensionOptionDynamicFeeTx); ok { maxPriorityPrice = extOpt.MaxPriorityPrice break } @@ -122,7 +123,7 @@ func checkTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coi // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdk.NewDec(int64(gas)) + glDec := sdkmath.LegacyNewDec(int64(gas)) for i, gp := range minGasPrices { fee := gp.Amount.Mul(glDec) diff --git a/app/ante/fee_checker_test.go b/app/ante/fee_checker_test.go index a9ef59ce..5142fe2f 100644 --- a/app/ante/fee_checker_test.go +++ b/app/ante/fee_checker_test.go @@ -6,17 +6,18 @@ import ( "github.com/stretchr/testify/require" - "github.com/cometbft/cometbft/libs/log" + "swisstronik/encoding" + swisstroniktypes "swisstronik/types" + "swisstronik/x/evm/types" + evmtypes "swisstronik/x/evm/types" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/params" - "swisstronik/encoding" - ethermint "swisstronik/types" - "swisstronik/x/evm/types" - evmtypes "swisstronik/x/evm/types" ) var _ DynamicFeeEVMKeeper = MockEVMKeeper{} @@ -51,8 +52,8 @@ func TestSDKTxFeeChecker(t *testing.T) { // with extension option // without extension option // london hardfork enableness - encodingConfig := encoding.MakeConfig(module.NewBasicManager()) - minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uswtr", sdk.NewInt(10))) + encodingConfig := encoding.MakeConfig() + minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uswtr", sdkmath.NewInt(10))) genesisCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) checkTxCtx := sdk.NewContext(nil, tmproto.Header{Height: 1}, true, log.NewNopLogger()).WithMinGasPrices(minGasPrices) @@ -96,7 +97,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.Tx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdk.NewInt(10)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdkmath.NewInt(10)))) return txBuilder.GetTx() }, "10uswtr", @@ -138,7 +139,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.Tx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdk.NewInt(10)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdkmath.NewInt(10)))) return txBuilder.GetTx() }, "10uswtr", @@ -154,7 +155,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.Tx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdk.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdk.NewInt(10))))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdkmath.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdkmath.NewInt(10))))) return txBuilder.GetTx() }, "10000010uswtr", @@ -170,9 +171,9 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.Tx { txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdk.NewInt(10).Mul(types.DefaultPriorityReduction)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdkmath.NewInt(10).Mul(types.DefaultPriorityReduction)))) - option, err := codectypes.NewAnyWithValue(ðermint.ExtensionOptionDynamicFeeTx{}) + option, err := codectypes.NewAnyWithValue(&swisstroniktypes.ExtensionOptionDynamicFeeTx{}) require.NoError(t, err) txBuilder.SetExtensionOptions(option) return txBuilder.GetTx() @@ -190,10 +191,10 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.Tx { txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdk.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdk.NewInt(10))))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uswtr", sdkmath.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdkmath.NewInt(10))))) - option, err := codectypes.NewAnyWithValue(ðermint.ExtensionOptionDynamicFeeTx{ - MaxPriorityPrice: sdk.NewInt(5).Mul(types.DefaultPriorityReduction), + option, err := codectypes.NewAnyWithValue(&swisstroniktypes.ExtensionOptionDynamicFeeTx{ + MaxPriorityPrice: sdkmath.NewInt(5).Mul(types.DefaultPriorityReduction), }) require.NoError(t, err) txBuilder.SetExtensionOptions(option) diff --git a/app/ante/fees.go b/app/ante/fees.go index fde3de55..c5f97afc 100644 --- a/app/ante/fees.go +++ b/app/ante/fees.go @@ -23,6 +23,8 @@ import ( errortypes "github.com/cosmos/cosmos-sdk/types/errors" evmtypes "swisstronik/x/evm/types" + + sdkmath "cosmossdk.io/math" ethtypes "github.com/ethereum/go-ethereum/core/types" ) @@ -108,7 +110,7 @@ func (mpd MinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(gas)) + gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(gas)) for _, gp := range minGasPrices { fee := gp.Amount.Mul(gasLimit).Ceil().RoundInt() @@ -172,10 +174,10 @@ func (empd EthMinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul feeAmt = ethMsg.GetEffectiveFee(baseFee) } - gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas())) + gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas())) requiredFee := minGasPrice.Mul(gasLimit) - fee := sdk.NewDecFromBigInt(feeAmt) + fee := sdkmath.LegacyNewDecFromBigInt(feeAmt) if fee.LT(requiredFee) { return ctx, errorsmod.Wrapf( @@ -215,8 +217,8 @@ func (mfd EthMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgHandleTx)(nil)) } - fee := sdk.NewDecFromBigInt(ethMsg.GetFee()) - gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas())) + fee := sdkmath.LegacyNewDecFromBigInt(ethMsg.GetFee()) + gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas())) requiredFee := minGasPrice.Mul(gasLimit) if fee.LT(requiredFee) { diff --git a/app/ante/fees_test.go b/app/ante/fees_test.go index 2b141c89..9b136553 100644 --- a/app/ante/fees_test.go +++ b/app/ante/fees_test.go @@ -50,7 +50,7 @@ func (s AnteTestSuite) TestMinGasPriceDecorator() { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) txBuilder := s.CreateTestCosmosTxBuilder(sdkmath.NewInt(0), denom, &testMsg) @@ -64,7 +64,7 @@ func (s AnteTestSuite) TestMinGasPriceDecorator() { "valid cosmos tx with MinGasPrices = 0, gasPrice > 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) txBuilder := s.CreateTestCosmosTxBuilder(sdkmath.NewInt(10), denom, &testMsg) @@ -78,7 +78,7 @@ func (s AnteTestSuite) TestMinGasPriceDecorator() { "valid cosmos tx with MinGasPrices = 10, gasPrice = 10", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) txBuilder := s.CreateTestCosmosTxBuilder(sdkmath.NewInt(10), denom, &testMsg) @@ -92,7 +92,7 @@ func (s AnteTestSuite) TestMinGasPriceDecorator() { "invalid cosmos tx with MinGasPrices = 10, gasPrice = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) txBuilder := s.CreateTestCosmosTxBuilder(sdkmath.NewInt(0), denom, &testMsg) @@ -106,7 +106,7 @@ func (s AnteTestSuite) TestMinGasPriceDecorator() { "invalid cosmos tx with wrong denom", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) txBuilder := s.CreateTestCosmosTxBuilder(sdkmath.NewInt(10), "stake", &testMsg) @@ -153,7 +153,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "invalid tx type", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) return &invalidTx{} }, @@ -164,7 +164,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "wrong tx type", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) testMsg := banktypes.MsgSend{ FromAddress: "swtr13sllcdsqhjektac5r6h50dvjrthm0yt6zw3q4s", @@ -181,7 +181,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid: invalid tx type with MinGasPrices = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) return &invalidTx{} }, @@ -192,7 +192,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid legacy tx with MinGasPrices = 0, gasPrice = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), big.NewInt(0), nil, nil, nil, nil, nil) @@ -205,7 +205,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid legacy tx with MinGasPrices = 0, gasPrice > 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), big.NewInt(10), nil, nil, nil, nil, nil) @@ -218,7 +218,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid legacy tx with MinGasPrices = 10, gasPrice = 10", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), big.NewInt(10), nil, nil, nil, nil, nil) @@ -231,7 +231,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "invalid legacy tx with MinGasPrices = 10, gasPrice = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), big.NewInt(0), nil, nil, nil, nil, nil) @@ -244,7 +244,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid dynamic tx with MinGasPrices = 0, EffectivePrice = 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), nil, big.NewInt(0), big.NewInt(0), &emptyAccessList, nil, nil) @@ -257,7 +257,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid dynamic tx with MinGasPrices = 0, EffectivePrice > 0", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.ZeroDec() + params.MinGasPrice = sdkmath.LegacyZeroDec() s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), nil, big.NewInt(100), big.NewInt(50), &emptyAccessList, nil, nil) @@ -270,7 +270,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid dynamic tx with MinGasPrices < EffectivePrice", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), nil, big.NewInt(100), big.NewInt(100), &emptyAccessList, nil, nil) @@ -283,7 +283,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "invalid dynamic tx with MinGasPrices > EffectivePrice", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(10) + params.MinGasPrice = sdkmath.LegacyNewDec(10) s.app.FeeMarketKeeper.SetParams(s.ctx, params) msg := s.BuildTestEthTx(from, to, nil, make([]byte, 0), nil, big.NewInt(0), big.NewInt(0), &emptyAccessList, nil, nil) @@ -296,7 +296,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "invalid dynamic tx with MinGasPrices > BaseFee, MinGasPrices > EffectivePrice", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(100) + params.MinGasPrice = sdkmath.LegacyNewDec(100) s.app.FeeMarketKeeper.SetParams(s.ctx, params) feemarketParams := s.app.FeeMarketKeeper.GetParams(s.ctx) @@ -313,7 +313,7 @@ func (s AnteTestSuite) TestEthMinGasPriceDecorator() { "valid dynamic tx with MinGasPrices > BaseFee, MinGasPrices < EffectivePrice (big GasTipCap)", func() sdk.Tx { params := s.app.FeeMarketKeeper.GetParams(s.ctx) - params.MinGasPrice = sdk.NewDec(100) + params.MinGasPrice = sdkmath.LegacyNewDec(100) s.app.FeeMarketKeeper.SetParams(s.ctx, params) feemarketParams := s.app.FeeMarketKeeper.GetParams(s.ctx) diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 0797a3e3..0aad17c6 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -17,15 +17,16 @@ package ante import ( errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + txsigning "cosmossdk.io/x/tx/signing" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" evmtypes "swisstronik/x/evm/types" @@ -41,8 +42,8 @@ type HandlerOptions struct { FeeMarketKeeper FeeMarketKeeper EvmKeeper EVMKeeper FeegrantKeeper ante.FeegrantKeeper - SignModeHandler authsigning.SignModeHandler - SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error + SignModeHandler *txsigning.HandlerMap + SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error MaxTxGasWanted uint64 ExtensionOptionChecker ante.ExtensionOptionChecker TxFeeChecker ante.TxFeeChecker diff --git a/app/ante/reject_nested_msgs_test.go b/app/ante/reject_nested_msgs_test.go index e567aa26..aade45b9 100644 --- a/app/ante/reject_nested_msgs_test.go +++ b/app/ante/reject_nested_msgs_test.go @@ -397,20 +397,14 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { bz, err := txEncoder(tx) suite.Require().NoError(err) - resCheckTx := suite.app.CheckTx( - abci.RequestCheckTx{ + resCheckTx, err := suite.app.CheckTx( + &abci.RequestCheckTx{ Tx: bz, Type: abci.CheckTxType_New, }, ) + suite.Require().NoError(err) suite.Require().Equal(resCheckTx.Code, tc.expectedCode, resCheckTx.Log) - - resDeliverTx := suite.app.DeliverTx( - abci.RequestDeliverTx{ - Tx: bz, - }, - ) - suite.Require().Equal(resDeliverTx.Code, tc.expectedCode, resDeliverTx.Log) }) } } diff --git a/app/ante/setup.go b/app/ante/setup.go index dbd0ac2e..cacd626f 100644 --- a/app/ante/setup.go +++ b/app/ante/setup.go @@ -19,10 +19,11 @@ import ( "errors" "strconv" + evmtypes "swisstronik/x/evm/types" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - evmtypes "swisstronik/x/evm/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -49,7 +50,7 @@ func (esc EthSetupContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul } // We need to setup an empty gas config so that the gas is consistent with Ethereum. - newCtx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()). + newCtx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()). WithKVGasConfig(storetypes.GasConfig{}). WithTransientKVGasConfig(storetypes.GasConfig{}) @@ -111,10 +112,11 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu return next(ctx, tx, simulate) } - err := tx.ValidateBasic() - // ErrNoSignatures is fine with eth tx - if err != nil && !errors.Is(err, errortypes.ErrNoSignatures) { - return ctx, errorsmod.Wrap(err, "tx basic validation failed") + if validateBasic, ok := tx.(sdk.HasValidateBasic); ok { + // ErrNoSignatures is fine with eth tx + if err := validateBasic.ValidateBasic(); err != nil && !errors.Is(err, errortypes.ErrNoSignatures) { + return ctx, errorsmod.Wrap(err, "tx basic validation failed") + } } // For eth type cosmos tx, some fields should be verified as zero values, @@ -193,7 +195,7 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu txFee = txFee.Add(sdk.Coin{Denom: evmDenom, Amount: sdkmath.NewIntFromBigInt(txData.Fee())}) } - if !authInfo.Fee.Amount.IsEqual(txFee) { + if !authInfo.Fee.Amount.Equal(txFee) { return ctx, errorsmod.Wrapf(errortypes.ErrInvalidRequest, "invalid AuthInfo Fee Amount (%s != %s)", authInfo.Fee.Amount, txFee) } diff --git a/app/ante/setup_test.go b/app/ante/setup_test.go index 25f16892..50fc702c 100644 --- a/app/ante/setup_test.go +++ b/app/ante/setup_test.go @@ -5,7 +5,8 @@ import ( "swisstronik/app/ante" evmtypes "swisstronik/x/evm/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/app/ante/utils_test.go b/app/ante/utils_test.go index 1ba192af..457c7c25 100644 --- a/app/ante/utils_test.go +++ b/app/ante/utils_test.go @@ -1,6 +1,7 @@ package ante_test import ( + "context" "encoding/json" "fmt" "math" @@ -37,7 +38,6 @@ import ( sdkante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authz "github.com/cosmos/cosmos-sdk/x/authz" "swisstronik/app" @@ -48,7 +48,13 @@ import ( evmtypes "swisstronik/x/evm/types" feemarkettypes "swisstronik/x/feemarket/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + storetypes "cosmossdk.io/store/types" + txsigning "cosmossdk.io/x/tx/signing" + protov2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" ) type AnteTestSuite struct { @@ -72,7 +78,7 @@ const TestGasLimit uint64 = 100000 func (suite *AnteTestSuite) SetupTest() { checkTx := false - chainID := utils.TestnetChainID + "-1" + // chainID := utils.TestnetChainID + "-1" priv, err := ethsecp256k1.GenerateKey() suite.Require().NoError(err) @@ -107,21 +113,17 @@ func (suite *AnteTestSuite) SetupTest() { return genesis }) - suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: chainID, Time: time.Now().UTC()}) - suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdk.OneInt()))) - suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000)) + suite.ctx = suite.app.BaseApp.NewContext(checkTx) + suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdkmath.OneInt()))) + suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1000000000000000000)) // set staking denomination to default denom - params := suite.app.StakingKeeper.GetParams(suite.ctx) + params, err := suite.app.StakingKeeper.GetParams(suite.ctx) params.BondDenom = utils.BaseDenom err = suite.app.StakingKeeper.SetParams(suite.ctx, params) suite.Require().NoError(err) - infCtx := suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - err = suite.app.AccountKeeper.SetParams(infCtx, authtypes.DefaultParams()) - suite.Require().NoError(err) - - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() // We're using TestMsg amino encoding in some tests, so register it here. encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) eip712.SetEncodingConfig(encodingConfig) @@ -230,6 +232,7 @@ func (suite *AnteTestSuite) CreateTestTxBuilder( fees := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewIntFromBigInt(txData.Fee()))) builder.SetFeeAmount(fees) builder.SetGasLimit(msg.GetGas()) + defaultSignMode, err := authsigning.APISignModeToInternal(suite.clientCtx.TxConfig.SignModeHandler().DefaultMode()) if signCosmosTx { // First round: we gather all the signer infos. We use the "set empty @@ -237,7 +240,7 @@ func (suite *AnteTestSuite) CreateTestTxBuilder( sigV2 := signing.SignatureV2{ PubKey: priv.PubKey(), Data: &signing.SingleSignatureData{ - SignMode: suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(), + SignMode: defaultSignMode, Signature: nil, }, Sequence: txData.GetNonce(), @@ -256,7 +259,8 @@ func (suite *AnteTestSuite) CreateTestTxBuilder( Sequence: txData.GetNonce(), } sigV2, err = tx.SignWithPrivKey( - suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(), signerData, + context.Background(), + defaultSignMode, signerData, txBuilder, priv, suite.clientCtx.TxConfig, txData.GetNonce(), ) suite.Require().NoError(err) @@ -293,15 +297,6 @@ func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequenc msgsBytes = append(msgsBytes, json.RawMessage(legacyMsg.GetSignBytes())) } - var stdTip *legacytx.StdTip - if tip != nil { - if tip.Tipper == "" { - panic(fmt.Errorf("tipper cannot be empty")) - } - - stdTip = &legacytx.StdTip{Amount: tip.Amount, Tipper: tip.Tipper} - } - bz, err := cdc.MarshalJSON(legacytx.StdSignDoc{ AccountNumber: accnum, ChainID: chainID, @@ -310,7 +305,6 @@ func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequenc Msgs: msgsBytes, Sequence: sequence, TimeoutHeight: timeout, - Tip: stdTip, }) if err != nil { panic(err) @@ -333,7 +327,7 @@ func (suite *AnteTestSuite) GenerateMultipleKeys(n int) ([]cryptotypes.PrivKey, } // generateSingleSignature signs the given sign doc bytes using the given signType (EIP-712 or Standard) -func (suite *AnteTestSuite) generateSingleSignature(signMode signing.SignMode, privKey cryptotypes.PrivKey, signDocBytes []byte, signType string) (signature signing.SignatureV2) { +func (suite *AnteTestSuite) generateSingleSignature(signMode signingv1beta1.SignMode, privKey cryptotypes.PrivKey, signDocBytes []byte, signType string) (signature signing.SignatureV2) { var ( msg []byte err error @@ -346,9 +340,11 @@ func (suite *AnteTestSuite) generateSingleSignature(signMode signing.SignMode, p suite.Require().NoError(err) } + defaultSignMode, err := authsigning.APISignModeToInternal(signMode) + sigBytes, _ := privKey.Sign(msg) sigData := &signing.SingleSignatureData{ - SignMode: signMode, + SignMode: defaultSignMode, Signature: sigBytes, } @@ -359,7 +355,7 @@ func (suite *AnteTestSuite) generateSingleSignature(signMode signing.SignMode, p } // generateMultikeySignatures signs a set of messages using each private key within a given multi-key -func (suite *AnteTestSuite) generateMultikeySignatures(signMode signing.SignMode, privKeys []cryptotypes.PrivKey, signDocBytes []byte, signType string) (signatures []signing.SignatureV2) { +func (suite *AnteTestSuite) generateMultikeySignatures(signMode signingv1beta1.SignMode, privKeys []cryptotypes.PrivKey, signDocBytes []byte, signType string) (signatures []signing.SignatureV2) { n := len(privKeys) signatures = make([]signing.SignatureV2, n) @@ -396,21 +392,65 @@ func (suite *AnteTestSuite) RegisterAccount(pubKey cryptotypes.PubKey, balance * } // createSignerBytes generates sign doc bytes using the given parameters -func (suite *AnteTestSuite) createSignerBytes(chainId string, signMode signing.SignMode, pubKey cryptotypes.PubKey, txBuilder client.TxBuilder) []byte { +func (suite *AnteTestSuite) createSignerBytes(chainId string, signMode signingv1beta1.SignMode, pubKey cryptotypes.PubKey, txBuilder client.TxBuilder, msg sdk.Msg) []byte { acc, err := sdkante.GetSignerAcc(suite.ctx, suite.app.AccountKeeper, sdk.AccAddress(pubKey.Address())) suite.Require().NoError(err) - signerInfo := authsigning.SignerData{ - Address: sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), acc.GetAddress().Bytes()), + + anyPk, _ := codectypes.NewAnyWithValue(pubKey) + // Declare signerData + signerInfo := txsigning.SignerData{ ChainID: chainId, AccountNumber: acc.GetAccountNumber(), Sequence: acc.GetSequence(), - PubKey: pubKey, + PubKey: &anypb.Any{ + TypeUrl: anyPk.TypeUrl, + Value: anyPk.Value, + }, + Address: sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), acc.GetAddress().Bytes()), + } + + tip := &txv1beta1.Tip{ + Tipper: "tipper", + Amount: []*v1beta1.Coin{{Denom: "uswtr", Amount: "1000"}}, + } + + anyMsgs := make([]*anypb.Any, 1) + legacyAny, err := codectypes.NewAnyWithValue(msg) + suite.Require().NoError(err) + + anyMsgs[0] = &anypb.Any{ + TypeUrl: legacyAny.TypeUrl, + Value: legacyAny.Value, + } + + auxBody := &txv1beta1.TxBody{ + Messages: anyMsgs, + Memo: "", + TimeoutHeight: 1000, + // AuxTxBuilder has no concern with extension options, so we set them to nil. + // This preserves pre-PR#16025 behavior where extension options were ignored, this code path: + // https://github.com/cosmos/cosmos-sdk/blob/ac3c209326a26b46f65a6cc6f5b5ebf6beb79b38/client/tx/aux_builder.go#L193 + // https://github.com/cosmos/cosmos-sdk/blob/ac3c209326a26b46f65a6cc6f5b5ebf6beb79b38/x/auth/migrations/legacytx/stdsign.go#L49 + ExtensionOptions: nil, + NonCriticalExtensionOptions: nil, } signerBytes, err := suite.clientCtx.TxConfig.SignModeHandler().GetSignBytes( + context.Background(), signMode, signerInfo, - txBuilder.GetTx(), + txsigning.TxData{ + Body: auxBody, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: nil, + // Aux signer never signs over fee. + // For LEGACY_AMINO_JSON, we use the convention to sign + // over empty fees. + // ref: https://github.com/cosmos/cosmos-sdk/pull/10348 + Fee: &txv1beta1.Fee{}, + Tip: tip, + }, + }, ) suite.Require().NoError(err) @@ -423,7 +463,7 @@ func (suite *AnteTestSuite) createBaseTxBuilder(msg sdk.Msg, gas uint64) client. txBuilder.SetGasLimit(gas) txBuilder.SetFeeAmount(sdk.NewCoins( - sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(int64(gas)*int64(100))), + sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(int64(gas)*int64(100))), )) err := txBuilder.SetMsgs(msg) @@ -436,7 +476,7 @@ func (suite *AnteTestSuite) createBaseTxBuilder(msg sdk.Msg, gas uint64) client. // CreateTestSignedMultisigTx creates and sign a multi-signed tx for the given message. `signType` indicates whether to use standard signing ("Standard"), // EIP-712 signing ("EIP-712"), or a mix of the two ("mixed"). -func (suite *AnteTestSuite) CreateTestSignedMultisigTx(privKeys []cryptotypes.PrivKey, signMode signing.SignMode, msg sdk.Msg, chainId string, gas uint64, signType string) client.TxBuilder { +func (suite *AnteTestSuite) CreateTestSignedMultisigTx(privKeys []cryptotypes.PrivKey, signMode signingv1beta1.SignMode, msg sdk.Msg, chainId string, gas uint64, signType string) client.TxBuilder { pubKeys := make([]cryptotypes.PubKey, len(privKeys)) for i, privKey := range privKeys { pubKeys[i] = privKey.PubKey() @@ -457,7 +497,7 @@ func (suite *AnteTestSuite) CreateTestSignedMultisigTx(privKeys []cryptotypes.Pr Data: sig, }) - signerBytes := suite.createSignerBytes(chainId, signMode, multiKey, txBuilder) + signerBytes := suite.createSignerBytes(chainId, signMode, multiKey, txBuilder, msg) // Sign for each key and update signature field sigs := suite.generateMultikeySignatures(signMode, privKeys, signerBytes, signType) @@ -474,7 +514,7 @@ func (suite *AnteTestSuite) CreateTestSignedMultisigTx(privKeys []cryptotypes.Pr return txBuilder } -func (suite *AnteTestSuite) CreateTestSingleSignedTx(privKey cryptotypes.PrivKey, signMode signing.SignMode, msg sdk.Msg, chainId string, gas uint64, signType string) client.TxBuilder { +func (suite *AnteTestSuite) CreateTestSingleSignedTx(privKey cryptotypes.PrivKey, signMode signingv1beta1.SignMode, msg sdk.Msg, chainId string, gas uint64, signType string) client.TxBuilder { pubKey := privKey.PubKey() suite.RegisterAccount(pubKey, big.NewInt(10000000000)) @@ -489,7 +529,7 @@ func (suite *AnteTestSuite) CreateTestSingleSignedTx(privKey cryptotypes.PrivKey }) suite.Require().NoError(err) - signerBytes := suite.createSignerBytes(chainId, signMode, pubKey, txBuilder) + signerBytes := suite.createSignerBytes(chainId, signMode, pubKey, txBuilder, msg) sigData := suite.generateSingleSignature(signMode, privKey, signerBytes, signType) err = txBuilder.SetSignatures(sigData) @@ -541,7 +581,7 @@ func createNestedMsgExec(a sdk.AccAddress, nestedLvl int, lastLvlMsgs []sdk.Msg) } func createTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1000000) @@ -549,12 +589,14 @@ func createTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { return nil, err } + defaultSignMode, err := authsigning.APISignModeToInternal(encodingConfig.TxConfig.SignModeHandler().DefaultMode()) + // First round: we gather all the signer infos. We use the "set empty // signature" hack to do that. sigV2 := signing.SignatureV2{ PubKey: priv.PubKey(), Data: &signing.SingleSignatureData{ - SignMode: encodingConfig.TxConfig.SignModeHandler().DefaultMode(), + SignMode: defaultSignMode, Signature: nil, }, Sequence: 0, @@ -571,8 +613,9 @@ func createTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { AccountNumber: 0, Sequence: 0, } - sigV2, err := tx.SignWithPrivKey( - encodingConfig.TxConfig.SignModeHandler().DefaultMode(), signerData, + sigV2, err = tx.SignWithPrivKey( + context.Background(), + defaultSignMode, signerData, txBuilder, priv, encodingConfig.TxConfig, 0, ) @@ -597,5 +640,6 @@ var _ sdk.Tx = &invalidTx{} type invalidTx struct{} -func (invalidTx) GetMsgs() []sdk.Msg { return []sdk.Msg{nil} } -func (invalidTx) ValidateBasic() error { return nil } +func (invalidTx) GetMsgs() []sdk.Msg { return []sdk.Msg{nil} } +func (invalidTx) GetMsgsV2() ([]protov2.Message, error) { return make([]protov2.Message, 0), nil } +func (invalidTx) ValidateBasic() error { return nil } diff --git a/app/app.go b/app/app.go index b66c4efb..e972e111 100644 --- a/app/app.go +++ b/app/app.go @@ -20,17 +20,16 @@ import ( "github.com/gorilla/mux" "github.com/rakyll/statik/fs" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store/streaming" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" @@ -40,32 +39,29 @@ import ( authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + feegrantmodule "cosmossdk.io/x/feegrant/module" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -75,6 +71,9 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -89,31 +88,31 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller" + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclient "github.com/cosmos/ibc-go/v8/modules/core/02-client" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" + + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + "github.com/spf13/cast" vestingmodule "swisstronik/x/vesting" @@ -129,8 +128,6 @@ import ( "swisstronik/docs" "swisstronik/encoding" - simappparams "cosmossdk.io/simapp/params" - evmante "swisstronik/app/ante" srvflags "swisstronik/server/flags" evmcommontypes "swisstronik/types" @@ -141,6 +138,8 @@ import ( "swisstronik/ethereum/eip712" + sdkmath "cosmossdk.io/math" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/mempool" "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" @@ -160,10 +159,6 @@ func getGovProposalHandlers() []govclient.ProposalHandler { govProposalHandlers = append(govProposalHandlers, paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, // this line is used by starport scaffolding # stargate/app/govProposalHandler ) @@ -290,7 +285,8 @@ type App struct { // this line is used by starport scaffolding # stargate/app/keeperDeclaration // mm is the module manager - mm *module.Manager + ModuleManager *module.Manager + BasicModuleManager module.BasicManager // sm is the simulation manager sm *module.SimulationManager @@ -306,16 +302,15 @@ func New( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, - encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App { + encodingConfig := encoding.MakeConfig() appCodec := encodingConfig.Codec cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry eip712.SetEncodingConfig(encodingConfig) - // Setup Mempool and Proposal Handlers baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) { mempool := mempool.NoOpMempool{} @@ -336,8 +331,9 @@ func New( bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) + bApp.SetTxEncoder(encodingConfig.TxConfig.TxEncoder()) - keys := sdk.NewKVStoreKeys( + keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, authz.ModuleName, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, @@ -347,14 +343,8 @@ func New( vestingmoduletypes.StoreKey, didmoduletypes.StoreKey, // this line is used by starport scaffolding # stargate/app/storeKey ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, didmoduletypes.MemStoreKey) - - // load state streaming if enabled - if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil { - fmt.Printf("failed to load state streaming: %s", err) - os.Exit(1) - } + tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) + memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, didmoduletypes.MemStoreKey) app := &App{ BaseApp: bApp, @@ -367,6 +357,12 @@ func New( memKeys: memKeys, } + // load state streaming if enabled + if err := app.RegisterStreamingServices(appOpts, keys); err != nil { + fmt.Printf("failed to load state streaming: %s", err) + os.Exit(1) + } + app.ParamsKeeper = initParamsKeeper( appCodec, cdc, @@ -377,8 +373,8 @@ func New( authAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authAddr) - bApp.SetParamStore(&app.ConsensusParamsKeeper) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), authAddr, runtime.EventService{}) + bApp.SetParamStore(&app.ConsensusParamsKeeper.ParamsStore) // add capability keeper and ScopeToModule for ibc module app.CapabilityKeeper = capabilitykeeper.NewKeeper( @@ -400,15 +396,16 @@ func New( // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, - keys[authtypes.StoreKey], + runtime.NewKVStoreService(keys[authtypes.StoreKey]), evmcommontypes.ProtoAccount, maccPerms, - sdk.Bech32PrefixAccAddr, + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + sdk.GetConfig().GetBech32AccountAddrPrefix(), authAddr, ) app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authz.ModuleName], + runtime.NewKVStoreService(keys[authz.ModuleName]), appCodec, app.MsgServiceRouter(), app.AccountKeeper, @@ -416,23 +413,26 @@ func New( app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, - keys[banktypes.StoreKey], + runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, app.BlockedModuleAccountAddrs(), authAddr, + logger, ) app.StakingKeeper = *stakingkeeper.NewKeeper( appCodec, - keys[stakingtypes.StoreKey], + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authAddr, + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) app.MintKeeper = mintkeeper.NewKeeper( appCodec, - keys[minttypes.StoreKey], + runtime.NewKVStoreService(keys[minttypes.StoreKey]), &app.StakingKeeper, app.AccountKeeper, app.BankKeeper, @@ -442,7 +442,7 @@ func New( app.DistrKeeper = distrkeeper.NewKeeper( appCodec, - keys[distrtypes.StoreKey], + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, &app.StakingKeeper, @@ -453,29 +453,30 @@ func New( app.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, app.LegacyAmino(), - keys[slashingtypes.StoreKey], + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), &app.StakingKeeper, authAddr, ) app.CrisisKeeper = *crisiskeeper.NewKeeper( appCodec, - keys[crisistypes.StoreKey], + runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, authAddr, + addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ) app.FeeGrantKeeper = feegrantkeeper.NewKeeper( appCodec, - keys[feegrant.StoreKey], + runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper, ) app.UpgradeKeeper = *upgradekeeper.NewKeeper( skipUpgradeHeights, - keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, @@ -512,6 +513,7 @@ func New( app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + authAddr, ) // Create Transfer Keepers @@ -521,10 +523,11 @@ func New( app.GetSubspace(ibctransfertypes.ModuleName), app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + authAddr, ) transferModule := transfer.NewAppModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) @@ -534,17 +537,19 @@ func New( app.GetSubspace(icahosttypes.SubModuleName), app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), + authAddr, ) app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), + authAddr, ) icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) @@ -554,9 +559,11 @@ func New( // Create evidence Keeper for to register the IBC light client misbehaviour evidence route evidenceKeeper := evidencekeeper.NewKeeper( appCodec, - keys[evidencetypes.StoreKey], - &app.StakingKeeper, + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), + app.StakingKeeper, app.SlashingKeeper, + addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr), + runtime.ProvideCometInfoService(), ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper @@ -565,17 +572,17 @@ func New( govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) govConfig := govtypes.Config{ MaxMetadataLen: 5000, } govKeeper := govkeeper.NewKeeper( appCodec, - keys[govtypes.StoreKey], + runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, - &app.StakingKeeper, + app.StakingKeeper, + app.DistrKeeper, app.MsgServiceRouter(), govConfig, authAddr, @@ -632,9 +639,9 @@ func New( // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. - app.mm = module.NewManager( + app.ModuleManager = module.NewManager( genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, + app.AccountKeeper, app.StakingKeeper, app.BaseApp, encodingConfig.TxConfig, ), auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), @@ -642,9 +649,9 @@ func New( capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), staking.NewAppModule(appCodec, &app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(&app.UpgradeKeeper), + upgrade.NewAppModule(&app.UpgradeKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr)), evidence.NewAppModule(app.EvidenceKeeper), params.NewAppModule(app.ParamsKeeper), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), @@ -663,13 +670,34 @@ func New( // this line is used by starport scaffolding # stargate/app/appModule ) + // BasicModuleManager defines the module BasicManager which is in charge of setting up basic, + // non-dependant module elements, such as codec registration and genesis verification. + // By default, it is composed of all the modules from the module manager. + // Additionally, app module basics can be overwritten by passing them as an argument. + app.BasicModuleManager = module.NewBasicManagerFromManager( + app.ModuleManager, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + }, + ), + }, + ) + app.BasicModuleManager.RegisterLegacyAminoCodec(cdc) + app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) + + app.ModuleManager.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) + // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( + app.ModuleManager.SetOrderBeginBlockers( // upgrades should be run first - upgradetypes.ModuleName, capabilitytypes.ModuleName, feemarkettypes.ModuleName, evmtypes.ModuleName, @@ -697,7 +725,7 @@ func New( // this line is used by starport scaffolding # stargate/app/beginBlockers ) - app.mm.SetOrderEndBlockers( + app.ModuleManager.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, @@ -730,7 +758,7 @@ func New( // NOTE: Capability module must occur first so that it can initialize any capabilities // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. - app.mm.SetOrderInitGenesis( + app.ModuleManager.SetOrderInitGenesis( capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -763,11 +791,11 @@ func New( // Uncomment if you want to set a custom migration order here. // app.mm.SetOrderMigrations(custom order) - app.mm.RegisterInvariants(&app.CrisisKeeper) + app.ModuleManager.RegisterInvariants(&app.CrisisKeeper) // app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + app.ModuleManager.RegisterServices(app.configurator) // add test gRPC service for testing gRPC queries in isolation // testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) @@ -780,9 +808,9 @@ func New( overrideModules := map[string]module.AppModuleSimulation{ authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), } - app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules) + app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) - autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) + autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) reflectionSvc, err := runtimeservices.NewReflectionService() if err != nil { panic(err) @@ -798,12 +826,15 @@ func New( // initialize BaseApp app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) maxGasWanted := cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted)) app.setAnteHandler(encodingConfig.TxConfig, maxGasWanted) + app.SetPreBlocker(app.PreBlocker) + app.SetBeginBlocker(app.BeginBlocker) app.setPostHandler() app.SetEndBlocker(app.EndBlocker) - SetupHandlers(app, app.EvmKeeper, app.IBCKeeper.ClientKeeper, app.ParamsKeeper, appCodec) + app.SetPrecommiter(app.Precommitter) + app.SetPrepareCheckStater(app.PrepareCheckStater) + app.SetupHandlers(app.EvmKeeper, app.IBCKeeper.ClientKeeper, app.ParamsKeeper, appCodec) if loadLatest { if err := app.LoadLatestVersion(); err != nil { @@ -857,6 +888,11 @@ func (app *App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } +// PreBlocker application updates before each begin block. +func (app *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.ModuleManager.PreBlock(ctx) +} + // GetStakingKeeper implements the TestingApp interface. func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { return app.StakingKeeper @@ -879,7 +915,7 @@ func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { // GetTxConfig implements the TestingApp interface. func (app *App) GetTxConfig() client.TxConfig { - cfg := encoding.MakeConfig(ModuleBasics) + cfg := encoding.MakeConfig() return cfg.TxConfig } @@ -887,23 +923,37 @@ func (app *App) GetTxConfig() client.TxConfig { func (app *App) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) +func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.ModuleManager.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) +func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.ModuleManager.EndBlock(ctx) +} + +// Precommitter application updates before the commital of a block after all transactions have been delivered. +func (app *App) Precommitter(ctx sdk.Context) { + if err := app.ModuleManager.Precommit(ctx); err != nil { + panic(err) + } +} + +// PrepareCheckStater application updates after commit and before any check state is invoked. +func (app *App) PrepareCheckStater(ctx sdk.Context) { + if err := app.ModuleManager.PrepareCheckState(ctx); err != nil { + panic(err) + } } // InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) + return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState) } // LoadHeight loads a particular height @@ -987,12 +1037,12 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + app.BasicModuleManager.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // register app's OpenAPI routes. docs.RegisterOpenAPIService(Name, apiSvr.Router) @@ -1010,7 +1060,7 @@ func (app *App) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, @@ -1019,8 +1069,8 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) { } // RegisterNodeService implements the Application.RegisterNodeService method. -func (app *App) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } // RegisterSwaggerAPI registers swagger route with API Server @@ -1074,6 +1124,6 @@ func (*App) SimulationManager() *module.SimulationManager { } func RegisterCoinDenominations() { - _ = sdk.RegisterDenom("swtr", sdk.OneDec()) - _ = sdk.RegisterDenom("uswtr", sdk.NewDecWithPrec(1, 18)) + _ = sdk.RegisterDenom("swtr", sdkmath.LegacyOneDec()) + _ = sdk.RegisterDenom("uswtr", sdkmath.LegacyNewDecWithPrec(1, 18)) } diff --git a/app/export.go b/app/export.go index ba8c361d..bd2298c7 100644 --- a/app/export.go +++ b/app/export.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + storetypes "cosmossdk.io/store/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -18,7 +18,7 @@ func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // Creates context with current height and checks txs for ctx to be usable by start of next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -31,7 +31,10 @@ func (app *App) ExportAppStateAndValidators( } } - genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -79,12 +82,16 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str // withdraw all validator commission app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, sdk.ValAddress(val.GetOperator())) return false }) // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + return err + } + for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -111,12 +118,18 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str // reinitialize all validators app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, sdk.ValAddress(val.GetOperator())) + if err != nil { + return true + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + return true + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) + app.DistrKeeper.FeePool.Set(ctx, feePool) - err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + err = app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, sdk.ValAddress(val.GetOperator())) // this lets us stop in case there's an error return err != nil }) @@ -167,13 +180,13 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { return fmt.Errorf("expected validator %s not found", addr) } diff --git a/app/genesis.go b/app/genesis.go index 5a38d28b..9f7d5773 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -18,6 +18,6 @@ type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. func NewDefaultGenesisState() simapp.GenesisState { - encCfg := encoding.MakeConfig(ModuleBasics) + encCfg := encoding.MakeConfig() return ModuleBasics.DefaultGenesis(encCfg.Codec) } diff --git a/app/setup_handler.go b/app/setup_handler.go index 6e6369d6..9a15b4e6 100644 --- a/app/setup_handler.go +++ b/app/setup_handler.go @@ -1,154 +1,68 @@ package app import ( - didmoduletypes "swisstronik/x/did/types" + "fmt" evmkeeper "swisstronik/x/evm/keeper" - evmmoduletypes "swisstronik/x/evm/types" - feemarketmoduletypes "swisstronik/x/feemarket/types" - vestmoduletypes "swisstronik/x/vesting/types" - "github.com/cosmos/cosmos-sdk/baseapp" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + + "swisstronik/app/upgrades" + v2_0_0 "swisstronik/app/upgrades/v2.0.0" + + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - m "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" + ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" +) + +var ( + // `Upgrades` defines the upgrade handlers and store loaders for the application. + // New upgrades should be added to this slice after they are implemented. + Upgrades = []upgrades.Upgrade{ + v2_0_0.Upgrade, + } ) -func SetupHandlers( - app *App, +func (app *App) SetupHandlers( ek *evmkeeper.Keeper, clientKeeper ibctmmigrations.ClientKeeper, pk paramskeeper.Keeper, cdc codec.BinaryCodec) { - setUpgradeHandler(app, ek, clientKeeper, pk, cdc) - - loadUpgradeStore(app) + app.setUpgradeHandler(ek, clientKeeper, pk, cdc) + app.loadUpgradeStore() } -func setUpgradeHandler( - app *App, +func (app *App) setUpgradeHandler( ek *evmkeeper.Keeper, clientKeeper ibctmmigrations.ClientKeeper, pk paramskeeper.Keeper, cdc codec.BinaryCodec) { - // Set param key table for params module migration - for _, subspace := range app.ParamsKeeper.GetSubspaces() { - subspace := subspace - - app.Logger().Info("Setting up upgrade handler for " + subspace.Name()) - - var keyTable paramstypes.KeyTable - switch subspace.Name() { - case authtypes.ModuleName: - keyTable = authtypes.ParamKeyTable() //nolint:staticcheck - case banktypes.ModuleName: - keyTable = banktypes.ParamKeyTable() //nolint:staticcheck - case stakingtypes.ModuleName: - keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck - case minttypes.ModuleName: - keyTable = minttypes.ParamKeyTable() //nolint:staticcheck - case slashingtypes.ModuleName: - keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck - case govtypes.ModuleName: - keyTable = govv1.ParamKeyTable() //nolint:staticcheck - case crisistypes.ModuleName: - keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck - case didmoduletypes.ModuleName: - keyTable = didmoduletypes.ParamKeyTable() - case evmmoduletypes.ModuleName: - keyTable = evmmoduletypes.ParamKeyTable() - case feemarketmoduletypes.ModuleName: - keyTable = feemarketmoduletypes.ParamKeyTable() - case vestmoduletypes.ModuleName: - keyTable = vestmoduletypes.ParamKeyTable() - case distrtypes.ModuleName: - keyTable = distrtypes.ParamKeyTable() - default: - continue - } - - if !subspace.HasKeyTable() { - subspace.WithKeyTable(keyTable) - } + if app.UpgradeKeeper.HasHandler(v2_0_0.UpgradeName) { + panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v2_0_0.UpgradeName)) } - baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) - app.UpgradeKeeper.SetUpgradeHandler( - version.Version, - func(ctx sdk.Context, plan upgradetypes.Plan, vm m.VersionMap) (m.VersionMap, error) { - app.Logger().Info("Running upgrade handler for " + version.Version) - - // Migrate Tendermint consensus parameters from x/params module to a - // dedicated x/consensus module. - baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) - - // Include this when migrating to ibc-go v7 (optional) - // source: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v6-to-v7.md - // prune expired tendermint consensus states to save storage space - if _, err := ibctmmigrations.PruneExpiredConsensusStates(ctx, cdc, clientKeeper); err != nil { - return nil, err - } - // !! ATTENTION !! - - // Add EIP contained in Shanghai hard fork to the extra EIPs - // in the EVM parameters. This enables using the PUSH0 opcode and - // thus supports Solidity v0.8.20. - // - app.Logger().Info("adding EIP 3855 to EVM parameters") - err := EnableEIPs(ctx, ek, 3855) - if err != nil { - app.Logger().Error("error while enabling EIPs", "error", err) - } - - app.Logger().Debug("running module migrations ...") - return app.mm.RunMigrations(ctx, app.configurator, vm) - }, + v2_0_0.UpgradeName, + v2_0_0.CreateUpgradeHandler(app.ModuleManager, ek, app.configurator, app.AccountKeeper, cdc, clientKeeper), ) } -// EnableEIPs enables the given EIPs in the EVM parameters. -func EnableEIPs(ctx sdk.Context, ek *evmkeeper.Keeper, eips ...int64) error { - evmParams := ek.GetParams(ctx) - evmParams.ExtraEIPs = append(evmParams.ExtraEIPs, eips...) - - return ek.SetParams(ctx, evmParams) -} - -func loadUpgradeStore(app *App) { +func (app *App) loadUpgradeStore() { upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { panic(err) } if shouldLoadUpgradeStore(app, upgradeInfo) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{ - didmoduletypes.StoreKey, - consensusparamtypes.StoreKey, - crisistypes.ModuleName, - }, + for _, upgrade := range Upgrades { + // Use upgrade store loader for the initial loading of all stores when app starts, + // it checks if version == upgradeHeight and applies store upgrades before loading the stores, + // so that new stores start with the correct version (the current height of chain), + // instead the default which is the latest version that store last committed i.e 0 for new stores. + if upgradeInfo.Name == upgrade.UpgradeName { + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades)) + } } - // Use upgrade store loader for the initial loading of all stores when app starts, - // it checks if version == upgradeHeight and applies store upgrades before loading the stores, - // so that new stores start with the correct version (the current height of chain), - // instead the default which is the latest version that store last committed i.e 0 for new stores. - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } } diff --git a/app/upgrades/types.go b/app/upgrades/types.go new file mode 100644 index 00000000..d91ffc16 --- /dev/null +++ b/app/upgrades/types.go @@ -0,0 +1,22 @@ +package upgrades + +import ( + store "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +// Upgrade defines a struct containing necessary fields that a MsgSoftwareUpgrade +// must have written, in order for the state migration to go smoothly. +// An upgrade must implement this struct, and then set it in the app.go. +// The app.go will then define the handler. +type Upgrade struct { + // Upgrade version name, for the upgrade handler, e.g. `v7` + UpgradeName string + + // CreateUpgradeHandler defines the function that creates an upgrade handler + CreateUpgradeHandler func(*module.Manager, module.Configurator) upgradetypes.UpgradeHandler + + // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. + StoreUpgrades store.StoreUpgrades +} diff --git a/app/upgrades/v1.0.0/constants.go b/app/upgrades/v1.0.0/constants.go new file mode 100644 index 00000000..c4f743fc --- /dev/null +++ b/app/upgrades/v1.0.0/constants.go @@ -0,0 +1,27 @@ +package v_1_0_0 + +import ( + "swisstronik/app/upgrades" + didmoduletypes "swisstronik/x/did/types" + + storetypes "cosmossdk.io/store/types" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" +) + +const ( + UpgradeName = "v1.0.0" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + StoreUpgrades: storetypes.StoreUpgrades{ + Added: []string{ + didmoduletypes.StoreKey, + consensusparamtypes.StoreKey, + crisistypes.ModuleName, + icacontrollertypes.StoreKey, + }, + }, +} diff --git a/app/upgrades/v1.0.0/upgrade.go b/app/upgrades/v1.0.0/upgrade.go new file mode 100644 index 00000000..7a796913 --- /dev/null +++ b/app/upgrades/v1.0.0/upgrade.go @@ -0,0 +1,123 @@ +package v_1_0_0 + +import ( + "context" + + swissapp "swisstronik/app" + didmoduletypes "swisstronik/x/did/types" + evmmoduletypes "swisstronik/x/evm/types" + feemarketmoduletypes "swisstronik/x/feemarket/types" + vestmoduletypes "swisstronik/x/vesting/types" + + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" + + evmkeeper "swisstronik/x/evm/keeper" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func CreateUpgradeHandler( + app *swissapp.App, + mm *module.Manager, + ek *evmkeeper.Keeper, + configurator module.Configurator, + ak authkeeper.AccountKeeper, + cdc codec.BinaryCodec, + clientKeeper ibctmmigrations.ClientKeeper, +) upgradetypes.UpgradeHandler { + // Set param key table for params module migration + for _, subspace := range app.ParamsKeeper.GetSubspaces() { + subspace := subspace + + app.Logger().Info("Setting up upgrade handler for " + subspace.Name()) + + var keyTable paramstypes.KeyTable + switch subspace.Name() { + case authtypes.ModuleName: + keyTable = authtypes.ParamKeyTable() //nolint:staticcheck + case banktypes.ModuleName: + keyTable = banktypes.ParamKeyTable() //nolint:staticcheck + case stakingtypes.ModuleName: + keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck + case minttypes.ModuleName: + keyTable = minttypes.ParamKeyTable() //nolint:staticcheck + case slashingtypes.ModuleName: + keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck + case govtypes.ModuleName: + keyTable = govv1.ParamKeyTable() //nolint:staticcheck + case crisistypes.ModuleName: + keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck + case didmoduletypes.ModuleName: + keyTable = didmoduletypes.ParamKeyTable() + case evmmoduletypes.ModuleName: + keyTable = evmmoduletypes.ParamKeyTable() + case feemarketmoduletypes.ModuleName: + keyTable = feemarketmoduletypes.ParamKeyTable() + case vestmoduletypes.ModuleName: + keyTable = vestmoduletypes.ParamKeyTable() + case distrtypes.ModuleName: + keyTable = distrtypes.ParamKeyTable() + default: + continue + } + + if !subspace.HasKeyTable() { + subspace.WithKeyTable(keyTable) + } + } + + baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) + + return func(goCtx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ctx.Logger().Info("Running upgrade handler for " + version.Version) + + baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper.ParamsStore) + + // Include this when migrating to ibc-go v7 (optional) + // source: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v6-to-v7.md + // prune expired tendermint consensus states to save storage space + if _, err := ibctmmigrations.PruneExpiredConsensusStates(ctx, cdc, clientKeeper); err != nil { + return nil, err + } + // !! ATTENTION !! + + // Add EIP contained in Shanghai hard fork to the extra EIPs + // in the EVM parameters. This enables using the PUSH0 opcode and + // thus supports Solidity v0.8.20. + // + ctx.Logger().Info("adding EIP 3855 to EVM parameters") + err := EnableEIPs(ctx, ek, 3855) + if err != nil { + ctx.Logger().Error("error while enabling EIPs", "error", err) + } + + ctx.Logger().Debug("running module migrations ...") + return mm.RunMigrations(ctx, configurator, vm) + } +} + +// EnableEIPs enables the given EIPs in the EVM parameters. +func EnableEIPs(ctx sdk.Context, ek *evmkeeper.Keeper, eips ...int64) error { + evmParams := ek.GetParams(ctx) + evmParams.ExtraEIPs = append(evmParams.ExtraEIPs, eips...) + + return ek.SetParams(ctx, evmParams) +} diff --git a/app/upgrades/v2.0.0/constants.go b/app/upgrades/v2.0.0/constants.go new file mode 100644 index 00000000..1c2e4726 --- /dev/null +++ b/app/upgrades/v2.0.0/constants.go @@ -0,0 +1,27 @@ +package v_2_0_0 + +import ( + "swisstronik/app/upgrades" + + store "cosmossdk.io/store/types" + circuittypes "cosmossdk.io/x/circuit/types" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" +) + +const ( + UpgradeName = "v2.0.0" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + // Add circuittypes as per 0.47 to 0.50 upgrade handler + // https://github.com/cosmos/cosmos-sdk/blob/b7d9d4c8a9b6b8b61716d2023982d29bdc9839a6/simapp/upgrades.go#L21 + circuittypes.ModuleName, + + // Add authz module to allow granting arbitrary privileges from one account to another acocunt. + authzkeeper.StoreKey, + }, + }, +} diff --git a/app/upgrades/v2.0.0/upgrade.go b/app/upgrades/v2.0.0/upgrade.go new file mode 100644 index 00000000..8b2846f5 --- /dev/null +++ b/app/upgrades/v2.0.0/upgrade.go @@ -0,0 +1,33 @@ +package v_2_0_0 + +import ( + "context" + + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" + + evmkeeper "swisstronik/x/evm/keeper" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + _ *evmkeeper.Keeper, + configurator module.Configurator, + _ authkeeper.AccountKeeper, + _ codec.BinaryCodec, + _ ibctmmigrations.ClientKeeper, +) upgradetypes.UpgradeHandler { + return func(goCtx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ctx.Logger().Info("Running upgrade handler for " + version.Version) + ctx.Logger().Debug("running module migrations ...") + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/app/utils.go b/app/utils.go index 84ebcbe0..acad704a 100644 --- a/app/utils.go +++ b/app/utils.go @@ -23,25 +23,29 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/testutil/mock" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "swisstronik/encoding" "swisstronik/utils" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" feemarkettypes "swisstronik/x/feemarket/types" + "swisstronik/encoding" + evmmoduletypes "swisstronik/types" + + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/baseapp" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" ) @@ -88,7 +92,6 @@ func SetupWithDB(isCheckTx bool, patchGenesis func(*App, simapp.GenesisState) si map[int64]bool{}, DefaultNodeHome, 5, - encoding.MakeConfig(ModuleBasics), simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome), baseapp.SetChainID(chainID), ) @@ -107,7 +110,7 @@ func SetupWithDB(isCheckTx bool, patchGenesis func(*App, simapp.GenesisState) si // Initialize the chain app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, @@ -135,7 +138,7 @@ func NewTestGenesisState(codec codec.Codec) simapp.GenesisState { acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100000000000000))), } genesisState := NewDefaultGenesisState() @@ -156,7 +159,7 @@ func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, bondAmt := sdk.DefaultPowerReduction for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) if err != nil { panic(err) } @@ -170,15 +173,15 @@ func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), + DelegatorShares: sdkmath.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + Commission: stakingtypes.NewCommission(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()), + MinSelfDelegation: sdkmath.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), sdkmath.LegacyOneDec())) } // set validators and delegations stakingParams := stakingtypes.DefaultParams() @@ -213,8 +216,7 @@ func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, // SetupTestingApp initializes the IBC-go testing application func SetupTestingApp(chainID string) (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() - cfg := encoding.MakeConfig(ModuleBasics) - app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, cfg, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome), baseapp.SetChainID(chainID)) + app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome), baseapp.SetChainID(chainID)) return app, NewDefaultGenesisState() } @@ -236,7 +238,7 @@ func SetupSwissApp( acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(utils.BaseDenom, sdk.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(utils.BaseDenom, sdkmath.NewInt(100000000000000))), } db := dbm.NewMemDB() @@ -244,7 +246,6 @@ func SetupSwissApp( log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, - encoding.MakeConfig(ModuleBasics), simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome), baseapp.SetChainID(chainID), ) @@ -268,7 +269,7 @@ func SetupSwissApp( // Initialize the chain app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, @@ -302,15 +303,15 @@ func GenesisStateWithValSet(app *App, genesisState simapp.GenesisState, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), + DelegatorShares: sdkmath.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + Commission: stakingtypes.NewCommission(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()), + MinSelfDelegation: sdkmath.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec())) } // set validators and delegations @@ -342,3 +343,10 @@ func GenesisStateWithValSet(app *App, genesisState simapp.GenesisState, return genesisState } + +func MakeConfig() evmmoduletypes.EncodingConfig { + config := encoding.MakeConfig() + ModuleBasics.RegisterLegacyAminoCodec(config.Amino) + ModuleBasics.RegisterInterfaces(config.InterfaceRegistry) + return config +} diff --git a/client/keys.go b/client/keys.go index ad4401ba..0dbddd26 100644 --- a/client/keys.go +++ b/client/keys.go @@ -91,14 +91,20 @@ The pass backend requires GnuPG: https://gnupg.org/ cmd.PersistentFlags().String(flags.FlagHome, defaultNodeHome, "The application home directory") cmd.PersistentFlags().String(flags.FlagKeyringDir, "", "The client Keyring directory; if omitted, the default 'home' directory will be used") - cmd.PersistentFlags().String(flags.FlagKeyringBackend, keyring.BackendOS, "Select keyring's backend (os|file|test)") + cmd.PersistentFlags().String(flags.FlagKeyringBackend, keyring.BackendTest, "Select keyring's backend (os|file|test)") cmd.PersistentFlags().String(cli.OutputFlag, "text", "Output format (text|json)") return cmd } func runAddCmd(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd).WithKeyringOptions(hd.EthSecp256k1Option()) - clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + flagSet := cmd.Flags() + + if !flagSet.Changed(flags.FlagKeyringBackend) { + flagSet.Set(flags.FlagKeyringBackend, keyring.BackendTest) + } + + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, flagSet) if err != nil { return err } diff --git a/client/keys/add.go b/client/keys/add.go index 2f843ba4..b9b466a4 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -31,7 +31,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" - "github.com/cosmos/cosmos-sdk/client/keys" + sdkKeys "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" @@ -155,7 +155,7 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } } - pubKey, _ := cmd.Flags().GetString(keys.FlagPublicKey) + pubKey, _ := cmd.Flags().GetString(sdkKeys.FlagPublicKey) if pubKey != "" { var pk cryptotypes.PubKey if err = ctx.Codec.UnmarshalInterfaceJSON([]byte(pubKey), &pk); err != nil { @@ -272,7 +272,7 @@ func printCreate(cmd *cobra.Command, k *keyring.Record, showMnemonic bool, mnemo switch outputFormat { case OutputFormatText: cmd.PrintErrln() - if err := printKeyringRecord(cmd.OutOrStdout(), k, keyring.MkAccKeyOutput, outputFormat); err != nil { + if err := printKeyringRecord(cmd.OutOrStdout(), k, sdkKeys.MkAccKeyOutput, outputFormat); err != nil { return err } @@ -285,7 +285,7 @@ func printCreate(cmd *cobra.Command, k *keyring.Record, showMnemonic bool, mnemo } } case OutputFormatJSON: - out, err := keyring.MkAccKeyOutput(k) + out, err := sdkKeys.MkAccKeyOutput(k) if err != nil { return err } diff --git a/client/keys/utils.go b/client/keys/utils.go index 11d8b7fc..a154e7b9 100644 --- a/client/keys/utils.go +++ b/client/keys/utils.go @@ -23,6 +23,7 @@ import ( "sigs.k8s.io/yaml" + sdkKeys "github.com/cosmos/cosmos-sdk/client/keys" cryptokeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" ) @@ -32,7 +33,7 @@ const ( OutputFormatJSON = "json" ) -type bechKeyOutFn func(k *cryptokeyring.Record) (cryptokeyring.KeyOutput, error) +type bechKeyOutFn func(k *cryptokeyring.Record) (sdkKeys.KeyOutput, error) func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKeyOutFn, output string) error { ko, err := bechKeyOut(k) @@ -42,7 +43,7 @@ func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKey switch output { case OutputFormatText: - if err := printTextRecords(w, []cryptokeyring.KeyOutput{ko}); err != nil { + if err := printTextRecords(w, []sdkKeys.KeyOutput{ko}); err != nil { return err } @@ -60,7 +61,7 @@ func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKey return nil } -func printTextRecords(w io.Writer, kos []cryptokeyring.KeyOutput) error { +func printTextRecords(w io.Writer, kos []sdkKeys.KeyOutput) error { out, err := yaml.Marshal(&kos) if err != nil { return err diff --git a/client/testnet.go b/client/testnet.go index fc636179..54f1e95c 100644 --- a/client/testnet.go +++ b/client/testnet.go @@ -38,6 +38,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/runtime" sdkserver "github.com/cosmos/cosmos-sdk/server" srvconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/testutil" @@ -60,6 +61,8 @@ import ( evmtypes "swisstronik/x/evm/types" "swisstronik/testutil/network" + + sdkmath "cosmossdk.io/math" ) var ( @@ -163,7 +166,7 @@ Example: args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) - return initTestnetFiles(clientCtx, cmd, serverCtx.Config, mbm, genBalIterator, args) + return initTestnetFiles(clientCtx, cmd, serverCtx.Config, mbm, genBalIterator, clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), args) }, } @@ -173,7 +176,7 @@ Example: cmd.Flags().String(flagStartingIPAddress, "192.167.10.1", "Starting IP address (192.167.10.1 results in persistent peers list ID0@192.167.10.1:46656, ID1@192.167.10.1:46656, ...)") - cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") + cmd.Flags().String(flags.FlagKeyringBackend, keyring.BackendTest, "Select keyring's backend (os|file|test)") return cmd } @@ -227,6 +230,7 @@ func initTestnetFiles( nodeConfig *tmconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, + valAddrCodec runtime.ValidatorAddressCodec, args initArgs, ) error { if args.chainID == "" { @@ -324,14 +328,19 @@ func initTestnetFiles( CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), }) + valStr, err := valAddrCodec.BytesToString(sdk.ValAddress(addr)) + if err != nil { + return err + } + valTokens := sdk.TokensFromConsensusPower(100, evmmoduletypes.PowerReduction) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + valStr, valPubKeys[i], sdk.NewCoin(evmmoduletypes.SwtrDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return err @@ -351,7 +360,7 @@ func initTestnetFiles( WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(clientCtx.CmdContext, txFactory, nodeDirName, txBuilder, true); err != nil { return err } @@ -379,7 +388,7 @@ func initTestnetFiles( err := collectGenFiles( clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, - args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, + args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, valAddrCodec, ) if err != nil { return err @@ -473,6 +482,7 @@ func collectGenFiles( clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + valAddrCodec runtime.ValidatorAddressCodec, ) error { var appState json.RawMessage genTime := tmtime.Now() @@ -488,12 +498,12 @@ func collectGenFiles( nodeID, valPubKey := nodeIDs[i], valPubKeys[i] initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey) - genDoc, err := types.GenesisDocFromFile(nodeConfig.GenesisFile()) + appGenesis, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile()) if err != nil { return err } - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator) + nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator, valAddrCodec) if err != nil { return err } diff --git a/cmd/swisstronikd/cmd/cli_root.go b/cmd/swisstronikd/cmd/cli_root.go deleted file mode 100644 index c301417b..00000000 --- a/cmd/swisstronikd/cmd/cli_root.go +++ /dev/null @@ -1,224 +0,0 @@ -//go:build nosgx -// +build nosgx - -package cmd - -import ( - "os" - "strings" - - "swisstronik/encoding" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/server" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - tmcfg "github.com/cometbft/cometbft/config" - simappparams "cosmossdk.io/simapp/params" - - "swisstronik/app" - - evmmoduleclient "swisstronik/client" - evmserverconfig "swisstronik/server/config" - srvflags "swisstronik/server/flags" -) - -// NewRootCmd creates a new root command for a Cosmos SDK application -func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) - initClientCtx := client.Context{}. - WithCodec(encodingConfig.Codec). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithHomeDir(app.DefaultNodeHome). - WithViper("") - - rootCmd := &cobra.Command{ - Use: app.Name + "cli", - Short: "Swisstronik CLI", - Long: ` - Command Line Interface for Swisstronik. - NOTE: This CLI does not support SGX, if you want to setup your node, use swisstronikd instead`, - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) - if err != nil { - return err - } - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - customAppTemplate, customAppConfig := initAppConfig() - customTMConfig := initTendermintConfig() - return server.InterceptConfigsPreRunHandler( - cmd, customAppTemplate, customAppConfig, customTMConfig, - ) - }, - } - - initRootCmd(rootCmd, encodingConfig) - overwriteFlagDefaults(rootCmd, map[string]string{ - flags.FlagChainID: strings.ReplaceAll(app.Name, "-", ""), - flags.FlagKeyringBackend: "test", - }) - - return rootCmd, encodingConfig -} - -// initTendermintConfig helps to override default Tendermint Config values. -// return tmcfg.DefaultConfig if no custom configuration is required for the application. -func initTendermintConfig() *tmcfg.Config { - cfg := tmcfg.DefaultConfig() - return cfg -} - -func initRootCmd( - rootCmd *cobra.Command, - encodingConfig simappparams.EncodingConfig, -) { - // Set config - InitSDKConfig() - - rootCmd.AddCommand( - config.Cmd(), - DebugCmd(), - ) - - // add keybase, auxiliary RPC, query, and tx child commands - rootCmd.AddCommand( - rpc.StatusCommand(), - queryCommand(), - txCommand(), - evmmoduleclient.KeyCommands(app.DefaultNodeHome), - ) - - rootCmd, err := srvflags.AddTxFlags(rootCmd) - if err != nil { - panic(err) - } -} - -// queryCommand returns the sub-command to send queries to the app -func queryCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetAccountCmd(), - rpc.ValidatorCommand(), - rpc.BlockCommand(), - authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), - ) - - app.ModuleBasics.AddQueryCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -// txCommand returns the sub-command to send transactions to the app -func txCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - ) - - app.ModuleBasics.AddTxCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) - // this line is used by starport scaffolding # root/arguments -} - -func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { - set := func(s *pflag.FlagSet, key, val string) { - if f := s.Lookup(key); f != nil { - f.DefValue = val - f.Value.Set(val) - } - } - for key, val := range defaults { - set(c.Flags(), key, val) - set(c.PersistentFlags(), key, val) - } - for _, c := range c.Commands() { - overwriteFlagDefaults(c, defaults) - } -} - -// initAppConfig helps to override default appConfig template and configs. -// return "", nil if no custom configuration is required for the application. -func initAppConfig() (string, interface{}) { - // The following code snippet is just for reference. - - type CustomAppConfig struct { - serverconfig.Config - - EVM evmserverconfig.EVMConfig `mapstructure:"evm"` - JSONRPC evmserverconfig.JSONRPCConfig `mapstructure:"json-rpc"` - TLS evmserverconfig.TLSConfig `mapstructure:"tls"` - } - - customAppConfig := CustomAppConfig{ - Config: *serverconfig.DefaultConfig(), - EVM: *evmserverconfig.DefaultEVMConfig(), - JSONRPC: *evmserverconfig.DefaultJSONRPCConfig(), - TLS: *evmserverconfig.DefaultTLSConfig(), - } - customAppTemplate := serverconfig.DefaultConfigTemplate + evmserverconfig.DefaultConfigTemplate - - return customAppTemplate, customAppConfig -} - -// convertEncodingConfig converts default cosmos encoding config to ignite format -func convertEncodingConfig(config simappparams.EncodingConfig) simappparams.EncodingConfig { - return simappparams.EncodingConfig{ - InterfaceRegistry: config.InterfaceRegistry, - Codec: config.Codec, - TxConfig: config.TxConfig, - Amino: config.Amino, - } -} \ No newline at end of file diff --git a/cmd/swisstronikd/cmd/enclave.go b/cmd/swisstronikd/cmd/enclave.go index fba42dbd..4b4e85c2 100644 --- a/cmd/swisstronikd/cmd/enclave.go +++ b/cmd/swisstronikd/cmd/enclave.go @@ -1,6 +1,7 @@ package cmd import ( + "context" "fmt" "net" "strconv" @@ -9,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" ) const flagShouldReset = "reset" @@ -33,7 +35,7 @@ func RequestMasterKeyCmd() *cobra.Command { cmd := &cobra.Command{ Use: "request-master-key [bootstrap-node-address]", Short: "Requests master key from bootstrap node", - Long: "Initializes SGX enclave by passing process of Remote Attestation agains bootstrap node. If remote attestation was successful, bootstrap node shares encrypted master key with this node. Process of Remote Attestation is performed over pure TCP protocol.", + Long: `Initializes SGX enclave by passing process of Remote Attestation agains bootstrap node. If remote attestation was successful, bootstrap node shares encrypted master key with this node. Process of Remote Attestation is performed over pure TCP protocol.`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) @@ -63,6 +65,34 @@ func RequestMasterKeyCmd() *cobra.Command { return cmd } +// CreateMasterKey returns create-master-key cobra Command. +func CreateMasterKey() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-master-key", + Short: "Creates new master key", + Long: `Initializes SGX enclave by creating new master key. Use this function for first validator in network`, + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + shouldReset, err := cmd.Flags().GetBool(flagShouldReset) + if err != nil { + return err + } + + if err := librustgo.InitializeMasterKey(shouldReset); err != nil { + return err + } + + fmt.Println("Node is ready for work") + + return nil + }, + } + + cmd.Flags().Bool(flagShouldReset, false, "reset already existing master key. Default: false") + + return cmd +} + // StartAttestationServer returns start-attestation-server cobra Command. func StartAttestationServer() *cobra.Command { cmd := &cobra.Command{ @@ -70,11 +100,17 @@ func StartAttestationServer() *cobra.Command { Short: "Starts attestation server", Long: "Start server for Intel SGX Remote Attestation to share master key with new nodes", Args: cobra.ExactArgs(1), - RunE: func(_ *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, args []string) error { if err := librustgo.StartSeedServer(args[0]); err != nil { return err } - return server.WaitForQuitSignals() + + srvCtx := server.GetServerContextFromCmd(cmd) + ctx, cancelFn := context.WithCancel(context.Background()) + g, _ := errgroup.WithContext(ctx) + + server.ListenForQuitSignals(g, false, cancelFn, srvCtx.Logger.With("module", "SGX-server")) + return nil }, } diff --git a/cmd/swisstronikd/cmd/genaccounts.go b/cmd/swisstronikd/cmd/genaccounts.go index d5ec6533..16e374e2 100644 --- a/cmd/swisstronikd/cmd/genaccounts.go +++ b/cmd/swisstronikd/cmd/genaccounts.go @@ -1,14 +1,17 @@ package cmd import ( - "bufio" "encoding/json" "errors" "fmt" + "swisstronik/crypto/hd" + evmtypes "swisstronik/x/evm/types" + "swisstronik/types" + + address "cosmossdk.io/core/address" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -16,6 +19,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/ethereum/go-ethereum/common" "github.com/spf13/cobra" ) @@ -23,10 +27,12 @@ const ( flagVestingStart = "vesting-start-time" flagVestingEnd = "vesting-end-time" flagVestingAmt = "vesting-amount" + flagAppendMode = "append" + flagModuleName = "module-name" ) // AddGenesisAccountCmd returns add-genesis-account cobra Command. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { +func AddGenesisAccountCmd(defaultNodeHome string, addressCodec address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", Short: "Add a genesis account to genesis.json", @@ -37,42 +43,34 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa `, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - cdc := clientCtx.Codec + clientCtx := client.GetClientContextFromCmd(cmd).WithKeyringOptions(hd.EthSecp256k1Option()) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config config.SetRoot(clientCtx.HomeDir) - coins, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - + kr := clientCtx.Keyring addr, err := sdk.AccAddressFromBech32(args[0]) if err != nil { - inBuf := bufio.NewReader(cmd.InOrStdin()) - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) + info, err := kr.Key(args[0]) if err != nil { - return err + return fmt.Errorf("failed to get address from Keyring: %w", err) } - // attempt to lookup address from Keybase if no address was provided - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, cdc) + addr, err = info.GetAddress() if err != nil { return err } + } - info, err := kb.Key(args[0]) - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - - addr, err = info.GetAddress() - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) } vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) @@ -100,7 +98,10 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err != nil { + return fmt.Errorf("failed to create base vesting account: %w", err) + } if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { @@ -118,7 +119,10 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa return errors.New("invalid vesting parameters; must supply start and end time or end time") } } else { - genAccount = baseAccount + genAccount = &types.EthAccount{ + BaseAccount: baseAccount, + CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), + } } if err := genAccount.Validate(); err != nil { @@ -131,7 +135,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa return fmt.Errorf("failed to unmarshal genesis state: %w", err) } - authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) accs, err := authtypes.UnpackAccounts(authGenState.Accounts) if err != nil { @@ -153,18 +157,19 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa } authGenState.Accounts = genAccs - authGenStateBz, err := cdc.MarshalJSON(&authGenState) + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) if err != nil { return fmt.Errorf("failed to marshal auth genesis state: %w", err) } appState[authtypes.ModuleName] = authGenStateBz - bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) bankGenState.Balances = append(bankGenState.Balances, balances) bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) - bankGenStateBz, err := cdc.MarshalJSON(bankGenState) + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) if err != nil { return fmt.Errorf("failed to marshal bank genesis state: %w", err) } @@ -181,8 +186,8 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa }, } - cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") diff --git a/cmd/swisstronikd/cmd/root.go b/cmd/swisstronikd/cmd/root.go index ff8cef5c..3809158d 100644 --- a/cmd/swisstronikd/cmd/root.go +++ b/cmd/swisstronikd/cmd/root.go @@ -10,29 +10,32 @@ import ( "path/filepath" "time" - "swisstronik/encoding" "swisstronik/ethereum/eip712" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/core/appmodule" + confixcmd "cosmossdk.io/tools/confix/cmd" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" - - simappparams "cosmossdk.io/simapp/params" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - dbm "github.com/cometbft/cometbft-db" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/types/module" + + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/rpc" sdkserver "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" @@ -51,13 +54,28 @@ import ( evmserverconfig "swisstronik/server/config" srvflags "swisstronik/server/flags" - "github.com/cosmos/cosmos-sdk/client/pruning" + "swisstronik/utils" + + swisstroniktypes "swisstronik/types" + "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/codec" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" + simutils "github.com/cosmos/cosmos-sdk/testutil/sims" + sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" ) +const ShortBlockWindow uint32 = 20 + // NewRootCmd creates a new root command for a Cosmos SDK application -func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) +func NewRootCmd() (*cobra.Command, swisstroniktypes.EncodingConfig) { + // Initialize the SDK config the first before doing anything else. + InitSDKConfig() + + encodingConfig := app.MakeConfig() initClientCtx := client.Context{}. WithCodec(encodingConfig.Codec). WithInterfaceRegistry(encodingConfig.InterfaceRegistry). @@ -88,6 +106,22 @@ func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { return err } + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. + enabledSignModes := append(authtx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfigWithTextual, err := authtx.NewTxConfigWithOptions( + codec.NewProtoCodec(encodingConfig.InterfaceRegistry), + txConfigOpts, + ) + if err != nil { + return err + } + initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } @@ -100,24 +134,22 @@ func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { }, } - InitSDKConfig() - + valOperAddressCodec := encodingConfig.TxConfig.SigningContext().ValidatorAddressCodec() a := appCreator{encodingConfig} rootCmd.AddCommand( evmmoduleclient.ValidateChainID( genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), ), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator), - genutilcli.MigrateGenesisCmd(), - genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator, valOperAddressCodec), + genutilcli.MigrateGenesisCmd(genutilcli.MigrationMap), + genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, valOperAddressCodec), genutilcli.ValidateGenesisCmd(app.ModuleBasics), - AddGenesisAccountCmd(app.DefaultNodeHome), + AddGenesisAccountCmd(app.DefaultNodeHome, valOperAddressCodec), tmcli.NewCompletionCmd(rootCmd, true), NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), - config.Cmd(), + confixcmd.ConfigCommand(), EnclaveCmd(), DebugCmd(), - pruning.PruningCmd(a.newApp), snapshot.Cmd(a.newApp), ) @@ -125,12 +157,11 @@ func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { rootCmd, evmmoduleserver.NewDefaultStartOptions(a.newApp, app.DefaultNodeHome), a.appExport, - addModuleInitFlags, - ) + addModuleInitFlags) // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + sdkserver.StatusCommand(), queryCommand(), txCommand(), evmmoduleclient.KeyCommands(app.DefaultNodeHome), @@ -140,12 +171,61 @@ func NewRootCmd() (*cobra.Command, simappparams.EncodingConfig) { panic(err) } - // add rosetta - rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) + db := dbm.NewMemDB() + chainID := utils.TestnetChainID + "-1" + newapp := app.New( + log.NewNopLogger(), + db, + nil, + true, + map[int64]bool{}, + app.DefaultNodeHome, + 5, + simutils.NewAppOptionsWithFlagHome(app.DefaultNodeHome), + baseapp.SetChainID(chainID), + ) + + initClientCtx, err = config.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) + if err != nil { + panic(err) + } + if err := autoCliOpts(newapp, initClientCtx).EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } return rootCmd, encodingConfig } +// autoCliOpts returns options based upon the modules in the Swisstronik app. +// +// Creates an instance of the application that is discarded to enumerate the modules. +func autoCliOpts(app *app.App, initClientCtx client.Context) autocli.AppOptions { + modules := make(map[string]appmodule.AppModule, 0) + for _, m := range app.ModuleManager.Modules { + if moduleWithName, ok := m.(module.HasName); ok { + moduleName := moduleWithName.Name() + if appModule, ok := moduleWithName.(appmodule.AppModule); ok { + modules[moduleName] = appModule + } + } + } + + cliKR, err := keyring.NewAutoCLIKeyring(initClientCtx.Keyring) + if err != nil { + panic(err) + } + + return autocli.AppOptions{ + Modules: modules, + ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), + AddressCodec: authcodec.NewBech32Codec(sdktypes.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: authcodec.NewBech32Codec(sdktypes.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdktypes.GetConfig().GetBech32ConsensusAddrPrefix()), + Keyring: cliKR, + ClientCtx: initClientCtx, + } +} + // queryCommand returns the sub-command to send queries to the app func queryCommand() *cobra.Command { cmd := &cobra.Command{ @@ -158,14 +238,12 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcmd.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + sdkserver.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), ) - app.ModuleBasics.AddQueryCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd @@ -192,7 +270,6 @@ func txCommand() *cobra.Command { authcmd.GetDecodeCommand(), ) - app.ModuleBasics.AddTxCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd @@ -204,7 +281,7 @@ func addModuleInitFlags(startCmd *cobra.Command) { } type appCreator struct { - encodingConfig simappparams.EncodingConfig + encodingConfig swisstroniktypes.EncodingConfig } // newApp creates a new Cosmos SDK app @@ -214,7 +291,7 @@ func (a appCreator) newApp( traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { - var cache sdk.MultiStorePersistentCache + var cache storetypes.MultiStorePersistentCache if cast.ToBool(appOpts.Get(sdkserver.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() @@ -271,7 +348,6 @@ func (a appCreator) newApp( skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(sdkserver.FlagInvCheckPeriod)), - a.encodingConfig, appOpts, baseapp.SetPruning(pruningOpts), baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(sdkserver.FlagMinGasPrices))), @@ -316,11 +392,10 @@ func (a appCreator) appExport( map[int64]bool{}, homePath, uint(1), - a.encodingConfig, appOpts, ) } else { - swissApp = app.New(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), a.encodingConfig, appOpts) + swissApp = app.New(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), appOpts) } @@ -331,14 +406,41 @@ func (a appCreator) appExport( // return tmcfg.DefaultConfig if no custom configuration is required for the application. func initTendermintConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() + + // TODO(DEC-1716): Set default seeds. + cfg.P2P.Seeds = "" + + // Expose the Tendermint RPC. + cfg.RPC.ListenAddress = "tcp://0.0.0.0:26657" + cfg.RPC.CORSAllowedOrigins = []string{"*"} + cfg.Consensus.TimeoutCommit = time.Second * 3 // use v0 since v1 severely impacts the node's performance - cfg.Mempool.Version = tmcfg.MempoolV0 + // Mempool config. + // We specifically are using a number greater than max QPS (currently set at 5000) * ShortBlockWindow to prevent + // a replay attack that is possible with short-term order placements and cancellations. The attack would consume + // a users rate limit if the entry is evicted from the mempool cache as it would be possible for the transaction + // to go through `CheckTx` again causing it to hit rate limit code against the users account. + cfg.Mempool.CacheSize = 5000 * int(ShortBlockWindow) + cfg.Mempool.Size = 50000 + cfg.Mempool.KeepInvalidTxsInCache = true // to put a higher strain on node memory, use these values: // cfg.P2P.MaxNumInboundPeers = 100 // cfg.P2P.MaxNumOutboundPeers = 40 + // Enable pex. + cfg.P2P.PexReactor = true + + // Enable telemetry. + cfg.Instrumentation.Prometheus = true + + // Set default commit timeout to 500ms for faster block time. + // Note: avoid using 1s since it's considered tne default Tendermint value + // (https://github.com/dydxprotocol/tendermint/blob/dc03b21cf5d54c641e1d14b14fae5920fa7ba656/config/config.go#L982) + // and will be overridden by `interceptConfigs` in `cosmos-sdk`. + cfg.Consensus.TimeoutCommit = 500 * time.Millisecond + return cfg } diff --git a/cmd/swisstronikd/cmd/testnet.go b/cmd/swisstronikd/cmd/testnet.go index bcfb8bf4..ec1a3c98 100644 --- a/cmd/swisstronikd/cmd/testnet.go +++ b/cmd/swisstronikd/cmd/testnet.go @@ -2,12 +2,16 @@ package cmd import ( "bufio" + "context" "encoding/json" "fmt" "net" "os" "path/filepath" + sdkmath "cosmossdk.io/math" + + "github.com/SigmaGmbH/librustgo" "github.com/ethereum/go-ethereum/common" tmconfig "github.com/cometbft/cometbft/config" @@ -43,7 +47,7 @@ import ( "swisstronik/testutil/network" tmtypes "github.com/cometbft/cometbft/types" - "github.com/SigmaGmbH/librustgo" + "github.com/cosmos/cosmos-sdk/runtime" ) var ( @@ -128,7 +132,7 @@ Example: args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) - return initTestnetConfigs(clientCtx, cmd, serverCtx.Config, mbm, genBalIterator, args) + return initTestnetConfigs(clientCtx, cmd, serverCtx.Config, mbm, genBalIterator, args, clientCtx.TxConfig.SigningContext().ValidatorAddressCodec()) }, } @@ -148,9 +152,9 @@ func initializeEnclave() *cobra.Command { cmd := &cobra.Command{ Use: "init-testnet-enclave", Short: "Initialize SGX Enclave for local testnet", - Long: `Initializes SGX enclave by creating new master key + Long: `Initializes SGX enclave by creating new master key *** WARNING: Do not use this command to setup master key for validator ***`, - Args: cobra.ExactArgs(0), + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, _ []string) error { shouldReset, err := cmd.Flags().GetBool(flagShouldReset) if err != nil { @@ -182,6 +186,7 @@ func initTestnetConfigs( mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, args initArgs, + valAddrCodec runtime.ValidatorAddressCodec, ) error { if args.chainID == "" { args.chainID = fmt.Sprintf("swisstronikd_%d-1", tmrand.Int63n(9999999999999)+1) @@ -280,12 +285,12 @@ func initTestnetConfigs( valTokens := sdk.TokensFromConsensusPower(100, evmmoduletypes.PowerReduction) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + addr.String(), valPubKeys[i], sdk.NewCoin(evmmoduletypes.SwtrDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return err @@ -304,8 +309,9 @@ func initTestnetConfigs( WithMemo(memo). WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) + ctx := context.Background() - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(ctx, txFactory, nodeDirName, txBuilder, true); err != nil { return err } @@ -333,7 +339,7 @@ func initTestnetConfigs( err := collectGenFiles( clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, - args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, + args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, valAddrCodec, ) if err != nil { return err @@ -423,7 +429,7 @@ func initGenFiles( func collectGenFiles( clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, - outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, valAddrCodec runtime.ValidatorAddressCodec, ) error { var appState json.RawMessage genTime := tmtime.Now() @@ -439,12 +445,12 @@ func collectGenFiles( nodeID, valPubKey := nodeIDs[i], valPubKeys[i] initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey) - genDoc, err := tmtypes.GenesisDocFromFile(nodeConfig.GenesisFile()) + appGenesis, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile()) if err != nil { return err } - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator) + nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator, valAddrCodec) if err != nil { return err } @@ -453,17 +459,11 @@ func collectGenFiles( // set the canonical application state (they should not differ) appState = nodeAppState } - + genFile := nodeConfig.GenesisFile() // overwrite each validator's genesis file to have a canonical genesis time - genDoc.GenesisTime = genTime - genDoc.Validators = nil - genDoc.AppState = nodeAppState - genDoc.ChainID = chainID - genDoc.ConsensusParams.Block.MaxGas = 20_000_000 - - if err := genutil.ExportGenesisFile(genDoc, genFile); err != nil { + if err := genutil.ExportGenesisFileWithTime(genFile, chainID, nil, appState, genTime); err != nil { return err } } diff --git a/cmd/swisstronikd/main.go b/cmd/swisstronikd/main.go index b9a205df..362fe9f2 100644 --- a/cmd/swisstronikd/main.go +++ b/cmd/swisstronikd/main.go @@ -5,7 +5,6 @@ import ( "os" "strconv" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/getsentry/sentry-go" @@ -30,22 +29,16 @@ func main() { } err := sentry.Init(sentry.ClientOptions{ - Dsn: sentryDsn, + Dsn: sentryDsn, TracesSampleRate: rate, }) if err != nil { log.Fatalf("sentry.Init: %s", err) } } - + rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + os.Exit(1) } } diff --git a/crypto/hd/benchmark_test.go b/crypto/hd/benchmark_test.go index 59a5885a..600cdff4 100644 --- a/crypto/hd/benchmark_test.go +++ b/crypto/hd/benchmark_test.go @@ -1,9 +1,9 @@ package hd import ( + ethermint "swisstronik/types" "testing" - ethermint "swisstronik/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" ) diff --git a/encoding/config.go b/encoding/config.go index 65238e2f..a2c31ff9 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -16,22 +16,59 @@ package encoding import ( - "cosmossdk.io/simapp/params" amino "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth/tx" + "github.com/ethereum/go-ethereum/common" + "google.golang.org/protobuf/proto" enccodec "swisstronik/encoding/codec" + + swisstroniktypes "swisstronik/types" + + "cosmossdk.io/x/tx/signing" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + gogoproto "github.com/cosmos/gogoproto/proto" + "google.golang.org/protobuf/reflect/protoreflect" ) +var InterfaceRegistry types.InterfaceRegistry + +func customGetSignerFn(path string) func(msg proto.Message) ([][]byte, error) { + return func(msg proto.Message) ([][]byte, error) { + m := msg.ProtoReflect() + fieldDesc := m.Descriptor().Fields().ByName(protoreflect.Name(path)) + addr := common.BytesToAddress((m.Get(fieldDesc).Bytes())) + signer := sdk.AccAddress(addr.Bytes()) + return [][]byte{signer}, nil + } +} + // MakeConfig creates an EncodingConfig for testing -func MakeConfig(mb module.BasicManager) params.EncodingConfig { +func MakeConfig() swisstroniktypes.EncodingConfig { cdc := amino.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() + addrPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix() + valAddrPrefix := sdk.GetConfig().GetBech32ValidatorAddrPrefix() + signingOptions := signing.Options{ + AddressCodec: addresscodec.NewBech32Codec(addrPrefix), + ValidatorAddressCodec: addresscodec.NewBech32Codec(valAddrPrefix), + CustomGetSigners: map[protoreflect.FullName]signing.GetSignersFunc{ + "ethermint.evm.v1.MsgHandleTx": customGetSignerFn("from"), + }, + } + interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: gogoproto.HybridResolver, + SigningOptions: signingOptions, + }) + + if err != nil { + panic(err) + } codec := amino.NewProtoCodec(interfaceRegistry) - encodingConfig := params.EncodingConfig{ + encodingConfig := swisstroniktypes.EncodingConfig{ InterfaceRegistry: interfaceRegistry, Codec: codec, TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes), @@ -39,8 +76,13 @@ func MakeConfig(mb module.BasicManager) params.EncodingConfig { } enccodec.RegisterLegacyAminoCodec(encodingConfig.Amino) - mb.RegisterLegacyAminoCodec(encodingConfig.Amino) + // mb.RegisterLegacyAminoCodec(encodingConfig.Amino) enccodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) - mb.RegisterInterfaces(encodingConfig.InterfaceRegistry) + // mb.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + // This is needed for the EIP712 txs because currently is using + // the deprecated method legacytx.StdSignBytes + legacytx.RegressionTestingAminoCodec = cdc + return encodingConfig } diff --git a/encoding/config_test.go b/encoding/config_test.go index dff8e5d2..4964bdf8 100644 --- a/encoding/config_test.go +++ b/encoding/config_test.go @@ -8,7 +8,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" - "swisstronik/app" "swisstronik/encoding" "swisstronik/tests" evmtypes "swisstronik/x/evm/types" @@ -25,7 +24,7 @@ func TestTxEncoding(t *testing.T) { err := msg.Sign(ethSigner, signer) require.NoError(t, err) - cfg := encoding.MakeConfig(app.ModuleBasics) + cfg := encoding.MakeConfig() _, err = cfg.TxConfig.TxEncoder()(msg) require.Error(t, err, "encoding failed") diff --git a/ethereum/eip712/eip712.go b/ethereum/eip712/eip712.go index f4f8e853..efac5211 100644 --- a/ethereum/eip712/eip712.go +++ b/ethereum/eip712/eip712.go @@ -24,7 +24,6 @@ import ( "strings" "time" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "golang.org/x/text/cases" "golang.org/x/text/language" @@ -34,6 +33,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" + sdkmath "cosmossdk.io/math" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/signer/core/apitypes" @@ -407,7 +407,7 @@ var ( addressType = reflect.TypeOf(common.Address{}) bigIntType = reflect.TypeOf(big.Int{}) cosmIntType = reflect.TypeOf(sdkmath.Int{}) - cosmDecType = reflect.TypeOf(sdk.Dec{}) + cosmDecType = reflect.TypeOf(sdkmath.LegacyDec{}) cosmosAnyType = reflect.TypeOf(&codectypes.Any{}) timeType = reflect.TypeOf(time.Time{}) diff --git a/ethereum/eip712/eip712_test.go b/ethereum/eip712/eip712_test.go index 98055c10..5c40dbfd 100644 --- a/ethereum/eip712/eip712_test.go +++ b/ethereum/eip712/eip712_test.go @@ -1,13 +1,14 @@ package eip712_test import ( + "context" "testing" "cosmossdk.io/math" "swisstronik/ethereum/eip712" + ethermint "swisstronik/types" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/crypto" @@ -17,7 +18,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "swisstronik/app" "swisstronik/encoding" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -26,10 +26,16 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + txsigning "cosmossdk.io/x/tx/signing" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/types/known/anypb" ) // Unit tests for single-signer EIP-712 signature verification. Multi-signer verification tests are included @@ -38,7 +44,7 @@ import ( type EIP712TestSuite struct { suite.Suite - config params.EncodingConfig + config ethermint.EncodingConfig clientCtx client.Context } @@ -48,7 +54,7 @@ func TestEIP712TestSuite(t *testing.T) { // Set up test env to replicate prod. environment func (suite *EIP712TestSuite) SetupTest() { - suite.config = encoding.MakeConfig(app.ModuleBasics) + suite.config = encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(suite.config.TxConfig) sdk.GetConfig().SetBech32PrefixForAccount("ethm", "") @@ -92,9 +98,9 @@ func (suite *EIP712TestSuite) makeCoins(denom string, amount math.Int) sdk.Coins func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { suite.SetupTest() - signModes := []signing.SignMode{ - signing.SignMode_SIGN_MODE_DIRECT, - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + signModes := []signingv1beta1.SignMode{ + signingv1beta1.SignMode_SIGN_MODE_DIRECT, + signingv1beta1.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, } // Fixed test address @@ -156,8 +162,8 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { memo: "", msgs: []sdk.Msg{ stakingtypes.NewMsgDelegate( - suite.createTestAddress(), - sdk.ValAddress(suite.createTestAddress()), + suite.createTestAddress().String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins("photon", math.NewInt(1))[0], ), }, @@ -174,8 +180,8 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { memo: "", msgs: []sdk.Msg{ distributiontypes.NewMsgWithdrawDelegatorReward( - suite.createTestAddress(), - sdk.ValAddress(suite.createTestAddress()), + suite.createTestAddress().String(), + sdk.ValAddress(suite.createTestAddress()).String(), ), }, accountNumber: 25, @@ -191,13 +197,13 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { memo: "", msgs: []sdk.Msg{ stakingtypes.NewMsgDelegate( - testAddress, - sdk.ValAddress(suite.createTestAddress()), + testAddress.String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins("photon", math.NewInt(1))[0], ), stakingtypes.NewMsgDelegate( - testAddress, - sdk.ValAddress(suite.createTestAddress()), + testAddress.String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins("photon", math.NewInt(5))[0], ), }, @@ -310,16 +316,10 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { memo: "", msgs: []sdk.Msg{ banktypes.NewMsgMultiSend( - []banktypes.Input{ - banktypes.NewInput( - suite.createTestAddress(), - suite.makeCoins("photon", math.NewInt(50)), - ), - banktypes.NewInput( - suite.createTestAddress(), - suite.makeCoins("photon", math.NewInt(50)), - ), - }, + banktypes.NewInput( + suite.createTestAddress(), + suite.makeCoins("photon", math.NewInt(50)), + ), []banktypes.Output{ banktypes.NewOutput( suite.createTestAddress(), @@ -357,9 +357,11 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { // Set memo txBuilder.SetMemo(tc.memo) + defaultSignMode, err := authsigning.APISignModeToInternal(signMode) + // Prepare signature field txSigData := signing.SingleSignatureData{ - SignMode: signMode, + SignMode: defaultSignMode, Signature: nil, } txSig := signing.SignatureV2{ @@ -379,23 +381,65 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { if tc.timeoutHeight != 0 { txBuilder.SetTimeoutHeight(tc.timeoutHeight) } + anyPk, _ := codectypes.NewAnyWithValue(pubKey) // Declare signerData - signerData := authsigning.SignerData{ + signerData := txsigning.SignerData{ ChainID: chainId, AccountNumber: tc.accountNumber, Sequence: tc.sequence, - PubKey: pubKey, - Address: sdk.MustBech32ifyAddressBytes("ethm", pubKey.Bytes()), + PubKey: &anypb.Any{ + TypeUrl: anyPk.TypeUrl, + Value: anyPk.Value, + }, + Address: sdk.MustBech32ifyAddressBytes("ethm", pubKey.Bytes()), + } + + tip := &txv1beta1.Tip{ + Tipper: "tipper", + Amount: []*v1beta1.Coin{{Denom: "uswtr", Amount: "1000"}}, + } + + anyMsgs := make([]*anypb.Any, len(tc.msgs)) + for j, msg := range tc.msgs { + legacyAny, err := codectypes.NewAnyWithValue(msg) + suite.Require().NoError(err) + + anyMsgs[j] = &anypb.Any{ + TypeUrl: legacyAny.TypeUrl, + Value: legacyAny.Value, + } + } + auxBody := &txv1beta1.TxBody{ + Messages: anyMsgs, + Memo: tc.memo, + TimeoutHeight: tc.timeoutHeight, + // AuxTxBuilder has no concern with extension options, so we set them to nil. + // This preserves pre-PR#16025 behavior where extension options were ignored, this code path: + // https://github.com/cosmos/cosmos-sdk/blob/ac3c209326a26b46f65a6cc6f5b5ebf6beb79b38/client/tx/aux_builder.go#L193 + // https://github.com/cosmos/cosmos-sdk/blob/ac3c209326a26b46f65a6cc6f5b5ebf6beb79b38/x/auth/migrations/legacytx/stdsign.go#L49 + ExtensionOptions: nil, + NonCriticalExtensionOptions: nil, } bz, err := suite.clientCtx.TxConfig.SignModeHandler().GetSignBytes( + context.Background(), signMode, signerData, - txBuilder.GetTx(), + txsigning.TxData{ + Body: auxBody, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: nil, + // Aux signer never signs over fee. + // For LEGACY_AMINO_JSON, we use the convention to sign + // over empty fees. + // ref: https://github.com/cosmos/cosmos-sdk/pull/10348 + Fee: &txv1beta1.Fee{}, + Tip: tip, + }, + }, ) suite.Require().NoError(err) - suite.verifyEIP712SignatureVerification(tc.expectSuccess, *privKey, *pubKey, bz) }) } diff --git a/ethereum/eip712/encoding.go b/ethereum/eip712/encoding.go index 65c0ef1f..dcb741f5 100644 --- a/ethereum/eip712/encoding.go +++ b/ethereum/eip712/encoding.go @@ -20,16 +20,15 @@ import ( "errors" "fmt" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" sdk "github.com/cosmos/cosmos-sdk/types" txTypes "github.com/cosmos/cosmos-sdk/types/tx" - ethermint "swisstronik/types" - apitypes "github.com/ethereum/go-ethereum/signer/core/apitypes" + swisstroniktypes "swisstronik/types" + "github.com/cosmos/cosmos-sdk/codec" ) @@ -47,7 +46,7 @@ var ( // The process of unmarshaling SignDoc bytes into a SignDoc object requires having a codec // populated with all relevant message types. As a result, we must call this method on app // initialization with the app's encoding config. -func SetEncodingConfig(cfg params.EncodingConfig) { +func SetEncodingConfig(cfg swisstroniktypes.EncodingConfig) { aminoCodec = cfg.Amino protoCodec = codec.NewProtoCodec(cfg.InterfaceRegistry) } @@ -127,13 +126,18 @@ func decodeAminoSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { // Use first message for fee payer and type inference msg := msgs[0] + signers, _, err := protoCodec.GetMsgV1Signers(msg) + if err != nil { + return apitypes.TypedData{}, errors.New("invalid signers") + } + // By convention, the fee payer is the first address in the list of signers. - feePayer := msg.GetSigners()[0] + feePayer := signers[0] feeDelegation := &FeeDelegationOptions{ FeePayer: feePayer, } - chainID, err := ethermint.ParseChainID(aminoDoc.ChainID) + chainID, err := swisstroniktypes.ParseChainID(aminoDoc.ChainID) if err != nil { return apitypes.TypedData{}, errors.New("invalid chain ID passed as argument") } @@ -203,7 +207,7 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { signerInfo := authInfo.SignerInfos[0] - chainID, err := ethermint.ParseChainID(signDoc.ChainId) + chainID, err := swisstroniktypes.ParseChainID(signDoc.ChainId) if err != nil { return apitypes.TypedData{}, fmt.Errorf("invalid chain ID passed as argument: %w", err) } @@ -213,13 +217,15 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { Gas: authInfo.Fee.GasLimit, } - feePayer := msg.GetSigners()[0] + signers, _, err := protoCodec.GetMsgV1Signers(msg) + if err != nil { + return apitypes.TypedData{}, errors.New("invalid signers as argument") + } + feePayer := signers[0] feeDelegation := &FeeDelegationOptions{ FeePayer: feePayer, } - tip := authInfo.Tip - // WrapTxToTypedData expects the payload as an Amino Sign Doc signBytes := legacytx.StdSignBytes( signDoc.ChainId, @@ -229,7 +235,6 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { *stdFee, msgs, body.Memo, - tip, ) typedData, err := WrapTxToTypedData( @@ -272,13 +277,17 @@ func validatePayloadMessages(msgs []sdk.Msg) error { return err } - if len(m.GetSigners()) != 1 { + signers, _, err := protoCodec.GetMsgV1Signers(m) + if err != nil { + return errors.New("invalid signers as argument") + } + if len(signers) != 1 { return errors.New("unable to build EIP-712 payload: expect exactly 1 signer") } if i == 0 { msgType = t - msgSigner = m.GetSigners()[0] + msgSigner = signers[0] continue } @@ -286,7 +295,7 @@ func validatePayloadMessages(msgs []sdk.Msg) error { return errors.New("unable to build EIP-712 payload: different types of messages detected") } - if !msgSigner.Equals(m.GetSigners()[0]) { + if !msgSigner.Equals(sdk.MustAccAddressFromBech32(string(signers[0]))) { return errors.New("unable to build EIP-712 payload: multiple signers detected") } } @@ -312,4 +321,4 @@ func getMsgType(msg sdk.Msg) (string, error) { } return jsonMsg.Type, nil -} \ No newline at end of file +} diff --git a/ethereum/eip712/preprocess.go b/ethereum/eip712/preprocess.go index f7ffce6d..f9ece2c9 100644 --- a/ethereum/eip712/preprocess.go +++ b/ethereum/eip712/preprocess.go @@ -68,7 +68,7 @@ func PreprocessLedgerTx(chainID string, keyType cosmoskr.KeyType, txBuilder clie // Add ExtensionOptionsWeb3Tx extension with signature var option *codectypes.Any option, err = codectypes.NewAnyWithValue(&types.ExtensionOptionsWeb3Tx{ - FeePayer: txBuilder.GetTx().FeePayer().String(), + FeePayer: string(txBuilder.GetTx().FeePayer()), TypedDataChainID: chainIDInt.Uint64(), FeePayerSig: sigBytes, }) diff --git a/ethereum/eip712/preprocess_test.go b/ethereum/eip712/preprocess_test.go index 3b576ea0..74aea650 100644 --- a/ethereum/eip712/preprocess_test.go +++ b/ethereum/eip712/preprocess_test.go @@ -5,7 +5,6 @@ import ( "strings" "testing" - "swisstronik/app" "swisstronik/encoding" "swisstronik/ethereum/eip712" "swisstronik/tests" @@ -27,7 +26,7 @@ import ( var ( chainId = "ethermint_9000-1" ctx = client.Context{}.WithTxConfig( - encoding.MakeConfig(app.ModuleBasics).TxConfig, + encoding.MakeConfig().TxConfig, ) ) var feePayerAddress = "ethm17xpfvakm2amg962yls6f84z3kell8c5lthdzgl" @@ -92,7 +91,7 @@ func TestLedgerPreprocessing(t *testing.T) { // Verify tx fields are unchanged tx := tc.txBuilder.GetTx() - require.Equal(t, tx.FeePayer().String(), tc.expectedFeePayer) + require.Equal(t, string(tx.FeePayer()), tc.expectedFeePayer) require.Equal(t, tx.GetGas(), tc.expectedGas) require.Equal(t, tx.GetFee().AmountOf(evmtypes.DefaultParams().EvmDenom), tc.expectedFee) require.Equal(t, tx.GetMemo(), tc.expectedMemo) diff --git a/external/evm-module b/external/evm-module new file mode 160000 index 00000000..95f792cb --- /dev/null +++ b/external/evm-module @@ -0,0 +1 @@ +Subproject commit 95f792cb3eebb24f6b8f66a799c04ab9ae00edc7 diff --git a/go-sgxvm/internal/api/libsgx_wrapper.x86_64.so b/go-sgxvm/internal/api/libsgx_wrapper.x86_64.so index 0ee6f1c6..2e9e71c5 100755 Binary files a/go-sgxvm/internal/api/libsgx_wrapper.x86_64.so and b/go-sgxvm/internal/api/libsgx_wrapper.x86_64.so differ diff --git a/go.mod b/go.mod index 2e67c45c..4d9eb2bd 100644 --- a/go.mod +++ b/go.mod @@ -1,38 +1,48 @@ module swisstronik -go 1.20 +go 1.21 require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0 - cosmossdk.io/math v1.1.3-rc.1 - cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d - cosmossdk.io/tools/rosetta v0.2.1 + cosmossdk.io/api v0.7.3 + cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 + cosmossdk.io/core v0.11.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.2.0 + cosmossdk.io/simapp v0.0.0-20240215075256-c122a3d8ab04 + cosmossdk.io/store v1.0.2 + cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/x/circuit v0.1.0 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + cosmossdk.io/x/tx v0.13.0 + cosmossdk.io/x/upgrade v0.1.1 filippo.io/edwards25519 v1.0.0 github.com/SigmaGmbH/librustgo v0.0.2-0.20230725120829-f1a254f14ac6 - github.com/armon/go-metrics v0.4.1 github.com/btcsuite/btcd v0.23.3 github.com/btcsuite/btcd/btcutil v1.1.3 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.47.5 + github.com/cometbft/cometbft v0.38.5 + github.com/cosmos/cosmos-db v1.0.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/cosmos-sdk v0.50.4 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.2.0 - github.com/davecgh/go-spew v1.1.1 + github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/ibc-go/modules/capability v1.0.0 + github.com/cosmos/ibc-go/v8 v8.1.0 + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 github.com/ethereum/go-ethereum v1.11.5 github.com/gabriel-vasile/mimetype v1.4.2 - github.com/getsentry/sentry-go v0.23.0 + github.com/getsentry/sentry-go v0.27.0 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.3 - github.com/google/uuid v1.3.0 - github.com/gorilla/mux v1.8.0 + github.com/google/uuid v1.4.0 + github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 + github.com/hashicorp/go-metrics v0.5.2 github.com/improbable-eng/grpc-web v0.15.0 github.com/lestrrat-go/jwx v1.2.26 github.com/mr-tron/base58 v1.2.0 @@ -44,40 +54,44 @@ require ( github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 github.com/rs/cors v1.9.0 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.16.0 + github.com/spf13/viper v1.18.2 github.com/status-im/keycard-go v0.2.0 github.com/stretchr/testify v1.8.4 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/crypto v0.13.0 - golang.org/x/net v0.15.0 - golang.org/x/text v0.13.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb - google.golang.org/grpc v1.58.2 + golang.org/x/crypto v0.19.0 + golang.org/x/net v0.21.0 + golang.org/x/sync v0.6.0 + golang.org/x/text v0.14.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f + google.golang.org/grpc v1.60.1 + google.golang.org/protobuf v1.32.0 gopkg.in/yaml.v2 v2.4.0 - sigs.k8s.io/yaml v1.3.0 + sigs.k8s.io/yaml v1.4.0 ) require ( - cloud.google.com/go v0.110.7 // indirect - cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go v0.110.10 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.1 // indirect - cloud.google.com/go/storage v1.31.0 // indirect - cosmossdk.io/core v0.6.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.2.0 // indirect + cloud.google.com/go/iam v1.1.5 // indirect + cloud.google.com/go/storage v1.35.1 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/x/nft v0.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/aws/aws-sdk-go v1.44.312 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect @@ -85,15 +99,19 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/iavl v1.0.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect @@ -102,10 +120,12 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/kit v0.12.0 // indirect @@ -118,40 +138,44 @@ require ( github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.2 // indirect + github.com/hashicorp/go-getter v1.7.3 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-memdb v1.3.4 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/huin/goupnp v1.0.3 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.6 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.1 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -159,14 +183,12 @@ require ( github.com/lestrrat-go/option v1.0.1 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.12 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -174,57 +196,63 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.47.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/tsdb v0.7.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rjeczalik/notify v0.9.1 // indirect - github.com/rs/zerolog v1.31.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/term v0.12.0 // indirect - golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.18.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.134.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/api v0.153.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect + pgregory.net/rapid v1.1.0 // indirect ) replace ( + // github.com/cosmos/cosmos-sdk/x/auth => cosmossdk.io/x/auth v0.0.0-20240213135126-c57dde2f343b github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/SigmaGmbH/librustgo v0.0.2-0.20230725120829-f1a254f14ac6 => ./go-sgxvm - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.47.4 github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index 24c689c7..34f7823a 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -18,7 +15,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -34,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -59,7 +55,6 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= @@ -73,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -114,8 +109,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -173,12 +168,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.31.0 h1:+S3LjjEN2zZ+L5hOwj4+1OkGCsLVe0NzpXKQ1pSdTCI= -cloud.google.com/go/storage v1.31.0/go.mod h1:81ams1PrhW16L4kF7qg+4mTq7SRs5HsbDTM0bWvrwJ0= +cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w= +cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -190,46 +184,58 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= -cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.2.0 h1:BbykkDsutXPSy8RojFB3KZEWyvMsToLy0ykb/ZhsLqQ= -cosmossdk.io/log v1.2.0/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= -cosmossdk.io/math v1.1.3-rc.1 h1:NebCNWDqb1MJRNfvxr4YY7d8FSYgkuB3L75K6xvM+Zo= -cosmossdk.io/math v1.1.3-rc.1/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d h1:E/8y0oG3u9hBR8l4F9MtC0LdZIamPCUwUoLlrHrX86I= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= +cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1nbFC7hLs0Xvy9WAiH7Iti5iVLXMM5C37F0= +cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= +cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/simapp v0.0.0-20240215075256-c122a3d8ab04 h1:hFNJx/TWJCXou4l3ZfOSpEeLr/+mwUusj2Ey1U8q6oo= +cosmossdk.io/simapp v0.0.0-20240215075256-c122a3d8ab04/go.mod h1:mzqU3HzBQTb4ZTE7smKM8452dJieBATr3O551TL4+n8= +cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= +cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= +cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= +cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= +cosmossdk.io/x/tx v0.13.0 h1:8lzyOh3zONPpZv2uTcUmsv0WTXy6T1/aCVDCqShmpzU= +cosmossdk.io/x/tx v0.13.0/go.mod h1:CpNQtmoqbXa33/DVxWQNx5Dcnbkv2xGUhL7tYQ5wUsY= +cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= +cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -240,12 +246,10 @@ github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -253,16 +257,12 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= @@ -273,15 +273,6 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k= github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -292,19 +283,15 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24= github.com/btcsuite/btcd v0.23.3/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= @@ -315,10 +302,7 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -326,9 +310,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -357,7 +340,6 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -369,23 +351,26 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= +github.com/cometbft/cometbft v0.38.5 h1:4lOcK5VTPrfbLOhNHmPYe6c7eDXHtBdMCQuKbAfFJdU= +github.com/cometbft/cometbft v0.38.5/go.mod h1:0tqKin+KQs8zDwzYD8rPHzSBIDNPuB4NrwwGDNb/hUg= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -394,49 +379,49 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= -github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= +github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= +github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-sdk v0.50.4 h1:hQT5/+Z1XXNF7skaPq0i247Ts2dzzqg/j2WO/BPHSto= +github.com/cosmos/cosmos-sdk v0.50.4/go.mod h1:UbShFs6P8Ly29xxJvkNGaNaL/UGj5a686NRtb1Cqra0= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.2.0 h1:dx0DLUl7rxdyZ8NiT6UsrbzKOJx/w7s+BOaewFRH6cg= -github.com/cosmos/ibc-go/v7 v7.2.0/go.mod h1:OOcjKIRku/j1Xs1RgKK0yvKRrJ5iFuZYMetR1n3yMlc= +github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= +github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= +github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.1.0 h1:pf1106wl0Cf+p1+FjXzV6odlS9DnqVunPVWCH1Uz+lQ= +github.com/cosmos/ibc-go/v8 v8.1.0/go.mod h1:o1ipS95xpdjqNcB8Drq0eI3Sn4FRLigjll42ec1ECuU= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= @@ -446,42 +431,35 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeC github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -499,40 +477,37 @@ github.com/evmos/go-ethereum v1.10.26-evmos-rc2 h1:tYghk1ZZ8X4/OQ4YI9hvtm8aSN8OS github.com/evmos/go-ethereum v1.10.26-evmos-rc2/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -551,23 +526,21 @@ github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= @@ -584,8 +557,6 @@ github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -598,11 +569,9 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -643,12 +612,10 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -663,18 +630,20 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -686,7 +655,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -695,19 +663,18 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= -github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -720,21 +687,18 @@ github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMd github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -747,11 +711,6 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8 github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -761,16 +720,22 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.2 h1:uJDtyXwEfalmp1PqdxuhZqrNkUyClZAhVeZYTArbqkg= -github.com/hashicorp/go-getter v1.7.2/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-memdb v1.3.4 h1:XSL3NR682X/cVk2IeV0d70N4DZ9ljI885xAEU8IoK3c= github.com/hashicorp/go-memdb v1.3.4/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg= +github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= +github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -778,8 +743,9 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -787,7 +753,6 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -796,11 +761,12 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -812,6 +778,8 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -819,24 +787,13 @@ github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPt github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -853,48 +810,36 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= +github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80= @@ -908,55 +853,39 @@ github.com/lestrrat-go/jwx v1.2.26/go.mod h1:MaiCdGbn3/cckbOFSCluJlJMmp9dmZm5hDu github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= +github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -970,8 +899,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= @@ -982,10 +909,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= @@ -998,8 +924,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -1007,24 +931,28 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2SEPp5+xrS26wEaeb26sZy6k9/ZXlZN+eXE4= github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.10.0 h1:sfUl4qgLdvkChZrWCYndY2EAu9BRIw1YphNAzy1VNWs= github.com/onsi/ginkgo/v2 v2.10.0/go.mod h1:UDQOh5wbQUlMnkLfVaIUMtQ1Vus92oM+P2JX1aulgcE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -1035,46 +963,46 @@ github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= 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/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b h1:vab8deKC4QoIfm9fJM59iuNz1ELGsuLoYYpiF+pHiG8= -github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= 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/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1082,34 +1010,33 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= +github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= @@ -1119,34 +1046,34 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1155,34 +1082,34 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1193,7 +1120,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1206,73 +1132,53 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1294,8 +1200,9 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= @@ -1304,32 +1211,17 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -1340,10 +1232,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1369,11 +1259,10 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1412,22 +1301,16 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1442,8 +1325,8 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1469,8 +1352,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1486,8 +1369,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1499,7 +1382,6 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1510,7 +1392,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1522,7 +1403,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1542,25 +1422,19 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1572,7 +1446,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1593,22 +1467,21 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1622,22 +1495,19 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1659,12 +1529,10 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1690,18 +1558,16 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1711,12 +1577,6 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1766,8 +1626,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.134.0 h1:ktL4Goua+UBgoP1eL1/60LwZJqa1sIzkLmvoR3hR6Gw= -google.golang.org/api v0.134.0/go.mod h1:sjRL3UnjTx5UqNQS9EWr9N8p7xbHpy1k0XGRLCf3Spk= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1775,8 +1635,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1784,7 +1645,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1792,7 +1652,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -1817,10 +1676,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1887,12 +1744,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= -google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= -google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1934,8 +1791,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1952,8 +1809,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1988,8 +1845,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1998,17 +1855,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/ibc/module.go b/ibc/module.go index f563a0f2..c0cac5f7 100644 --- a/ibc/module.go +++ b/ibc/module.go @@ -18,10 +18,10 @@ package ibc import ( sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" ) var _ porttypes.IBCModule = &Module{} diff --git a/ibc/module_test.go b/ibc/module_test.go index b5adba42..3170b5e0 100644 --- a/ibc/module_test.go +++ b/ibc/module_test.go @@ -7,12 +7,12 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" ) var _ porttypes.IBCModule = &MockIBCModule{} diff --git a/ibc/testing/README.md b/ibc/testing/README.md index e8f57e04..e9c996ac 100644 --- a/ibc/testing/README.md +++ b/ibc/testing/README.md @@ -259,11 +259,11 @@ package transfertesting import ( "encoding/json" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" dbm "github.com/cometbft/cometbft-db" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/simapp" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/simapp" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) func SetupTransferTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { diff --git a/ibc/testing/app.go b/ibc/testing/app.go index f3d5927d..f6f83182 100644 --- a/ibc/testing/app.go +++ b/ibc/testing/app.go @@ -22,7 +22,6 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -33,11 +32,13 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" + ibcgotesting "github.com/cosmos/ibc-go/v8/testing" testingApp "swisstronik/app" "swisstronik/types" "swisstronik/utils" + + sdkmath "cosmossdk.io/math" ) var DefaultTestingAppInit func(chainID string) (ibcgotesting.TestingApp, map[string]json.RawMessage) = testingApp.SetupTestingApp @@ -68,15 +69,15 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), + DelegatorShares: sdkmath.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + Commission: stakingtypes.NewCommission(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()), + MinSelfDelegation: sdkmath.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), sdkmath.LegacyOneDec())) } // set validators and delegations @@ -106,7 +107,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs // init chain will set the validator set and initialize the genesis accounts app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: testingApp.DefaultConsensusParams, @@ -116,13 +117,14 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs // commit genesis changes app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - ChainID: chainID, - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ValidatorsHash: valSet.Hash(), - NextValidatorsHash: valSet.Hash(), - }}) + // abciReq := abci.RequestBeginBlock{Header: tmproto.Header{ + // ChainID: chainID, + // Height: app.LastBlockHeight() + 1, + // AppHash: app.LastCommitID().Hash, + // ValidatorsHash: valSet.Hash(), + // NextValidatorsHash: valSet.Hash(), + // }} + // app.BeginBlocker() return app } diff --git a/ibc/testing/chain.go b/ibc/testing/chain.go index 8f3893e2..afb86450 100644 --- a/ibc/testing/chain.go +++ b/ibc/testing/chain.go @@ -30,9 +30,9 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/cosmos/ibc-go/v7/testing/mock" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibcgotesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/cosmos/ibc-go/v8/testing/mock" "swisstronik/crypto/ethsecp256k1" "swisstronik/types" @@ -100,7 +100,7 @@ func NewTestChain(t *testing.T, coord *ibcgotesting.Coordinator, chainID string) // create an account to send transactions from chain := &ibcgotesting.TestChain{ - T: t, + TB: t, Coordinator: coord, ChainID: chainID, App: app, diff --git a/ibc/testing/coordinator.go b/ibc/testing/coordinator.go index ba36133b..977d7b4c 100644 --- a/ibc/testing/coordinator.go +++ b/ibc/testing/coordinator.go @@ -17,18 +17,10 @@ package ibctesting import ( - "math/rand" "testing" "time" - "swisstronik/app" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/stretchr/testify/require" ) @@ -136,82 +128,3 @@ func SetupClients(coord *ibctesting.Coordinator, path *Path) { err = path.EndpointB.CreateClient() require.NoError(coord.T, err) } - -func SendMsgs(chain *ibctesting.TestChain, feeAmt int64, msgs ...sdk.Msg) (*sdk.Result, error) { - var bondDenom string - // ensure the chain has the latest time - chain.Coordinator.UpdateTimeForChain(chain) - - if evmChain, ok := chain.App.(*app.App); ok { - bondDenom = evmChain.StakingKeeper.BondDenom(chain.GetContext()) - } else { - bondDenom = chain.GetSimApp().StakingKeeper.BondDenom(chain.GetContext()) - } - - fee := sdk.Coins{sdk.NewInt64Coin(bondDenom, feeAmt)} - _, r, err := SignAndDeliver( - chain.T, - chain.TxConfig, - chain.App.GetBaseApp(), - msgs, - fee, - chain.ChainID, - []uint64{chain.SenderAccount.GetAccountNumber()}, - []uint64{chain.SenderAccount.GetSequence()}, - true, chain.SenderPrivKey, - ) - if err != nil { - return nil, err - } - - // NextBlock calls app.Commit() - chain.NextBlock() - - // increment sequence for successful transaction execution - err = chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence() + 1) - if err != nil { - return nil, err - } - - chain.Coordinator.IncrementTime() - - return r, nil -} - -// SignAndDeliver signs and delivers a transaction. No simulation occurs as the -// ibc testing package causes checkState and deliverState to diverge in block time. -// -// CONTRACT: BeginBlock must be called before this function. -// Is a customization of IBC-go function that allows to modify the fee denom and amount -// IBC-go implementation: https://github.com/cosmos/ibc-go/blob/d34cef7e075dda1a24a0a3e9b6d3eff406cc606c/testing/simapp/test_helpers.go#L332-L364 -func SignAndDeliver( - t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, msgs []sdk.Msg, - fee sdk.Coins, - chainID string, accNums, accSeqs []uint64, expPass bool, priv ...cryptotypes.PrivKey, -) (sdk.GasInfo, *sdk.Result, error) { - tx, err := simtestutil.GenSignedMockTx( - rand.New(rand.NewSource(time.Now().UnixNano())), //nolint:gosec - txCfg, - msgs, - fee, - simtestutil.DefaultGenTxGas, - chainID, - accNums, - accSeqs, - priv..., - ) - require.NoError(t, err) - - // Simulate a sending a transaction - gInfo, res, err := app.SimDeliver(txCfg.TxEncoder(), tx) - - if expPass { - require.NoError(t, err) - require.NotNil(t, res) - } else { - require.Error(t, err) - require.Nil(t, res) - } - - return gInfo, res, err -} diff --git a/ibc/testing/endpoint.go b/ibc/testing/endpoint.go index dbe51d79..697da7a8 100644 --- a/ibc/testing/endpoint.go +++ b/ibc/testing/endpoint.go @@ -3,17 +3,16 @@ package ibctesting import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/cometbft/cometbft/abci/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibclightclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/stretchr/testify/require" - - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibclightclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibctesting "github.com/cosmos/ibc-go/v7/testing" ) // Endpoint is a which represents a channel endpoint and its associated @@ -89,7 +88,7 @@ func (endpoint *Endpoint) CreateClient() (err error) { switch endpoint.ClientConfig.GetClientType() { case exported.Tendermint: tmConfig, ok := endpoint.ClientConfig.(*ibctesting.TendermintConfig) - require.True(endpoint.Chain.T, ok) + require.True(endpoint.Chain.TB, ok) height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height) clientState = ibclightclient.NewClientState( @@ -110,15 +109,15 @@ func (endpoint *Endpoint) CreateClient() (err error) { msg, err := clienttypes.NewMsgCreateClient( clientState, consensusState, endpoint.Chain.SenderAccount.GetAddress().String(), ) - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + res, err := endpoint.Chain.SendMsgs(msg) if err != nil { return err } - endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.Events) + require.NoError(endpoint.Chain.TB, err) return nil } @@ -146,9 +145,9 @@ func (endpoint *Endpoint) UpdateClient() (err error) { endpoint.ClientID, header, endpoint.Chain.SenderAccount.GetAddress().String(), ) - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) - _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + _, err = endpoint.Chain.SendMsgs(msg) return err } @@ -160,13 +159,13 @@ func (endpoint *Endpoint) ConnOpenInit() error { endpoint.Counterparty.Chain.GetPrefix(), ibctesting.DefaultOpenInitVersion, endpoint.ConnectionConfig.DelayPeriod, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + res, err := endpoint.Chain.SendMsgs(msg) if err != nil { return err } - endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.Events) + require.NoError(endpoint.Chain.TB, err) return nil } @@ -174,7 +173,7 @@ func (endpoint *Endpoint) ConnOpenInit() error { // ConnOpenTry will construct and execute a MsgConnectionOpenTry on the associated endpoint. func (endpoint *Endpoint) ConnOpenTry() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) counterpartyClient, proofClient, proofConsensus, consensusHeight, proofInit, proofHeight := endpoint.QueryConnectionHandshakeProof() @@ -185,14 +184,14 @@ func (endpoint *Endpoint) ConnOpenTry() error { proofHeight, consensusHeight, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + res, err := endpoint.Chain.SendMsgs(msg) if err != nil { return err } if endpoint.ConnectionID == "" { - endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.Events) + require.NoError(endpoint.Chain.TB, err) } return nil @@ -201,7 +200,7 @@ func (endpoint *Endpoint) ConnOpenTry() error { // ConnOpenAck will construct and execute a MsgConnectionOpenAck on the associated endpoint. func (endpoint *Endpoint) ConnOpenAck() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) counterpartyClient, proofClient, proofConsensus, consensusHeight, proofTry, proofHeight := endpoint.QueryConnectionHandshakeProof() @@ -212,14 +211,14 @@ func (endpoint *Endpoint) ConnOpenAck() error { ibctesting.ConnectionVersion, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + _, err = endpoint.Chain.SendMsgs(msg) return err } // ConnOpenConfirm will construct and execute a MsgConnectionOpenConfirm on the associated endpoint. func (endpoint *Endpoint) ConnOpenConfirm() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID) proof, height := endpoint.Counterparty.Chain.QueryProof(connectionKey) @@ -229,7 +228,7 @@ func (endpoint *Endpoint) ConnOpenConfirm() error { proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + _, err = endpoint.Chain.SendMsgs(msg) return err } @@ -270,13 +269,13 @@ func (endpoint *Endpoint) ChanOpenInit() error { endpoint.Counterparty.ChannelConfig.PortID, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + res, err := endpoint.Chain.SendMsgs(msg) if err != nil { return err } - endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.Events) + require.NoError(endpoint.Chain.TB, err) // update version to selected app version // NOTE: this update must be performed after SendMsgs() @@ -288,7 +287,7 @@ func (endpoint *Endpoint) ChanOpenInit() error { // ChanOpenTry will construct and execute a MsgChannelOpenTry on the associated endpoint. func (endpoint *Endpoint) ChanOpenTry() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -300,14 +299,14 @@ func (endpoint *Endpoint) ChanOpenTry() error { proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + res, err := endpoint.Chain.SendMsgs(msg) if err != nil { return err } if endpoint.ChannelID == "" { - endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.Events) + require.NoError(endpoint.Chain.TB, err) } // update version to selected app version @@ -320,7 +319,7 @@ func (endpoint *Endpoint) ChanOpenTry() error { // ChanOpenAck will construct and execute a MsgChannelOpenAck on the associated endpoint. func (endpoint *Endpoint) ChanOpenAck() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -332,7 +331,7 @@ func (endpoint *Endpoint) ChanOpenAck() error { endpoint.Chain.SenderAccount.GetAddress().String(), ) - if _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg); err != nil { + if _, err = endpoint.Chain.SendMsgs(msg); err != nil { return err } @@ -344,7 +343,7 @@ func (endpoint *Endpoint) ChanOpenAck() error { // ChanOpenConfirm will construct and execute a MsgChannelOpenConfirm on the associated endpoint. func (endpoint *Endpoint) ChanOpenConfirm() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -354,7 +353,7 @@ func (endpoint *Endpoint) ChanOpenConfirm() error { proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + _, err = endpoint.Chain.SendMsgs(msg) return err } @@ -366,7 +365,7 @@ func (endpoint *Endpoint) ChanCloseInit() error { endpoint.ChannelConfig.PortID, endpoint.ChannelID, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) + _, err := endpoint.Chain.SendMsgs(msg) return err } @@ -411,7 +410,7 @@ func (endpoint *Endpoint) RecvPacket(packet channeltypes.Packet) error { // RecvPacketWithResult receives a packet on the associated endpoint and the result // of the transaction is returned. The counterparty client is updated. -func (endpoint *Endpoint) RecvPacketWithResult(packet channeltypes.Packet) (*sdk.Result, error) { +func (endpoint *Endpoint) RecvPacketWithResult(packet channeltypes.Packet) (*abci.ExecTxResult, error) { // get proof of packet commitment on source packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) proof, proofHeight := endpoint.Counterparty.Chain.QueryProof(packetKey) @@ -419,7 +418,7 @@ func (endpoint *Endpoint) RecvPacketWithResult(packet channeltypes.Packet) (*sdk recvMsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String()) // receive on counterparty and update source client - res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, recvMsg) + res, err := endpoint.Chain.SendMsgs(recvMsg) if err != nil { return nil, err } @@ -456,7 +455,7 @@ func (endpoint *Endpoint) AcknowledgePacket(packet channeltypes.Packet, ack []by ackMsg := channeltypes.NewMsgAcknowledgement(packet, ack, proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String()) - _, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, ackMsg) + _, err := endpoint.Chain.SendMsgs(ackMsg) return err } @@ -476,14 +475,14 @@ func (endpoint *Endpoint) TimeoutPacket(packet channeltypes.Packet) error { proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey) nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) timeoutMsg := channeltypes.NewMsgTimeout( packet, nextSeqRecv, proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, timeoutMsg) + _, err := endpoint.Chain.SendMsgs(timeoutMsg) return err } @@ -507,14 +506,14 @@ func (endpoint *Endpoint) TimeoutOnClose(packet channeltypes.Packet) error { proofClosed, _ := endpoint.Counterparty.QueryProof(channelKey) nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) timeoutOnCloseMsg := channeltypes.NewMsgTimeoutOnClose( packet, nextSeqRecv, proof, proofClosed, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String(), ) - _, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, timeoutOnCloseMsg) + _, err := endpoint.Chain.SendMsgs(timeoutOnCloseMsg) return err } @@ -545,7 +544,7 @@ func (endpoint *Endpoint) SetClientState(clientState exported.ClientState) { // The consensus state is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetConsensusState(height exported.Height) exported.ConsensusState { consensusState, found := endpoint.Chain.GetConsensusState(endpoint.ClientID, height) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return consensusState } @@ -559,7 +558,7 @@ func (endpoint *Endpoint) SetConsensusState(consensusState exported.ConsensusSta // connection is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetConnection() connectiontypes.ConnectionEnd { connection, found := endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.GetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return connection } @@ -573,7 +572,7 @@ func (endpoint *Endpoint) SetConnection(connection connectiontypes.ConnectionEnd // is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetChannel() channeltypes.Channel { channel, found := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return channel } diff --git a/ibc/testing/path.go b/ibc/testing/path.go index 81c3fff7..0834f102 100644 --- a/ibc/testing/path.go +++ b/ibc/testing/path.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) // Path contains two endpoints representing two chains connected over IBC @@ -53,7 +53,7 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + ack, err := ibctesting.ParseAckFromEvents(res.Events) if err != nil { return err } @@ -78,7 +78,7 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + ack, err := ibctesting.ParseAckFromEvents(res.Events) if err != nil { return err } diff --git a/ibc/utils.go b/ibc/utils.go index c3ce5ae4..338ce9e0 100644 --- a/ibc/utils.go +++ b/ibc/utils.go @@ -21,10 +21,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "swisstronik/utils" + + sdkmath "cosmossdk.io/math" ) // GetTransferSenderRecipient returns the sender and recipient sdk.AccAddresses @@ -73,7 +75,7 @@ func GetTransferAmount(packet channeltypes.Packet) (string, error) { return "", errorsmod.Wrapf(errortypes.ErrInvalidCoins, "empty amount") } - if _, ok := sdk.NewIntFromString(data.Amount); !ok { + if _, ok := sdkmath.NewIntFromString(data.Amount); !ok { return "", errorsmod.Wrapf(errortypes.ErrInvalidCoins, "invalid amount") } @@ -87,7 +89,7 @@ func GetTransferAmount(packet channeltypes.Packet) (string, error) { // prefix path from the destination chain to the denom. func GetReceivedCoin(srcPort, srcChannel, dstPort, dstChannel, rawDenom, rawAmt string) sdk.Coin { // NOTE: Denom and amount are already validated - amount, _ := sdk.NewIntFromString(rawAmt) + amount, _ := sdkmath.NewIntFromString(rawAmt) if transfertypes.ReceiverChainIsSource(srcPort, srcChannel, rawDenom) { // remove prefix added by sender chain @@ -128,7 +130,7 @@ func GetReceivedCoin(srcPort, srcChannel, dstPort, dstChannel, rawDenom, rawAmt // GetSentCoin returns the sent coin from an ICS20 FungibleTokenPacketData. func GetSentCoin(rawDenom, rawAmt string) sdk.Coin { // NOTE: Denom and amount are already validated - amount, _ := sdk.NewIntFromString(rawAmt) + amount, _ := sdkmath.NewIntFromString(rawAmt) trace := transfertypes.ParseDenomTrace(rawDenom) return sdk.Coin{ diff --git a/ibc/utils_test.go b/ibc/utils_test.go index 5c04b7f4..0000bfca 100644 --- a/ibc/utils_test.go +++ b/ibc/utils_test.go @@ -9,9 +9,10 @@ import ( teststypes "swisstronik/types/tests" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + sdkmath "cosmossdk.io/math" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) func init() { @@ -247,7 +248,7 @@ func TestGetReceivedCoin(t *testing.T) { "channel-0", "uosmo", "10", - sdk.Coin{Denom: teststypes.UosmoIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UosmoIbcdenom, Amount: sdkmath.NewInt(10)}, }, { "transfer ibc wrapped coin to destination which is its source", @@ -257,7 +258,7 @@ func TestGetReceivedCoin(t *testing.T) { "channel-0", "transfer/channel-0/uswtr", "10", - sdk.Coin{Denom: "uswtr", Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: "uswtr", Amount: sdkmath.NewInt(10)}, }, { "transfer 2x ibc wrapped coin to destination which is its source", @@ -267,7 +268,7 @@ func TestGetReceivedCoin(t *testing.T) { "channel-2", "transfer/channel-0/transfer/channel-1/uatom", "10", - sdk.Coin{Denom: teststypes.UatomIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UatomIbcdenom, Amount: sdkmath.NewInt(10)}, }, { "transfer ibc wrapped coin to destination which is not its source", @@ -277,7 +278,7 @@ func TestGetReceivedCoin(t *testing.T) { "channel-0", "transfer/channel-1/uatom", "10", - sdk.Coin{Denom: teststypes.UatomOsmoIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UatomOsmoIbcdenom, Amount: sdkmath.NewInt(10)}, }, } @@ -298,25 +299,25 @@ func TestGetSentCoin(t *testing.T) { "get unwrapped uswtr coin", "uswtr", "10", - sdk.Coin{Denom: "uswtr", Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: "uswtr", Amount: sdkmath.NewInt(10)}, }, { "get ibc wrapped uosmo coin", "transfer/channel-0/uosmo", "10", - sdk.Coin{Denom: teststypes.UosmoIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UosmoIbcdenom, Amount: sdkmath.NewInt(10)}, }, { "get ibc wrapped uatom coin", "transfer/channel-1/uatom", "10", - sdk.Coin{Denom: teststypes.UatomIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UatomIbcdenom, Amount: sdkmath.NewInt(10)}, }, { "get 2x ibc wrapped uatom coin", "transfer/channel-0/transfer/channel-1/uatom", "10", - sdk.Coin{Denom: teststypes.UatomOsmoIbcdenom, Amount: sdk.NewInt(10)}, + sdk.Coin{Denom: teststypes.UatomOsmoIbcdenom, Amount: sdkmath.NewInt(10)}, }, } diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index 47e3352f..1c3e35e3 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -21,17 +21,17 @@ import ( rpctypes "swisstronik/rpc/types" errorsmod "cosmossdk.io/errors" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/ethereum/go-ethereum/common" - ethermint "swisstronik/types" + swisstroniktypes "swisstronik/types" evmtypes "swisstronik/x/evm/types" ) @@ -43,7 +43,7 @@ const ( TxIndexKeyLength = 1 + 8 + 8 ) -var _ ethermint.EVMTxIndexer = &KVIndexer{} +var _ swisstroniktypes.EVMTxIndexer = &KVIndexer{} // KVIndexer implements a eth tx indexer on a KV db. type KVIndexer struct { @@ -62,7 +62,7 @@ func NewKVIndexer(db dbm.DB, logger log.Logger, clientCtx client.Context) *KVInd // - Parses eth Tx infos from cosmos-sdk events for every TxResult // - Iterates over all the messages of the Tx // - Builds and stores a indexer.TxResult based on parsed events for every message -func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.ResponseDeliverTx) error { +func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.ExecTxResult) error { height := block.Header.Height batch := kv.db.NewBatch() @@ -97,7 +97,7 @@ func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.Response ethMsg := msg.(*evmtypes.MsgHandleTx) txHash := common.HexToHash(ethMsg.Hash) - txResult := ethermint.TxResult{ + txResult := swisstroniktypes.TxResult{ Height: height, TxIndex: uint32(txIndex), MsgIndex: uint32(msgIndex), @@ -147,7 +147,7 @@ func (kv *KVIndexer) FirstIndexedBlock() (int64, error) { } // GetByTxHash finds eth tx by eth tx hash -func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error) { +func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*swisstroniktypes.TxResult, error) { bz, err := kv.db.Get(TxHashKey(hash)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) @@ -155,7 +155,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error) if len(bz) == 0 { return nil, fmt.Errorf("tx not found, hash: %s", hash.Hex()) } - var txKey ethermint.TxResult + var txKey swisstroniktypes.TxResult if err := kv.clientCtx.Codec.Unmarshal(bz, &txKey); err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) } @@ -163,7 +163,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error) } // GetByBlockAndIndex finds eth tx by block number and eth tx index -func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*ethermint.TxResult, error) { +func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*swisstroniktypes.TxResult, error) { bz, err := kv.db.Get(TxIndexKey(blockNumber, txIndex)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByBlockAndIndex %d %d", blockNumber, txIndex) @@ -226,7 +226,7 @@ func isEthTx(tx sdk.Tx) bool { } // saveTxResult index the txResult into the kv db batch -func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *ethermint.TxResult) error { +func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *swisstroniktypes.TxResult) error { bz := codec.MustMarshal(txResult) if err := batch.Set(TxHashKey(txHash), bz); err != nil { return errorsmod.Wrap(err, "set tx-hash key") diff --git a/indexer/kv_indexer_test.go b/indexer/kv_indexer_test.go index 89c438ae..aa31730a 100644 --- a/indexer/kv_indexer_test.go +++ b/indexer/kv_indexer_test.go @@ -4,18 +4,18 @@ import ( "math/big" "testing" - "swisstronik/app" "swisstronik/crypto/ethsecp256k1" evmenc "swisstronik/encoding" "swisstronik/indexer" "swisstronik/tests" "swisstronik/x/evm/types" - "cosmossdk.io/simapp/params" - dbm "github.com/cometbft/cometbft-db" + swisstroniktypes "swisstronik/types" + + tmlog "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -56,13 +56,13 @@ func TestKVIndexer(t *testing.T) { testCases := []struct { name string block *tmtypes.Block - blockResult []*abci.ResponseDeliverTx + blockResult []*abci.ExecTxResult expSuccess bool }{ { "success, format 1", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -82,7 +82,7 @@ func TestKVIndexer(t *testing.T) { { "success, format 2", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -104,7 +104,7 @@ func TestKVIndexer(t *testing.T) { { "success, exceed block gas limit", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 11, Log: "out of gas in location: block gas meter; gasWanted: 21000", @@ -116,7 +116,7 @@ func TestKVIndexer(t *testing.T) { { "fail, failed eth tx", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 15, Log: "nonce mismatch", @@ -128,7 +128,7 @@ func TestKVIndexer(t *testing.T) { { "fail, invalid events", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{}, @@ -139,7 +139,7 @@ func TestKVIndexer(t *testing.T) { { "fail, not eth tx", &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz2}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{}, @@ -185,6 +185,6 @@ func TestKVIndexer(t *testing.T) { } // MakeEncodingConfig creates the EncodingConfig -func MakeEncodingConfig() params.EncodingConfig { - return evmenc.MakeConfig(app.ModuleBasics) +func MakeEncodingConfig() swisstroniktypes.EncodingConfig { + return evmenc.MakeConfig() } diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index 34f85b68..a87ededa 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -34,13 +34,13 @@ message Params { message ChainConfig { // homestead_block switch (nil no fork, 0 = already homestead) string homestead_block = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"homestead_block\"" ]; // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) string dao_fork_block = 2 [ (gogoproto.customname) = "DAOForkBlock", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"dao_fork_block\"" ]; // dao_fork_support defines whether the nodes supports or opposes the DAO @@ -53,7 +53,7 @@ message ChainConfig { // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) string eip150_block = 4 [ (gogoproto.customname) = "EIP150Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"eip150_block\"" ]; // eip150_hash: EIP150 HF hash (needed for header only clients as only gas @@ -65,47 +65,47 @@ message ChainConfig { // eip155_block: EIP155Block HF block string eip155_block = 6 [ (gogoproto.customname) = "EIP155Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"eip155_block\"" ]; // eip158_block: EIP158 HF block string eip158_block = 7 [ (gogoproto.customname) = "EIP158Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"eip158_block\"" ]; // byzantium_block: Byzantium switch block (nil no fork, 0 = already on // byzantium) string byzantium_block = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"byzantium_block\"" ]; // constantinople_block: Constantinople switch block (nil no fork, 0 = already // activated) string constantinople_block = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"constantinople_block\"" ]; // petersburg_block: Petersburg switch block (nil same as Constantinople) string petersburg_block = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"petersburg_block\"" ]; // istanbul_block: Istanbul switch block (nil no fork, 0 = already on // istanbul) string istanbul_block = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"istanbul_block\"" ]; // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = // already activated) string muir_glacier_block = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" ]; // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) string berlin_block = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"berlin_block\"" ]; // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated @@ -113,13 +113,13 @@ message ChainConfig { reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; // london_block: London switch block (nil = no fork, 0 = already on london) string london_block = 17 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"london_block\"" ]; // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = // already activated) string arrow_glacier_block = 18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" ]; // DEPRECATED: merge fork block was deprecated: @@ -129,23 +129,23 @@ message ChainConfig { // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = // already activated) string gray_glacier_block = 20 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" ]; // merge_netsplit_block: Virtual fork after The Merge to use as a network // splitter string merge_netsplit_block = 21 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" ]; // shanghai_block switch block (nil = no fork, 0 = already on shanghai) string shanghai_block = 22 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"shanghai_block\"" ]; // cancun_block switch block (nil = no fork, 0 = already on cancun) string cancun_block = 23 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"cancun_block\"" ]; } diff --git a/proto/ethermint/evm/v1/query.proto b/proto/ethermint/evm/v1/query.proto index 5876e104..0846881f 100644 --- a/proto/ethermint/evm/v1/query.proto +++ b/proto/ethermint/evm/v1/query.proto @@ -312,7 +312,7 @@ message QueryBaseFeeRequest {} message QueryBaseFeeResponse { // base_fee is the EIP1559 base fee string base_fee = 1 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.nullable) = false, (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } // QueryNodePublicKey defines the request type for querying node public key diff --git a/proto/ethermint/evm/v1/tx.proto b/proto/ethermint/evm/v1/tx.proto index 5bde8542..6f77a693 100644 --- a/proto/ethermint/evm/v1/tx.proto +++ b/proto/ethermint/evm/v1/tx.proto @@ -50,14 +50,14 @@ message LegacyTx { uint64 nonce = 1; // gas_price defines the value for each gas unit string gas_price = 2 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; // gas defines the gas limit defined for the transaction. uint64 gas = 3 [ (gogoproto.customname) = "GasLimit" ]; // to is the hex formatted address of the recipient string to = 4; // value defines the unsigned integer value of the transaction amount. string value = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount" ]; // data is the data payload bytes of the transaction. @@ -77,7 +77,7 @@ message AccessListTx { // chain_id of the destination EVM chain string chain_id = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "ChainID", (gogoproto.jsontag) = "chainID" ]; @@ -85,14 +85,14 @@ message AccessListTx { uint64 nonce = 2; // gas_price defines the value for each gas unit string gas_price = 3 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; // gas defines the gas limit defined for the transaction. uint64 gas = 4 [ (gogoproto.customname) = "GasLimit" ]; // to is the recipient address in hex format string to = 5; // value defines the unsigned integer value of the transaction amount. string value = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount" ]; // data is the data payload bytes of the transaction. @@ -118,7 +118,7 @@ message DynamicFeeTx { // chain_id of the destination EVM chain string chain_id = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "ChainID", (gogoproto.jsontag) = "chainID" ]; @@ -126,17 +126,17 @@ message DynamicFeeTx { uint64 nonce = 2; // gas_tip_cap defines the max value for the gas tip string gas_tip_cap = 3 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; // gas_fee_cap defines the max value for the gas fee string gas_fee_cap = 4 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; // gas defines the gas limit defined for the transaction. uint64 gas = 5 [ (gogoproto.customname) = "GasLimit" ]; // to is the hex formatted address of the recipient string to = 6; // value defines the the transaction amount. string value = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount" ]; // data is the data payload bytes of the transaction. diff --git a/proto/ethermint/feemarket/v1/feemarket.proto b/proto/ethermint/feemarket/v1/feemarket.proto index fb7e59aa..a616efe5 100644 --- a/proto/ethermint/feemarket/v1/feemarket.proto +++ b/proto/ethermint/feemarket/v1/feemarket.proto @@ -23,19 +23,19 @@ message Params { int64 enable_height = 5; // base_fee for EIP-1559 blocks. string base_fee = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // min_gas_price defines the minimum gas price value for cosmos and eth // transactions string min_gas_price = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // min_gas_multiplier bounds the minimum gas used to be charged // to senders based on gas limit string min_gas_multiplier = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/ethermint/feemarket/v1/query.proto b/proto/ethermint/feemarket/v1/query.proto index 23c8ecea..a94213d0 100644 --- a/proto/ethermint/feemarket/v1/query.proto +++ b/proto/ethermint/feemarket/v1/query.proto @@ -43,7 +43,7 @@ message QueryBaseFeeRequest {} message QueryBaseFeeResponse { // base_fee is the EIP1559 base fee string base_fee = 1 - [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } // QueryBlockGasRequest defines the request type for querying the EIP1559 base diff --git a/proto/ethermint/types/v1/dynamic_fee.proto b/proto/ethermint/types/v1/dynamic_fee.proto index 6e8b3751..4ced44c0 100644 --- a/proto/ethermint/types/v1/dynamic_fee.proto +++ b/proto/ethermint/types/v1/dynamic_fee.proto @@ -11,7 +11,7 @@ message ExtensionOptionDynamicFeeTx { // max_priority_price is the same as `max_priority_fee_per_gas` in eip-1559 // spec string max_priority_price = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } diff --git a/rpc/apis.go b/rpc/apis.go index cd42292d..84c5904d 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -34,9 +34,8 @@ import ( "swisstronik/rpc/namespaces/ethereum/txpool" "swisstronik/rpc/namespaces/ethereum/web3" "swisstronik/rpc/namespaces/utils" - ethermint "swisstronik/types" - - rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" + "swisstronik/rpc/stream" + swisstroniktypes "swisstronik/types" ) // RPC namespaces and API version @@ -65,9 +64,9 @@ const ( type APICreator = func( ctx *server.Context, clientCtx client.Context, - tendermintWebsocketClient *rpcclient.WSClient, + stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API // apiCreators defines the JSON-RPC API namespaces. @@ -77,9 +76,9 @@ func init() { apiCreators = map[string]APICreator{ EthNamespace: func(ctx *server.Context, clientCtx client.Context, - tmWSClient *rpcclient.WSClient, + stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) return []rpc.API{ @@ -92,12 +91,12 @@ func init() { { Namespace: EthNamespace, Version: apiVersion, - Service: filters.NewPublicAPI(ctx.Logger, clientCtx, tmWSClient, evmBackend), + Service: filters.NewPublicAPI(ctx.Logger, clientCtx, stream, evmBackend), Public: true, }, } }, - Web3Namespace: func(*server.Context, client.Context, *rpcclient.WSClient, bool, ethermint.EVMTxIndexer) []rpc.API { + Web3Namespace: func(*server.Context, client.Context, *stream.RPCStream, bool, swisstroniktypes.EVMTxIndexer) []rpc.API { return []rpc.API{ { Namespace: Web3Namespace, @@ -107,7 +106,7 @@ func init() { }, } }, - NetNamespace: func(_ *server.Context, clientCtx client.Context, _ *rpcclient.WSClient, _ bool, _ ethermint.EVMTxIndexer) []rpc.API { + NetNamespace: func(_ *server.Context, clientCtx client.Context, _ *stream.RPCStream, _ bool, _ swisstroniktypes.EVMTxIndexer) []rpc.API { return []rpc.API{ { Namespace: NetNamespace, @@ -119,9 +118,9 @@ func init() { }, PersonalNamespace: func(ctx *server.Context, clientCtx client.Context, - _ *rpcclient.WSClient, + _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) return []rpc.API{ @@ -133,7 +132,7 @@ func init() { }, } }, - TxPoolNamespace: func(ctx *server.Context, _ client.Context, _ *rpcclient.WSClient, _ bool, _ ethermint.EVMTxIndexer) []rpc.API { + TxPoolNamespace: func(ctx *server.Context, _ client.Context, _ *stream.RPCStream, _ bool, _ swisstroniktypes.EVMTxIndexer) []rpc.API { return []rpc.API{ { Namespace: TxPoolNamespace, @@ -145,9 +144,9 @@ func init() { }, DebugNamespace: func(ctx *server.Context, clientCtx client.Context, - _ *rpcclient.WSClient, + _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) return []rpc.API{ @@ -161,9 +160,9 @@ func init() { }, MinerNamespace: func(ctx *server.Context, clientCtx client.Context, - _ *rpcclient.WSClient, + _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) return []rpc.API{ @@ -177,9 +176,9 @@ func init() { }, DidNamespace: func(ctx *server.Context, clientCtx client.Context, - _ *rpcclient.WSClient, + _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) []rpc.API { didBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) return []rpc.API{ @@ -193,9 +192,9 @@ func init() { }, UtilsNamespace: func(_ *server.Context, _ client.Context, - _ *rpcclient.WSClient, + _ *stream.RPCStream, _ bool, - _ ethermint.EVMTxIndexer, + _ swisstroniktypes.EVMTxIndexer, ) []rpc.API { return []rpc.API{ { @@ -212,16 +211,16 @@ func init() { // GetRPCAPIs returns the list of all APIs func GetRPCAPIs(ctx *server.Context, clientCtx client.Context, - tmWSClient *rpcclient.WSClient, + stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, selectedAPIs []string, ) []rpc.API { var apis []rpc.API for _, ns := range selectedAPIs { if creator, ok := apiCreators[ns]; ok { - apis = append(apis, creator(ctx, clientCtx, tmWSClient, allowUnprotectedTxs, indexer)...) + apis = append(apis, creator(ctx, clientCtx, stream, allowUnprotectedTxs, indexer)...) } else { ctx.Logger.Error("invalid namespace value", "namespace", ns) } diff --git a/rpc/backend/account_info.go b/rpc/backend/account_info.go index 18f6939a..08f096be 100644 --- a/rpc/backend/account_info.go +++ b/rpc/backend/account_info.go @@ -22,9 +22,10 @@ import ( errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" rpctypes "swisstronik/rpc/types" evmtypes "swisstronik/x/evm/types" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -111,7 +112,8 @@ func (b *Backend) GetProof(address common.Address, storageKeys []string, blockNr } // query account proofs - accountKey := authtypes.AddressStoreKey(sdk.AccAddress(address.Bytes())) + // accountKey := authtypes.AddressStoreKey(sdk.AccAddress(address.Bytes())) + accountKey := append(authtypes.AddressStoreKeyPrefix, address.Bytes()...) _, proof, err := b.queryClient.GetProof(clientCtx, authtypes.StoreKey, accountKey) if err != nil { return nil, err diff --git a/rpc/backend/account_info_test.go b/rpc/backend/account_info_test.go index 3869d987..d458abf3 100644 --- a/rpc/backend/account_info_test.go +++ b/rpc/backend/account_info_test.go @@ -5,7 +5,6 @@ import ( "math/big" tmrpcclient "github.com/cometbft/cometbft/rpc/client" - sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -140,11 +139,13 @@ func (suite *BackendTestSuite) TestGetProof() { evmtypes.StateKey(address1, common.HexToHash("0x0").Bytes()), tmrpcclient.ABCIQueryOptions{Height: ivalHeight, Prove: true}, ) + + accountKey := append(authtypes.AddressStoreKeyPrefix, address1.Bytes()...) RegisterABCIQueryWithOptions( client, bn.Int64(), "store/acc/key", - authtypes.AddressStoreKey(sdk.AccAddress(address1.Bytes())), + accountKey, tmrpcclient.ABCIQueryOptions{Height: ivalHeight, Prove: true}, ) }, diff --git a/rpc/backend/backend.go b/rpc/backend/backend.go index 0033a358..3766aec5 100644 --- a/rpc/backend/backend.go +++ b/rpc/backend/backend.go @@ -22,12 +22,14 @@ import ( rpctypes "swisstronik/rpc/types" "swisstronik/server/config" - ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" didtypes "swisstronik/x/did/types" - "github.com/cometbft/cometbft/libs/log" + swisstroniktypes "swisstronik/types" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -110,7 +112,7 @@ type EVMBackend interface { // Chain Info ChainID() (*hexutil.Big, error) ChainConfig() *params.ChainConfig - GlobalMinGasPrice() (sdk.Dec, error) + GlobalMinGasPrice() (sdkmath.LegacyDec, error) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error) CurrentHeader() *ethtypes.Header PendingTransactions() ([]*sdk.Tx, error) @@ -120,8 +122,8 @@ type EVMBackend interface { // Tx Info GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error) - GetTxByEthHash(txHash common.Hash) (*ethermint.TxResult, error) - GetTxByTxIndex(height int64, txIndex uint) (*ethermint.TxResult, error) + GetTxByEthHash(txHash common.Hash) (*swisstroniktypes.TxResult, error) + GetTxByTxIndex(height int64, txIndex uint) (*swisstroniktypes.TxResult, error) GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) @@ -162,7 +164,7 @@ type Backend struct { chainID *big.Int cfg config.Config allowUnprotectedTxs bool - indexer ethermint.EVMTxIndexer + indexer swisstroniktypes.EVMTxIndexer } // NewBackend creates a new Backend instance for cosmos and ethereum namespaces @@ -171,9 +173,9 @@ func NewBackend( logger log.Logger, clientCtx client.Context, allowUnprotectedTxs bool, - indexer ethermint.EVMTxIndexer, + indexer swisstroniktypes.EVMTxIndexer, ) *Backend { - chainID, err := ethermint.ParseChainID(clientCtx.ChainID) + chainID, err := swisstroniktypes.ParseChainID(clientCtx.ChainID) if err != nil { panic(err) } diff --git a/rpc/backend/backend_suite_test.go b/rpc/backend/backend_suite_test.go index ba815de5..2b19ee99 100644 --- a/rpc/backend/backend_suite_test.go +++ b/rpc/backend/backend_suite_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - dbm "github.com/cometbft/cometbft-db" + dbm "github.com/cosmos/cosmos-db" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" @@ -18,7 +18,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/suite" - "swisstronik/app" "swisstronik/crypto/ethsecp256k1" "swisstronik/crypto/hd" "swisstronik/encoding" @@ -68,7 +67,7 @@ func (suite *BackendTestSuite) SetupTest() { suite.signer = tests.NewTestSigner(priv) suite.Require().NoError(err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() clientCtx := client.Context{}.WithChainID(ChainID). WithHeight(1). WithTxConfig(encodingConfig.TxConfig). @@ -86,7 +85,7 @@ func (suite *BackendTestSuite) SetupTest() { suite.backend.ctx = rpctypes.ContextWithHeight(1) // Add codec - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeConfig() suite.backend.clientCtx.Codec = encCfg.Codec } @@ -168,7 +167,7 @@ func (suite *BackendTestSuite) buildFormattedBlock( func (suite *BackendTestSuite) generateTestKeyring(clientDir string) (keyring.Keyring, error) { buf := bufio.NewReader(os.Stdin) - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeConfig() return keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, clientDir, buf, encCfg.Codec, []keyring.Option{hd.EthSecp256k1Option()}...) } diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 8d5e6eb5..49c34c71 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -364,7 +364,7 @@ func (b *Backend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error) // BlockBloom query block bloom filter from block results func (b *Backend) BlockBloom(blockRes *tmrpctypes.ResultBlockResults) (ethtypes.Bloom, error) { - for _, event := range blockRes.EndBlockEvents { + for _, event := range blockRes.FinalizeBlockEvents { if event.Type != evmtypes.EventTypeBlockBloom { continue } diff --git a/rpc/backend/blocks_test.go b/rpc/backend/blocks_test.go index 4b758e34..00fdc326 100644 --- a/rpc/backend/blocks_test.go +++ b/rpc/backend/blocks_test.go @@ -18,6 +18,8 @@ import ( ethrpc "swisstronik/rpc/types" "swisstronik/tests" evmtypes "swisstronik/x/evm/types" + + sdkmath "cosmossdk.io/math" ) func (suite *BackendTestSuite) TestBlockNumber() { @@ -93,7 +95,7 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { validator sdk.AccAddress tx *evmtypes.MsgHandleTx txBz []byte - registerMock func(ethrpc.BlockNumber, sdk.Int, sdk.AccAddress, []byte) + registerMock func(ethrpc.BlockNumber, sdkmath.Int, sdk.AccAddress, []byte) expNoop bool expPass bool }{ @@ -101,11 +103,11 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { "pass - tendermint block not found", ethrpc.BlockNumber(1), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(blockNum ethrpc.BlockNumber, _ sdk.Int, _ sdk.AccAddress, _ []byte) { + func(blockNum ethrpc.BlockNumber, _ sdkmath.Int, _ sdk.AccAddress, _ []byte) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockError(client, height) @@ -117,11 +119,11 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { "pass - block not found (e.g. request block height that is greater than current one)", ethrpc.BlockNumber(1), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlockNotFound(client, height) @@ -133,11 +135,11 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { "pass - block results error", ethrpc.BlockNumber(1), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlock(client, height, txBz) @@ -150,11 +152,11 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { "pass - without tx", ethrpc.BlockNumber(1), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlock(client, height, txBz) @@ -172,11 +174,11 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { "pass - with tx", ethrpc.BlockNumber(1), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), msgHandleTx, bz, - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlock(client, height, txBz) @@ -194,7 +196,7 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(tc.blockNumber, sdk.NewIntFromBigInt(tc.baseFee), tc.validator, tc.txBz) + tc.registerMock(tc.blockNumber, sdkmath.NewIntFromBigInt(tc.baseFee), tc.validator, tc.txBz) block, err := suite.backend.GetBlockByNumber(tc.blockNumber, tc.fullTx) @@ -238,7 +240,7 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { validator sdk.AccAddress tx *evmtypes.MsgHandleTx txBz []byte - registerMock func(common.Hash, sdk.Int, sdk.AccAddress, []byte) + registerMock func(common.Hash, sdkmath.Int, sdk.AccAddress, []byte) expNoop bool expPass bool }{ @@ -246,11 +248,11 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { "fail - tendermint failed to get block", common.BytesToHash(block.Hash()), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(hash common.Hash, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(hash common.Hash, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockByHashError(client, hash, txBz) }, @@ -261,11 +263,11 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { "noop - tendermint blockres not found", common.BytesToHash(block.Hash()), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(hash common.Hash, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(hash common.Hash, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockByHashNotFound(client, hash, txBz) }, @@ -276,11 +278,11 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { "noop - tendermint failed to fetch block result", common.BytesToHash(block.Hash()), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(hash common.Hash, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(hash common.Hash, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlockByHash(client, hash, txBz) @@ -294,11 +296,11 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { "pass - without tx", common.BytesToHash(block.Hash()), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), nil, nil, - func(hash common.Hash, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(hash common.Hash, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlockByHash(client, hash, txBz) @@ -317,11 +319,11 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { "pass - with tx", common.BytesToHash(block.Hash()), true, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), msgHandleTx, bz, - func(hash common.Hash, baseFee sdk.Int, validator sdk.AccAddress, txBz []byte) { + func(hash common.Hash, baseFee sdkmath.Int, validator sdk.AccAddress, txBz []byte) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlockByHash(client, hash, txBz) @@ -340,7 +342,7 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(tc.hash, sdk.NewIntFromBigInt(tc.baseFee), tc.validator, tc.txBz) + tc.registerMock(tc.hash, sdkmath.NewIntFromBigInt(tc.baseFee), tc.validator, tc.txBz) block, err := suite.backend.GetBlockByHash(tc.hash, tc.fullTx) @@ -660,7 +662,7 @@ func (suite *BackendTestSuite) TestTendermintBlockResultByNumber() { suite.Require().NoError(err) expBlockRes = &tmrpctypes.ResultBlockResults{ Height: blockNum, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, } }, true, @@ -834,7 +836,7 @@ func (suite *BackendTestSuite) TestBlockBloom() { { "fail - non block bloom event type", &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{{Type: evmtypes.EventTypeEthereumTx}}, + FinalizeBlockEvents: []types.Event{{Type: evmtypes.EventTypeEthereumTx}}, }, ethtypes.Bloom{}, false, @@ -842,7 +844,7 @@ func (suite *BackendTestSuite) TestBlockBloom() { { "fail - nonblock bloom attribute key", &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ @@ -857,7 +859,7 @@ func (suite *BackendTestSuite) TestBlockBloom() { { "pass - block bloom attribute key", &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ @@ -896,22 +898,22 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { resBlock *tmrpctypes.ResultBlock blockRes *tmrpctypes.ResultBlockResults fullTx bool - registerMock func(sdk.Int, sdk.AccAddress, int64) + registerMock func(sdkmath.Int, sdk.AccAddress, int64) expTxs bool expPass bool }{ { "pass - block without tx", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(common.Address{}.Bytes()), int64(1), &tmrpctypes.ResultBlock{Block: emptyBlock}, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, false, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccount(queryClient, validator) @@ -932,10 +934,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFeeError(queryClient) RegisterValidatorAccount(queryClient, validator) @@ -948,7 +950,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, { "pass - block with tx - with ValidatorAccount error", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(common.Address{}.Bytes()), int64(1), &tmrpctypes.ResultBlock{ @@ -956,10 +958,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccountError(queryClient) @@ -972,7 +974,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, { "pass - block with tx - with ConsensusParams error - BlockMaxGas defaults to max uint32", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), int64(1), &tmrpctypes.ResultBlock{ @@ -980,10 +982,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccount(queryClient, validator) @@ -996,7 +998,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, { "pass - block with tx - with ShouldIgnoreGasUsed - empty txs", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), int64(1), &tmrpctypes.ResultBlock{ @@ -1004,7 +1006,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{ + TxsResults: []*types.ExecTxResult{ { Code: 11, GasUsed: 0, @@ -1013,7 +1015,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, }, true, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccount(queryClient, validator) @@ -1026,7 +1028,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, { "pass - block with tx - non fullTx", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), int64(1), &tmrpctypes.ResultBlock{ @@ -1034,10 +1036,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, false, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccount(queryClient, validator) @@ -1050,7 +1052,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, { "pass - block with tx", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), sdk.AccAddress(tests.RandomEthAddress().Bytes()), int64(1), &tmrpctypes.ResultBlock{ @@ -1058,10 +1060,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, - func(baseFee sdk.Int, validator sdk.AccAddress, height int64) { + func(baseFee sdkmath.Int, validator sdk.AccAddress, height int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) RegisterValidatorAccount(queryClient, validator) @@ -1076,7 +1078,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(sdk.NewIntFromBigInt(tc.baseFee), tc.validator, tc.height) + tc.registerMock(sdkmath.NewIntFromBigInt(tc.baseFee), tc.validator, tc.height) block, err := suite.backend.RPCBlockFromTendermintBlock(tc.resBlock, tc.blockRes, tc.fullTx) @@ -1144,7 +1146,7 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), }, &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + TxsResults: []*types.ExecTxResult{ { Code: 1, }, @@ -1158,7 +1160,7 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), }, &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + TxsResults: []*types.ExecTxResult{ { Code: 1, Log: ethrpc.ExceedBlockGasLimitError, @@ -1173,7 +1175,7 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), }, &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + TxsResults: []*types.ExecTxResult{ { Code: 0, Log: ethrpc.ExceedBlockGasLimitError, @@ -1202,14 +1204,14 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { name string blockNumber ethrpc.BlockNumber baseFee *big.Int - registerMock func(ethrpc.BlockNumber, sdk.Int) + registerMock func(ethrpc.BlockNumber, sdkmath.Int) expPass bool }{ { "fail - tendermint client failed to get block", ethrpc.BlockNumber(1), - sdk.NewInt(1).BigInt(), - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockError(client, height) @@ -1219,8 +1221,8 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { { "fail - block not found for height", ethrpc.BlockNumber(1), - sdk.NewInt(1).BigInt(), - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) _, err := RegisterBlockNotFound(client, height) @@ -1231,8 +1233,8 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { { "fail - block not found for height", ethrpc.BlockNumber(1), - sdk.NewInt(1).BigInt(), - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) _, err := RegisterBlock(client, height, nil) @@ -1245,7 +1247,7 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { "pass - without Base Fee, failed to fetch from prunned block", ethrpc.BlockNumber(1), nil, - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlock(client, height, nil) @@ -1259,8 +1261,8 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { { "pass - blockNum = 1, without tx", ethrpc.BlockNumber(1), - sdk.NewInt(1).BigInt(), - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlock(client, height, nil) @@ -1274,8 +1276,8 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { { "pass - blockNum = 1, with tx", ethrpc.BlockNumber(1), - sdk.NewInt(1).BigInt(), - func(blockNum ethrpc.BlockNumber, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlock(client, height, bz) @@ -1291,7 +1293,7 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(tc.blockNumber, sdk.NewIntFromBigInt(tc.baseFee)) + tc.registerMock(tc.blockNumber, sdkmath.NewIntFromBigInt(tc.baseFee)) header, err := suite.backend.HeaderByNumber(tc.blockNumber) if tc.expPass { @@ -1316,14 +1318,14 @@ func (suite *BackendTestSuite) TestHeaderByHash() { name string hash common.Hash baseFee *big.Int - registerMock func(common.Hash, sdk.Int) + registerMock func(common.Hash, sdkmath.Int) expPass bool }{ { "fail - tendermint client failed to get block", common.BytesToHash(block.Hash()), - sdk.NewInt(1).BigInt(), - func(hash common.Hash, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(hash common.Hash, baseFee sdkmath.Int) { client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockByHashError(client, hash, bz) }, @@ -1332,8 +1334,8 @@ func (suite *BackendTestSuite) TestHeaderByHash() { { "fail - block not found for height", common.BytesToHash(block.Hash()), - sdk.NewInt(1).BigInt(), - func(hash common.Hash, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(hash common.Hash, baseFee sdkmath.Int) { client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockByHashNotFound(client, hash, bz) }, @@ -1342,8 +1344,8 @@ func (suite *BackendTestSuite) TestHeaderByHash() { { "fail - block not found for height", common.BytesToHash(block.Hash()), - sdk.NewInt(1).BigInt(), - func(hash common.Hash, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) _, err := RegisterBlockByHash(client, hash, bz) @@ -1356,7 +1358,7 @@ func (suite *BackendTestSuite) TestHeaderByHash() { "pass - without Base Fee, failed to fetch from prunned block", common.BytesToHash(block.Hash()), nil, - func(hash common.Hash, baseFee sdk.Int) { + func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlockByHash(client, hash, bz) @@ -1370,8 +1372,8 @@ func (suite *BackendTestSuite) TestHeaderByHash() { { "pass - blockNum = 1, without tx", common.BytesToHash(emptyBlock.Hash()), - sdk.NewInt(1).BigInt(), - func(hash common.Hash, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlockByHash(client, hash, nil) @@ -1385,8 +1387,8 @@ func (suite *BackendTestSuite) TestHeaderByHash() { { "pass - with tx", common.BytesToHash(block.Hash()), - sdk.NewInt(1).BigInt(), - func(hash common.Hash, baseFee sdk.Int) { + sdkmath.NewInt(1).BigInt(), + func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) expResultBlock, _ = RegisterBlockByHash(client, hash, bz) @@ -1402,7 +1404,7 @@ func (suite *BackendTestSuite) TestHeaderByHash() { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(tc.hash, sdk.NewIntFromBigInt(tc.baseFee)) + tc.registerMock(tc.hash, sdkmath.NewIntFromBigInt(tc.baseFee)) header, err := suite.backend.HeaderByHash(tc.hash) if tc.expPass { @@ -1462,14 +1464,14 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { _, err = RegisterBlockResults(client, blockNum.Int64()) suite.Require().NoError(err) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) RegisterBaseFee(queryClient, baseFee) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), ), []*ethtypes.Transaction{}, nil, @@ -1489,14 +1491,14 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { _, err = RegisterBlockResults(client, blockNum.Int64()) suite.Require().NoError(err) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) RegisterBaseFee(queryClient, baseFee) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), ), []*ethtypes.Transaction{msgHandleTx.AsTransaction()}, nil, @@ -1538,21 +1540,21 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { baseFee *big.Int resBlock *tmrpctypes.ResultBlock blockRes *tmrpctypes.ResultBlockResults - registerMock func(sdk.Int, int64) + registerMock func(sdkmath.Int, int64) expEthBlock *ethtypes.Block expPass bool }{ { "pass - block without tx", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), &tmrpctypes.ResultBlock{ Block: emptyBlock, }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, - func(baseFee sdk.Int, blockNum int64) { + func(baseFee sdkmath.Int, blockNum int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) }, @@ -1560,7 +1562,7 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), ), []*ethtypes.Transaction{}, nil, @@ -1571,14 +1573,14 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { }, { "pass - block with tx", - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), &tmrpctypes.ResultBlock{ Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), }, &tmrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, - EndBlockEvents: []types.Event{ + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ @@ -1587,7 +1589,7 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { }, }, }, - func(baseFee sdk.Int, blockNum int64) { + func(baseFee sdkmath.Int, blockNum int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) }, @@ -1595,7 +1597,7 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, - sdk.NewInt(1).BigInt(), + sdkmath.NewInt(1).BigInt(), ), []*ethtypes.Transaction{msgHandleTx.AsTransaction()}, nil, @@ -1608,7 +1610,7 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset test and queries - tc.registerMock(sdk.NewIntFromBigInt(tc.baseFee), tc.blockRes.Height) + tc.registerMock(sdkmath.NewIntFromBigInt(tc.baseFee), tc.blockRes.Height) ethBlock, err := suite.backend.EthBlockFromTendermintBlock(tc.resBlock, tc.blockRes) diff --git a/rpc/backend/call_tx.go b/rpc/backend/call_tx.go index 3a5a67fc..ddfe464f 100644 --- a/rpc/backend/call_tx.go +++ b/rpc/backend/call_tx.go @@ -22,10 +22,11 @@ import ( "fmt" "math/big" - errorsmod "cosmossdk.io/errors" rpctypes "swisstronik/rpc/types" ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" + + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" @@ -310,25 +311,25 @@ func (b *Backend) EstimateGas(args evmtypes.TransactionArgs, blockNrOptional *rp if blockNrOptional != nil { blockNr = *blockNrOptional } - + bz, err := json.Marshal(&args) if err != nil { return 0, err } - + header, err := b.TendermintBlockByNumber(blockNr) if err != nil { // the error message imitates geth behavior return 0, errors.New("header not found") } - + req := evmtypes.EthCallRequest{ Args: bz, GasCap: b.RPCGasCap(), ProposerAddress: sdk.ConsAddress(header.Block.ProposerAddress), ChainId: b.chainID.Int64(), } - + // From ContextWithHeight: if the provided height is 0, // it will return an empty context and the gRPC query will use // the latest block height for querying. diff --git a/rpc/backend/call_tx_test.go b/rpc/backend/call_tx_test.go index 6074fbed..5e18dc7c 100644 --- a/rpc/backend/call_tx_test.go +++ b/rpc/backend/call_tx_test.go @@ -10,7 +10,7 @@ import ( "swisstronik/tests" evmtypes "swisstronik/x/evm/types" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rlp" @@ -19,7 +19,7 @@ import ( func (suite *BackendTestSuite) TestResend() { txNonce := (hexutil.Uint64)(1) - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) gasPrice := new(hexutil.Big) toAddr := tests.RandomEthAddress() chainID := (*hexutil.Big)(suite.backend.chainID) @@ -469,7 +469,7 @@ func (suite *BackendTestSuite) TestGasPrice() { RegisterParams(queryClient, &header, 1) RegisterBlock(client, 1, nil) RegisterBlockResults(client, 1) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, defaultGasPrice, true, @@ -485,7 +485,7 @@ func (suite *BackendTestSuite) TestGasPrice() { RegisterParams(queryClient, &header, 1) RegisterBlock(client, 1, nil) RegisterBlockResults(client, 1) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, defaultGasPrice, false, diff --git a/rpc/backend/chain_info.go b/rpc/backend/chain_info.go index 3fe2de57..bb029c80 100644 --- a/rpc/backend/chain_info.go +++ b/rpc/backend/chain_info.go @@ -25,6 +25,7 @@ import ( evmtypes "swisstronik/x/evm/types" feemarkettypes "swisstronik/x/feemarket/types" + sdkmath "cosmossdk.io/math" tmrpcclient "github.com/cometbft/cometbft/rpc/client" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -66,10 +67,10 @@ func (b *Backend) ChainConfig() *params.ChainConfig { } // GlobalMinGasPrice returns MinGasPrice param from FeeMarket -func (b *Backend) GlobalMinGasPrice() (sdk.Dec, error) { +func (b *Backend) GlobalMinGasPrice() (sdkmath.LegacyDec, error) { res, err := b.queryClient.FeeMarket.Params(b.ctx, &feemarkettypes.QueryParamsRequest{}) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } return res.Params.MinGasPrice, nil } @@ -81,12 +82,12 @@ func (b *Backend) GlobalMinGasPrice() (sdk.Dec, error) { func (b *Backend) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error) { // return BaseFee if London hard fork is activated and feemarket is enabled res, err := b.queryClient.BaseFee(rpctypes.ContextWithHeight(blockRes.Height), &evmtypes.QueryBaseFeeRequest{}) - if err != nil || res.BaseFee == nil { + if err != nil { // we can't tell if it's london HF not enabled or the state is pruned, // in either case, we'll fallback to parsing from begin blocker event, // faster to iterate reversely - for i := len(blockRes.BeginBlockEvents) - 1; i >= 0; i-- { - evt := blockRes.BeginBlockEvents[i] + for i := len(blockRes.FinalizeBlockEvents) - 1; i >= 0; i-- { + evt := blockRes.FinalizeBlockEvents[i] if evt.Type == feemarkettypes.EventTypeFeeMarket && len(evt.Attributes) > 0 { baseFee, err := strconv.ParseInt(string(evt.Attributes[0].Value), 10, 64) if err == nil { @@ -98,10 +99,6 @@ func (b *Backend) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, er return nil, err } - if res.BaseFee == nil { - return nil, nil - } - return res.BaseFee.BigInt(), nil } diff --git a/rpc/backend/chain_info_test.go b/rpc/backend/chain_info_test.go index 8742c47a..6624f459 100644 --- a/rpc/backend/chain_info_test.go +++ b/rpc/backend/chain_info_test.go @@ -18,10 +18,12 @@ import ( "swisstronik/rpc/backend/mocks" evmtypes "swisstronik/x/evm/types" feemarkettypes "swisstronik/x/feemarket/types" + + sdkmath "cosmossdk.io/math" ) func (suite *BackendTestSuite) TestBaseFee() { - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) testCases := []struct { name string @@ -44,7 +46,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with non feemarket block event", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, }, @@ -61,7 +63,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with feemarket block event", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, }, @@ -78,7 +80,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with feemarket block event with wrong attribute value", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, Attributes: []types.EventAttribute{ @@ -98,7 +100,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc baseFee error - with feemarket block event with baseFee attribute value", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, Attributes: []types.EventAttribute{ @@ -289,7 +291,7 @@ func (suite *BackendTestSuite) TestGlobalMinGasPrice() { testCases := []struct { name string registerMock func() - expMinGasPrice sdk.Dec + expMinGasPrice sdkmath.LegacyDec expPass bool }{ { @@ -298,7 +300,7 @@ func (suite *BackendTestSuite) TestGlobalMinGasPrice() { feeMarketCleint := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) RegisterFeeMarketParamsError(feeMarketCleint, int64(1)) }, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), false, }, } @@ -407,7 +409,7 @@ func (suite *BackendTestSuite) TestFeeHistory() { "pass - Valid FeeHistoryResults object", func(validator sdk.AccAddress) { var header metadata.MD - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) client := suite.backend.clientCtx.Client.(*mocks.Client) suite.backend.cfg.JSONRPC.FeeHistoryCap = 2 diff --git a/rpc/backend/client_test.go b/rpc/backend/client_test.go index a488559c..048306cf 100644 --- a/rpc/backend/client_test.go +++ b/rpc/backend/client_test.go @@ -13,7 +13,6 @@ import ( evmtypes "swisstronik/x/evm/types" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/bytes" tmrpcclient "github.com/cometbft/cometbft/rpc/client" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" @@ -181,7 +180,7 @@ func TestRegisterConsensusParams(t *testing.T) { func RegisterBlockResultsWithEventLog(client *mocks.Client, height int64) (*tmrpctypes.ResultBlockResults, error) { res := &tmrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{ + TxsResults: []*abci.ExecTxResult{ {Code: 0, GasUsed: 0, Events: []abci.Event{{ Type: evmtypes.EventTypeTxLog, Attributes: []abci.EventAttribute{{ @@ -203,7 +202,7 @@ func RegisterBlockResults( ) (*tmrpctypes.ResultBlockResults, error) { res := &tmrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*abci.ExecTxResult{{Code: 0, GasUsed: 0}}, } client.On("BlockResults", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")). @@ -224,7 +223,7 @@ func TestRegisterBlockResults(t *testing.T) { res, err := client.BlockResults(rpc.ContextWithHeight(height), &height) expRes := &tmrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*abci.ExecTxResult{{Code: 0, GasUsed: 0}}, } require.Equal(t, expRes, res) require.NoError(t, err) @@ -254,7 +253,7 @@ func RegisterBlockByHashNotFound(client *mocks.Client, hash common.Hash, tx []by Return(nil, nil) } -func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path string, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions) { +func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path string, data []byte, opts tmrpcclient.ABCIQueryOptions) { client.On("ABCIQueryWithOptions", context.Background(), path, data, opts). Return(&tmrpctypes.ResultABCIQuery{ Response: abci.ResponseQuery{ @@ -264,12 +263,12 @@ func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path strin }, nil) } -func RegisterABCIQueryWithOptionsError(clients *mocks.Client, path string, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions) { +func RegisterABCIQueryWithOptionsError(clients *mocks.Client, path string, data []byte, opts tmrpcclient.ABCIQueryOptions) { clients.On("ABCIQueryWithOptions", context.Background(), path, data, opts). Return(nil, errortypes.ErrInvalidRequest) } -func RegisterABCIQueryAccount(clients *mocks.Client, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions, acc client.Account) { +func RegisterABCIQueryAccount(clients *mocks.Client, data []byte, opts tmrpcclient.ABCIQueryOptions, acc client.Account) { baseAccount := authtypes.NewBaseAccount(acc.GetAddress(), acc.GetPubKey(), acc.GetAccountNumber(), acc.GetSequence()) accAny, _ := codectypes.NewAnyWithValue(baseAccount) accResponse := authtypes.QueryAccountResponse{Account: accAny} diff --git a/rpc/backend/evm_query_client_test.go b/rpc/backend/evm_query_client_test.go index d815648a..36e761f5 100644 --- a/rpc/backend/evm_query_client_test.go +++ b/rpc/backend/evm_query_client_test.go @@ -12,6 +12,7 @@ import ( "swisstronik/tests" evmtypes "swisstronik/x/evm/types" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" @@ -139,13 +140,15 @@ func TestRegisterParamsError(t *testing.T) { // ETH Call func RegisterEthCall(queryClient *mocks.EVMQueryClient, request *evmtypes.EthCallRequest) { - ctx, _ := context.WithCancel(rpc.ContextWithHeight(1)) //nolint + ctx, cancelFn := context.WithCancel(rpc.ContextWithHeight(1)) //nolint + defer cancelFn() queryClient.On("EthCall", ctx, request). Return(&evmtypes.MsgEthereumTxResponse{}, nil) } func RegisterEthCallError(queryClient *mocks.EVMQueryClient, request *evmtypes.EthCallRequest) { - ctx, _ := context.WithCancel(rpc.ContextWithHeight(1)) //nolint + ctx, cancelFn := context.WithCancel(rpc.ContextWithHeight(1)) //nolint + defer cancelFn() queryClient.On("EthCall", ctx, request). Return(nil, errortypes.ErrInvalidRequest) } @@ -158,9 +161,9 @@ func RegisterEstimateGas(queryClient *mocks.EVMQueryClient, args evmtypes.Transa } // BaseFee -func RegisterBaseFee(queryClient *mocks.EVMQueryClient, baseFee sdk.Int) { +func RegisterBaseFee(queryClient *mocks.EVMQueryClient, baseFee sdkmath.Int) { queryClient.On("BaseFee", rpc.ContextWithHeight(1), &evmtypes.QueryBaseFeeRequest{}). - Return(&evmtypes.QueryBaseFeeResponse{BaseFee: &baseFee}, nil) + Return(&evmtypes.QueryBaseFeeResponse{BaseFee: baseFee}, nil) } // Base fee returns error @@ -176,11 +179,11 @@ func RegisterBaseFeeDisabled(queryClient *mocks.EVMQueryClient) { } func TestRegisterBaseFee(t *testing.T) { - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) queryClient := mocks.NewEVMQueryClient(t) RegisterBaseFee(queryClient, baseFee) res, err := queryClient.BaseFee(rpc.ContextWithHeight(1), &evmtypes.QueryBaseFeeRequest{}) - require.Equal(t, &evmtypes.QueryBaseFeeResponse{BaseFee: &baseFee}, res) + require.Equal(t, &evmtypes.QueryBaseFeeResponse{BaseFee: baseFee}, res) require.NoError(t, err) } diff --git a/rpc/backend/node_info.go b/rpc/backend/node_info.go index 55830e54..554f4188 100644 --- a/rpc/backend/node_info.go +++ b/rpc/backend/node_info.go @@ -16,10 +16,18 @@ package backend import ( + "context" "fmt" "math/big" "time" + "swisstronik/crypto/ethsecp256k1" + rpctypes "swisstronik/rpc/types" + "swisstronik/server/config" + evmtypes "swisstronik/x/evm/types" + + swisstroniktypes "swisstronik/types" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" tmtypes "github.com/cometbft/cometbft/types" @@ -34,11 +42,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" - "swisstronik/crypto/ethsecp256k1" - rpctypes "swisstronik/rpc/types" - "swisstronik/server/config" - ethermint "swisstronik/types" - evmtypes "swisstronik/x/evm/types" ) // Accounts returns the list of accounts available to this node. @@ -99,11 +102,6 @@ func (b *Backend) SetEtherbase(etherbase common.Address) bool { withdrawAddr := sdk.AccAddress(etherbase.Bytes()) msg := distributiontypes.NewMsgSetWithdrawAddress(delAddr, withdrawAddr) - if err := msg.ValidateBasic(); err != nil { - b.logger.Debug("tx failed basic validation", "error", err.Error()) - return false - } - // Assemble transaction from fields builder, ok := b.clientCtx.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) if !ok { @@ -160,7 +158,7 @@ func (b *Backend) SetEtherbase(etherbase common.Address) bool { return false } - if err := tx.Sign(txFactory, keyInfo.Name, builder, false); err != nil { + if err := tx.Sign(context.Background(), txFactory, keyInfo.Name, builder, false); err != nil { b.logger.Debug("failed to sign tx", "error", err.Error()) return false } @@ -286,7 +284,7 @@ func (b *Backend) SetGasPrice(gasPrice hexutil.Big) bool { unit = minGasPrices[0].Denom } - c := sdk.NewDecCoin(unit, sdk.NewIntFromBigInt(gasPrice.ToInt())) + c := sdk.NewDecCoin(unit, sdkmath.NewIntFromBigInt(gasPrice.ToInt())) appConf.SetMinGasPrices(sdk.DecCoins{c}) sdkconfig.WriteConfigFile(b.clientCtx.Viper.ConfigFileUsed(), appConf) @@ -340,13 +338,13 @@ func (b *Backend) RPCBlockRangeCap() int32 { func (b *Backend) RPCMinGasPrice() int64 { evmParams, err := b.queryClient.Params(b.ctx, &evmtypes.QueryParamsRequest{}) if err != nil { - return ethermint.DefaultGasPrice + return swisstroniktypes.DefaultGasPrice } minGasPrice := b.cfg.GetMinGasPrices() amt := minGasPrice.AmountOf(evmParams.Params.EvmDenom).TruncateInt64() if amt == 0 { - return ethermint.DefaultGasPrice + return swisstroniktypes.DefaultGasPrice } return amt diff --git a/rpc/backend/node_info_test.go b/rpc/backend/node_info_test.go index 0895ce9f..1e3ae495 100644 --- a/rpc/backend/node_info_test.go +++ b/rpc/backend/node_info_test.go @@ -6,15 +6,17 @@ import ( "google.golang.org/grpc/metadata" + "swisstronik/crypto/ethsecp256k1" + "swisstronik/rpc/backend/mocks" + ethermint "swisstronik/types" + + sdkmath "cosmossdk.io/math" tmrpcclient "github.com/cometbft/cometbft/rpc/client" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/spf13/viper" - "swisstronik/crypto/ethsecp256k1" - "swisstronik/rpc/backend/mocks" - ethermint "swisstronik/types" ) func (suite *BackendTestSuite) TestRPCMinGasPrice() { @@ -255,7 +257,7 @@ func (suite *BackendTestSuite) TestSetEtherbase() { RegisterStatus(client) RegisterValidatorAccount(queryClient, suite.acc) RegisterParams(queryClient, &header, 1) - c := sdk.NewDecCoin("uswtr", sdk.NewIntFromBigInt(big.NewInt(1))) + c := sdk.NewDecCoin("uswtr", sdkmath.NewIntFromBigInt(big.NewInt(1))) suite.backend.cfg.SetMinGasPrices(sdk.DecCoins{c}) delAddr, _ := suite.backend.GetCoinbase() // account, _ := suite.backend.clientCtx.AccountRetriever.GetAccount(suite.backend.clientCtx, delAddr) diff --git a/rpc/backend/sign_tx.go b/rpc/backend/sign_tx.go index 6465fcb5..7515f4f6 100644 --- a/rpc/backend/sign_tx.go +++ b/rpc/backend/sign_tx.go @@ -31,6 +31,8 @@ import ( "github.com/ethereum/go-ethereum/signer/core/apitypes" evmtypes "swisstronik/x/evm/types" + + "github.com/cosmos/cosmos-sdk/types/tx/signing" ) // SendTransaction sends transaction based on received args using Node's key to sign it @@ -130,7 +132,7 @@ func (b *Backend) Sign(address common.Address, data hexutil.Bytes) (hexutil.Byte } // Sign the requested hash with the wallet - signature, _, err := b.clientCtx.Keyring.SignByAddress(from, data) + signature, _, err := b.clientCtx.Keyring.SignByAddress(from, data, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) if err != nil { b.logger.Error("keyring.SignByAddress failed", "address", address.Hex()) return nil, err @@ -156,7 +158,7 @@ func (b *Backend) SignTypedData(address common.Address, typedData apitypes.Typed } // Sign the requested hash with the wallet - signature, _, err := b.clientCtx.Keyring.SignByAddress(from, sigHash) + signature, _, err := b.clientCtx.Keyring.SignByAddress(from, sigHash, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) if err != nil { b.logger.Error("keyring.SignByAddress failed", "address", address.Hex()) return nil, err diff --git a/rpc/backend/sign_tx_test.go b/rpc/backend/sign_tx_test.go index 88feae20..7e0d5b22 100644 --- a/rpc/backend/sign_tx_test.go +++ b/rpc/backend/sign_tx_test.go @@ -8,8 +8,10 @@ import ( "swisstronik/tests" evmtypes "swisstronik/x/evm/types" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/crypto" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -26,7 +28,7 @@ func (suite *BackendTestSuite) TestSendTransaction() { priv, _ := ethsecp256k1.GenerateKey() from := common.BytesToAddress(priv.PubKey().Address().Bytes()) nonce := hexutil.Uint64(1) - baseFee := sdk.NewInt(1) + baseFee := sdkmath.NewInt(1) callArgsDefault := evmtypes.TransactionArgs{ From: &from, To: &toAddr, @@ -217,7 +219,7 @@ func (suite *BackendTestSuite) TestSign() { responseBz, err := suite.backend.Sign(tc.fromAddr, tc.inputBz) if tc.expPass { - signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), tc.inputBz) + signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), tc.inputBz, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) signature[goethcrypto.RecoveryIDOffset] += 27 suite.Require().NoError(err) suite.Require().Equal((hexutil.Bytes)(signature), responseBz) @@ -266,7 +268,7 @@ func (suite *BackendTestSuite) TestSignTypedData() { if tc.expPass { sigHash, _, err := apitypes.TypedDataAndHash(tc.inputTypedData) - signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), sigHash) + signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), sigHash, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) signature[goethcrypto.RecoveryIDOffset] += 27 suite.Require().NoError(err) suite.Require().Equal((hexutil.Bytes)(signature), responseBz) diff --git a/rpc/backend/tracing_test.go b/rpc/backend/tracing_test.go index b56db980..7d31127f 100644 --- a/rpc/backend/tracing_test.go +++ b/rpc/backend/tracing_test.go @@ -8,12 +8,12 @@ import ( "swisstronik/rpc/backend/mocks" evmtypes "swisstronik/x/evm/types" - dbm "github.com/cometbft/cometbft-db" + tmlog "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/crypto" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -52,7 +52,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { name string registerMock func() block *types.Block - responseBlock []*abci.ResponseDeliverTx + responseBlock []*abci.ExecTxResult expResult interface{} expPass bool }{ @@ -60,7 +60,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { "fail - tx not found", func() {}, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -86,7 +86,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterBlockError(client, 1) }, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -113,7 +113,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterTraceTransactionWithPredecessors(queryClient, msgHandleTx, []*evmtypes.MsgHandleTx{msgHandleTx}) }, &types.Block{Header: types.Header{Height: 1, ChainID: ChainID}, Data: types.Data{Txs: []types.Tx{txBz, txBz2}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -153,7 +153,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterTraceTransaction(queryClient, msgHandleTx) }, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 843e86d5..c11e2840 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -21,9 +21,10 @@ import ( "math/big" rpctypes "swisstronik/rpc/types" - ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" + swisstroniktypes "swisstronik/types" + errorsmod "cosmossdk.io/errors" tmrpcclient "github.com/cometbft/cometbft/rpc/client" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" @@ -139,7 +140,7 @@ func (b *Backend) getTransactionByHashPending(txHash common.Hash) (*rpctypes.RPC } // GetGasUsed returns gasUsed from transaction -func (b *Backend) GetGasUsed(res *ethermint.TxResult, price *big.Int, gas uint64) uint64 { +func (b *Backend) GetGasUsed(res *swisstroniktypes.TxResult, price *big.Int, gas uint64) uint64 { // patch gasUsed if tx is reverted and happened before height on which fixed was introduced // to return real gas charged // more info at https://github.com/evmos/ethermint/pull/1557 @@ -315,7 +316,7 @@ func (b *Backend) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNum // GetTxByEthHash uses `/tx_query` to find transaction by ethereum tx hash // TODO: Don't need to convert once hashing is fixed on Tendermint // https://github.com/cometbft/cometbft/issues/6539 -func (b *Backend) GetTxByEthHash(hash common.Hash) (*ethermint.TxResult, error) { +func (b *Backend) GetTxByEthHash(hash common.Hash) (*swisstroniktypes.TxResult, error) { if b.indexer != nil { return b.indexer.GetByTxHash(hash) } @@ -332,7 +333,7 @@ func (b *Backend) GetTxByEthHash(hash common.Hash) (*ethermint.TxResult, error) } // GetTxByTxIndex uses `/tx_query` to find transaction by tx index of valid ethereum txs -func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult, error) { +func (b *Backend) GetTxByTxIndex(height int64, index uint) (*swisstroniktypes.TxResult, error) { if b.indexer != nil { return b.indexer.GetByBlockAndIndex(height, int32(index)) } @@ -352,7 +353,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult, } // queryTendermintTxIndexer query tx in tendermint tx indexer -func (b *Backend) queryTendermintTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*ethermint.TxResult, error) { +func (b *Backend) queryTendermintTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*swisstroniktypes.TxResult, error) { resTxs, err := b.clientCtx.Client.TxSearch(b.ctx, query, false, nil, nil, "") if err != nil { return nil, err diff --git a/rpc/backend/tx_info_test.go b/rpc/backend/tx_info_test.go index 0f318d66..d790f1db 100644 --- a/rpc/backend/tx_info_test.go +++ b/rpc/backend/tx_info_test.go @@ -10,12 +10,12 @@ import ( ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" - dbm "github.com/cometbft/cometbft-db" + tmlog "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" - sdk "github.com/cosmos/cosmos-sdk/types" + dbm "github.com/cosmos/cosmos-db" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "google.golang.org/grpc/metadata" @@ -27,7 +27,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() { txBz := suite.signAndEncodeEthTx(msgHandleTx) block := &types.Block{Header: types.Header{Height: 1, ChainID: "test"}, Data: types.Data{Txs: []types.Tx{txBz}}} - responseDeliver := []*abci.ResponseDeliverTx{ + responseDeliver := []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -98,7 +98,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() { suite.Require().NoError(err) _, err = RegisterBlockResults(client, 1) suite.Require().NoError(err) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, msgHandleTx, rpcTransaction, @@ -285,7 +285,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() { msgEthTx, bz := suite.buildEthereumTx() defaultBlock := types.MakeBlock(1, []types.Tx{bz}, nil, nil) - defaultResponseDeliverTx := []*abci.ResponseDeliverTx{ + defaultExecTxResult := []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -352,11 +352,11 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() { suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx) txBz := suite.signAndEncodeEthTx(msgEthTx) block := &types.Block{Header: types.Header{Height: 1, ChainID: "test"}, Data: types.Data{Txs: []types.Tx{txBz}}} - err := suite.backend.indexer.IndexBlock(block, defaultResponseDeliverTx) + err := suite.backend.indexer.IndexBlock(block, defaultExecTxResult) suite.Require().NoError(err) _, err = RegisterBlockResults(client, 1) suite.Require().NoError(err) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, &tmrpctypes.ResultBlock{Block: defaultBlock}, 0, @@ -370,7 +370,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() { client := suite.backend.clientCtx.Client.(*mocks.Client) _, err := RegisterBlockResults(client, 1) suite.Require().NoError(err) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, &tmrpctypes.ResultBlock{Block: defaultBlock}, 0, @@ -435,7 +435,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockNumberAndIndex() { suite.Require().NoError(err) _, err = RegisterBlockResults(client, 1) suite.Require().NoError(err) - RegisterBaseFee(queryClient, sdk.NewInt(1)) + RegisterBaseFee(queryClient, sdkmath.NewInt(1)) }, 0, 0, @@ -554,7 +554,7 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() { registerMock func() tx *evmtypes.MsgHandleTx block *types.Block - blockResult []*abci.ResponseDeliverTx + blockResult []*abci.ExecTxResult expTxReceipt map[string]interface{} expPass bool }{ @@ -573,7 +573,7 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() { }, msgHandleTx, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ diff --git a/rpc/backend/utils.go b/rpc/backend/utils.go index a1f8c6de..a23ec49f 100644 --- a/rpc/backend/utils.go +++ b/rpc/backend/utils.go @@ -32,8 +32,8 @@ import ( "github.com/ethereum/go-ethereum/consensus/misc" ethtypes "github.com/ethereum/go-ethereum/core/types" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "swisstronik/rpc/types" @@ -276,7 +276,7 @@ func ParseTxLogsFromEvent(event abci.Event) ([]*ethtypes.Log, error) { // ShouldIgnoreGasUsed returns true if the gasUsed in result should be ignored // workaround for issue: https://github.com/cosmos/cosmos-sdk/issues/10832 -func ShouldIgnoreGasUsed(res *abci.ResponseDeliverTx) bool { +func ShouldIgnoreGasUsed(res *abci.ExecTxResult) bool { return res.GetCode() == 11 && strings.Contains(res.GetLog(), "no block gas left to run tx: out of gas") } diff --git a/rpc/namespaces/ethereum/debug/api.go b/rpc/namespaces/ethereum/debug/api.go index dc08d379..acda10c9 100644 --- a/rpc/namespaces/ethereum/debug/api.go +++ b/rpc/namespaces/ethereum/debug/api.go @@ -35,13 +35,14 @@ import ( "github.com/cosmos/cosmos-sdk/server" - "github.com/cometbft/cometbft/libs/log" + "swisstronik/rpc/backend" + rpctypes "swisstronik/rpc/types" + + "cosmossdk.io/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/rlp" - "swisstronik/rpc/backend" - rpctypes "swisstronik/rpc/types" ) // HandlerT keeps track of the cpu profiler and trace execution diff --git a/rpc/namespaces/ethereum/debug/utils.go b/rpc/namespaces/ethereum/debug/utils.go index 648a6986..41675b61 100644 --- a/rpc/namespaces/ethereum/debug/utils.go +++ b/rpc/namespaces/ethereum/debug/utils.go @@ -22,7 +22,7 @@ import ( "runtime/pprof" "strings" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/server" ) diff --git a/rpc/namespaces/ethereum/did/api.go b/rpc/namespaces/ethereum/did/api.go index 2f31d939..3584daac 100644 --- a/rpc/namespaces/ethereum/did/api.go +++ b/rpc/namespaces/ethereum/did/api.go @@ -20,7 +20,7 @@ import ( rpctypes "swisstronik/rpc/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "swisstronik/rpc/backend" didtypes "swisstronik/x/did/types" diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index 533624bf..557402d0 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -22,7 +22,7 @@ import ( "github.com/ethereum/go-ethereum/rpc" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -31,7 +31,7 @@ import ( "swisstronik/rpc/backend" rpctypes "swisstronik/rpc/types" - ethermint "swisstronik/types" + swisstroniktypes "swisstronik/types" evmtypes "swisstronik/x/evm/types" ) @@ -314,7 +314,7 @@ func (e *PublicAPI) GetNodePublicKey(blockNrOrHash rpctypes.BlockNumberOrHash) ( // ProtocolVersion returns the supported Ethereum protocol version. func (e *PublicAPI) ProtocolVersion() hexutil.Uint { e.logger.Debug("eth_protocolVersion") - return hexutil.Uint(ethermint.ProtocolVersion) + return hexutil.Uint(swisstroniktypes.ProtocolVersion) } // GasPrice returns the current gas price based on Ethermint's gas price oracle. diff --git a/rpc/namespaces/ethereum/eth/filters/api.go b/rpc/namespaces/ethereum/eth/filters/api.go index 3a967476..071f5328 100644 --- a/rpc/namespaces/ethereum/eth/filters/api.go +++ b/rpc/namespaces/ethereum/eth/filters/api.go @@ -12,7 +12,7 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package filters import ( @@ -22,20 +22,18 @@ import ( "time" "github.com/cosmos/cosmos-sdk/client" - "swisstronik/rpc/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" coretypes "github.com/cometbft/cometbft/rpc/core/types" - rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" - tmtypes "github.com/cometbft/cometbft/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rpc" - evmtypes "swisstronik/x/evm/types" + "swisstronik/rpc/stream" + "swisstronik/rpc/types" ) // FilterAPI gathers @@ -75,10 +73,8 @@ var deadline = 5 * time.Minute type filter struct { typ filters.Type deadline *time.Timer // filter is inactive when deadline triggers - hashes []common.Hash crit filters.FilterCriteria - logs []*ethtypes.Log - s *Subscription // associated subscription in event system + offset int // offset for stream subscription } // PublicFilterAPI offers support to create and manage filters. This will allow external clients to retrieve various @@ -87,20 +83,21 @@ type PublicFilterAPI struct { logger log.Logger clientCtx client.Context backend Backend - events *EventSystem + events *stream.RPCStream filtersMu sync.Mutex filters map[rpc.ID]*filter } // NewPublicAPI returns a new PublicFilterAPI instance. -func NewPublicAPI(logger log.Logger, clientCtx client.Context, tmWSClient *rpcclient.WSClient, backend Backend) *PublicFilterAPI { +func NewPublicAPI(logger log.Logger, clientCtx client.Context, stream *stream.RPCStream, backend Backend) *PublicFilterAPI { logger = logger.With("api", "filter") + api := &PublicFilterAPI{ logger: logger, clientCtx: clientCtx, backend: backend, filters: make(map[rpc.ID]*filter), - events: NewEventSystem(logger, tmWSClient), + events: stream, } go api.timeoutLoop() @@ -120,7 +117,6 @@ func (api *PublicFilterAPI) timeoutLoop() { for id, f := range api.filters { select { case <-f.deadline.C: - f.s.Unsubscribe(api.events) delete(api.filters, id) default: continue @@ -145,127 +141,15 @@ func (api *PublicFilterAPI) NewPendingTransactionFilter() rpc.ID { return rpc.ID("error creating pending tx filter: max limit reached") } - pendingTxSub, cancelSubs, err := api.events.SubscribePendingTxs() - if err != nil { - // wrap error on the ID - return rpc.ID(fmt.Sprintf("error creating pending tx filter: %s", err.Error())) - } - - api.filters[pendingTxSub.ID()] = &filter{ + id := rpc.NewID() + _, offset := api.events.TxStream().ReadNonBlocking(-1) + api.filters[id] = &filter{ typ: filters.PendingTransactionsSubscription, deadline: time.NewTimer(deadline), - hashes: make([]common.Hash, 0), - s: pendingTxSub, + offset: offset, } - go func(txsCh <-chan coretypes.ResultEvent, errCh <-chan error) { - defer cancelSubs() - - for { - select { - case ev, ok := <-txsCh: - if !ok { - api.filtersMu.Lock() - delete(api.filters, pendingTxSub.ID()) - api.filtersMu.Unlock() - return - } - - data, ok := ev.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - tx, err := api.clientCtx.TxConfig.TxDecoder()(data.Tx) - if err != nil { - api.logger.Debug("fail to decode tx", "error", err.Error()) - continue - } - - api.filtersMu.Lock() - if f, found := api.filters[pendingTxSub.ID()]; found { - for _, msg := range tx.GetMsgs() { - ethTx, ok := msg.(*evmtypes.MsgHandleTx) - if ok { - f.hashes = append(f.hashes, ethTx.AsTransaction().Hash()) - } - } - } - api.filtersMu.Unlock() - case <-errCh: - api.filtersMu.Lock() - delete(api.filters, pendingTxSub.ID()) - api.filtersMu.Unlock() - } - } - }(pendingTxSub.eventCh, pendingTxSub.Err()) - - return pendingTxSub.ID() -} - -// NewPendingTransactions creates a subscription that is triggered each time a transaction -// enters the transaction pool and was signed from one of the transactions this nodes manages. -func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error) { - notifier, supported := rpc.NotifierFromContext(ctx) - if !supported { - return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported - } - - rpcSub := notifier.CreateSubscription() - - ctx, cancelFn := context.WithTimeout(context.Background(), deadline) - defer cancelFn() - - api.events.WithContext(ctx) - - pendingTxSub, cancelSubs, err := api.events.SubscribePendingTxs() - if err != nil { - return nil, err - } - - go func(txsCh <-chan coretypes.ResultEvent) { - defer cancelSubs() - - for { - select { - case ev, ok := <-txsCh: - if !ok { - api.filtersMu.Lock() - delete(api.filters, pendingTxSub.ID()) - api.filtersMu.Unlock() - return - } - - data, ok := ev.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - tx, err := api.clientCtx.TxConfig.TxDecoder()(data.Tx) - if err != nil { - api.logger.Debug("fail to decode tx", "error", err.Error()) - continue - } - - for _, msg := range tx.GetMsgs() { - ethTx, ok := msg.(*evmtypes.MsgHandleTx) - if ok { - _ = notifier.Notify(rpcSub.ID, ethTx.AsTransaction().Hash()) - } - } - case <-rpcSub.Err(): - pendingTxSub.Unsubscribe(api.events) - return - case <-notifier.Closed(): - pendingTxSub.Unsubscribe(api.events) - return - } - } - }(pendingTxSub.eventCh) - - return rpcSub, err + return id } // NewBlockFilter creates a filter that fetches blocks that are imported into the chain. @@ -280,163 +164,15 @@ func (api *PublicFilterAPI) NewBlockFilter() rpc.ID { return rpc.ID("error creating block filter: max limit reached") } - headerSub, cancelSubs, err := api.events.SubscribeNewHeads() - if err != nil { - // wrap error on the ID - return rpc.ID(fmt.Sprintf("error creating block filter: %s", err.Error())) - } - - api.filters[headerSub.ID()] = &filter{typ: filters.BlocksSubscription, deadline: time.NewTimer(deadline), hashes: []common.Hash{}, s: headerSub} - - go func(headersCh <-chan coretypes.ResultEvent, errCh <-chan error) { - defer cancelSubs() - - for { - select { - case ev, ok := <-headersCh: - if !ok { - api.filtersMu.Lock() - delete(api.filters, headerSub.ID()) - api.filtersMu.Unlock() - return - } - - data, ok := ev.Data.(tmtypes.EventDataNewBlockHeader) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - api.filtersMu.Lock() - if f, found := api.filters[headerSub.ID()]; found { - f.hashes = append(f.hashes, common.BytesToHash(data.Header.Hash())) - } - api.filtersMu.Unlock() - case <-errCh: - api.filtersMu.Lock() - delete(api.filters, headerSub.ID()) - api.filtersMu.Unlock() - return - } - } - }(headerSub.eventCh, headerSub.Err()) - - return headerSub.ID() -} - -// NewHeads send a notification each time a new (header) block is appended to the chain. -func (api *PublicFilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, error) { - notifier, supported := rpc.NotifierFromContext(ctx) - if !supported { - return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported - } - - api.events.WithContext(ctx) - rpcSub := notifier.CreateSubscription() - - headersSub, cancelSubs, err := api.events.SubscribeNewHeads() - if err != nil { - return &rpc.Subscription{}, err + id := rpc.NewID() + _, offset := api.events.HeaderStream().ReadNonBlocking(-1) + api.filters[id] = &filter{ + typ: filters.BlocksSubscription, + deadline: time.NewTimer(deadline), + offset: offset, } - go func(headersCh <-chan coretypes.ResultEvent) { - defer cancelSubs() - - for { - select { - case ev, ok := <-headersCh: - if !ok { - headersSub.Unsubscribe(api.events) - return - } - - data, ok := ev.Data.(tmtypes.EventDataNewBlockHeader) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - baseFee := types.BaseFeeFromEvents(data.ResultBeginBlock.Events) - - // TODO: fetch bloom from events - header := types.EthHeaderFromTendermint(data.Header, ethtypes.Bloom{}, baseFee) - _ = notifier.Notify(rpcSub.ID, header) - case <-rpcSub.Err(): - headersSub.Unsubscribe(api.events) - return - case <-notifier.Closed(): - headersSub.Unsubscribe(api.events) - return - } - } - }(headersSub.eventCh) - - return rpcSub, err -} - -// Logs creates a subscription that fires for all new log that match the given filter criteria. -func (api *PublicFilterAPI) Logs(ctx context.Context, crit filters.FilterCriteria) (*rpc.Subscription, error) { - notifier, supported := rpc.NotifierFromContext(ctx) - if !supported { - return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported - } - - api.events.WithContext(ctx) - rpcSub := notifier.CreateSubscription() - - logsSub, cancelSubs, err := api.events.SubscribeLogs(crit) - if err != nil { - return &rpc.Subscription{}, err - } - - go func(logsCh <-chan coretypes.ResultEvent) { - defer cancelSubs() - - for { - select { - case ev, ok := <-logsCh: - if !ok { - logsSub.Unsubscribe(api.events) - return - } - - // filter only events from EVM module txs - _, isMsgEthereumTx := ev.Events[evmtypes.TypeMsgEthereumTx] - - if !isMsgEthereumTx { - // ignore transaction as it's not from the evm module - return - } - - // get transaction result data - dataTx, ok := ev.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - txResponse, err := evmtypes.DecodeTxResponse(dataTx.TxResult.Result.Data) - if err != nil { - api.logger.Error("fail to decode tx response", "error", err) - return - } - - logs := FilterLogs(evmtypes.LogsToEthereum(txResponse.Logs), crit.FromBlock, crit.ToBlock, crit.Addresses, crit.Topics) - - for _, log := range logs { - _ = notifier.Notify(rpcSub.ID, log) - } - case <-rpcSub.Err(): // client send an unsubscribe request - logsSub.Unsubscribe(api.events) - return - case <-notifier.Closed(): // connection dropped - logsSub.Unsubscribe(api.events) - return - } - } - }(logsSub.eventCh) - - return rpcSub, err + return id } // NewFilter creates a new filter and returns the filter id. It can be @@ -460,67 +196,16 @@ func (api *PublicFilterAPI) NewFilter(criteria filters.FilterCriteria) (rpc.ID, return rpc.ID(""), fmt.Errorf("error creating filter: max limit reached") } - var ( - filterID = rpc.ID("") - err error - ) - - logsSub, cancelSubs, err := api.events.SubscribeLogs(criteria) - if err != nil { - return rpc.ID(""), err - } - - filterID = logsSub.ID() - - api.filters[filterID] = &filter{ + id := rpc.NewID() + _, offset := api.events.LogStream().ReadNonBlocking(-1) + api.filters[id] = &filter{ typ: filters.LogsSubscription, - crit: criteria, deadline: time.NewTimer(deadline), - hashes: []common.Hash{}, - s: logsSub, + crit: criteria, + offset: offset, } - go func(eventCh <-chan coretypes.ResultEvent) { - defer cancelSubs() - - for { - select { - case ev, ok := <-eventCh: - if !ok { - api.filtersMu.Lock() - delete(api.filters, filterID) - api.filtersMu.Unlock() - return - } - dataTx, ok := ev.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - txResponse, err := evmtypes.DecodeTxResponse(dataTx.TxResult.Result.Data) - if err != nil { - api.logger.Error("fail to decode tx response", "error", err) - return - } - - logs := FilterLogs(evmtypes.LogsToEthereum(txResponse.Logs), criteria.FromBlock, criteria.ToBlock, criteria.Addresses, criteria.Topics) - - api.filtersMu.Lock() - if f, found := api.filters[filterID]; found { - f.logs = append(f.logs, logs...) - } - api.filtersMu.Unlock() - case <-logsSub.Err(): - api.filtersMu.Lock() - delete(api.filters, filterID) - api.filtersMu.Unlock() - return - } - } - }(logsSub.eventCh) - - return filterID, err + return id, nil } // GetLogs returns logs matching the given argument that are stored within the state. @@ -559,17 +244,13 @@ func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit filters.FilterCrit // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_uninstallfilter func (api *PublicFilterAPI) UninstallFilter(id rpc.ID) bool { api.filtersMu.Lock() - f, found := api.filters[id] + _, found := api.filters[id] if found { delete(api.filters, id) } api.filtersMu.Unlock() - if !found { - return false - } - f.s.Unsubscribe(api.events) - return true + return found } // GetFilterLogs returns the logs for the filter with the given id. @@ -638,14 +319,31 @@ func (api *PublicFilterAPI) GetFilterChanges(id rpc.ID) (interface{}, error) { f.deadline.Reset(deadline) switch f.typ { - case filters.PendingTransactionsSubscription, filters.BlocksSubscription: - hashes := f.hashes - f.hashes = nil + case filters.PendingTransactionsSubscription: + var hashes []common.Hash + hashes, f.offset = api.events.TxStream().ReadAllNonBlocking(f.offset) return returnHashes(hashes), nil - case filters.LogsSubscription, filters.MinedAndPendingLogsSubscription: - logs := make([]*ethtypes.Log, len(f.logs)) - copy(logs, f.logs) - f.logs = []*ethtypes.Log{} + case filters.BlocksSubscription: + var headers []stream.RPCHeader + headers, f.offset = api.events.HeaderStream().ReadAllNonBlocking(f.offset) + hashes := make([]common.Hash, len(headers)) + for i, header := range headers { + hashes[i] = header.Hash + } + return hashes, nil + case filters.LogsSubscription: + var ( + logs []*ethtypes.Log + chunk []*ethtypes.Log + ) + for { + chunk, f.offset = api.events.LogStream().ReadNonBlocking(f.offset) + if len(chunk) == 0 { + break + } + chunk = FilterLogs(chunk, f.crit.FromBlock, f.crit.ToBlock, f.crit.Addresses, f.crit.Topics) + logs = append(logs, chunk...) + } return returnLogs(logs), nil default: return nil, fmt.Errorf("invalid filter %s type %d", id, f.typ) diff --git a/rpc/namespaces/ethereum/eth/filters/filter_system.go b/rpc/namespaces/ethereum/eth/filters/filter_system.go index 7f2751ed..e9c3840c 100644 --- a/rpc/namespaces/ethereum/eth/filters/filter_system.go +++ b/rpc/namespaces/ethereum/eth/filters/filter_system.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" + "cosmossdk.io/log" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmquery "github.com/cometbft/cometbft/libs/pubsub/query" coretypes "github.com/cometbft/cometbft/rpc/core/types" rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" @@ -43,7 +43,7 @@ import ( var ( txEvents = tmtypes.QueryForEvent(tmtypes.EventTx).String() - evmEvents = tmquery.MustParse(fmt.Sprintf("%s='%s' AND %s.%s='%s'", + evmEvents = tmquery.MustCompile(fmt.Sprintf("%s='%s' AND %s.%s='%s'", tmtypes.EventTypeKey, tmtypes.EventTx, sdk.EventTypeMessage, diff --git a/rpc/namespaces/ethereum/eth/filters/filters.go b/rpc/namespaces/ethereum/eth/filters/filters.go index 3a086d0b..4eb8a825 100644 --- a/rpc/namespaces/ethereum/eth/filters/filters.go +++ b/rpc/namespaces/ethereum/eth/filters/filters.go @@ -24,7 +24,7 @@ import ( "swisstronik/rpc/backend" "swisstronik/rpc/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/pkg/errors" diff --git a/rpc/namespaces/ethereum/miner/api.go b/rpc/namespaces/ethereum/miner/api.go index 40da024f..3fcea093 100644 --- a/rpc/namespaces/ethereum/miner/api.go +++ b/rpc/namespaces/ethereum/miner/api.go @@ -21,7 +21,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "swisstronik/rpc/backend" ) diff --git a/rpc/namespaces/ethereum/net/api.go b/rpc/namespaces/ethereum/net/api.go index 99f730fb..4e944ed0 100644 --- a/rpc/namespaces/ethereum/net/api.go +++ b/rpc/namespaces/ethereum/net/api.go @@ -19,7 +19,7 @@ import ( "context" "fmt" - ethermint "swisstronik/types" + swisstroniktypes "swisstronik/types" rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/cosmos/cosmos-sdk/client" @@ -34,7 +34,7 @@ type PublicAPI struct { // NewPublicAPI creates an instance of the public Net Web3 API. func NewPublicAPI(clientCtx client.Context) *PublicAPI { // parse the chainID from a integer string - chainIDEpoch, err := ethermint.ParseChainID(clientCtx.ChainID) + chainIDEpoch, err := swisstroniktypes.ParseChainID(clientCtx.ChainID) if err != nil { panic(err) } diff --git a/rpc/namespaces/ethereum/personal/api.go b/rpc/namespaces/ethereum/personal/api.go index 040776ab..1bc6acfb 100644 --- a/rpc/namespaces/ethereum/personal/api.go +++ b/rpc/namespaces/ethereum/personal/api.go @@ -24,9 +24,8 @@ import ( "swisstronik/rpc/backend" "swisstronik/crypto/hd" - ethermint "swisstronik/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" @@ -36,6 +35,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" + swisstroniktypes "swisstronik/types" evmtypes "swisstronik/x/evm/types" ) @@ -43,7 +43,7 @@ import ( type PrivateAccountAPI struct { backend backend.EVMBackend logger log.Logger - hdPathIter ethermint.HDPathIterator + hdPathIter swisstroniktypes.HDPathIterator } // NewAPI creates an instance of the public Personal Eth API. @@ -54,7 +54,7 @@ func NewAPI( cfg := sdk.GetConfig() basePath := cfg.GetFullBIP44Path() - iterator, err := ethermint.NewHDPathIterator(basePath, true) + iterator, err := swisstroniktypes.NewHDPathIterator(basePath, true) if err != nil { panic(err) } diff --git a/rpc/namespaces/ethereum/txpool/api.go b/rpc/namespaces/ethereum/txpool/api.go index 59ea9806..b93b1ca3 100644 --- a/rpc/namespaces/ethereum/txpool/api.go +++ b/rpc/namespaces/ethereum/txpool/api.go @@ -16,7 +16,7 @@ package txpool import ( - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/rpc/stream/cond.go b/rpc/stream/cond.go new file mode 100644 index 00000000..8f629907 --- /dev/null +++ b/rpc/stream/cond.go @@ -0,0 +1,37 @@ +package stream + +import ( + "context" + "sync" +) + +// Cond implements conditional variable with a channel +type Cond struct { + mu sync.Mutex // guards ch + ch chan struct{} +} + +func NewCond() *Cond { + return &Cond{ch: make(chan struct{})} +} + +// Wait returns true if the condition is signaled, false if the context is canceled +func (c *Cond) Wait(ctx context.Context) bool { + c.mu.Lock() + ch := c.ch + c.mu.Unlock() + + select { + case <-ch: + return true + case <-ctx.Done(): + return false + } +} + +func (c *Cond) Broadcast() { + c.mu.Lock() + defer c.mu.Unlock() + close(c.ch) + c.ch = make(chan struct{}) +} diff --git a/rpc/stream/queue.go b/rpc/stream/queue.go new file mode 100644 index 00000000..abfe08d1 --- /dev/null +++ b/rpc/stream/queue.go @@ -0,0 +1,152 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Evan Huus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/* +Package queue provides a fast, ring-buffer queue based on the version suggested by Dariusz Górecki. +Using this instead of other, simpler, queue implementations (slice+append or linked list) provides +substantial memory and time benefits, and fewer GC pauses. + +The queue implemented here is as fast as it is for an additional reason: it is *not* thread-safe. +*/ + +package stream + +// minQueueLen is smallest capacity that queue may have. +// Must be power of 2 for bitwise modulus: x % n == x & (n - 1). +const minQueueLen = 16 + +// Queue represents a single instance of the queue data structure. +type Queue[V any] struct { + buf []V + head, tail, count int +} + +// New constructs and returns a new Queue. +func New[V any]() *Queue[V] { + return &Queue[V]{ + buf: make([]V, minQueueLen), + } +} + +// Length returns the number of elements currently stored in the queue. +func (q *Queue[V]) Length() int { + return q.count +} + +// resizes the queue to fit exactly twice its current contents +// this can result in shrinking if the queue is less than half-full +func (q *Queue[V]) resize() { + newBuf := make([]V, q.count<<1) + + if q.tail > q.head { + copy(newBuf, q.buf[q.head:q.tail]) + } else { + n := copy(newBuf, q.buf[q.head:]) + copy(newBuf[n:], q.buf[:q.tail]) + } + + q.head = 0 + q.tail = q.count + q.buf = newBuf +} + +// Add puts an element on the end of the queue. +func (q *Queue[V]) Add(elem V) { + if q.count == len(q.buf) { + q.resize() + } + + q.buf[q.tail] = elem + // bitwise modulus + q.tail = (q.tail + 1) & (len(q.buf) - 1) + q.count++ +} + +// Peek returns the element at the head of the queue. This call panics +// if the queue is empty. +func (q *Queue[V]) Peek() V { + return *q.PeekP() +} + +// PeekP returns the element at the head of the queue. This call panics +// if the queue is empty. +func (q *Queue[V]) PeekP() *V { + if q.count <= 0 { + panic("queue: Peek() called on empty queue") + } + return &q.buf[q.head] +} + +// Tail returns the element at the tail of the queue. This call panics +// if the queue is empty. +func (q *Queue[V]) Tail() V { + return *q.TailP() +} + +// TailP returns the element at the tail of the queue. This call panics +// if the queue is empty. +func (q *Queue[V]) TailP() *V { + return q.GetP(-1) +} + +// Get returns the element at index i in the queue. If the index is +// invalid, the call will panic. This method accepts both positive and +// negative index values. Index 0 refers to the first element, and +// index -1 refers to the last. +func (q *Queue[V]) Get(i int) V { + return *q.GetP(i) +} + +// GetP returns the pointer to the element at index i in the queue. If the index is +// invalid, the call will panic. This method accepts both positive and +// negative index values. Index 0 refers to the first element, and +// index -1 refers to the last. +func (q *Queue[V]) GetP(i int) *V { + // If indexing backwards, convert to positive index. + if i < 0 { + i += q.count + } + if i < 0 || i >= q.count { + panic("queue: Get() called with index out of range") + } + // bitwise modulus + return &q.buf[(q.head+i)&(len(q.buf)-1)] +} + +// Remove removes and returns the element from the front of the queue. If the +// queue is empty, the call will panic. +func (q *Queue[V]) Remove() V { + if q.count <= 0 { + panic("queue: Remove() called on empty queue") + } + ret := q.buf[q.head] + // bitwise modulus + q.head = (q.head + 1) & (len(q.buf) - 1) + q.count-- + // Resize down if buffer 1/4 full. + if len(q.buf) > minQueueLen && (q.count<<2) == len(q.buf) { + q.resize() + } + return ret +} diff --git a/rpc/stream/queue_test.go b/rpc/stream/queue_test.go new file mode 100644 index 00000000..d31d3b54 --- /dev/null +++ b/rpc/stream/queue_test.go @@ -0,0 +1,203 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Evan Huus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package stream + +import "testing" + +func TestQueueSimple(t *testing.T) { + q := New[int]() + + for i := 0; i < minQueueLen; i++ { + q.Add(i) + } + for i := 0; i < minQueueLen; i++ { + if q.Peek() != i { + t.Error("peek", i, "had value", q.Peek()) + } + x := q.Remove() + if x != i { + t.Error("remove", i, "had value", x) + } + } +} + +func TestQueueWrapping(t *testing.T) { + q := New[int]() + + for i := 0; i < minQueueLen; i++ { + q.Add(i) + } + for i := 0; i < 3; i++ { + q.Remove() + q.Add(minQueueLen + i) + } + + for i := 0; i < minQueueLen; i++ { + if q.Peek() != i+3 { + t.Error("peek", i, "had value", q.Peek()) + } + q.Remove() + } +} + +func TestQueueLength(t *testing.T) { + q := New[int]() + + if q.Length() != 0 { + t.Error("empty queue length not 0") + } + + for i := 0; i < 1000; i++ { + q.Add(i) + if q.Length() != i+1 { + t.Error("adding: queue with", i, "elements has length", q.Length()) + } + } + for i := 0; i < 1000; i++ { + q.Remove() + if q.Length() != 1000-i-1 { + t.Error("removing: queue with", 1000-i-i, "elements has length", q.Length()) + } + } +} + +func TestQueueGet(t *testing.T) { + q := New[int]() + + for i := 0; i < 1000; i++ { + q.Add(i) + for j := 0; j < q.Length(); j++ { + if q.Get(j) != j { + t.Errorf("index %d doesn't contain %d", j, j) + } + } + } +} + +func TestQueueGetNegative(t *testing.T) { + q := New[int]() + + for i := 0; i < 1000; i++ { + q.Add(i) + for j := 1; j <= q.Length(); j++ { + if q.Get(-j) != q.Length()-j { + t.Errorf("index %d doesn't contain %d", -j, q.Length()-j) + } + } + } +} + +func TestQueueGetOutOfRangePanics(t *testing.T) { + q := New[int]() + + q.Add(1) + q.Add(2) + q.Add(3) + + assertPanics(t, "should panic when negative index", func() { + q.Get(-4) + }) + + assertPanics(t, "should panic when index greater than length", func() { + q.Get(4) + }) +} + +func TestQueuePeekOutOfRangePanics(t *testing.T) { + q := New[any]() + + assertPanics(t, "should panic when peeking empty queue", func() { + q.Peek() + }) + + q.Add(1) + q.Remove() + + assertPanics(t, "should panic when peeking emptied queue", func() { + q.Peek() + }) +} + +func TestQueueRemoveOutOfRangePanics(t *testing.T) { + q := New[int]() + + assertPanics(t, "should panic when removing empty queue", func() { + q.Remove() + }) + + q.Add(1) + q.Remove() + + assertPanics(t, "should panic when removing emptied queue", func() { + q.Remove() + }) +} + +func assertPanics(t *testing.T, name string, f func()) { + defer func() { + if r := recover(); r == nil { + t.Errorf("%s: didn't panic as expected", name) + } + }() + + f() +} + +// WARNING: Go's benchmark utility (go test -bench .) increases the number of +// iterations until the benchmarks take a reasonable amount of time to run; memory usage +// is *NOT* considered. On a fast CPU, these benchmarks can fill hundreds of GB of memory +// (and then hang when they start to swap). You can manually control the number of iterations +// with the `-benchtime` argument. Passing `-benchtime 1000000x` seems to be about right. + +func BenchmarkQueueSerial(b *testing.B) { + q := New[any]() + for i := 0; i < b.N; i++ { + q.Add(nil) + } + for i := 0; i < b.N; i++ { + q.Peek() + q.Remove() + } +} + +func BenchmarkQueueGet(b *testing.B) { + q := New[int]() + for i := 0; i < b.N; i++ { + q.Add(i) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + q.Get(i) + } +} + +func BenchmarkQueueTickTock(b *testing.B) { + q := New[any]() + for i := 0; i < b.N; i++ { + q.Add(nil) + q.Peek() + q.Remove() + } +} diff --git a/rpc/stream/rpc.go b/rpc/stream/rpc.go new file mode 100644 index 00000000..211b49f6 --- /dev/null +++ b/rpc/stream/rpc.go @@ -0,0 +1,211 @@ +package stream + +import ( + "context" + "fmt" + "sync" + + "swisstronik/rpc/types" + evmtypes "swisstronik/x/evm/types" + + "cosmossdk.io/log" + cmtquery "github.com/cometbft/cometbft/libs/pubsub/query" + rpcclient "github.com/cometbft/cometbft/rpc/client" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + tmtypes "github.com/cometbft/cometbft/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +const ( + streamSubscriberName = "swisstronik-json-rpc" + subscribBufferSize = 1024 + + headerStreamSegmentSize = 128 + headerStreamCapacity = 128 * 32 + txStreamSegmentSize = 1024 + txStreamCapacity = 1024 * 32 + logStreamSegmentSize = 2048 + logStreamCapacity = 2048 * 32 +) + +var ( + txEvents = tmtypes.QueryForEvent(tmtypes.EventTx).String() + evmEvents = cmtquery.MustCompile(fmt.Sprintf("%s='%s' AND %s.%s='%s'", + tmtypes.EventTypeKey, + tmtypes.EventTx, + sdk.EventTypeMessage, + sdk.AttributeKeyModule, evmtypes.ModuleName)).String() + blockEvents = tmtypes.QueryForEvent(tmtypes.EventNewBlock).String() + evmTxHashKey = fmt.Sprintf("%s.%s", evmtypes.TypeMsgEthereumTx, evmtypes.AttributeKeyEthereumTxHash) +) + +type RPCHeader struct { + EthHeader *ethtypes.Header + Hash common.Hash +} + +// RPCStream provides data streams for newHeads, logs, and pendingTransactions. +type RPCStream struct { + evtClient rpcclient.EventsClient + logger log.Logger + txDecoder sdk.TxDecoder + + headerStream *Stream[RPCHeader] + txStream *Stream[common.Hash] + logStream *Stream[*ethtypes.Log] + + wg sync.WaitGroup +} + +func NewRPCStreams(evtClient rpcclient.EventsClient, logger log.Logger, txDecoder sdk.TxDecoder) (*RPCStream, error) { + s := &RPCStream{ + evtClient: evtClient, + logger: logger, + txDecoder: txDecoder, + + headerStream: NewStream[RPCHeader](headerStreamSegmentSize, headerStreamCapacity), + txStream: NewStream[common.Hash](txStreamSegmentSize, txStreamCapacity), + logStream: NewStream[*ethtypes.Log](logStreamSegmentSize, logStreamCapacity), + } + + ctx := context.Background() + + chBlocks, err := s.evtClient.Subscribe(ctx, streamSubscriberName, blockEvents, subscribBufferSize) + if err != nil { + return nil, err + } + + chTx, err := s.evtClient.Subscribe(ctx, streamSubscriberName, txEvents, subscribBufferSize) + if err != nil { + if err := s.evtClient.UnsubscribeAll(ctx, streamSubscriberName); err != nil { + s.logger.Error("failed to unsubscribe", "err", err) + } + return nil, err + } + + chLogs, err := s.evtClient.Subscribe(ctx, streamSubscriberName, evmEvents, subscribBufferSize) + if err != nil { + if err := s.evtClient.UnsubscribeAll(context.Background(), streamSubscriberName); err != nil { + s.logger.Error("failed to unsubscribe", "err", err) + } + return nil, err + } + + go s.start(&s.wg, chBlocks, chTx, chLogs) + + return s, nil +} + +func (s *RPCStream) Close() error { + if err := s.evtClient.UnsubscribeAll(context.Background(), streamSubscriberName); err != nil { + return err + } + s.wg.Wait() + return nil +} + +func (s *RPCStream) HeaderStream() *Stream[RPCHeader] { + return s.headerStream +} + +func (s *RPCStream) TxStream() *Stream[common.Hash] { + return s.txStream +} + +func (s *RPCStream) LogStream() *Stream[*ethtypes.Log] { + return s.logStream +} + +func (s *RPCStream) start( + wg *sync.WaitGroup, + chBlocks <-chan coretypes.ResultEvent, + chTx <-chan coretypes.ResultEvent, + chLogs <-chan coretypes.ResultEvent, +) { + wg.Add(1) + defer func() { + wg.Done() + if err := s.evtClient.UnsubscribeAll(context.Background(), streamSubscriberName); err != nil { + s.logger.Error("failed to unsubscribe", "err", err) + } + }() + + for { + select { + case ev, ok := <-chBlocks: + if !ok { + chBlocks = nil + break + } + + data, ok := ev.Data.(tmtypes.EventDataNewBlock) + if !ok { + s.logger.Error("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) + continue + } + + baseFee := types.BaseFeeFromEvents(data.ResultFinalizeBlock.Events) + + // TODO: fetch bloom from events + header := types.EthHeaderFromTendermint(data.Block.Header, ethtypes.Bloom{}, baseFee) + s.headerStream.Add(RPCHeader{EthHeader: header, Hash: common.BytesToHash(data.Block.Header.Hash())}) + case ev, ok := <-chTx: + if !ok { + chTx = nil + break + } + + data, ok := ev.Data.(tmtypes.EventDataTx) + if !ok { + s.logger.Error("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) + continue + } + + tx, err := s.txDecoder(data.Tx) + if err != nil { + s.logger.Error("fail to decode tx", "error", err.Error()) + continue + } + + var hashes []common.Hash + for _, msg := range tx.GetMsgs() { + if ethTx, ok := msg.(*evmtypes.MsgHandleTx); ok { + hashes = append(hashes, ethTx.AsTransaction().Hash()) + } + } + s.txStream.Add(hashes...) + case ev, ok := <-chLogs: + if !ok { + chLogs = nil + break + } + + if _, ok := ev.Events[evmTxHashKey]; !ok { + // ignore transaction as it's not from the evm module + continue + } + + // get transaction result data + dataTx, ok := ev.Data.(tmtypes.EventDataTx) + if !ok { + s.logger.Error("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) + continue + } + txLogs, err := evmtypes.DecodeTransactionLogs(dataTx.TxResult.Result.Data) + if err != nil { + s.logger.Error("fail to decode evm tx response", "error", err.Error()) + continue + } + + // Convert swistronik type tranasction log into ethereum tx log + ethTxLogs := evmtypes.ConvertLogToEthereumType(txLogs) + s.logStream.Add(ethTxLogs...) + } + + if chBlocks == nil && chTx == nil && chLogs == nil { + break + } + } +} diff --git a/rpc/stream/stream.go b/rpc/stream/stream.go new file mode 100644 index 00000000..794bcb2d --- /dev/null +++ b/rpc/stream/stream.go @@ -0,0 +1,187 @@ +package stream + +import ( + "context" + "sync" +) + +// Stream implements a data stream, user can subscribe the stream in blocking or non-blocking way using offsets. +// it use a segmented ring buffer to store the items, with a fixed capacity, when buffer is full, the old data get pruned when new data comes. +type Stream[V any] struct { + segments *Queue[[]V] + segmentSize int + maxSegments int + segmentOffset int + cond *Cond + mutex sync.RWMutex +} + +func NewStream[V any](segmentSize, capacity int) *Stream[V] { + maxSegments := (capacity + segmentSize - 1) / segmentSize + if maxSegments < 1 { + panic("capacity is too small") + } + + stream := &Stream[V]{ + segments: New[[]V](), + segmentSize: segmentSize, + maxSegments: maxSegments, + segmentOffset: 0, + cond: NewCond(), + } + return stream +} + +// Add appends items to the stream and returns the id of last one. +// item id start with 1. +func (s *Stream[V]) Add(vs ...V) int { + if len(vs) == 0 { + return 0 + } + + s.mutex.Lock() + defer s.mutex.Unlock() + + for _, v := range vs { + if s.segments.Length() == 0 || len(s.segments.Tail()) == s.segmentSize { + var seg []V + if s.segments.Length() > s.maxSegments { + // reuse the free segment + seg = s.segments.Remove()[:0] + s.segmentOffset++ + } else { + seg = make([]V, 0, s.segmentSize) + } + s.segments.Add(seg) + } + + tail := s.segments.TailP() + *tail = append(*tail, v) + } + + // notify the subscribers + s.cond.Broadcast() + + return s.lastID() +} + +// Subscribe subscribes the stream in a loop, pass the chunks of items to the callback, +// it only stops if the context is canceled. +// it returns the last id of the items. +func (s *Stream[V]) Subscribe(ctx context.Context, callback func([]V, int) error) error { + var ( + items []V + offset = -1 + ) + for { + items, offset = s.ReadBlocking(ctx, offset) + if len(items) == 0 { + // canceled + break + } + if err := callback(items, offset); err != nil { + return err + } + } + return nil +} + +// ReadNonBlocking returns items with id greater than the last received id reported by user, without blocking. +// if there are no new items, it also returns the largest id of the items. +func (s *Stream[V]) ReadNonBlocking(offset int) ([]V, int) { + s.mutex.RLock() + defer s.mutex.RUnlock() + + return s.doRead(offset) +} + +// ReadAllNonBlocking returns all items in the stream, without blocking. +func (s *Stream[V]) ReadAllNonBlocking(offset int) ([]V, int) { + s.mutex.RLock() + defer s.mutex.RUnlock() + + var ( + result []V + items []V + ) + for { + items, offset = s.doRead(offset) + if len(items) == 0 { + break + } + result = append(result, items...) + } + + return result, offset +} + +// ReadBlocking returns items with id greater than the last received id reported by user. +// reads at most one segment at a time. +// negative offset means read from the end. +// it also returns the largest id of the items, if there are no new items, returns the id of the last item. +func (s *Stream[V]) ReadBlocking(ctx context.Context, offset int) ([]V, int) { + s.mutex.RLock() + defer s.mutex.RUnlock() + + var items []V + for { + items, offset = s.doRead(offset) + if len(items) > 0 { + return items, offset + } + + s.mutex.RUnlock() + r := s.cond.Wait(ctx) + s.mutex.RLock() + + if !r { + // context canceled + return nil, 0 + } + } +} + +// lastID returns the id of the last item, 0 for empty stream. +func (s *Stream[V]) lastID() int { + if s.segments.Length() == 0 { + return 0 + } + + return (s.segmentOffset+s.segments.Length()-1)*s.segmentSize + len(s.segments.Tail()) +} + +// doRead is the underlying logic of Read. +func (s *Stream[V]) doRead(offset int) ([]V, int) { + if s.segments.Length() == 0 { + return nil, s.lastID() + } + + if offset < 0 { + return nil, s.lastID() + } + + segment := offset / s.segmentSize + if segment >= s.segmentOffset { + segment -= s.segmentOffset + } else { + // the target segment is pruned, ajust to earliest segment + segment = 0 + } + + if segment >= s.segments.Length() { + // offset is in the future + return nil, s.lastID() + } + + seg := s.segments.Get(segment) + items := seg[offset%s.segmentSize:] + if len(items) == 0 { + return nil, s.lastID() + } + + // copy the slice + clone := make([]V, len(items)) + copy(clone, items) + + return clone, (s.segmentOffset+segment)*s.segmentSize + len(seg) +} diff --git a/rpc/stream/stream_test.go b/rpc/stream/stream_test.go new file mode 100644 index 00000000..c86df358 --- /dev/null +++ b/rpc/stream/stream_test.go @@ -0,0 +1,120 @@ +package stream + +import ( + "context" + "fmt" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestStreamAdd(t *testing.T) { + testCases := []struct { + segmentSize, capacity int + }{ + {128, 1280}, + {1024, 2048}, + {1024, 2148}, + {1024, 1024}, + {2048, 100}, + } + + for _, tc := range testCases { + name := fmt.Sprintf("segmentSize=%d,capacity=%d", tc.segmentSize, tc.capacity) + t.Run(name, func(t *testing.T) { + stream := NewStream[int](tc.segmentSize, tc.capacity) + + amount := 100000 + for i := 0; i < amount; i++ { + require.Equal(t, i+1, stream.Add(i)) + } + + all, _ := stream.ReadAllNonBlocking(0) + maxSegments := (tc.capacity + tc.segmentSize - 1) / tc.segmentSize + require.Equal(t, maxSegments*tc.segmentSize+amount%tc.segmentSize, len(all)) + require.Equal(t, 100000-1, all[len(all)-1]) + for i, n := range all[:len(all)-1] { + require.Equal(t, n+1, all[i+1]) + } + }) + } +} + +func TestStreamReadNonBlocking(t *testing.T) { + stream := NewStream[int](16, 31) + + for i := 0; i < 32; i++ { + require.Equal(t, i+1, stream.Add(i)) + } + + items, offset := stream.ReadNonBlocking(0) + require.Equal(t, []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, items) + require.Equal(t, 16, offset) +} + +func TestStreamReadBlocking(t *testing.T) { + stream := NewStream[int](16, 31) + + wg := sync.WaitGroup{} + + ctx, cancel := context.WithCancel(context.Background()) + + // subscriber + subscribers := 10 + result := make([][]int, subscribers) + for i := 0; i < 10; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + + require.NoError(t, stream.Subscribe(ctx, func(items []int, offset int) error { + result[i] = append(result[i], items...) + return nil + })) + }(i) + } + + // wait for subscribers to setup + time.Sleep(100 * time.Millisecond) + + // publisher + for i := 0; i < 32; i++ { + require.Equal(t, i+1, stream.Add(i)) + } + + // wait for subscribers to finish + time.Sleep(100 * time.Millisecond) + cancel() + wg.Wait() + + // check result + for i := 0; i < subscribers; i++ { + require.Equal(t, 32, len(result[i])) + require.Equal(t, 31, result[i][len(result[i])-1]) + for j, n := range result[i][:len(result[i])-1] { + require.Equal(t, n+1, result[i][j+1]) + } + } +} + +func TestStreamReadFromEnd(t *testing.T) { + stream := NewStream[int](16, 31) + + items, offset := stream.ReadNonBlocking(-1) + require.Empty(t, items) + require.Equal(t, 0, offset) + + stream.Add(1) + + items, offset = stream.ReadNonBlocking(-1) + require.Empty(t, items) + require.Equal(t, 1, offset) + + stream.Add(2) + + items, offset = stream.ReadNonBlocking(offset) + require.Equal(t, []int{2}, items) + require.Equal(t, 2, offset) +} diff --git a/rpc/types/block.go b/rpc/types/block.go index 11a4255a..30025dd9 100644 --- a/rpc/types/block.go +++ b/rpc/types/block.go @@ -30,9 +30,9 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" + swisstroniktypes "swisstronik/types" - ethermint "swisstronik/types" + grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) // BlockNumber represents decoding hex string to block values @@ -198,7 +198,7 @@ func (bnh *BlockNumberOrHash) decodeFromString(input string) error { return err } - bnInt, err := ethermint.SafeInt64(blockNumber) + bnInt, err := swisstroniktypes.SafeInt64(blockNumber) if err != nil { return err } diff --git a/rpc/types/events.go b/rpc/types/events.go index 18594977..f2651b69 100644 --- a/rpc/types/events.go +++ b/rpc/types/events.go @@ -19,9 +19,10 @@ import ( "fmt" "strconv" - ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" + swisstroniktypes "swisstronik/types" + abci "github.com/cometbft/cometbft/abci/types" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -90,7 +91,7 @@ type ParsedTxs struct { // ParseTxResult parse eth tx infos from cosmos-sdk events. // It supports two event formats, the formats are described in the comments of the format constants. -func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error) { +func ParseTxResult(result *abci.ExecTxResult, tx sdk.Tx) (*ParsedTxs, error) { format := eventFormatUnknown // the index of current ethereum_tx event in format 1 or the second part of format 2 eventIndex := -1 @@ -153,7 +154,7 @@ func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error } // ParseTxIndexerResult parse tm tx result to a format compatible with the custom tx indexer. -func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func(*ParsedTxs) *ParsedTx) (*ethermint.TxResult, error) { +func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func(*ParsedTxs) *ParsedTx) (*swisstroniktypes.TxResult, error) { txs, err := ParseTxResult(&txResult.TxResult, tx) if err != nil { return nil, fmt.Errorf("failed to parse tx events: block %d, index %d, %v", txResult.Height, txResult.Index, err) @@ -164,7 +165,7 @@ func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func( return nil, fmt.Errorf("ethereum tx not found in msgs: block %d, index %d", txResult.Height, txResult.Index) } - return ðermint.TxResult{ + return &swisstroniktypes.TxResult{ Height: txResult.Height, TxIndex: txResult.Index, MsgIndex: uint32(parsedTx.MsgIndex), diff --git a/rpc/types/events_test.go b/rpc/types/events_test.go index 5a90b01b..fb6c9372 100644 --- a/rpc/types/events_test.go +++ b/rpc/types/events_test.go @@ -18,12 +18,12 @@ func TestParseTxResult(t *testing.T) { testCases := []struct { name string - response abci.ResponseDeliverTx + response abci.ExecTxResult expTxs []*ParsedTx // expected parse result, nil means expect error. }{ { "format 1 events", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: "coin_received", Attributes: []abci.EventAttribute{ @@ -79,7 +79,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 2 events", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: "coin_received", Attributes: []abci.EventAttribute{ @@ -122,7 +122,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 1 events, failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ @@ -149,7 +149,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 1 events, failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ @@ -176,7 +176,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 2 events failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ @@ -195,7 +195,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 2 events failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 7fa5f624..1aaf4dd5 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -275,12 +275,12 @@ func CheckTxFee(gasPrice *big.Int, gas uint64, cap float64) error { } // TxExceedBlockGasLimit returns true if the tx exceeds block gas limit. -func TxExceedBlockGasLimit(res *abci.ResponseDeliverTx) bool { +func TxExceedBlockGasLimit(res *abci.ExecTxResult) bool { return strings.Contains(res.Log, ExceedBlockGasLimitError) } // TxSuccessOrExceedsBlockGasLimit returnsrue if the transaction was successful // or if it failed with an ExceedBlockGasLimit error -func TxSuccessOrExceedsBlockGasLimit(res *abci.ResponseDeliverTx) bool { +func TxSuccessOrExceedsBlockGasLimit(res *abci.ExecTxResult) bool { return res.Code == 0 || TxExceedBlockGasLimit(res) } diff --git a/rpc/websockets.go b/rpc/websockets.go index e69421af..265f7e4e 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -12,7 +12,7 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package rpc import ( @@ -24,6 +24,7 @@ import ( "math/big" "net" "net/http" + "strconv" "sync" "github.com/cosmos/cosmos-sdk/client" @@ -34,18 +35,13 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "github.com/cometbft/cometbft/libs/log" - rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" - tmtypes "github.com/cometbft/cometbft/types" + "cosmossdk.io/log" - "swisstronik/rpc/ethereum/pubsub" rpcfilters "swisstronik/rpc/namespaces/ethereum/eth/filters" - "swisstronik/rpc/types" + "swisstronik/rpc/stream" "swisstronik/server/config" - evmtypes "swisstronik/x/evm/types" ) type WebsocketsServer interface { @@ -89,7 +85,7 @@ type websocketsServer struct { logger log.Logger } -func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, tmWSClient *rpcclient.WSClient, cfg *config.Config) WebsocketsServer { +func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, stream *stream.RPCStream, cfg *config.Config) WebsocketsServer { logger = logger.With("api", "websocket-server") _, port, _ := net.SplitHostPort(cfg.JSONRPC.Address) @@ -98,7 +94,7 @@ func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, tmWSClient wsAddr: cfg.JSONRPC.WsAddress, certFile: cfg.TLS.CertificatePath, keyFile: cfg.TLS.KeyPath, - api: newPubSubAPI(clientCtx, logger, tmWSClient), + api: newPubSubAPI(clientCtx, logger, stream), logger: logger, } } @@ -109,13 +105,11 @@ func (s *websocketsServer) Start() { go func() { var err error - /* #nosec G114 -- http functions have no support for timeouts */ if s.certFile == "" || s.keyFile == "" { - err = http.ListenAndServe(s.wsAddr, ws) + err = http.ListenAndServe(s.wsAddr, ws) // #nosec G114 -- http functions have no support for timeouts } else { - err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws) + err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws) // #nosec G114 -- http functions have no support for timeouts } - if err != nil { if err == http.ErrServerClosed { return @@ -128,7 +122,7 @@ func (s *websocketsServer) Start() { func (s *websocketsServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { upgrader := websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { + CheckOrigin: func(_ *http.Request) bool { return true }, } @@ -185,7 +179,7 @@ func (w *wsConn) ReadMessage() (messageType int, p []byte, err error) { func (s *websocketsServer) readLoop(wsConn *wsConn) { // subscriptions of current connection - subscriptions := make(map[rpc.ID]pubsub.UnsubscribeFunc) + subscriptions := make(map[rpc.ID]context.CancelFunc) defer func() { // cancel all subscriptions when connection closed for _, unsubFn := range subscriptions { @@ -225,8 +219,16 @@ func (s *websocketsServer) readLoop(wsConn *wsConn) { continue } - connID, ok := msg["id"].(float64) - if !ok { + var connID float64 + switch id := msg["id"].(type) { + case string: + connID, err = strconv.ParseFloat(id, 64) + case float64: + connID = id + default: + err = fmt.Errorf("unknown type") + } + if err != nil { s.sendErrResponse( wsConn, fmt.Errorf("invalid type for connection ID: %T", msg["id"]).Error(), @@ -256,7 +258,7 @@ func (s *websocketsServer) readLoop(wsConn *wsConn) { } if err := wsConn.WriteJSON(res); err != nil { - break + continue } case "eth_unsubscribe": params, ok := s.getParamsAndCheckValid(msg, wsConn) @@ -284,7 +286,7 @@ func (s *websocketsServer) readLoop(wsConn *wsConn) { } if err := wsConn.WriteJSON(res); err != nil { - break + continue } default: // otherwise, call the usual rpc server to respond @@ -344,22 +346,22 @@ func (s *websocketsServer) tcpGetAndSendResponse(wsConn *wsConn, mb []byte) erro // pubSubAPI is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec type pubSubAPI struct { - events *rpcfilters.EventSystem + events *stream.RPCStream logger log.Logger clientCtx client.Context } // newPubSubAPI creates an instance of the ethereum PubSub API. -func newPubSubAPI(clientCtx client.Context, logger log.Logger, tmWSClient *rpcclient.WSClient) *pubSubAPI { +func newPubSubAPI(clientCtx client.Context, logger log.Logger, stream *stream.RPCStream) *pubSubAPI { logger = logger.With("module", "websocket-client") return &pubSubAPI{ - events: rpcfilters.NewEventSystem(logger, tmWSClient), + events: stream, logger: logger, clientCtx: clientCtx, } } -func (api *pubSubAPI) subscribe(wsConn *wsConn, subID rpc.ID, params []interface{}) (pubsub.UnsubscribeFunc, error) { +func (api *pubSubAPI) subscribe(wsConn *wsConn, subID rpc.ID, params []interface{}) (context.CancelFunc, error) { method, ok := params[0].(string) if !ok { return nil, errors.New("invalid parameters") @@ -383,63 +385,36 @@ func (api *pubSubAPI) subscribe(wsConn *wsConn, subID rpc.ID, params []interface } } -func (api *pubSubAPI) subscribeNewHeads(wsConn *wsConn, subID rpc.ID) (pubsub.UnsubscribeFunc, error) { - sub, unsubFn, err := api.events.SubscribeNewHeads() - if err != nil { - return nil, errors.Wrap(err, "error creating block filter") - } - - // TODO: use events - baseFee := big.NewInt(params.InitialBaseFee) - - go func() { - headersCh := sub.Event() - errCh := sub.Err() - for { - select { - case event, ok := <-headersCh: - if !ok { - return - } - - data, ok := event.Data.(tmtypes.EventDataNewBlockHeader) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", event.Data)) - continue - } - - header := types.EthHeaderFromTendermint(data.Header, ethtypes.Bloom{}, baseFee) - - // write to ws conn - res := &SubscriptionNotification{ - Jsonrpc: "2.0", - Method: "eth_subscription", - Params: &SubscriptionResult{ - Subscription: subID, - Result: header, - }, - } +func (api *pubSubAPI) subscribeNewHeads(wsConn *wsConn, subID rpc.ID) (context.CancelFunc, error) { + ctx, cancel := context.WithCancel(context.Background()) + //nolint: errcheck + go api.events.HeaderStream().Subscribe(ctx, func(headers []stream.RPCHeader, _ int) error { + for _, header := range headers { + // write to ws conn + res := &SubscriptionNotification{ + Jsonrpc: "2.0", + Method: "eth_subscription", + Params: &SubscriptionResult{ + Subscription: subID, + Result: header.EthHeader, + }, + } - err = wsConn.WriteJSON(res) - if err != nil { - api.logger.Error("error writing header, will drop peer", "error", err.Error()) + if err := wsConn.WriteJSON(res); err != nil { + api.logger.Error("error writing header, will drop peer", "error", err.Error()) - try(func() { - if err != websocket.ErrCloseSent { - _ = wsConn.Close() - } - }, api.logger, "closing websocket peer sub") - } - case err, ok := <-errCh: - if !ok { - return - } - api.logger.Debug("dropping NewHeads WebSocket subscription", "subscription-id", subID, "error", err.Error()) + try(func() { + if err != websocket.ErrCloseSent { + _ = wsConn.Close() + } + }, api.logger, "closing websocket peer sub") + return err } } - }() + return nil + }) - return unsubFn, nil + return cancel, nil } func try(fn func(), l log.Logger, desc string) { @@ -459,7 +434,7 @@ func try(fn func(), l log.Logger, desc string) { fn() } -func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interface{}) (pubsub.UnsubscribeFunc, error) { +func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interface{}) (context.CancelFunc, error) { crit := filters.FilterCriteria{} if extra != nil { @@ -471,30 +446,20 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac } if params["address"] != nil { - address, isString := params["address"].(string) - addresses, isSlice := params["address"].([]interface{}) - if !isString && !isSlice { - err := errors.New("invalid addresses; must be address or array of addresses") - api.logger.Debug("invalid addresses", "type", fmt.Sprintf("%T", params["address"])) - return nil, err - } - - if ok { + switch address := params["address"].(type) { + case string: crit.Addresses = []common.Address{common.HexToAddress(address)} - } - - if isSlice { - crit.Addresses = []common.Address{} - for _, addr := range addresses { + case []interface{}: + for _, addr := range address { address, ok := addr.(string) if !ok { - err := errors.New("invalid address") - api.logger.Debug("invalid address", "type", fmt.Sprintf("%T", addr)) - return nil, err + return nil, errors.New("invalid address") } crit.Addresses = append(crit.Addresses, common.HexToAddress(address)) } + default: + return nil, errors.New("invalid addresses; must be address or array of addresses") } } @@ -559,129 +524,75 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac } } - sub, unsubFn, err := api.events.SubscribeLogs(crit) - if err != nil { - api.logger.Error("failed to subscribe logs", "error", err.Error()) - return nil, err - } - - go func() { - ch := sub.Event() - errCh := sub.Err() - for { - select { - case event, ok := <-ch: - if !ok { - return - } - - dataTx, ok := event.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", event.Data)) - continue - } - - txResponse, err := evmtypes.DecodeTxResponse(dataTx.TxResult.Result.Data) - if err != nil { - api.logger.Error("failed to decode tx response", "error", err.Error()) - return - } + ctx, cancel := context.WithCancel(context.Background()) + //nolint: errcheck + go api.events.LogStream().Subscribe(ctx, func(txLogs []*ethtypes.Log, _ int) error { + logs := rpcfilters.FilterLogs(txLogs, crit.FromBlock, crit.ToBlock, crit.Addresses, crit.Topics) + if len(logs) == 0 { + return nil + } - logs := rpcfilters.FilterLogs(evmtypes.LogsToEthereum(txResponse.Logs), crit.FromBlock, crit.ToBlock, crit.Addresses, crit.Topics) - if len(logs) == 0 { - continue - } + for _, ethLog := range logs { + res := &SubscriptionNotification{ + Jsonrpc: "2.0", + Method: "eth_subscription", + Params: &SubscriptionResult{ + Subscription: subID, + Result: ethLog, + }, + } - for _, ethLog := range logs { - res := &SubscriptionNotification{ - Jsonrpc: "2.0", - Method: "eth_subscription", - Params: &SubscriptionResult{ - Subscription: subID, - Result: ethLog, - }, + err := wsConn.WriteJSON(res) + if err != nil { + try(func() { + if err != websocket.ErrCloseSent { + _ = wsConn.Close() } + }, api.logger, "closing websocket peer sub") - err = wsConn.WriteJSON(res) - if err != nil { - try(func() { - if err != websocket.ErrCloseSent { - _ = wsConn.Close() - } - }, api.logger, "closing websocket peer sub") - } - } - case err, ok := <-errCh: - if !ok { - return - } - api.logger.Debug("dropping Logs WebSocket subscription", "subscription-id", subID, "error", err.Error()) + return err } } - }() + return nil + }) - return unsubFn, nil + return cancel, nil } -func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn, subID rpc.ID) (pubsub.UnsubscribeFunc, error) { - sub, unsubFn, err := api.events.SubscribePendingTxs() - if err != nil { - return nil, errors.Wrap(err, "error creating block filter: %s") - } - - go func() { - txsCh := sub.Event() - errCh := sub.Err() - for { - select { - case ev := <-txsCh: - data, ok := ev.Data.(tmtypes.EventDataTx) - if !ok { - api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) - continue - } - - ethTxs, err := types.RawTxToEthTx(api.clientCtx, data.Tx) - if err != nil { - // not ethereum tx - continue - } - - for _, ethTx := range ethTxs { - // write to ws conn - res := &SubscriptionNotification{ - Jsonrpc: "2.0", - Method: "eth_subscription", - Params: &SubscriptionResult{ - Subscription: subID, - Result: ethTx.Hash, - }, - } +func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn, subID rpc.ID) (context.CancelFunc, error) { + ctx, cancel := context.WithCancel(context.Background()) + //nolint: errcheck + go api.events.TxStream().Subscribe(ctx, func(items []common.Hash, _ int) error { + for _, hash := range items { + // write to ws conn + res := &SubscriptionNotification{ + Jsonrpc: "2.0", + Method: "eth_subscription", + Params: &SubscriptionResult{ + Subscription: subID, + Result: hash, + }, + } - err = wsConn.WriteJSON(res) - if err != nil { - api.logger.Debug("error writing header, will drop peer", "error", err.Error()) + err := wsConn.WriteJSON(res) + if err != nil { + api.logger.Debug("error writing header, will drop peer", "error", err.Error()) - try(func() { - if err != websocket.ErrCloseSent { - _ = wsConn.Close() - } - }, api.logger, "closing websocket peer sub") + try(func() { + if err != websocket.ErrCloseSent { + _ = wsConn.Close() } - } - case err, ok := <-errCh: - if !ok { - return - } - api.logger.Debug("dropping PendingTransactions WebSocket subscription", subID, "error", err.Error()) + }, api.logger, "closing websocket peer sub") + return err } } - }() + return nil + }) - return unsubFn, nil + return cancel, nil } -func (api *pubSubAPI) subscribeSyncing(wsConn *wsConn, subID rpc.ID) (pubsub.UnsubscribeFunc, error) { +func (api *pubSubAPI) subscribeSyncing(_ *wsConn, _ rpc.ID) (context.CancelFunc, error) { return nil, errors.New("syncing subscription is not implemented") } diff --git a/scripts/genesis-migrate.sh b/scripts/genesis-migrate.sh new file mode 100644 index 00000000..107062b8 --- /dev/null +++ b/scripts/genesis-migrate.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -euo pipefail + +echo "Migrating genesis file" + +GENESIS_FILE="$HOME/.swisstronik/config/genesis.json" +TMP_GENESIS_FILE="./genesis.json" +UPDATES_FILE="./gov_params_change.json" + +gov_params=$(jq '.params' $UPDATES_FILE) + +# Update the fields in the JSON object +updated_json=$(jq ".app_state.gov.params = ${gov_params}" $GENESIS_FILE) + +# Write the updated JSON object to the temp file +echo "$updated_json" > $TMP_GENESIS_FILE +mv $TMP_GENESIS_FILE $GENESIS_FILE \ No newline at end of file diff --git a/scripts/gov_params_change.json b/scripts/gov_params_change.json new file mode 100644 index 00000000..0be7357c --- /dev/null +++ b/scripts/gov_params_change.json @@ -0,0 +1,30 @@ +{ + "params": { + "min_deposit": [ + { + "denom": "uswtr", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s", + "voting_period": "172800s", + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000", + "min_initial_deposit_ratio": "0.000000000000000000", + "proposal_cancel_ratio": "0.500000000000000000", + "proposal_cancel_dest": "", + "expedited_voting_period": "86400s", + "expedited_threshold": "0.667000000000000000", + "expedited_min_deposit": [ + { + "denom": "uswtr", + "amount": "50000000" + } + ], + "burn_vote_quorum": false, + "burn_proposal_deposit_prevote": false, + "burn_vote_veto": true, + "min_deposit_ratio": "0.010000000000000000" + } +} diff --git a/scripts/legacy_genesis_template.json b/scripts/legacy_genesis_template.json new file mode 100644 index 00000000..141aa2a1 --- /dev/null +++ b/scripts/legacy_genesis_template.json @@ -0,0 +1,340 @@ +{ + "genesis_time": "2023-07-11T18:35:36.615463102Z", + "chain_id": "swisstronik_1291-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "10000000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "validators": [], + "app_hash": "", + "app_state": { + "auth": { + "accounts": [], + "params": { + "max_memo_characters": "256", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10" + } + }, + "authz": { + "authorization": [] + }, + "bank": { + "balances": [], + "denom_metadata": [], + "params": { + "default_send_enabled": true, + "send_enabled": [] + }, + "supply": [ + { + "amount": "2034157724464312996149804", + "denom": "uswtr" + } + ] + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "amount": "1000", + "denom": "uswtr" + } + }, + "distribution": { + "delegator_starting_infos": [], + "delegator_withdraw_infos": [], + "fee_pool": { + "community_pool": [] + }, + "outstanding_rewards": [], + "params": { + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "community_tax": "0.020000000000000000", + "withdraw_addr_enabled": true + }, + "previous_proposer": "", + "validator_accumulated_commissions": [], + "validator_current_rewards": [], + "validator_historical_rewards": [], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "evm": { + "accounts": [], + "params": { + "allow_unprotected_txs": false, + "chain_config": { + "arrow_glacier_block": "0", + "berlin_block": "0", + "byzantium_block": "0", + "cancun_block": "0", + "constantinople_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "gray_glacier_block": "0", + "homestead_block": "0", + "istanbul_block": "0", + "london_block": "0", + "merge_netsplit_block": "0", + "muir_glacier_block": "0", + "petersburg_block": "0", + "shanghai_block": "0" + }, + "enable_call": true, + "enable_create": true, + "evm_denom": "uswtr", + "extra_eips": [] + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "last_block_gas": "0", + "params": { + "base_fee": "7", + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "min_gas_multiplier": "0.500000000000000000", + "min_gas_price": "0.000000000000000000", + "no_base_fee": false + } + }, + "genutil": { + "gen_txs": [ + { + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "validator", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "", + "validator_address": "swtrvaloper1e6a335tujs44t850lnwuvkucufwgjllm90080q", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "qr3fypHh6bu5chVshTsMimqU0cQDZEQVXyv8gJOh3q8=" + }, + "value": { + "denom": "uswtr", + "amount": "90000000000000000000000" + } + } + ], + "memo": "af876e3f89eee050bc5d7b68cc4ee10ac01af6dc@148.113.17.32:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/ethermint.crypto.v1.ethsecp256k1.PubKey", + "key": "AhEsX5zWq6zyMiBigSm687ewb35KlEzIxQlLblH3zYFu" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + }, + "tip": null + }, + "signatures": [ + "QU6B7WxUhEZWDYhZa9cqKILKoCGM828E5SEQzEFtZJcSRrOPgaAQ40mikQCZvPX3RhbtZbRNWxiy85+I8GrWVAE=" + ] + } + ] + }, + "gov": { + "deposit_params": { + "max_deposit_period": "172800s", + "min_deposit": [ + { + "amount": "10000000", + "denom": "uswtr" + } + ] + }, + "deposits": [], + "proposals": [], + "starting_proposal_id": "1", + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + }, + "votes": [], + "voting_params": { + "voting_period": "172800s" + } + }, + "group": { + "group_members": [], + "group_policies": [], + "group_policy_seq": "0", + "group_seq": "0", + "groups": [], + "proposal_seq": "0", + "proposals": [], + "votes": [] + }, + "ibc": { + "channel_genesis": { + "ack_sequences": [], + "acknowledgements": [], + "channels": [], + "commitments": [], + "next_channel_sequence": "0", + "receipts": [], + "recv_sequences": [], + "send_sequences": [] + }, + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "create_localhost": false, + "next_client_sequence": "0", + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + } + }, + "connection_genesis": { + "client_connection_paths": [], + "connections": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "controller_enabled": true + }, + "ports": [] + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "allow_messages": [ + "*" + ], + "host_enabled": true + }, + "port": "icahost" + } + }, + "mint": { + "minter": { + "annual_provisions": "292781406220341048348433.435844680541078423", + "inflation": "0.143932503058111897" + }, + "params": { + "blocks_per_year": "6311520", + "goal_bonded": "0.670000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "inflation_rate_change": "0.130000000000000000", + "mint_denom": "uswtr" + } + }, + "params": null, + "slashing": { + "missed_blocks": [], + "params": { + "downtime_jail_duration": "1800s", + "min_signed_per_window": "0.500000000000000000", + "signed_blocks_window": "90000", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": [] + }, + "staking": { + "delegations": [], + "exported": true, + "last_total_power": "180000000000000000", + "last_validator_powers": [], + "params": { + "bond_denom": "uswtr", + "historical_entries": 10000, + "max_entries": 7, + "max_validators": 100, + "min_commission_rate": "0.000000000000000000", + "unbonding_time": "1814400s" + }, + "redelegations": [], + "unbonding_delegations": [], + "validators": [] + }, + "transfer": { + "denom_traces": [], + "params": { + "receive_enabled": true, + "send_enabled": true + }, + "port_id": "transfer" + }, + "upgrade": {}, + "vesting": { + "params": {} + } + } +} \ No newline at end of file diff --git a/scripts/new_genesis_template.json b/scripts/new_genesis_template.json new file mode 100644 index 00000000..ad9fbf38 --- /dev/null +++ b/scripts/new_genesis_template.json @@ -0,0 +1,368 @@ +{ + "genesis_time": "2023-07-11T18:35:36.615463102Z", + "chain_id": "swisstronik_1291-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "10000000000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "validators": [], + "app_hash": "", + "app_state": { + "auth": { + "accounts": [], + "params": { + "max_memo_characters": "256", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10" + } + }, + "authz": { + "authorization": [] + }, + "bank": { + "balances": [], + "denom_metadata": [], + "params": { + "default_send_enabled": true, + "send_enabled": [] + }, + "supply": [ + { + "amount": "200000000000000000000000", + "denom": "uswtr" + } + ] + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "amount": "1000", + "denom": "uswtr" + } + }, + "distribution": { + "delegator_starting_infos": [], + "delegator_withdraw_infos": [], + "fee_pool": { + "community_pool": [] + }, + "outstanding_rewards": [], + "params": { + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "community_tax": "0.020000000000000000", + "withdraw_addr_enabled": true + }, + "previous_proposer": "", + "validator_accumulated_commissions": [], + "validator_current_rewards": [], + "validator_historical_rewards": [], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "evm": { + "accounts": [], + "params": { + "allow_unprotected_txs": false, + "chain_config": { + "arrow_glacier_block": "0", + "berlin_block": "0", + "byzantium_block": "0", + "cancun_block": "0", + "constantinople_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "gray_glacier_block": "0", + "homestead_block": "0", + "istanbul_block": "0", + "london_block": "0", + "merge_netsplit_block": "0", + "muir_glacier_block": "0", + "petersburg_block": "0", + "shanghai_block": "0" + }, + "enable_call": true, + "enable_create": true, + "evm_denom": "uswtr", + "extra_eips": [] + } + }, + "feegrant": { + "allowances": [] + }, + "feemarket": { + "last_block_gas": "0", + "params": { + "base_fee": "7", + "base_fee_change_denominator": 8, + "elasticity_multiplier": 2, + "enable_height": "0", + "min_gas_multiplier": "0.500000000000000000", + "min_gas_price": "0.000000000000000000", + "no_base_fee": false + } + }, + "genutil": { + "gen_txs": [ + { + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "validator", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "", + "validator_address": "swtrvaloper1e6a335tujs44t850lnwuvkucufwgjllm90080q", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "qr3fypHh6bu5chVshTsMimqU0cQDZEQVXyv8gJOh3q8=" + }, + "value": { + "denom": "uswtr", + "amount": "90000000000000000000000" + } + } + ], + "memo": "af876e3f89eee050bc5d7b68cc4ee10ac01af6dc@148.113.17.32:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/ethermint.crypto.v1.ethsecp256k1.PubKey", + "key": "AhEsX5zWq6zyMiBigSm687ewb35KlEzIxQlLblH3zYFu" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + }, + "tip": null + }, + "signatures": [ + "QU6B7WxUhEZWDYhZa9cqKILKoCGM828E5SEQzEFtZJcSRrOPgaAQ40mikQCZvPX3RhbtZbRNWxiy85+I8GrWVAE=" + ] + } + ] + }, + "gov": { + "deposit_params": { + "max_deposit_period": "172800s", + "min_deposit": [ + { + "amount": "10000000", + "denom": "uswtr" + } + ] + }, + "deposits": [], + "proposals": [], + "starting_proposal_id": "1", + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + }, + "votes": [], + "voting_params": { + "voting_period": "172800s" + }, + "params": { + "min_deposit": [ + { + "denom": "uswtr", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s", + "voting_period": "172800s", + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000", + "min_initial_deposit_ratio": "0.000000000000000000", + "proposal_cancel_ratio": "0.500000000000000000", + "proposal_cancel_dest": "", + "expedited_voting_period": "86400s", + "expedited_threshold": "0.667000000000000000", + "expedited_min_deposit": [ + { + "denom": "uswtr", + "amount": "50000000" + } + ], + "burn_vote_quorum": false, + "burn_proposal_deposit_prevote": false, + "burn_vote_veto": true, + "min_deposit_ratio": "0.010000000000000000" + } + }, + "group": { + "group_members": [], + "group_policies": [], + "group_policy_seq": "0", + "group_seq": "0", + "groups": [], + "proposal_seq": "0", + "proposals": [], + "votes": [] + }, + "ibc": { + "channel_genesis": { + "ack_sequences": [], + "acknowledgements": [], + "channels": [], + "commitments": [], + "next_channel_sequence": "0", + "receipts": [], + "recv_sequences": [], + "send_sequences": [] + }, + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "create_localhost": false, + "next_client_sequence": "0", + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + } + }, + "connection_genesis": { + "client_connection_paths": [], + "connections": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "controller_enabled": true + }, + "ports": [] + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "allow_messages": [ + "*" + ], + "host_enabled": true + }, + "port": "icahost" + } + }, + "mint": { + "minter": { + "annual_provisions": "292781406220341048348433.435844680541078423", + "inflation": "0.143932503058111897" + }, + "params": { + "blocks_per_year": "6311520", + "goal_bonded": "0.670000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "inflation_rate_change": "0.130000000000000000", + "mint_denom": "uswtr" + } + }, + "params": null, + "slashing": { + "missed_blocks": [], + "params": { + "downtime_jail_duration": "1800s", + "min_signed_per_window": "0.500000000000000000", + "signed_blocks_window": "90000", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": [] + }, + "staking": { + "delegations": [], + "exported": true, + "last_total_power": "180000000000000000", + "last_validator_powers": [], + "params": { + "bond_denom": "uswtr", + "historical_entries": 10000, + "max_entries": 7, + "max_validators": 100, + "min_commission_rate": "0.000000000000000000", + "unbonding_time": "1814400s" + }, + "redelegations": [], + "unbonding_delegations": [], + "validators": [] + }, + "transfer": { + "denom_traces": [], + "params": { + "receive_enabled": true, + "send_enabled": true + }, + "port_id": "transfer" + }, + "upgrade": {}, + "vesting": { + "params": {} + } + } +} \ No newline at end of file diff --git a/server/config/config.go b/server/config/config.go index 4e7e94ee..11b87775 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -137,6 +137,8 @@ type JSONRPCConfig struct { MaxOpenConnections int `mapstructure:"max-open-connections"` // EnableIndexer defines if enable the custom indexer service. EnableIndexer bool `mapstructure:"enable-indexer"` + // AllowIndexerGap defines if allow block gap for the custom indexer service. + AllowIndexerGap bool `mapstructure:"allow-indexer-gap"` // MetricsAddress defines the metrics server to listen on MetricsAddress string `mapstructure:"metrics-address"` // FixRevertGasRefundHeight defines the upgrade height for fix of revert gas refund logic when transaction reverted @@ -242,6 +244,7 @@ func DefaultJSONRPCConfig() *JSONRPCConfig { AllowUnprotectedTxs: DefaultAllowUnprotectedTxs, MaxOpenConnections: DefaultMaxOpenConnections, EnableIndexer: false, + AllowIndexerGap: true, MetricsAddress: DefaultJSONRPCMetricsAddress, FixRevertGasRefundHeight: DefaultFixRevertGasRefundHeight, } @@ -352,6 +355,7 @@ func GetConfig(v *viper.Viper) (Config, error) { HTTPIdleTimeout: v.GetDuration("json-rpc.http-idle-timeout"), MaxOpenConnections: v.GetInt("json-rpc.max-open-connections"), EnableIndexer: v.GetBool("json-rpc.enable-indexer"), + AllowIndexerGap: v.GetBool("json-rpc.allow-indexer-gap"), MetricsAddress: v.GetString("json-rpc.metrics-address"), FixRevertGasRefundHeight: v.GetInt64("json-rpc.fix-revert-gas-refund-height"), }, diff --git a/server/flags/flags.go b/server/flags/flags.go index 97f2953c..4ac99e78 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -22,13 +22,13 @@ import ( "github.com/spf13/viper" ) -// Tendermint/cosmos-sdk full-node start flags +// WithComet/cosmos-sdk full-node start flags const ( - WithTendermint = "with-tendermint" - Address = "address" - Transport = "transport" - TraceStore = "trace-store" - CPUProfile = "cpu-profile" + WithCometBFT = "with-cometbft" + Address = "address" + Transport = "transport" + TraceStore = "trace-store" + CPUProfile = "cpu-profile" // The type of database for application and snapshots databases AppDBBackend = "app-db-backend" ) @@ -65,6 +65,7 @@ const ( JSONRPCAllowUnprotectedTxs = "json-rpc.allow-unprotected-txs" JSONRPCMaxOpenConnections = "json-rpc.max-open-connections" JSONRPCEnableIndexer = "json-rpc.enable-indexer" + JSONRPCAllowIndexerGap = "json-rpc.allow-indexer-gap" JSONRPCFeeHistoryCap = "json-rpc.feehistory-cap" // JSONRPCEnableMetrics enables EVM RPC metrics server. // Set to `metrics` which is hardcoded flag from go-ethereum. diff --git a/server/indexer_cmd.go b/server/indexer_cmd.go index f8df661d..97d8b0a0 100644 --- a/server/indexer_cmd.go +++ b/server/indexer_cmd.go @@ -12,7 +12,7 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package server import ( @@ -22,9 +22,9 @@ import ( "swisstronik/indexer" - tmnode "github.com/cometbft/cometbft/node" + cmtnode "github.com/cometbft/cometbft/config" sm "github.com/cometbft/cometbft/state" - tmstore "github.com/cometbft/cometbft/store" + cmtstore "github.com/cometbft/cometbft/store" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" ) @@ -64,13 +64,13 @@ func NewIndexTxCmd() *cobra.Command { idxer := indexer.NewKVIndexer(idxDB, logger.With("module", "evmindex"), clientCtx) // open local tendermint db, because the local rpc won't be available. - tmdb, err := tmnode.DefaultDBProvider(&tmnode.DBContext{ID: "blockstore", Config: cfg}) + cmtdb, err := cmtnode.DefaultDBProvider(&cmtnode.DBContext{ID: "blockstore", Config: cfg}) if err != nil { return err } - blockStore := tmstore.NewBlockStore(tmdb) + blockStore := cmtstore.NewBlockStore(cmtdb) - stateDB, err := tmnode.DefaultDBProvider(&tmnode.DBContext{ID: "state", Config: cfg}) + stateDB, err := cmtnode.DefaultDBProvider(&cmtnode.DBContext{ID: "state", Config: cfg}) if err != nil { return err } @@ -83,11 +83,11 @@ func NewIndexTxCmd() *cobra.Command { if blk == nil { return fmt.Errorf("block not found %d", height) } - resBlk, err := stateStore.LoadABCIResponses(height) + resBlk, err := stateStore.LoadFinalizeBlockResponse(height) if err != nil { return err } - if err := idxer.IndexBlock(blk, resBlk.DeliverTxs); err != nil { + if err := idxer.IndexBlock(blk, resBlk.TxResults); err != nil { return err } fmt.Println(height) diff --git a/server/indexer_service.go b/server/indexer_service.go index 05457f5c..39ba08d0 100644 --- a/server/indexer_service.go +++ b/server/indexer_service.go @@ -17,35 +17,42 @@ package server import ( "context" + "strings" + ethermint "swisstronik/types" "time" "github.com/cometbft/cometbft/libs/service" rpcclient "github.com/cometbft/cometbft/rpc/client" + ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" - - evmcommontypes "swisstronik/types" ) const ( ServiceName = "EVMIndexerService" NewBlockWaitTimeout = 60 * time.Second + + // https://github.com/cometbft/cometbft/blob/v0.37.4/rpc/core/env.go#L193 + NotFoundErr = "is not available" + ErrorBackoffDuration = 1 * time.Second ) // EVMIndexerService indexes transactions for json-rpc service. type EVMIndexerService struct { service.BaseService - txIdxr evmcommontypes.EVMTxIndexer - client rpcclient.Client + txIdxr ethermint.EVMTxIndexer + client rpcclient.Client + allowGap bool } // NewEVMIndexerService returns a new service instance. func NewEVMIndexerService( - txIdxr evmcommontypes.EVMTxIndexer, + txIdxr ethermint.EVMTxIndexer, client rpcclient.Client, + allowGap bool, ) *EVMIndexerService { - is := &EVMIndexerService{txIdxr: txIdxr, client: client} + is := &EVMIndexerService{txIdxr: txIdxr, client: client, allowGap: allowGap} is.BaseService = *service.NewBaseService(nil, ServiceName, is) return is } @@ -94,24 +101,47 @@ func (eis *EVMIndexerService) OnStart() error { } if lastBlock == -1 { lastBlock = latestBlock + } else if lastBlock < status.SyncInfo.EarliestBlockHeight { + if !eis.allowGap { + panic("Block gap detected, please recover the missing data") + } + // to avoid infinite failed to fetch block error when lastBlock is smaller than earliest + lastBlock = status.SyncInfo.EarliestBlockHeight } + // to avoid height must be greater than 0 error + if lastBlock <= 0 { + lastBlock = 1 + } + for { if latestBlock <= lastBlock { // nothing to index. wait for signal of new block + select { case <-newBlockSignal: case <-time.After(NewBlockWaitTimeout): } continue } + var ( + err error + block *ctypes.ResultBlock + blockResult *ctypes.ResultBlockResults + ) for i := lastBlock + 1; i <= latestBlock; i++ { - block, err := eis.client.Block(ctx, &i) + block, err = eis.client.Block(ctx, &i) if err != nil { + if eis.allowGap && strings.Contains(err.Error(), NotFoundErr) { + continue + } eis.Logger.Error("failed to fetch block", "height", i, "err", err) break } - blockResult, err := eis.client.BlockResults(ctx, &i) + blockResult, err = eis.client.BlockResults(ctx, &i) if err != nil { + if eis.allowGap && strings.Contains(err.Error(), NotFoundErr) { + continue + } eis.Logger.Error("failed to fetch block result", "height", i, "err", err) break } @@ -120,5 +150,8 @@ func (eis *EVMIndexerService) OnStart() error { } lastBlock = blockResult.Height } + if err != nil { + time.Sleep(ErrorBackoffDuration) + } } } diff --git a/server/json_rpc.go b/server/json_rpc.go index eb687865..64e81484 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -12,38 +12,64 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package server import ( + "fmt" "net/http" "time" "github.com/gorilla/mux" "github.com/rs/cors" + "golang.org/x/sync/errgroup" "swisstronik/rpc" + "swisstronik/rpc/stream" + ethermint "swisstronik/types" + + rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/types" ethlog "github.com/ethereum/go-ethereum/log" ethrpc "github.com/ethereum/go-ethereum/rpc" "swisstronik/server/config" - evmcommontypes "swisstronik/types" +) + +const ( + ServerStartTime = 5 * time.Second + MaxRetry = 6 ) // StartJSONRPC starts the JSON-RPC server -func StartJSONRPC(ctx *server.Context, +func StartJSONRPC(srvCtx *server.Context, clientCtx client.Context, - tmRPCAddr, - tmEndpoint string, + g *errgroup.Group, config *config.Config, - indexer evmcommontypes.EVMTxIndexer, + indexer ethermint.EVMTxIndexer, ) (*http.Server, chan struct{}, error) { - tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) + logger := srvCtx.Logger.With("module", "geth") + + evtClient, ok := clientCtx.Client.(rpcclient.EventsClient) + if !ok { + return nil, nil, fmt.Errorf("client %T does not implement EventsClient", clientCtx.Client) + } + + var rpcStream *stream.RPCStream + var err error + for i := 0; i < MaxRetry; i++ { + rpcStream, err = stream.NewRPCStreams(evtClient, logger, clientCtx.TxConfig.TxDecoder()) + if err == nil { + break + } + time.Sleep(time.Second) + } + + if err != nil { + return nil, nil, fmt.Errorf("failed to create rpc streams after %d attempts: %w", MaxRetry, err) + } - logger := ctx.Logger.With("module", "geth") ethlog.Root().SetHandler(ethlog.FuncHandler(func(r *ethlog.Record) error { switch r.Lvl { case ethlog.LvlTrace, ethlog.LvlDebug: @@ -61,11 +87,11 @@ func StartJSONRPC(ctx *server.Context, allowUnprotectedTxs := config.JSONRPC.AllowUnprotectedTxs rpcAPIArr := config.JSONRPC.API - apis := rpc.GetRPCAPIs(ctx, clientCtx, tmWsClient, allowUnprotectedTxs, indexer, rpcAPIArr) + apis := rpc.GetRPCAPIs(srvCtx, clientCtx, rpcStream, allowUnprotectedTxs, indexer, rpcAPIArr) for _, api := range apis { if err := rpcServer.RegisterName(api.Namespace, api.Service); err != nil { - ctx.Logger.Error( + srvCtx.Logger.Error( "failed to register service in JSON RPC namespace", "namespace", api.Namespace, "service", api.Service, @@ -97,32 +123,22 @@ func StartJSONRPC(ctx *server.Context, return nil, nil, err } - errCh := make(chan error) - go func() { - ctx.Logger.Info("Starting JSON-RPC server", "address", config.JSONRPC.Address) + g.Go(func() error { + srvCtx.Logger.Info("Starting JSON-RPC server", "address", config.JSONRPC.Address) if err := httpSrv.Serve(ln); err != nil { if err == http.ErrServerClosed { close(httpSrvDone) - return } - ctx.Logger.Error("failed to start JSON-RPC server", "error", err.Error()) - errCh <- err + srvCtx.Logger.Error("failed to start JSON-RPC server", "error", err.Error()) + return err } - }() - - select { - case err := <-errCh: - ctx.Logger.Error("failed to boot JSON-RPC server", "error", err.Error()) - return nil, nil, err - case <-time.After(types.ServerStartTime): // assume JSON RPC server started successfully - } + return nil + }) - ctx.Logger.Info("Starting JSON WebSocket server", "address", config.JSONRPC.WsAddress) + srvCtx.Logger.Info("Starting JSON WebSocket server", "address", config.JSONRPC.WsAddress) - // allocate separate WS connection to Tendermint - tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) - wsSrv := rpc.NewWebsocketsServer(clientCtx, ctx.Logger, tmWsClient, config) + wsSrv := rpc.NewWebsocketsServer(clientCtx, srvCtx.Logger, rpcStream, config) wsSrv.Start() return httpSrv, httpSrvDone, nil } diff --git a/server/start.go b/server/start.go index c5f519ea..3a4255d9 100644 --- a/server/start.go +++ b/server/start.go @@ -12,12 +12,11 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package server import ( "context" - "errors" "fmt" "io" "net" @@ -30,47 +29,43 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/telemetry" + "golang.org/x/sync/errgroup" "github.com/spf13/cobra" - "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - rpcclient "github.com/cometbft/cometbft/rpc/client" - - dbm "github.com/cometbft/cometbft-db" abciserver "github.com/cometbft/cometbft/abci/server" tcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" - tmos "github.com/cometbft/cometbft/libs/os" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" "github.com/cometbft/cometbft/proxy" + rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/cometbft/cometbft/rpc/client/local" - - "cosmossdk.io/tools/rosetta" - crgserver "cosmossdk.io/tools/rosetta/lib/server" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp" errorsmod "cosmossdk.io/errors" + pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" - sdk "github.com/cosmos/cosmos-sdk/types" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "swisstronik/indexer" ethdebug "swisstronik/rpc/namespaces/ethereum/debug" "swisstronik/server/config" srvflags "swisstronik/server/flags" - evmcommontypes "swisstronik/types" - - "github.com/SigmaGmbH/librustgo" + ethermint "swisstronik/types" ) // DBOpener is a function to open `application.db`, potentially with customized options. @@ -93,13 +88,13 @@ func NewDefaultStartOptions(appCreator types.AppCreator, defaultNodeHome string) } // StartCmd runs the service passed in, either stand-alone or in-process with -// Tendermint. +// CometBFT. func StartCmd(opts StartOptions) *cobra.Command { cmd := &cobra.Command{ Use: "start", Short: "Run the full node", - Long: `Run the full node application with Tendermint in or out of process. By -default, the application will run with Tendermint in process. + Long: `Run the full node application with CometBFT in or out of process. By +default, the application will run with CometBFT in process. Pruning options can be provided via the '--pruning' flag or alternatively with '--pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' together. @@ -140,20 +135,12 @@ which accepts a path for the resulting pprof file. return err } - // check if node has sealed master key - nodeInitialized, err := librustgo.IsNodeInitialized() - if err != nil { - return err - } - - if !nodeInitialized { - return errors.New("sealed master key was not found. Request it by using `swisstronikd enclave request-master-key`") - } - - withTM, _ := cmd.Flags().GetBool(srvflags.WithTendermint) + withTM, _ := cmd.Flags().GetBool(srvflags.WithCometBFT) if !withTM { - serverCtx.Logger.Info("starting ABCI without Tendermint") - return startStandAlone(serverCtx, opts) + serverCtx.Logger.Info("starting ABCI without CometBFT") + return wrapCPUProfile(serverCtx, func() error { + return startStandAlone(serverCtx, opts) + }) } serverCtx.Logger.Info("Unlocking keyring") @@ -167,22 +154,22 @@ which accepts a path for the resulting pprof file. } } - serverCtx.Logger.Info("starting ABCI with Tendermint") + serverCtx.Logger.Info("starting ABCI with CometBFT") // amino is needed here for backwards compatibility of REST routes - err = startInProcess(serverCtx, clientCtx, opts) - errCode, ok := err.(server.ErrorCode) - if !ok { + err = wrapCPUProfile(serverCtx, func() error { + return startInProcess(serverCtx, clientCtx, opts) + }) + if err != nil { return err } - serverCtx.Logger.Debug(fmt.Sprintf("received quit signal: %d", errCode.Code)) return nil }, } cmd.Flags().String(flags.FlagHome, opts.DefaultNodeHome, "The application home directory") - cmd.Flags().Bool(srvflags.WithTendermint, true, "Run abci app embedded in-process with tendermint") + cmd.Flags().Bool(srvflags.WithCometBFT, true, "Run abci app embedded in-process with tendermint") cmd.Flags().String(srvflags.Address, "tcp://0.0.0.0:26658", "Listen address") cmd.Flags().String(srvflags.Transport, "socket", "Transport protocol: socket, grpc") cmd.Flags().String(srvflags.TraceStore, "", "Enable KVStore tracing to an output file") @@ -197,14 +184,13 @@ which accepts a path for the resulting pprof file. cmd.Flags().Uint64(server.FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(server.FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") //nolint:lll cmd.Flags().Uint(server.FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") - cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune Tendermint blocks") + cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune CometBFT blocks") cmd.Flags().String(srvflags.AppDBBackend, "", "The type of database for application and snapshots databases") - cmd.Flags().Bool(srvflags.GRPCOnly, false, "Start the node in gRPC query only mode without Tendermint process") + cmd.Flags().Bool(srvflags.GRPCOnly, false, "Start the node in gRPC query only mode without CometBFT process") cmd.Flags().Bool(srvflags.GRPCEnable, true, "Define if the gRPC server should be enabled") cmd.Flags().String(srvflags.GRPCAddress, serverconfig.DefaultGRPCAddress, "the gRPC server address to listen on") cmd.Flags().Bool(srvflags.GRPCWebEnable, true, "Define if the gRPC-Web server should be enabled. (Note: gRPC must also be enabled.)") - cmd.Flags().String(srvflags.GRPCWebAddress, serverconfig.DefaultGRPCWebAddress, "The gRPC-Web server address to listen on") cmd.Flags().Bool(srvflags.RPCEnable, false, "Defines if Cosmos-sdk REST server should be enabled") cmd.Flags().Bool(srvflags.EnabledUnsafeCors, false, "Defines if CORS should be enabled (unsafe - use it at your own risk)") @@ -213,7 +199,7 @@ which accepts a path for the resulting pprof file. cmd.Flags().StringSlice(srvflags.JSONRPCAPI, config.GetDefaultAPINamespaces(), "Defines a list of JSON-RPC namespaces that should be enabled") cmd.Flags().String(srvflags.JSONRPCAddress, config.DefaultJSONRPCAddress, "the JSON-RPC server address to listen on") cmd.Flags().String(srvflags.JSONWsAddress, config.DefaultJSONRPCWsAddress, "the JSON-RPC WS server address to listen on") - cmd.Flags().Uint64(srvflags.JSONRPCGasCap, config.DefaultGasCap, "Sets a cap on gas that can be used in eth_call/estimateGas unit is uswtr (0=infinite)") //nolint:lll + cmd.Flags().Uint64(srvflags.JSONRPCGasCap, config.DefaultGasCap, "Sets a cap on gas that can be used in eth_call/estimateGas unit is aphoton (0=infinite)") //nolint:lll cmd.Flags().Float64(srvflags.JSONRPCTxFeeCap, config.DefaultTxFeeCap, "Sets a cap on transaction fee that can be sent via the RPC APIs (1 = default 1 photon)") //nolint:lll cmd.Flags().Int32(srvflags.JSONRPCFilterCap, config.DefaultFilterCap, "Sets the global cap for total number of filters that can be created") cmd.Flags().Duration(srvflags.JSONRPCEVMTimeout, config.DefaultEVMTimeout, "Sets a timeout used for eth_call (0=infinite)") @@ -224,8 +210,8 @@ which accepts a path for the resulting pprof file. cmd.Flags().Int32(srvflags.JSONRPCBlockRangeCap, config.DefaultBlockRangeCap, "Sets the max block range allowed for `eth_getLogs` query") cmd.Flags().Int(srvflags.JSONRPCMaxOpenConnections, config.DefaultMaxOpenConnections, "Sets the maximum number of simultaneous connections for the server listener") //nolint:lll cmd.Flags().Bool(srvflags.JSONRPCEnableIndexer, false, "Enable the custom tx indexer for json-rpc") + cmd.Flags().Bool(srvflags.JSONRPCAllowIndexerGap, true, "Allow block gap for the custom tx indexer for json-rpc") cmd.Flags().Bool(srvflags.JSONRPCEnableMetrics, false, "Define if EVM rpc metrics server should be enabled") - cmd.Flags().Int32(srvflags.JSONRPCFeeHistoryCap, config.DefaultFeeHistoryCap, "Sets a max fee history depth") cmd.Flags().String(srvflags.EVMTracer, config.DefaultEVMTracer, "the EVM tracer type to collect execution traces from the EVM transaction execution (json|struct|access_list|markdown)") //nolint:lll cmd.Flags().Uint64(srvflags.EVMMaxTxGasWanted, config.DefaultMaxTxGasWanted, "the gas wanted for each eth tx returned in ante handler in check tx mode") //nolint:lll @@ -236,43 +222,48 @@ which accepts a path for the resulting pprof file. cmd.Flags().Uint64(server.FlagStateSyncSnapshotInterval, 0, "State sync snapshot interval") cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") - // add support for all Tendermint-specific command line options + // add support for all CometBFT-specific command line options tcmd.AddNodeFlags(cmd) return cmd } -func startStandAlone(ctx *server.Context, opts StartOptions) error { - addr := ctx.Viper.GetString(srvflags.Address) - transport := ctx.Viper.GetString(srvflags.Transport) - home := ctx.Viper.GetString(flags.FlagHome) +func startStandAlone(svrCtx *server.Context, opts StartOptions) error { + addr := svrCtx.Viper.GetString(srvflags.Address) + transport := svrCtx.Viper.GetString(srvflags.Transport) + home := svrCtx.Viper.GetString(flags.FlagHome) - db, err := opts.DBOpener(ctx.Viper, home, server.GetAppDBBackend(ctx.Viper)) + db, err := opts.DBOpener(svrCtx.Viper, home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { return err } defer func() { if err := db.Close(); err != nil { - ctx.Logger.Error("error closing db", "error", err.Error()) + svrCtx.Logger.Error("error closing db", "error", err.Error()) } }() - traceWriterFile := ctx.Viper.GetString(srvflags.TraceStore) + traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { return err } - app := opts.AppCreator(ctx.Logger, db, traceWriter, ctx.Viper) + app := opts.AppCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) + defer func() { + if err := app.Close(); err != nil { + svrCtx.Logger.Error("close application failed", "error", err.Error()) + } + }() - config, err := config.GetConfig(ctx.Viper) + config, err := config.GetConfig(svrCtx.Viper) if err != nil { - ctx.Logger.Error("failed to get server config", "error", err.Error()) + svrCtx.Logger.Error("failed to get server config", "error", err.Error()) return err } if err := config.ValidateBasic(); err != nil { - ctx.Logger.Error("invalid server config", "error", err.Error()) + svrCtx.Logger.Error("invalid server config", "error", err.Error()) return err } @@ -281,61 +272,39 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error { return err } - svr, err := abciserver.NewServer(addr, transport, app) + cmtApp := server.NewCometABCIWrapper(app) + svr, err := abciserver.NewServer(addr, transport, cmtApp) if err != nil { return fmt.Errorf("error creating listener: %v", err) } - svr.SetLogger(ctx.Logger.With("server", "abci")) - - err = svr.Start() - if err != nil { - tmos.Exit(err.Error()) - } + svr.SetLogger(servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger.With("server", "abci")}) + g, ctx := getCtx(svrCtx, false) - defer func() { - if err = svr.Stop(); err != nil { - tmos.Exit(err.Error()) + g.Go(func() error { + if err := svr.Start(); err != nil { + svrCtx.Logger.Error("failed to start out-of-process ABCI server", "err", err) + return err } - }() - // Wait for SIGINT or SIGTERM signal - return server.WaitForQuitSignals() + // Wait for the calling process to be canceled or close the provided context, + // so we can gracefully stop the ABCI server. + <-ctx.Done() + svrCtx.Logger.Info("stopping the ABCI server...") + return svr.Stop() + }) + + return g.Wait() } // legacyAminoCdc is used for the legacy REST API -func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOptions) (err error) { - cfg := ctx.Config +func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts StartOptions) (err error) { + cfg := svrCtx.Config home := cfg.RootDir - logger := ctx.Logger - - if cpuProfile := ctx.Viper.GetString(srvflags.CPUProfile); cpuProfile != "" { - fp, err := ethdebug.ExpandHome(cpuProfile) - if err != nil { - ctx.Logger.Debug("failed to get filepath for the CPU profile file", "error", err.Error()) - return err - } + logger := svrCtx.Logger + g, ctx := getCtx(svrCtx, true) - f, err := os.Create(fp) - if err != nil { - return err - } - - ctx.Logger.Info("starting CPU profiler", "profile", cpuProfile) - if err := pprof.StartCPUProfile(f); err != nil { - return err - } - - defer func() { - ctx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) - pprof.StopCPUProfile() - if err := f.Close(); err != nil { - logger.Error("failed to close CPU profiler file", "error", err.Error()) - } - }() - } - - db, err := opts.DBOpener(ctx.Viper, home, server.GetAppDBBackend(ctx.Viper)) + db, err := opts.DBOpener(svrCtx.Viper, home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { logger.Error("failed to open DB", "error", err.Error()) return err @@ -343,18 +312,18 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt defer func() { if err := db.Close(); err != nil { - ctx.Logger.With("error", err).Error("error closing db") + logger.With("error", err).Error("error closing db") } }() - traceWriterFile := ctx.Viper.GetString(srvflags.TraceStore) + traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { logger.Error("failed to open trace writer", "error", err.Error()) return err } - config, err := config.GetConfig(ctx.Viper) + config, err := config.GetConfig(svrCtx.Viper) if err != nil { logger.Error("failed to get server config", "error", err.Error()) return err @@ -365,7 +334,12 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt return err } - app := opts.AppCreator(ctx.Logger, db, traceWriter, ctx.Viper) + app := opts.AppCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) + defer func() { + if err := app.Close(); err != nil { + logger.Error("close application failed", "error", err.Error()) + } + }() nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile()) if err != nil { @@ -373,29 +347,31 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt return err } - genDocProvider := node.DefaultGenesisDocProviderFunc(cfg) + genDocProvider := GenDocProvider(cfg) var ( tmNode *node.Node - gRPCOnly = ctx.Viper.GetBool(srvflags.GRPCOnly) + gRPCOnly = svrCtx.Viper.GetBool(srvflags.GRPCOnly) ) if gRPCOnly { - logger.Info("starting node in query only mode; Tendermint is disabled") + logger.Info("starting node in query only mode; CometBFT is disabled") config.GRPC.Enable = true config.JSONRPC.EnableIndexer = false } else { - logger.Info("starting node with ABCI Tendermint in-process") + logger.Info("starting node with ABCI CometBFT in-process") - tmNode, err = node.NewNode( + cmtApp := server.NewCometABCIWrapper(app) + tmNode, err = node.NewNodeWithContext( + ctx, cfg, pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()), nodeKey, - proxy.NewLocalClientCreator(app), + proxy.NewLocalClientCreator(cmtApp), genDocProvider, - node.DefaultDBProvider, + cmtcfg.DefaultDBProvider, node.DefaultMetricsProvider(cfg.Instrumentation), - ctx.Logger.With("server", "node"), + servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger.With("server", "node")}, ) if err != nil { logger.Error("failed init node", "error", err.Error()) @@ -422,7 +398,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt app.RegisterTxService(clientCtx) app.RegisterTendermintService(clientCtx) - app.RegisterNodeService(clientCtx) + app.RegisterNodeService(clientCtx, config.Config) } metrics, err := startTelemetry(config) @@ -432,156 +408,57 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt // Enable metrics if JSONRPC is enabled and --metrics is passed // Flag not added in config to avoid user enabling in config without passing in CLI - if config.JSONRPC.Enable && ctx.Viper.GetBool(srvflags.JSONRPCEnableMetrics) { + if config.JSONRPC.Enable && svrCtx.Viper.GetBool(srvflags.JSONRPCEnableMetrics) { ethmetricsexp.Setup(config.JSONRPC.MetricsAddress) } - var idxer evmcommontypes.EVMTxIndexer + var idxer ethermint.EVMTxIndexer if config.JSONRPC.EnableIndexer { - idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(ctx.Viper)) + idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { logger.Error("failed to open evm indexer DB", "error", err.Error()) return err } - idxLogger := ctx.Logger.With("indexer", "evm") + idxLogger := logger.With("indexer", "evm") idxer = indexer.NewKVIndexer(idxDB, idxLogger, clientCtx) - indexerService := NewEVMIndexerService(idxer, clientCtx.Client.(rpcclient.Client)) - indexerService.SetLogger(idxLogger) - - errCh := make(chan error) - go func() { - if err := indexerService.Start(); err != nil { - errCh <- err - } - }() + indexerService := NewEVMIndexerService(idxer, clientCtx.Client.(rpcclient.Client), config.JSONRPC.AllowIndexerGap) + indexerService.SetLogger(servercmtlog.CometLoggerWrapper{Logger: idxLogger}) - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } + g.Go(func() error { + return indexerService.Start() + }) } if config.API.Enable || config.JSONRPC.Enable { - genDoc, err := genDocProvider() - if err != nil { - return err - } - - clientCtx = clientCtx. - WithHomeDir(home). - WithChainID(genDoc.ChainID) - - // Set `GRPCClient` to `clientCtx` to enjoy concurrent grpc query. - // only use it if gRPC server is enabled. - if config.GRPC.Enable { - _, port, err := net.SplitHostPort(config.GRPC.Address) - if err != nil { - return errorsmod.Wrapf(err, "invalid grpc address %s", config.GRPC.Address) - } - - maxSendMsgSize := config.GRPC.MaxSendMsgSize - if maxSendMsgSize == 0 { - maxSendMsgSize = serverconfig.DefaultGRPCMaxSendMsgSize - } - - maxRecvMsgSize := config.GRPC.MaxRecvMsgSize - if maxRecvMsgSize == 0 { - maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize - } - - grpcAddress := fmt.Sprintf("127.0.0.1:%s", port) - - // If grpc is enabled, configure grpc client for grpc gateway and json-rpc. - grpcClient, err := grpc.Dial( - grpcAddress, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithDefaultCallOptions( - grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), - grpc.MaxCallRecvMsgSize(maxRecvMsgSize), - grpc.MaxCallSendMsgSize(maxSendMsgSize), - ), - ) + chainID := svrCtx.Viper.GetString(flags.FlagChainID) + if chainID == "" { + genDoc, err := genDocProvider() if err != nil { return err } - - clientCtx = clientCtx.WithGRPCClient(grpcClient) - ctx.Logger.Debug("gRPC client assigned to client context", "address", grpcAddress) + chainID = genDoc.ChainID } + clientCtx = clientCtx. + WithHomeDir(home). + WithChainID(chainID) } - var apiSrv *api.Server - if config.API.Enable { - apiSrv = api.New(clientCtx, ctx.Logger.With("server", "api")) - app.RegisterAPIRoutes(apiSrv, config.API) - - if config.Telemetry.Enabled { - apiSrv.SetTelemetry(metrics) - } - - errCh := make(chan error) - go func() { - if err := apiSrv.Start(config.Config); err != nil { - errCh <- err - } - }() - - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } - - defer apiSrv.Close() + grpcSrv, clientCtx, err := startGrpcServer(ctx, svrCtx, clientCtx, g, config.GRPC, app) + if err != nil { + return err } - - var ( - grpcSrv *grpc.Server - grpcWebSrv *http.Server - ) - - if config.GRPC.Enable { - grpcSrv, err = servergrpc.StartGRPCServer(clientCtx, app, config.GRPC) - if err != nil { - return err - } - defer grpcSrv.Stop() - if config.GRPCWeb.Enable { - grpcWebSrv, err = servergrpc.StartGRPCWeb(grpcSrv, config.Config) - if err != nil { - ctx.Logger.Error("failed to start grpc-web http server", "error", err.Error()) - return err - } - - defer func() { - if err := grpcWebSrv.Close(); err != nil { - logger.Error("failed to close the grpc-web http server", "error", err.Error()) - } - }() - } + if grpcSrv != nil { + defer grpcSrv.GracefulStop() } - var ( - httpSrv *http.Server - httpSrvDone chan struct{} - ) - - if config.JSONRPC.Enable { - genDoc, err := genDocProvider() - if err != nil { - return err - } - - clientCtx := clientCtx.WithChainID(genDoc.ChainID) + apiSrv := startAPIServer(ctx, svrCtx, clientCtx, g, config.Config, app, grpcSrv, metrics) + if apiSrv != nil { + defer apiSrv.Close() + } - tmEndpoint := "/websocket" - tmRPCAddr := cfg.RPC.ListenAddress - httpSrv, httpSrvDone, err = StartJSONRPC(ctx, clientCtx, tmRPCAddr, tmEndpoint, &config, idxer) - if err != nil { - return err - } + clientCtx, httpSrv, httpSrvDone, err := StartJSONRPCServer(svrCtx, clientCtx, g, config, genDocProvider, idxer) + if httpSrv != nil { defer func() { shutdownCtx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second) defer cancelFn() @@ -598,63 +475,9 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt } // At this point it is safe to block the process if we're in query only mode as - // we do not need to start Rosetta or handle any Tendermint related processes. - if gRPCOnly { - // wait for signal capture and gracefully return - return server.WaitForQuitSignals() - } - - var rosettaSrv crgserver.Server - if config.Rosetta.Enable { - offlineMode := config.Rosetta.Offline - - // If GRPC is not enabled rosetta cannot work in online mode, so it works in - // offline mode. - if !config.GRPC.Enable { - offlineMode = true - } - - minGasPrices, err := sdk.ParseDecCoins(config.MinGasPrices) - if err != nil { - ctx.Logger.Error("failed to parse minimum-gas-prices", "error", err.Error()) - return err - } - - conf := &rosetta.Config{ - Blockchain: config.Rosetta.Blockchain, - Network: config.Rosetta.Network, - TendermintRPC: ctx.Config.RPC.ListenAddress, - GRPCEndpoint: config.GRPC.Address, - Addr: config.Rosetta.Address, - Retries: config.Rosetta.Retries, - Offline: offlineMode, - GasToSuggest: config.Rosetta.GasToSuggest, - EnableFeeSuggestion: config.Rosetta.EnableFeeSuggestion, - GasPrices: minGasPrices.Sort(), - Codec: clientCtx.Codec.(*codec.ProtoCodec), - InterfaceRegistry: clientCtx.InterfaceRegistry, - } - - rosettaSrv, err = rosetta.ServerFromConfig(conf) - if err != nil { - return err - } - - errCh := make(chan error) - go func() { - if err := rosettaSrv.Start(); err != nil { - errCh <- err - } - }() + // we do not need to start Rosetta or handle any CometBFT related processes. - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } - } - // Wait for SIGINT or SIGTERM signal - return server.WaitForQuitSignals() + return g.Wait() } func openDB(_ types.AppOptions, rootDir string, backendType dbm.BackendType) (dbm.DB, error) { @@ -687,3 +510,164 @@ func startTelemetry(cfg config.Config) (*telemetry.Metrics, error) { } return telemetry.New(cfg.Telemetry) } + +// wrapCPUProfile runs callback in a goroutine, then wait for quit signals. +func wrapCPUProfile(ctx *server.Context, callback func() error) error { + if cpuProfile := ctx.Viper.GetString(srvflags.CPUProfile); cpuProfile != "" { + fp, err := ethdebug.ExpandHome(cpuProfile) + if err != nil { + ctx.Logger.Debug("failed to get filepath for the CPU profile file", "error", err.Error()) + return err + } + f, err := os.Create(fp) + if err != nil { + return err + } + + ctx.Logger.Info("starting CPU profiler", "profile", cpuProfile) + if err := pprof.StartCPUProfile(f); err != nil { + return err + } + + defer func() { + ctx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) + pprof.StopCPUProfile() + if err := f.Close(); err != nil { + ctx.Logger.Info("failed to close cpu-profile file", "profile", cpuProfile, "err", err.Error()) + } + }() + } + + return callback() +} + +func getCtx(svrCtx *server.Context, block bool) (*errgroup.Group, context.Context) { + ctx, cancelFn := context.WithCancel(context.Background()) + g, ctx := errgroup.WithContext(ctx) + // listen for quit signals so the calling parent process can gracefully exit + server.ListenForQuitSignals(g, block, cancelFn, svrCtx.Logger) + return g, ctx +} + +func startGrpcServer( + ctx context.Context, + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + config serverconfig.GRPCConfig, + app types.Application, +) (*grpc.Server, client.Context, error) { + if !config.Enable { + // return grpcServer as nil if gRPC is disabled + return nil, clientCtx, nil + } + _, _, err := net.SplitHostPort(config.Address) + if err != nil { + return nil, clientCtx, errorsmod.Wrapf(err, "invalid grpc address %s", config.Address) + } + + maxSendMsgSize := config.MaxSendMsgSize + if maxSendMsgSize == 0 { + maxSendMsgSize = serverconfig.DefaultGRPCMaxSendMsgSize + } + + maxRecvMsgSize := config.MaxRecvMsgSize + if maxRecvMsgSize == 0 { + maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize + } + + // if gRPC is enabled, configure gRPC client for gRPC gateway and json-rpc + grpcClient, err := grpc.Dial( + config.Address, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), + grpc.MaxCallRecvMsgSize(maxRecvMsgSize), + grpc.MaxCallSendMsgSize(maxSendMsgSize), + ), + ) + if err != nil { + return nil, clientCtx, err + } + // Set `GRPCClient` to `clientCtx` to enjoy concurrent grpc query. + // only use it if gRPC server is enabled. + clientCtx = clientCtx.WithGRPCClient(grpcClient) + svrCtx.Logger.Debug("gRPC client assigned to client context", "address", config.Address) + + grpcSrv, err := servergrpc.NewGRPCServer(clientCtx, app, config) + if err != nil { + return nil, clientCtx, err + } + + // Start the gRPC server in a goroutine. Note, the provided ctx will ensure + // that the server is gracefully shut down. + g.Go(func() error { + return servergrpc.StartGRPCServer(ctx, svrCtx.Logger.With("module", "grpc-server"), config, grpcSrv) + }) + return grpcSrv, clientCtx, nil +} + +func startAPIServer( + ctx context.Context, + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + svrCfg serverconfig.Config, + app types.Application, + grpcSrv *grpc.Server, + metrics *telemetry.Metrics, +) *api.Server { + if !svrCfg.API.Enable { + return nil + } + + apiSrv := api.New(clientCtx, svrCtx.Logger.With("server", "api"), grpcSrv) + app.RegisterAPIRoutes(apiSrv, svrCfg.API) + + if svrCfg.Telemetry.Enabled { + apiSrv.SetTelemetry(metrics) + } + + g.Go(func() error { + return apiSrv.Start(ctx, svrCfg) + }) + return apiSrv +} + +func StartJSONRPCServer( + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + config config.Config, + genDocProvider node.GenesisDocProvider, + idxer ethermint.EVMTxIndexer, +) (ctx client.Context, httpSrv *http.Server, httpSrvDone chan struct{}, err error) { + ctx = clientCtx + if !config.JSONRPC.Enable { + return + } + + genDoc, err := genDocProvider() + if err != nil { + return ctx, httpSrv, httpSrvDone, err + } + + ctx = clientCtx.WithChainID(genDoc.ChainID) + g.Go(func() error { + httpSrv, httpSrvDone, err = StartJSONRPC(svrCtx, clientCtx, g, &config, idxer) + return err + }) + return +} + +// returns a function which returns the genesis doc from the genesis file. +func GenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error) { + return func() (*cmttypes.GenesisDoc, error) { + appGenesis, err := genutiltypes.AppGenesisFromFile(cfg.GenesisFile()) + if err != nil { + return nil, err + } + + return appGenesis.ToGenesisDoc() + } +} diff --git a/server/util.go b/server/util.go index be716a0e..1b8ef57b 100644 --- a/server/util.go +++ b/server/util.go @@ -16,23 +16,27 @@ package server import ( + "context" "net" "net/http" - "time" + "os" + "os/signal" + "syscall" + + "swisstronik/server/config" "github.com/gorilla/mux" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/spf13/cobra" "golang.org/x/net/netutil" - "swisstronik/server/config" + "golang.org/x/sync/errgroup" sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/version" - tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" - tmlog "github.com/cometbft/cometbft/libs/log" - rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" + tmlog "cosmossdk.io/log" + cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" ) // AddCommands adds server commands @@ -42,18 +46,20 @@ func AddCommands( appExport types.AppExporter, addStartFlags types.ModuleInitFlags, ) { - tendermintCmd := &cobra.Command{ - Use: "tendermint", - Short: "Tendermint subcommands", + cometCmd := &cobra.Command{ + Use: "comet", + Aliases: []string{"cometbft", "tendermint"}, + Short: "CometBFT subcommands", } - tendermintCmd.AddCommand( + cometCmd.AddCommand( sdkserver.ShowNodeIDCmd(), sdkserver.ShowValidatorCmd(), sdkserver.ShowAddressCmd(), sdkserver.VersionCmd(), - tmcmd.ResetAllCmd, - tmcmd.ResetStateCmd, + cmtcmd.ResetAllCmd, + cmtcmd.ResetStateCmd, + sdkserver.BootstrapStateCmd(opts.AppCreator), ) startCmd := StartCmd(opts) @@ -61,7 +67,7 @@ func AddCommands( rootCmd.AddCommand( startCmd, - tendermintCmd, + cometCmd, sdkserver.ExportCmd(appExport, opts.DefaultNodeHome), version.NewVersionCommand(), sdkserver.NewRollbackCmd(opts.AppCreator, opts.DefaultNodeHome), @@ -71,34 +77,6 @@ func AddCommands( ) } -func ConnectTmWS(tmRPCAddr, tmEndpoint string, logger tmlog.Logger) *rpcclient.WSClient { - tmWsClient, err := rpcclient.NewWS(tmRPCAddr, tmEndpoint, - rpcclient.MaxReconnectAttempts(256), - rpcclient.ReadWait(120*time.Second), - rpcclient.WriteWait(120*time.Second), - rpcclient.PingPeriod(50*time.Second), - rpcclient.OnReconnect(func() { - logger.Debug("EVM RPC reconnects to Tendermint WS", "address", tmRPCAddr+tmEndpoint) - }), - ) - - if err != nil { - logger.Error( - "Tendermint WS client could not be created", - "address", tmRPCAddr+tmEndpoint, - "error", err, - ) - } else if err := tmWsClient.OnStart(); err != nil { - logger.Error( - "Tendermint WS client could not start", - "address", tmRPCAddr+tmEndpoint, - "error", err, - ) - } - - return tmWsClient -} - func MountGRPCWebServices( router *mux.Router, grpcWeb *grpcweb.WrappedGrpcServer, @@ -138,3 +116,30 @@ func Listen(addr string, config *config.Config) (net.Listener, error) { } return ln, err } + +// ListenForQuitSignals listens for SIGINT and SIGTERM. When a signal is received, +// the cleanup function is called, indicating the caller can gracefully exit or +// return. +// +// Note, the blocking behavior of this depends on the block argument. +// The caller must ensure the corresponding context derived from the cancelFn is used correctly. +func ListenForQuitSignals(g *errgroup.Group, block bool, cancelFn context.CancelFunc, logger tmlog.Logger) { + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) + + f := func() { + sig := <-sigCh + cancelFn() + + logger.Info("caught signal", "signal", sig.String()) + } + + if block { + g.Go(func() error { + f() + return nil + }) + } else { + go f() + } +} diff --git a/tests/rpc/rpc_test.go b/tests/rpc/rpc_test.go index 069143b8..a0602803 100644 --- a/tests/rpc/rpc_test.go +++ b/tests/rpc/rpc_test.go @@ -18,9 +18,10 @@ import ( "github.com/stretchr/testify/require" rpctypes "swisstronik/rpc/types" - ethermint "swisstronik/types" evmtypes "swisstronik/x/evm/types" + swisstroniktypes "swisstronik/types" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -136,7 +137,7 @@ func callWithError(method string, params interface{}) (*Response, error) { } func TestEth_protocolVersion(t *testing.T) { - expectedRes := hexutil.Uint(ethermint.ProtocolVersion) + expectedRes := hexutil.Uint(swisstroniktypes.ProtocolVersion) rpcRes := call(t, "eth_protocolVersion", []string{}) diff --git a/tests/signer.go b/tests/signer.go index cb3e4ef8..d0a83c49 100644 --- a/tests/signer.go +++ b/tests/signer.go @@ -26,6 +26,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "swisstronik/crypto/ethsecp256k1" + + "github.com/cosmos/cosmos-sdk/types/tx/signing" ) // RandomEthAddressWithPrivateKey generates an Ethereum address and its corresponding private key. @@ -61,7 +63,7 @@ func NewTestSigner(sk cryptotypes.PrivKey) keyring.Signer { } // Sign signs the message using the underlying private key -func (s Signer) Sign(_ string, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (s Signer) Sign(_ string, msg []byte, _ signing.SignMode) ([]byte, cryptotypes.PubKey, error) { if s.privKey.Type() != ethsecp256k1.KeyType { return nil, nil, fmt.Errorf( "invalid private key type for signing ethereum tx; expected %s, got %s", @@ -79,11 +81,11 @@ func (s Signer) Sign(_ string, msg []byte) ([]byte, cryptotypes.PubKey, error) { } // SignByAddress sign byte messages with a user key providing the address. -func (s Signer) SignByAddress(address sdk.Address, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (s Signer) SignByAddress(address sdk.Address, msg []byte, _ signing.SignMode) ([]byte, cryptotypes.PubKey, error) { signer := sdk.AccAddress(s.privKey.PubKey().Address()) if !signer.Equals(address) { return nil, nil, fmt.Errorf("address mismatch: signer %s ≠ given address %s", signer, address) } - return s.Sign("", msg) + return s.Sign("", msg, signing.SignMode_SIGN_MODE_DIRECT) } diff --git a/testutil/keeper/did.go b/testutil/keeper/did.go index 15bcb012..3b6bc559 100644 --- a/testutil/keeper/did.go +++ b/testutil/keeper/did.go @@ -6,24 +6,25 @@ import ( "swisstronik/x/did/keeper" "swisstronik/x/did/types" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/require" ) func DIDKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/keeper/vesting.go b/testutil/keeper/vesting.go index 419ea7de..759c4860 100644 --- a/testutil/keeper/vesting.go +++ b/testutil/keeper/vesting.go @@ -6,24 +6,25 @@ import ( "swisstronik/x/vesting/keeper" "swisstronik/x/vesting/types" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/require" ) func VestingKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) diff --git a/testutil/network/network.go b/testutil/network/network.go index baf8eaf8..494b8edb 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -12,7 +12,7 @@ // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License -// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE +// along with the Ethermint library. If not, see https://swisstronik/blob/main/LICENSE package network import ( @@ -24,27 +24,27 @@ import ( "net/http" "net/url" "os" + "os/signal" "path/filepath" "strings" "sync" + "syscall" "testing" "time" + "cosmossdk.io/log" sdkmath "cosmossdk.io/math" - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" - tmflags "github.com/cometbft/cometbft/libs/cli/flags" - "github.com/cometbft/cometbft/libs/log" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/node" - tmclient "github.com/cometbft/cometbft/rpc/client" + tmrpcclient "github.com/cometbft/cometbft/rpc/client" + dbm "github.com/cosmos/cosmos-db" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" "google.golang.org/grpc" - "cosmossdk.io/simapp" - "cosmossdk.io/simapp/params" + pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" @@ -56,7 +56,6 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" srvconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -65,34 +64,42 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "swisstronik/crypto/hd" - "swisstronik/encoding" "swisstronik/server/config" - evmmoduletypes "swisstronik/types" evmtypes "swisstronik/x/evm/types" "swisstronik/app" - simutils "github.com/cosmos/cosmos-sdk/testutil/sims" + "swisstronik/encoding" + + swisstroniktypes "swisstronik/types" + + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" ) // network lock to only allow one test network at a time -var lock = new(sync.Mutex) +var ( + lock = new(sync.Mutex) + portPool = make(chan string, 200) +) // AppConstructor defines a function which accepts a network configuration and // creates an ABCI Application to provide to Tendermint. type AppConstructor = func(val Validator) servertypes.Application // NewAppConstructor returns a new simapp AppConstructor -func NewAppConstructor(encodingCfg params.EncodingConfig, chainID string) AppConstructor { +func NewAppConstructor(chainID string) AppConstructor { return func(val Validator) servertypes.Application { return app.New( - val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0, - encodingCfg, - simutils.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir), + val.Ctx.Logger, + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + app.DefaultNodeHome, 5, + simtestutil.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir), baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), baseapp.SetChainID(chainID), - ) } } @@ -106,49 +113,48 @@ type Config struct { InterfaceRegistry codectypes.InterfaceRegistry TxConfig client.TxConfig AccountRetriever client.AccountRetriever - AppConstructor AppConstructor // the ABCI application constructor - GenesisState simapp.GenesisState // custom gensis state to provide - TimeoutCommit time.Duration // the consensus commitment timeout - AccountTokens sdkmath.Int // the amount of unique validator tokens (e.g. 1000node0) - StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake - BondedTokens sdkmath.Int // the amount of tokens each validator stakes - NumValidators int // the total number of validators to create and bond - ChainID string // the network chain-id - BondDenom string // the staking bond denomination - MinGasPrices string // the minimum gas prices each validator will accept - PruningStrategy string // the pruning strategy each validator will have - SigningAlgo string // signing algorithm for keys - RPCAddress string // RPC listen address (including port) - JSONRPCAddress string // JSON-RPC listen address (including port) - APIAddress string // REST API listen address (including port) - GRPCAddress string // GRPC server listen address (including port) - EnableTMLogging bool // enable Tendermint logging to STDOUT - CleanupDir bool // remove base temporary directory during cleanup - PrintMnemonic bool // print the mnemonic of first validator as log output for testing + AppConstructor AppConstructor // the ABCI application constructor + GenesisState app.GenesisState // custom gensis state to provide + TimeoutCommit time.Duration // the consensus commitment timeout + AccountTokens sdkmath.Int // the amount of unique validator tokens (e.g. 1000node0) + StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake + BondedTokens sdkmath.Int // the amount of tokens each validator stakes + NumValidators int // the total number of validators to create and bond + ChainID string // the network chain-id + BondDenom string // the staking bond denomination + MinGasPrices string // the minimum gas prices each validator will accept + PruningStrategy string // the pruning strategy each validator will have + SigningAlgo string // signing algorithm for keys + RPCAddress string // RPC listen address (including port) + JSONRPCAddress string // JSON-RPC listen address (including port) + APIAddress string // REST API listen address (including port) + GRPCAddress string // GRPC server listen address (including port) + EnableTMLogging bool // enable Tendermint logging to STDOUT + CleanupDir bool // remove base temporary directory during cleanup + PrintMnemonic bool // print the mnemonic of first validator as log output for testing } // DefaultConfig returns a sane default configuration suitable for nearly all // testing requirements. func DefaultConfig() Config { - encCfg := encoding.MakeConfig(app.ModuleBasics) - chainID := fmt.Sprintf("swisstronik_%d-1", tmrand.Int63n(9999999999999)+1) - + encCfg := encoding.MakeConfig() + chainID := fmt.Sprintf("ethermint_%d-1", cmtrand.Int63n(9999999999999)+1) return Config{ Codec: encCfg.Codec, TxConfig: encCfg.TxConfig, LegacyAmino: encCfg.Amino, InterfaceRegistry: encCfg.InterfaceRegistry, AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: NewAppConstructor(encCfg, chainID), + AppConstructor: NewAppConstructor(chainID), GenesisState: app.ModuleBasics.DefaultGenesis(encCfg.Codec), TimeoutCommit: 2 * time.Second, - ChainID: fmt.Sprintf("swisstronik_%d-1", tmrand.Int63n(9999999999999)+1), + ChainID: chainID, NumValidators: 4, - BondDenom: evmmoduletypes.SwtrDenom, - MinGasPrices: fmt.Sprintf("0.000006%s", evmmoduletypes.SwtrDenom), - AccountTokens: sdk.TokensFromConsensusPower(1000000000000000000, evmmoduletypes.PowerReduction), - StakingTokens: sdk.TokensFromConsensusPower(500000000000000000, evmmoduletypes.PowerReduction), - BondedTokens: sdk.TokensFromConsensusPower(100000000000000000, evmmoduletypes.PowerReduction), + BondDenom: swisstroniktypes.SwtrDenom, + MinGasPrices: fmt.Sprintf("0.000006%s", swisstroniktypes.SwtrDenom), + AccountTokens: sdk.TokensFromConsensusPower(1000, swisstroniktypes.PowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500, swisstroniktypes.PowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100, swisstroniktypes.PowerReduction), PruningStrategy: pruningtypes.PruningOptionNothing, CleanupDir: true, SigningAlgo: string(hd.EthSecp256k1Type), @@ -192,7 +198,7 @@ type ( P2PAddress string Address sdk.AccAddress ValAddress sdk.ValAddress - RPCClient tmclient.Client + RPCClient tmrpcclient.Client JSONRPCClient *ethclient.Client tmNode *node.Node @@ -201,6 +207,8 @@ type ( grpcWeb *http.Server jsonrpc *http.Server jsonrpcDone chan struct{} + errGroup *errgroup.Group + cancelFn context.CancelFunc } ) @@ -238,7 +246,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { l.Log("acquiring test network lock") lock.Lock() - if !evmmoduletypes.IsValidChainID(cfg.ChainID) { + if !swisstroniktypes.IsValidChainID(cfg.ChainID) { return nil, fmt.Errorf("invalid chain-id: %s", cfg.ChainID) } @@ -274,13 +282,13 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { appCfg.Telemetry.GlobalLabels = [][]string{{"chain_id", cfg.ChainID}} ctx := server.NewDefaultContext() - tmCfg := ctx.Config - tmCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit + cmtCfg := ctx.Config + cmtCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit // Only allow the first validator to expose an RPC, API and gRPC // server/client due to Tendermint in-process constraints. apiAddr := "" - tmCfg.RPC.ListenAddress = "" + cmtCfg.RPC.ListenAddress = "" appCfg.GRPC.Enable = false appCfg.GRPCWeb.Enable = false apiListenAddr := "" @@ -288,11 +296,11 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { if cfg.APIAddress != "" { apiListenAddr = cfg.APIAddress } else { - var err error - apiListenAddr, _, err = server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for API server") } + port := <-portPool + apiListenAddr = fmt.Sprintf("tcp://0.0.0.0:%s", port) } appCfg.API.Address = apiListenAddr @@ -303,41 +311,34 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { apiAddr = fmt.Sprintf("http://%s:%s", apiURL.Hostname(), apiURL.Port()) if cfg.RPCAddress != "" { - tmCfg.RPC.ListenAddress = cfg.RPCAddress + cmtCfg.RPC.ListenAddress = cfg.RPCAddress } else { - rpcAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for RPC server") } - tmCfg.RPC.ListenAddress = rpcAddr + port := <-portPool + cmtCfg.RPC.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%s", port) } if cfg.GRPCAddress != "" { appCfg.GRPC.Address = cfg.GRPCAddress } else { - _, grpcPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for GRPC server") } - appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", grpcPort) + port := <-portPool + appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", port) } appCfg.GRPC.Enable = true - _, grpcWebPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err - } - appCfg.GRPCWeb.Address = fmt.Sprintf("0.0.0.0:%s", grpcWebPort) - appCfg.GRPCWeb.Enable = true - if cfg.JSONRPCAddress != "" { appCfg.JSONRPC.Address = cfg.JSONRPCAddress } else { - _, jsonRPCPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for JSON-RPC server") } - appCfg.JSONRPC.Address = fmt.Sprintf("127.0.0.1:%s", jsonRPCPort) + port := <-portPool + appCfg.JSONRPC.Address = fmt.Sprintf("0.0.0.0:%s", port) } appCfg.JSONRPC.Enable = true appCfg.JSONRPC.API = config.GetAPINamespaces() @@ -345,8 +346,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { logger := log.NewNopLogger() if cfg.EnableTMLogging { - logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) - logger, _ = tmflags.ParseLogLevel("info", logger, tmcfg.DefaultLogLevel) + logger = log.NewLogger(os.Stdout) } ctx.Logger = logger @@ -366,25 +366,27 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - tmCfg.SetRoot(nodeDir) - tmCfg.Moniker = nodeDirName + cmtCfg.SetRoot(nodeDir) + cmtCfg.Moniker = nodeDirName monikers[i] = nodeDirName - proxyAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for Proxy server") } - tmCfg.ProxyApp = proxyAddr + port := <-portPool + proxyAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) + cmtCfg.ProxyApp = proxyAddr - p2pAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for Proxy server") } - tmCfg.P2P.ListenAddress = p2pAddr - tmCfg.P2P.AddrBookStrict = false - tmCfg.P2P.AllowDuplicateIP = true + port = <-portPool + p2pAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) + cmtCfg.P2P.ListenAddress = p2pAddr + cmtCfg.P2P.AddrBookStrict = false + cmtCfg.P2P.AllowDuplicateIP = true - nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(tmCfg) + nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(cmtCfg) if err != nil { return nil, err } @@ -430,25 +432,25 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { sdk.NewCoin(cfg.BondDenom, cfg.StakingTokens), ) - genFiles = append(genFiles, tmCfg.GenesisFile()) + genFiles = append(genFiles, cmtCfg.GenesisFile()) genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()}) - genAccounts = append(genAccounts, &evmmoduletypes.EthAccount{ + genAccounts = append(genAccounts, &swisstroniktypes.EthAccount{ BaseAccount: authtypes.NewBaseAccount(addr, nil, 0, 0), CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), }) - commission, err := sdk.NewDecFromStr("0.5") + commission, err := sdkmath.LegacyNewDecFromStr("0.5") if err != nil { return nil, err } createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + addr.String(), valPubKeys[i], sdk.NewCoin(cfg.BondDenom, cfg.BondedTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(commission, sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return nil, err @@ -477,7 +479,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { WithKeybase(kb). WithTxConfig(cfg.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(context.Background(), txFactory, nodeDirName, txBuilder, true); err != nil { return nil, err } @@ -490,7 +492,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - customAppTemplate, _ := config.AppConfig(evmmoduletypes.SwtrDenom) + customAppTemplate, _ := config.AppConfig(swisstroniktypes.SwtrDenom) srvconfig.SetConfigTemplate(customAppTemplate) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg) @@ -504,7 +506,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { clientCtx := client.Context{}. WithKeyringDir(clientDir). WithKeyring(kb). - WithHomeDir(tmCfg.RootDir). + WithHomeDir(cmtCfg.RootDir). WithChainID(cfg.ChainID). WithInterfaceRegistry(cfg.InterfaceRegistry). WithCodec(cfg.Codec). @@ -520,8 +522,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { NodeID: nodeID, PubKey: pubKey, Moniker: nodeDirName, - RPCAddress: tmCfg.RPC.ListenAddress, - P2PAddress: tmCfg.P2P.ListenAddress, + RPCAddress: cmtCfg.RPC.ListenAddress, + P2PAddress: cmtCfg.P2P.ListenAddress, APIAddress: apiAddr, Address: addr, ValAddress: sdk.ValAddress(addr), @@ -549,7 +551,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { // Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as any // defer in a test would not be called. - server.TrapSignal(network.Cleanup) + trapSignal(network.Cleanup) return network, nil } @@ -714,3 +716,27 @@ func centerText(text string, width int) string { return fmt.Sprintf("%s%s%s", leftBuffer, text, rightBuffer) } + +// trapSignal traps SIGINT and SIGTERM and calls os.Exit once a signal is received. +func trapSignal(cleanupFunc func()) { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + + go func() { + sig := <-sigs + + if cleanupFunc != nil { + cleanupFunc() + } + exitCode := 128 + + switch sig { + case syscall.SIGINT: + exitCode += int(syscall.SIGINT) + case syscall.SIGTERM: + exitCode += int(syscall.SIGTERM) + } + + os.Exit(exitCode) + }() +} diff --git a/testutil/network/util.go b/testutil/network/util.go index 88403a29..68388dd6 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -16,11 +16,13 @@ package network import ( + "context" "encoding/json" "fmt" "path/filepath" - "time" + "cosmossdk.io/log" + cmtcfg "github.com/cometbft/cometbft/config" tmos "github.com/cometbft/cometbft/libs/os" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" @@ -28,19 +30,22 @@ import ( "github.com/cometbft/cometbft/proxy" "github.com/cometbft/cometbft/rpc/client/local" "github.com/cometbft/cometbft/types" - tmtime "github.com/cometbft/cometbft/types/time" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/ethereum/go-ethereum/ethclient" + "golang.org/x/sync/errgroup" + sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" - srvtypes "github.com/cosmos/cosmos-sdk/server/types" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" mintypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -50,30 +55,31 @@ import ( func startInProcess(cfg Config, val *Validator) error { logger := val.Ctx.Logger - tmCfg := val.Ctx.Config - tmCfg.Instrumentation.Prometheus = false + cmtCfg := val.Ctx.Config + cmtCfg.Instrumentation.Prometheus = false if err := val.AppConfig.ValidateBasic(); err != nil { return err } - nodeKey, err := p2p.LoadOrGenNodeKey(tmCfg.NodeKeyFile()) + nodeKey, err := p2p.LoadOrGenNodeKey(cmtCfg.NodeKeyFile()) if err != nil { return err } app := cfg.AppConstructor(*val) - genDocProvider := node.DefaultGenesisDocProviderFunc(tmCfg) + genDocProvider := server.GenDocProvider(cmtCfg) + cmtApp := sdkserver.NewCometABCIWrapper(app) tmNode, err := node.NewNode( - tmCfg, - pvm.LoadOrGenFilePV(tmCfg.PrivValidatorKeyFile(), tmCfg.PrivValidatorStateFile()), + cmtCfg, + pvm.LoadOrGenFilePV(cmtCfg.PrivValidatorKeyFile(), cmtCfg.PrivValidatorStateFile()), nodeKey, - proxy.NewLocalClientCreator(app), + proxy.NewLocalClientCreator(cmtApp), genDocProvider, - node.DefaultDBProvider, - node.DefaultMetricsProvider(tmCfg.Instrumentation), - logger.With("module", val.Moniker), + cmtcfg.DefaultDBProvider, + node.DefaultMetricsProvider(cmtCfg.Instrumentation), + servercmtlog.CometLoggerWrapper{Logger: logger.With("module", val.Moniker)}, ) if err != nil { return err @@ -99,43 +105,37 @@ func startInProcess(cfg Config, val *Validator) error { // Add the tendermint queries service in the gRPC router. app.RegisterTendermintService(val.ClientCtx) + app.RegisterNodeService(val.ClientCtx, val.AppConfig.Config) } + ctx := context.Background() + ctx, val.cancelFn = context.WithCancel(ctx) + val.errGroup, ctx = errgroup.WithContext(ctx) + if val.AppConfig.API.Enable && val.APIAddress != "" { - apiSrv := api.New(val.ClientCtx, logger.With("module", "api-server")) + apiSrv := api.New(val.ClientCtx, logger.With("module", "api-server"), val.grpc) app.RegisterAPIRoutes(apiSrv, val.AppConfig.API) - errCh := make(chan error) - - go func() { - if err := apiSrv.Start(val.AppConfig.Config); err != nil { - errCh <- err - } - }() - - select { - case err := <-errCh: - return err - case <-time.After(srvtypes.ServerStartTime): // assume server started successfully - } + val.errGroup.Go(func() error { + return apiSrv.Start(ctx, val.AppConfig.Config) + }) val.api = apiSrv } if val.AppConfig.GRPC.Enable { - grpcSrv, err := servergrpc.StartGRPCServer(val.ClientCtx, app, val.AppConfig.GRPC) + grpcSrv, err := servergrpc.NewGRPCServer(val.ClientCtx, app, val.AppConfig.GRPC) if err != nil { return err } - val.grpc = grpcSrv + // Start the gRPC server in a goroutine. Note, the provided ctx will ensure + // that the server is gracefully shut down. + val.errGroup.Go(func() error { + return servergrpc.StartGRPCServer(ctx, logger.With(log.ModuleKey, "grpc-server"), val.AppConfig.GRPC, grpcSrv) + }) - if val.AppConfig.GRPCWeb.Enable { - val.grpcWeb, err = servergrpc.StartGRPCWeb(grpcSrv, val.AppConfig.Config) - if err != nil { - return err - } - } + val.grpc = grpcSrv } if val.AppConfig.JSONRPC.Enable && val.AppConfig.JSONRPC.Address != "" { @@ -143,10 +143,7 @@ func startInProcess(cfg Config, val *Validator) error { return fmt.Errorf("validator %s context is nil", val.Moniker) } - tmEndpoint := "/websocket" - tmRPCAddr := val.RPCAddress - - val.jsonrpc, val.jsonrpcDone, err = server.StartJSONRPC(val.Ctx, val.ClientCtx, tmRPCAddr, tmEndpoint, val.AppConfig, nil) + val.jsonrpc, val.jsonrpcDone, err = server.StartJSONRPC(val.Ctx, val.ClientCtx, val.errGroup, val.AppConfig, nil) if err != nil { return err } @@ -163,7 +160,7 @@ func startInProcess(cfg Config, val *Validator) error { } func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { - genTime := tmtime.Now() + genTime := cmttime.Now() for i := 0; i < cfg.NumValidators; i++ { tmCfg := vals[i].Ctx.Config @@ -177,13 +174,19 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { initCfg := genutiltypes.NewInitConfig(cfg.ChainID, gentxsDir, vals[i].NodeID, vals[i].PubKey) genFile := tmCfg.GenesisFile() - genDoc, err := types.GenesisDocFromFile(genFile) + genDoc, err := genutiltypes.AppGenesisFromFile(genFile) if err != nil { return err } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - tmCfg, initCfg, *genDoc, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator) + tmCfg, + initCfg, + genDoc, + banktypes.GenesisBalancesIterator{}, + genutiltypes.DefaultMessageValidator, + cfg.TxConfig.SigningContext().ValidatorAddressCodec(), + ) if err != nil { return err } @@ -226,7 +229,7 @@ func initGenFiles(cfg Config, genAccounts []authtypes.GenesisAccount, genBalance var govGenState govv1.GenesisState cfg.Codec.MustUnmarshalJSON(cfg.GenesisState[govtypes.ModuleName], &govGenState) - govGenState.DepositParams.MinDeposit[0].Denom = cfg.BondDenom + govGenState.Params.MinDeposit[0].Denom = cfg.BondDenom cfg.GenesisState[govtypes.ModuleName] = cfg.Codec.MustMarshalJSON(&govGenState) var mintGenState mintypes.GenesisState diff --git a/testutil/signer.go b/testutil/signer.go index 2c5aa097..76e4ce3f 100644 --- a/testutil/signer.go +++ b/testutil/signer.go @@ -2,24 +2,26 @@ package testutil import ( "fmt" + "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing" ) type TestSigner struct { - privateKey cryptotypes.PrivKey - address sdk.Address + privateKey cryptotypes.PrivKey + address sdk.Address } func NewTestSigner(privateKey cryptotypes.PrivKey) keyring.Signer { return TestSigner{ privateKey: privateKey, - address: sdk.AccAddress(privateKey.PubKey().Address()), + address: sdk.AccAddress(privateKey.PubKey().Address()), } } -func (ts TestSigner) Sign(uid string, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (ts TestSigner) Sign(uid string, msg []byte, signMode txsigning.SignMode) ([]byte, cryptotypes.PubKey, error) { sig, err := ts.privateKey.Sign(msg) if err != nil { return nil, nil, err @@ -28,10 +30,10 @@ func (ts TestSigner) Sign(uid string, msg []byte) ([]byte, cryptotypes.PubKey, e return sig, ts.privateKey.PubKey(), nil } -func (ts TestSigner) SignByAddress(address sdk.Address, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (ts TestSigner) SignByAddress(address sdk.Address, msg []byte, signMode txsigning.SignMode) ([]byte, cryptotypes.PubKey, error) { if !ts.address.Equals(address) { return nil, nil, fmt.Errorf("cannot find address. Given address: %s, Signer address: %s", address, ts.address) } - return ts.Sign("", msg) -} \ No newline at end of file + return ts.Sign("", msg, signMode) +} diff --git a/types/account.go b/types/account.go index a93dcc17..3617f31f 100644 --- a/types/account.go +++ b/types/account.go @@ -21,12 +21,14 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" ) var ( - _ authtypes.AccountI = (*EthAccount)(nil) + _ sdk.AccountI = (*EthAccount)(nil) _ EthAccountI = (*EthAccount)(nil) _ authtypes.GenesisAccount = (*EthAccount)(nil) _ codectypes.UnpackInterfacesMessage = (*EthAccount)(nil) @@ -43,7 +45,7 @@ const ( // EthAccountI represents the interface of an EVM compatible account type EthAccountI interface { - authtypes.AccountI + sdk.AccountI // EthAddress returns the ethereum Address representation of the AccAddress EthAddress() common.Address // CodeHash is the keccak256 hash of the contract code (if any) @@ -60,7 +62,7 @@ type EthAccountI interface { // ProtoAccount defines the prototype function for BaseAccount used for an // AccountKeeper. -func ProtoAccount() authtypes.AccountI { +func ProtoAccount() sdk.AccountI { return &EthAccount{ BaseAccount: &authtypes.BaseAccount{}, CodeHash: common.BytesToHash(emptyCodeHash).String(), diff --git a/types/block.go b/types/block.go index ed1eae33..5d0db44b 100644 --- a/types/block.go +++ b/types/block.go @@ -30,7 +30,7 @@ func BlockGasLimit(ctx sdk.Context) uint64 { // Otherwise get from the consensus parameters cp := ctx.ConsensusParams() - if cp == nil || cp.Block == nil { + if cp.Block == nil { return 0 } diff --git a/types/codec.go b/types/codec.go index 1bf2e00d..e85182cd 100644 --- a/types/codec.go +++ b/types/codec.go @@ -17,6 +17,7 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -25,7 +26,7 @@ import ( // implementations and interfaces. func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( - (*authtypes.AccountI)(nil), + (*sdk.AccountI)(nil), &EthAccount{}, ) registry.RegisterImplementations( diff --git a/types/dynamic_fee.pb.go b/types/dynamic_fee.pb.go index 83212367..795ebab5 100644 --- a/types/dynamic_fee.pb.go +++ b/types/dynamic_fee.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -29,7 +29,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ExtensionOptionDynamicFeeTx struct { // max_priority_price is the same as `max_priority_fee_per_gas` in eip-1559 // spec - MaxPriorityPrice github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=max_priority_price,json=maxPriorityPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_priority_price"` + MaxPriorityPrice cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=max_priority_price,json=maxPriorityPrice,proto3,customtype=cosmossdk.io/math.Int" json:"max_priority_price"` } func (m *ExtensionOptionDynamicFeeTx) Reset() { *m = ExtensionOptionDynamicFeeTx{} } @@ -74,22 +74,22 @@ func init() { } var fileDescriptor_9d7cf05c9992c480 = []byte{ - // 232 bytes of a gzipped FileDescriptorProto + // 234 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0x2d, 0xc9, 0x48, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x8e, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xab, 0xd2, 0x03, 0xab, 0xd2, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, - 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x4a, 0xd5, 0x5c, 0xd2, 0xae, 0x15, 0x25, 0xa9, 0x79, + 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x4a, 0x59, 0x5c, 0xd2, 0xae, 0x15, 0x25, 0xa9, 0x79, 0xc5, 0x99, 0xf9, 0x79, 0xfe, 0x05, 0x25, 0x99, 0xf9, 0x79, 0x2e, 0x10, 0xd3, 0xdc, 0x52, 0x53, - 0x43, 0x2a, 0x84, 0x62, 0xb8, 0x84, 0x72, 0x13, 0x2b, 0xe2, 0x0b, 0x8a, 0x32, 0xf3, 0x8b, 0x32, - 0x4b, 0x2a, 0x41, 0x8c, 0xe4, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xbd, 0x13, 0xf7, - 0xe4, 0x19, 0x6e, 0xdd, 0x93, 0x57, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x86, 0x52, 0xba, 0xc5, 0x29, 0xd9, 0x10, 0x57, 0xea, - 0x79, 0xe6, 0x95, 0x04, 0x09, 0xe4, 0x26, 0x56, 0x04, 0x40, 0x0d, 0x0a, 0x00, 0x99, 0xe3, 0x64, - 0x75, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, - 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x0a, 0x48, 0x66, 0xa6, 0x96, - 0x81, 0x8c, 0x44, 0xf3, 0x77, 0x12, 0x1b, 0xd8, 0xfd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x5c, 0xa9, 0x04, 0x48, 0x11, 0x01, 0x00, 0x00, + 0x43, 0x2a, 0x84, 0xbc, 0xb9, 0x84, 0x72, 0x13, 0x2b, 0xe2, 0x0b, 0x8a, 0x32, 0xf3, 0x8b, 0x32, + 0x4b, 0x2a, 0x41, 0x8c, 0xe4, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xd9, 0x13, 0xf7, + 0xe4, 0x19, 0x6e, 0xdd, 0x93, 0x17, 0x4d, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x2e, 0x4e, 0xc9, 0xd6, + 0xcb, 0xcc, 0xd7, 0xcf, 0x4d, 0x2c, 0xc9, 0xd0, 0xf3, 0xcc, 0x2b, 0x09, 0x12, 0xc8, 0x4d, 0xac, + 0x08, 0x80, 0xea, 0x0b, 0x00, 0x69, 0x73, 0xb2, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, + 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, + 0x39, 0x86, 0x28, 0x85, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xd4, + 0xb2, 0xdc, 0xfc, 0x62, 0x7d, 0x34, 0x6f, 0x26, 0xb1, 0x81, 0x9d, 0x6b, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x8c, 0x36, 0x25, 0x41, 0x00, 0x01, 0x00, 0x00, } func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error) { diff --git a/types/encoding.go b/types/encoding.go new file mode 100644 index 00000000..e4a4f1e3 --- /dev/null +++ b/types/encoding.go @@ -0,0 +1,16 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Codec codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} diff --git a/types/gasmeter.go b/types/gasmeter.go index 342f40a2..936e616c 100644 --- a/types/gasmeter.go +++ b/types/gasmeter.go @@ -19,7 +19,7 @@ import ( fmt "fmt" math "math" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" ) // ErrorNegativeGasConsumed defines an error thrown when the amount of gas refunded results in a @@ -36,27 +36,27 @@ type ErrorGasOverflow struct { } type infiniteGasMeterWithLimit struct { - consumed sdk.Gas - limit sdk.Gas + consumed uint64 + limit uint64 } // NewInfiniteGasMeterWithLimit returns a reference to a new infiniteGasMeter. -func NewInfiniteGasMeterWithLimit(limit sdk.Gas) sdk.GasMeter { +func NewInfiniteGasMeterWithLimit(limit uint64) storetypes.GasMeter { return &infiniteGasMeterWithLimit{ consumed: 0, limit: limit, } } -func (g *infiniteGasMeterWithLimit) GasConsumed() sdk.Gas { +func (g *infiniteGasMeterWithLimit) GasConsumed() uint64 { return g.consumed } -func (g *infiniteGasMeterWithLimit) GasConsumedToLimit() sdk.Gas { +func (g *infiniteGasMeterWithLimit) GasConsumedToLimit() uint64 { return g.consumed } -func (g *infiniteGasMeterWithLimit) Limit() sdk.Gas { +func (g *infiniteGasMeterWithLimit) Limit() uint64 { return g.limit } @@ -70,7 +70,7 @@ func addUint64Overflow(a, b uint64) (uint64, bool) { return a + b, false } -func (g *infiniteGasMeterWithLimit) ConsumeGas(amount sdk.Gas, descriptor string) { +func (g *infiniteGasMeterWithLimit) ConsumeGas(amount uint64, descriptor string) { var overflow bool // TODO: Should we set the consumed field after overflow checking? g.consumed, overflow = addUint64Overflow(g.consumed, amount) @@ -85,7 +85,7 @@ func (g *infiniteGasMeterWithLimit) ConsumeGas(amount sdk.Gas, descriptor string // Use case: This functionality enables refunding gas to the trasaction or block gas pools so that // EVM-compatible chains can fully support the go-ethereum StateDb interface. // See https://github.com/cosmos/cosmos-sdk/pull/9403 for reference. -func (g *infiniteGasMeterWithLimit) RefundGas(amount sdk.Gas, descriptor string) { +func (g *infiniteGasMeterWithLimit) RefundGas(amount uint64, descriptor string) { if g.consumed < amount { panic(ErrorNegativeGasConsumed{Descriptor: descriptor}) } @@ -105,6 +105,6 @@ func (g *infiniteGasMeterWithLimit) String() string { return fmt.Sprintf("InfiniteGasMeter:\n consumed: %d", g.consumed) } -func (g *infiniteGasMeterWithLimit) GasRemaining() sdk.Gas { +func (g *infiniteGasMeterWithLimit) GasRemaining() uint64 { return math.MaxUint64 } diff --git a/types/indexer.go b/types/indexer.go index f27e77fb..fb6acbf0 100644 --- a/types/indexer.go +++ b/types/indexer.go @@ -25,7 +25,7 @@ import ( type EVMTxIndexer interface { // LastIndexedBlock returns -1 if indexer db is empty LastIndexedBlock() (int64, error) - IndexBlock(*tmtypes.Block, []*abci.ResponseDeliverTx) error + IndexBlock(*tmtypes.Block, []*abci.ExecTxResult) error // GetByTxHash returns nil if tx not found. GetByTxHash(common.Hash) (*TxResult, error) diff --git a/types/tests/test_utils.go b/types/tests/test_utils.go index 09e7c0f4..63618fa4 100644 --- a/types/tests/test_utils.go +++ b/types/tests/test_utils.go @@ -17,7 +17,7 @@ package tests import ( - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ) var ( diff --git a/x/did/client/cli/tx.go b/x/did/client/cli/tx.go index f25a2f46..2eac9d21 100644 --- a/x/did/client/cli/tx.go +++ b/x/did/client/cli/tx.go @@ -9,11 +9,13 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "swisstronik/x/did/types" + + sdkerr "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -116,7 +118,7 @@ func AccAddrByKeyRef(keyring keyring.Keyring, keyRef string) (sdk.AccAddress, er return info.GetAddress() } - if !sdkerrors.IsOf(err, sdkerrors.ErrIO, sdkerrors.ErrKeyNotFound) { + if !sdkerrors.IsOf(err, sdkerr.ErrIO, sdkerr.ErrKeyNotFound) { return nil, err } diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index ceddd3a7..8dfd2fe0 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -2,13 +2,14 @@ package keeper import ( "fmt" - "github.com/cosmos/gogoproto/proto" "strconv" "strings" - "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -255,7 +256,7 @@ func (k Keeper) GetAllDIDDocumentVersions(ctx sdk.Context, did string) ([]*types result := make([]*types.Metadata, 0) - versionIterator := sdk.KVStorePrefixIterator(store, types.GetDocumentVersionsPrefix(did)) + versionIterator := storetypes.KVStorePrefixIterator(store, types.GetDocumentVersionsPrefix(did)) defer closeIteratorOrPanic(versionIterator) for ; versionIterator.Valid(); versionIterator.Next() { @@ -313,7 +314,7 @@ func (k Keeper) HasDIDDocumentVersion(ctx sdk.Context, id, version string) bool func (k Keeper) IterateDIDs(ctx sdk.Context, callback func(did string) (continue_ bool)) { store := ctx.KVStore(k.storeKey) - latestVersionIterator := sdk.KVStorePrefixIterator(store, types.GetLatestDocumentVersionPrefix()) + latestVersionIterator := storetypes.KVStorePrefixIterator(store, types.GetLatestDocumentVersionPrefix()) defer closeIteratorOrPanic(latestVersionIterator) for ; latestVersionIterator.Valid(); latestVersionIterator.Next() { @@ -329,7 +330,7 @@ func (k Keeper) IterateDIDs(ctx sdk.Context, callback func(did string) (continue func (k Keeper) IterateDIDDocumentVersions(ctx sdk.Context, did string, callback func(version types.DIDDocumentWithMetadata) (continue_ bool)) { store := ctx.KVStore(k.storeKey) - versionIterator := sdk.KVStorePrefixIterator(store, types.GetDocumentVersionsPrefix(did)) + versionIterator := storetypes.KVStorePrefixIterator(store, types.GetDocumentVersionsPrefix(did)) defer closeIteratorOrPanic(versionIterator) for ; versionIterator.Valid(); versionIterator.Next() { @@ -344,7 +345,7 @@ func (k Keeper) IterateDIDDocumentVersions(ctx sdk.Context, did string, callback func (k Keeper) IterateAllDIDDocumentVersions(ctx sdk.Context, callback func(version types.DIDDocumentWithMetadata) (continue_ bool)) { store := ctx.KVStore(k.storeKey) - allVersionsIterator := sdk.KVStorePrefixIterator(store, []byte(types.DocumentVersionKey)) + allVersionsIterator := storetypes.KVStorePrefixIterator(store, []byte(types.DocumentVersionKey)) defer closeIteratorOrPanic(allVersionsIterator) for ; allVersionsIterator.Valid(); allVersionsIterator.Next() { @@ -530,7 +531,7 @@ func GetSignerIDForErrorMessage(signerID string, existingVersionID string, updat return signerID } -func closeIteratorOrPanic(iterator sdk.Iterator) { +func closeIteratorOrPanic(iterator storetypes.Iterator) { err := iterator.Close() if err != nil { panic(err.Error()) @@ -656,7 +657,7 @@ func (k Keeper) HasResource(ctx sdk.Context, collectionID string, id string) boo func (k Keeper) GetResourceCollection(ctx sdk.Context, collectionID string) []*types.ResourceMetadata { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.GetResourceMetadataCollectionPrefix(collectionID)) + iterator := storetypes.KVStorePrefixIterator(store, types.GetResourceMetadataCollectionPrefix(collectionID)) var resources []*types.ResourceMetadata @@ -673,7 +674,7 @@ func (k Keeper) GetResourceCollection(ctx sdk.Context, collectionID string) []*t } func (k Keeper) GetLastResourceVersionMetadata(ctx sdk.Context, collectionID, name, resourceType string) (types.ResourceMetadata, bool) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.GetResourceMetadataCollectionPrefix(collectionID)) + iterator := storetypes.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.GetResourceMetadataCollectionPrefix(collectionID)) defer closeIteratorOrPanic(iterator) @@ -706,7 +707,7 @@ func (k Keeper) UpdateResourceMetadata(ctx sdk.Context, metadata *types.Resource } func (k Keeper) IterateAllResourceMetadatas(ctx sdk.Context, callback func(metadata types.ResourceMetadata) (continue_ bool)) { - headerIterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.StrBytes(types.ResourceMetadataKey)) + headerIterator := storetypes.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.StrBytes(types.ResourceMetadataKey)) defer closeIteratorOrPanic(headerIterator) for headerIterator.Valid() { diff --git a/x/did/keeper/keeper_test.go b/x/did/keeper/keeper_test.go index dfda0984..a378287b 100644 --- a/x/did/keeper/keeper_test.go +++ b/x/did/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "fmt" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/google/uuid" . "github.com/onsi/ginkgo/v2" @@ -47,8 +46,8 @@ func (suite *KeeperTestSuite) Setup(t *testing.T) { chainID := utils.TestnetChainID + "-1" app, _ := app.SetupSwissApp(checkTx, nil, chainID) - s.ctx = app.BaseApp.NewContext(false, tmproto.Header{ChainID: "swisstronik_1291-1"}) - s.goCtx = sdk.WrapSDKContext(s.ctx) + s.ctx = app.BaseApp.NewContext(false) + s.goCtx = s.ctx s.keeper = app.DIDKeeper } @@ -1246,7 +1245,7 @@ func (suite *KeeperTestSuite) TestIndexMultipleDocuments() { // Generate 3 did documents with same verification method var createdDocuments []*types.DIDDocument - for i:=0; i 0 { + if params.Block != nil && params.Block.MaxGas > 0 { hi = uint64(params.Block.MaxGas) } else { hi = req.GasCap @@ -328,7 +328,7 @@ func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*type nonce := k.GetNonce(ctx, args.GetFrom()) args.Nonce = (*hexutil.Uint64)(&nonce) - txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) // convert the tx args to an ethereum message msg, err := args.ToMessage(req.GasCap, cfg.BaseFee) @@ -432,7 +432,7 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ } signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) - txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) for i, tx := range req.Predecessors { ethTx := tx.AsTransaction() msg, err := ethTx.AsMessage(signer, cfg.BaseFee) @@ -517,7 +517,7 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) txsLength := len(req.Txs) results := make([]*types.TxTraceResult, 0, txsLength) - txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := types.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) for i, tx := range req.Txs { result := types.TxTraceResult{} ethTx := tx.AsTransaction() @@ -645,7 +645,7 @@ func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types res := &types.QueryBaseFeeResponse{} if baseFee != nil { aux := sdkmath.NewIntFromBigInt(baseFee) - res.BaseFee = &aux + res.BaseFee = aux } return res, nil diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index cad45d9b..1b577553 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -752,25 +752,25 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { "pass - default Base Fee", func() { initialBaseFee := sdkmath.NewInt(ethparams.InitialBaseFee) - expRes = &types.QueryBaseFeeResponse{BaseFee: &initialBaseFee} + expRes = &types.QueryBaseFeeResponse{BaseFee: initialBaseFee} }, true, true, true, }, { "pass - non-nil Base Fee", func() { - baseFee := sdk.OneInt().BigInt() + baseFee := sdkmath.OneInt().BigInt() suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) aux = sdkmath.NewIntFromBigInt(baseFee) - expRes = &types.QueryBaseFeeResponse{BaseFee: &aux} + expRes = &types.QueryBaseFeeResponse{BaseFee: aux} }, true, true, true, }, { "pass - nil Base Fee when london hardfork not activated", func() { - baseFee := sdk.OneInt().BigInt() + baseFee := sdkmath.OneInt().BigInt() suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) expRes = &types.QueryBaseFeeResponse{} @@ -780,8 +780,8 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { { "pass - zero Base Fee when feemarket not activated", func() { - baseFee := sdk.ZeroInt() - expRes = &types.QueryBaseFeeResponse{BaseFee: &baseFee} + baseFee := sdkmath.ZeroInt() + expRes = &types.QueryBaseFeeResponse{BaseFee: baseFee} }, true, false, true, }, diff --git a/x/evm/keeper/hooks.go b/x/evm/keeper/hooks.go index 44a4cfe4..4e386ac1 100644 --- a/x/evm/keeper/hooks.go +++ b/x/evm/keeper/hooks.go @@ -16,9 +16,10 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" + "context" "swisstronik/x/evm/types" - sdk "github.com/cosmos/cosmos-sdk/types" + + errorsmod "cosmossdk.io/errors" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" ) @@ -34,7 +35,7 @@ func NewMultiEvmHooks(hooks ...types.EvmHooks) MultiEvmHooks { } // PostTxProcessing delegate the call to underlying hooks -func (mh MultiEvmHooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error { +func (mh MultiEvmHooks) PostTxProcessing(ctx context.Context, msg core.Message, receipt *ethtypes.Receipt) error { for i := range mh { if err := mh[i].PostTxProcessing(ctx, msg, receipt); err != nil { return errorsmod.Wrapf(err, "EVM hook %T failed", mh[i]) diff --git a/x/evm/keeper/hooks_test.go b/x/evm/keeper/hooks_test.go index ea1362f6..4090c48c 100644 --- a/x/evm/keeper/hooks_test.go +++ b/x/evm/keeper/hooks_test.go @@ -1,10 +1,10 @@ package keeper_test import ( + "context" "errors" "math/big" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -16,7 +16,7 @@ import ( // FailureHook always fail type FailureHook struct{} -func (dh FailureHook) PostTxProcessing(sdk.Context, core.Message, *ethtypes.Receipt) error { +func (dh FailureHook) PostTxProcessing(context.Context, core.Message, *ethtypes.Receipt) error { return errors.New("post tx processing failed") } diff --git a/x/evm/keeper/integration_test.go b/x/evm/keeper/integration_test.go index 4ade0e25..0ac9135a 100644 --- a/x/evm/keeper/integration_test.go +++ b/x/evm/keeper/integration_test.go @@ -25,9 +25,10 @@ import ( evmtypes "swisstronik/x/evm/types" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" simutils "github.com/cosmos/cosmos-sdk/testutil/sims" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -59,7 +60,7 @@ var _ = Describe("Feemarket", func() { // 100_000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, // a `minGasPrices = 5_000_000_000` results in `minGlobalFee = // 500_000_000_000_000` - privKey, _ = setupTestWithContext("1", sdk.NewDec(minGasPrices), sdk.NewInt(baseFee)) + privKey, _ = setupTestWithContext("1", sdkmath.LegacyNewDec(minGasPrices), sdkmath.NewInt(baseFee)) }) Context("during CheckTx", func() { @@ -96,21 +97,6 @@ var _ = Describe("Feemarket", func() { }) Context("during DeliverTx", func() { - DescribeTable("should accept transactions with gas Limit > 0", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasLimit, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }, - Entry("legacy tx", func() txParams { - return txParams{100000, big.NewInt(baseFee), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{100000, nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} - }), - ) DescribeTable("should not accept transactions with gas Limit > 0", func(malleate getprices) { p := malleate() @@ -133,7 +119,7 @@ var _ = Describe("Feemarket", func() { // setupTestWithContext sets up a test chain with an example Cosmos send msg, // given a local (validator config) and a gloabl (feemarket param) minGasPrice -func setupTestWithContext(valMinGasPrice string, minGasPrice sdk.Dec, baseFee math.Int) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { +func setupTestWithContext(valMinGasPrice string, minGasPrice sdkmath.LegacyDec, baseFee math.Int) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { privKey, msg := setupTest(valMinGasPrice + utils.BaseDenom) params := types.DefaultParams() params.MinGasPrice = minGasPrice @@ -148,7 +134,7 @@ func setupTest(localMinGasPrices string) (*ethsecp256k1.PrivKey, banktypes.MsgSe setupChain(localMinGasPrices) privKey, address := generateKey() - amount, ok := sdk.NewIntFromString("10000000000000000000") + amount, ok := sdkmath.NewIntFromString("10000000000000000000") s.Require().True(ok) initBalance := sdk.Coins{sdk.Coin{ Denom: s.denom, @@ -161,7 +147,7 @@ func setupTest(localMinGasPrices string) (*ethsecp256k1.PrivKey, banktypes.MsgSe ToAddress: address.String(), Amount: sdk.Coins{sdk.Coin{ Denom: s.denom, - Amount: sdk.NewInt(10000), + Amount: sdkmath.NewInt(10000), }}, } s.Commit() @@ -181,7 +167,6 @@ func setupChain(localMinGasPricesStr string) { map[int64]bool{}, app.DefaultNodeHome, 5, - encoding.MakeConfig(app.ModuleBasics), simutils.NewAppOptionsWithFlagHome(app.DefaultNodeHome), baseapp.SetChainID(chainID), baseapp.SetMinGasPrices(localMinGasPricesStr), @@ -195,7 +180,7 @@ func setupChain(localMinGasPricesStr string) { // Initialize the chain newapp.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, AppStateBytes: stateBytes, @@ -251,7 +236,7 @@ func buildEthTx( } func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) []byte { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() option, err := codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{}) s.Require().NoError(err) @@ -272,7 +257,7 @@ func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleT s.Require().NoError(err) evmDenom := s.app.EvmKeeper.GetParams(s.ctx).EvmDenom - fees := sdk.Coins{{Denom: evmDenom, Amount: sdk.NewIntFromBigInt(txData.Fee())}} + fees := sdk.Coins{{Denom: evmDenom, Amount: sdkmath.NewIntFromBigInt(txData.Fee())}} builder.SetFeeAmount(fees) builder.SetGasLimit(msgEthereumTx.GetGas()) @@ -286,13 +271,9 @@ func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleT func checkEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) abci.ResponseCheckTx { bz := prepareEthTx(priv, msgEthereumTx) req := abci.RequestCheckTx{Tx: bz} - res := s.app.BaseApp.CheckTx(req) - return res -} - -func deliverEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) abci.ResponseDeliverTx { - bz := prepareEthTx(priv, msgEthereumTx) - req := abci.RequestDeliverTx{Tx: bz} - res := s.app.BaseApp.DeliverTx(req) - return res + res, err := s.app.BaseApp.CheckTx(&req) + if err != nil { + return abci.ResponseCheckTx{} + } + return *res } diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index df9a4b62..133f80f4 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -16,6 +16,7 @@ package keeper import ( + "context" "fmt" "math/big" @@ -23,10 +24,10 @@ import ( "github.com/ethereum/go-ethereum/crypto" errorsmod "cosmossdk.io/errors" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ethereum/go-ethereum/common" @@ -264,7 +265,7 @@ func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper { } // PostTxProcessing delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error -func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error { +func (k *Keeper) PostTxProcessing(ctx context.Context, msg core.Message, receipt *ethtypes.Receipt) error { if k.hooks == nil { return nil } @@ -351,11 +352,11 @@ func (k Keeper) getBaseFee(ctx sdk.Context, london bool) *big.Int { } // GetMinGasMultiplier returns the MinGasMultiplier param from the fee market module -func (k Keeper) GetMinGasMultiplier(ctx sdk.Context) sdk.Dec { +func (k Keeper) GetMinGasMultiplier(ctx sdk.Context) sdkmath.LegacyDec { fmkParmas := k.feeMarketKeeper.GetParams(ctx) if fmkParmas.MinGasMultiplier.IsNil() { // in case we are executing eth_call on a legacy block, returns a zero value. - return sdk.ZeroDec() + return sdkmath.LegacyZeroDec() } return fmkParmas.MinGasMultiplier } @@ -427,7 +428,7 @@ func (k *Keeper) ForEachStorage(ctx sdk.Context, addr common.Address, cb func(ke store := ctx.KVStore(k.storeKey) prefix := types.AddressStoragePrefix(addr) - iterator := sdk.KVStorePrefixIterator(store, prefix) + iterator := storetypes.KVStorePrefixIterator(store, prefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { diff --git a/x/evm/keeper/keeper_sgxvm_test.go b/x/evm/keeper/keeper_sgxvm_test.go index bca8d5e3..d040d5fd 100644 --- a/x/evm/keeper/keeper_sgxvm_test.go +++ b/x/evm/keeper/keeper_sgxvm_test.go @@ -5,7 +5,6 @@ import ( "encoding/json" "math" "math/big" - "time" "github.com/SigmaGmbH/librustgo" @@ -38,10 +37,6 @@ import ( "github.com/ethereum/go-ethereum/params" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmversion "github.com/cometbft/cometbft/proto/tendermint/version" - "github.com/cometbft/cometbft/version" ) func (suite *KeeperTestSuite) SetupSGXVMTest() { @@ -128,7 +123,7 @@ func (suite *KeeperTestSuite) SetupSGXVMAppWithT(checkTx bool, t require.Testing // Initialize the chain suite.app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: "ethermint_9000-1", Validators: []abci.ValidatorUpdate{}, ConsensusParams: app.DefaultConsensusParams, @@ -137,29 +132,7 @@ func (suite *KeeperTestSuite) SetupSGXVMAppWithT(checkTx bool, t require.Testing ) } - suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ - Height: 1, - ChainID: "ethermint_9000-1", - Time: time.Now().UTC(), - ProposerAddress: suite.consAddress.Bytes(), - Version: tmversion.Consensus{ - Block: version.BlockProtocol, - }, - LastBlockId: tmproto.BlockID{ - Hash: tmhash.Sum([]byte("block_id")), - PartSetHeader: tmproto.PartSetHeader{ - Total: 11, - Hash: tmhash.Sum([]byte("partset_header")), - }, - }, - AppHash: tmhash.Sum([]byte("app")), - DataHash: tmhash.Sum([]byte("data")), - EvidenceHash: tmhash.Sum([]byte("evidence")), - ValidatorsHash: tmhash.Sum([]byte("validators")), - NextValidatorsHash: tmhash.Sum([]byte("next_validators")), - ConsensusHash: tmhash.Sum([]byte("consensus")), - LastResultsHash: tmhash.Sum([]byte("last_result")), - }) + suite.ctx = suite.app.BaseApp.NewContext(checkTx) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) @@ -173,7 +146,7 @@ func (suite *KeeperTestSuite) SetupSGXVMAppWithT(checkTx bool, t require.Testing suite.app.AccountKeeper.SetAccount(suite.ctx, acc) valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(valAddr.String(), priv.PubKey(), stakingtypes.Description{}) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) require.NoError(t, err) @@ -181,7 +154,7 @@ func (suite *KeeperTestSuite) SetupSGXVMAppWithT(checkTx bool, t require.Testing require.NoError(t, err) suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID()) suite.appCodec = encodingConfig.Codec diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index e7ac4d12..bbd0abea 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" + "cosmossdk.io/store/prefix" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/store/prefix" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -56,10 +56,6 @@ import ( "github.com/SigmaGmbH/librustgo" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmversion "github.com/cometbft/cometbft/proto/tendermint/version" - "github.com/cometbft/cometbft/version" "swisstronik/crypto/deoxys" ) @@ -176,7 +172,6 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, ch }) if suite.mintFeeCollector { - panic("8888888888888888") // mint some coin to fee collector coins := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(int64(params.TxGas)-1))) genesisState := app.NewTestGenesisState(suite.app.AppCodec()) @@ -199,7 +194,7 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, ch // Initialize the chain suite.app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: app.DefaultConsensusParams, @@ -207,32 +202,7 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, ch }, ) } - - header := tmproto.Header{ - ChainID: chainID, - Height: 1, - Time: time.Now().UTC(), - ValidatorsHash: tmhash.Sum([]byte("validators")), - AppHash: tmhash.Sum([]byte("app")), - ProposerAddress: suite.consAddress.Bytes(), - Version: tmversion.Consensus{ - Block: version.BlockProtocol, - }, - LastBlockId: tmproto.BlockID{ - Hash: tmhash.Sum([]byte("block_id")), - PartSetHeader: tmproto.PartSetHeader{ - Total: 11, - Hash: tmhash.Sum([]byte("partset_header")), - }, - }, - DataHash: tmhash.Sum([]byte("data")), - NextValidatorsHash: tmhash.Sum([]byte("next_validators")), - ConsensusHash: tmhash.Sum([]byte("consensus")), - LastResultsHash: tmhash.Sum([]byte("last_result")), - EvidenceHash: tmhash.Sum([]byte("evidence")), - } - - suite.ctx = suite.app.NewContext(checkTx, header) + suite.ctx = suite.app.NewContext(checkTx) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) evmtypes.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) @@ -246,7 +216,7 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, ch suite.app.AccountKeeper.SetAccount(suite.ctx, acc) valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(valAddr.String(), priv.PubKey(), stakingtypes.Description{}) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) require.NoError(t, err) @@ -259,7 +229,7 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, ch err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) require.NoError(t, err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID()) suite.appCodec = encodingConfig.Codec @@ -274,15 +244,13 @@ func (suite *KeeperTestSuite) EvmDenom() string { // Commit and begin new block func (suite *KeeperTestSuite) Commit() { - _ = suite.app.Commit() + suite.app.Commit() header := suite.ctx.BlockHeader() header.Height += 1 - suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: header, - }) + suite.app.BeginBlocker(suite.ctx) // update ctx - suite.ctx = suite.app.BaseApp.NewContext(false, header) + suite.ctx = suite.app.BaseApp.NewContext(false) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) evmtypes.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) @@ -485,7 +453,7 @@ func (suite *KeeperTestSuite) TestBaseFee() { suite.enableFeemarket = tc.enableFeemarket suite.enableLondonHF = tc.enableLondonHF suite.SetupTest() - suite.app.EvmKeeper.BeginBlock(suite.ctx, abci.RequestBeginBlock{}) + suite.app.EvmKeeper.BeginBlock(suite.ctx) evmParams := suite.app.EvmKeeper.GetParams(suite.ctx) ethCfg := evmParams.ChainConfig.EthereumConfig(suite.app.EvmKeeper.ChainID()) baseFee := suite.app.EvmKeeper.GetBaseFee(suite.ctx, ethCfg) @@ -522,7 +490,7 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { suite.SetupTest() tc.malleate() i := 0 - suite.app.AccountKeeper.IterateAccounts(suite.ctx, func(account authtypes.AccountI) bool { + suite.app.AccountKeeper.IterateAccounts(suite.ctx, func(account sdk.AccountI) bool { ethAccount, ok := account.(evmcommontypes.EthAccountI) if !ok { // ignore non EthAccounts diff --git a/x/evm/keeper/sgxvm.go b/x/evm/keeper/sgxvm.go index 1ca684ce..3c4095c2 100644 --- a/x/evm/keeper/sgxvm.go +++ b/x/evm/keeper/sgxvm.go @@ -2,11 +2,16 @@ package keeper import ( "context" - errorsmod "cosmossdk.io/errors" "encoding/json" "fmt" + "math/big" + "strconv" + evmcommontypes "swisstronik/types" + "swisstronik/x/evm/types" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "github.com/SigmaGmbH/librustgo" - "github.com/armon/go-metrics" tmbytes "github.com/cometbft/cometbft/libs/bytes" tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/telemetry" @@ -16,10 +21,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" - "math/big" - "strconv" - evmcommontypes "swisstronik/types" - "swisstronik/x/evm/types" + gometrics "github.com/hashicorp/go-metrics" ) // HandleTx receives a transaction which is then @@ -33,7 +35,7 @@ func (k *Keeper) HandleTx(goCtx context.Context, msg *types.MsgHandleTx) (*types tx := msg.AsTransaction() txIndex := k.GetTxIndexTransient(ctx) - labels := []metrics.Label{ + labels := []gometrics.Label{ telemetry.NewLabel("tx_type", fmt.Sprintf("%d", tx.Type())), } if tx.To() == nil { @@ -63,7 +65,7 @@ func (k *Keeper) HandleTx(goCtx context.Context, msg *types.MsgHandleTx) (*types // Observe which users define a gas limit >> gas used. Note, that // gas_limit and gas_used are always > 0 - gasLimit := sdk.NewDec(int64(tx.Gas())) + gasLimit := sdkmath.LegacyNewDec(int64(tx.Gas())) gasRatio, err := gasLimit.QuoInt64(int64(response.GasUsed)).Float64() if err == nil { telemetry.SetGaugeWithLabels( diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index c0da2f22..210d5dd2 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -20,9 +20,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + evmcommontypes "swisstronik/types" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" - evmcommontypes "swisstronik/types" ) // GetHashFn implements vm.GetHashFunc for Ethermint. It handles 3 cases: @@ -61,8 +62,8 @@ func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { case ctx.BlockHeight() > h: // Case 2: if the chain is not the current height we need to retrieve the hash from the store for the // current chain epoch. This only applies if the current height is greater than the requested height. - histInfo, found := k.stakingKeeper.GetHistoricalInfo(ctx, h) - if !found { + histInfo, err := k.stakingKeeper.GetHistoricalInfo(ctx, h) + if err != nil { k.Logger(ctx).Debug("historical info not found", "height", h) return common.Hash{} } diff --git a/x/evm/keeper/state_transition_benchmark_test.go b/x/evm/keeper/state_transition_benchmark_test.go index c21aa204..6d99ab5b 100644 --- a/x/evm/keeper/state_transition_benchmark_test.go +++ b/x/evm/keeper/state_transition_benchmark_test.go @@ -6,8 +6,10 @@ import ( "testing" evmtypes "swisstronik/x/evm/types" + "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -62,7 +64,7 @@ func newSignedEthTx( return nil, errors.New("unknown transaction type!") } - sig, _, err := krSigner.SignByAddress(addr, ethTx.Hash().Bytes()) + sig, _, err := krSigner.SignByAddress(addr, ethTx.Hash().Bytes(), signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) if err != nil { return nil, err } diff --git a/x/evm/keeper/state_transition_test.go b/x/evm/keeper/state_transition_test.go index 4bdc6a8e..e490590c 100644 --- a/x/evm/keeper/state_transition_test.go +++ b/x/evm/keeper/state_transition_test.go @@ -10,6 +10,7 @@ import ( "swisstronik/x/evm/keeper" "swisstronik/x/evm/types" + storetypes "cosmossdk.io/store/types" "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" @@ -145,8 +146,8 @@ func (suite *KeeperTestSuite) TestGetCoinbaseAddress() { header.ProposerAddress = valConsAddr.Bytes() suite.ctx = suite.ctx.WithBlockHeader(header) - _, found := suite.app.StakingKeeper.GetValidatorByConsAddr(suite.ctx, valConsAddr.Bytes()) - suite.Require().True(found) + _, err = suite.app.StakingKeeper.GetValidatorByConsAddr(suite.ctx, valConsAddr.Bytes()) + suite.Require().NoError(err) suite.Require().NotEmpty(suite.ctx.BlockHeader().ProposerAddress) }, @@ -332,7 +333,7 @@ func (suite *KeeperTestSuite) TestResetGasMeterAndConsumeGas() { suite.SetupTest() // reset panicF := func() { - gm := sdk.NewGasMeter(10) + gm := storetypes.NewGasMeter(10) gm.ConsumeGas(tc.gasConsumed, "") ctx := suite.ctx.WithGasMeter(gm) suite.app.EvmKeeper.ResetGasMeterAndConsumeGas(ctx, tc.gasUsed) diff --git a/x/evm/keeper/utils.go b/x/evm/keeper/utils.go index 54cc9200..4bbf10e1 100644 --- a/x/evm/keeper/utils.go +++ b/x/evm/keeper/utils.go @@ -34,8 +34,8 @@ import ( // GetCoinbaseAddress returns the block proposer's validator operator address. func (k Keeper) GetCoinbaseAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) (common.Address, error) { - validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress)) - if !found { + validator, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress)) + if err != nil { return common.Address{}, errorsmod.Wrapf( stakingtypes.ErrNoValidatorFound, "failed to retrieve validator from block proposer address %s", @@ -43,7 +43,7 @@ func (k Keeper) GetCoinbaseAddress(ctx sdk.Context, proposerAddress sdk.ConsAddr ) } - coinbase := common.BytesToAddress(validator.GetOperator()) + coinbase := common.BytesToAddress(sdk.ValAddress(validator.GetOperator())) return coinbase, nil } diff --git a/x/evm/keeper/utils_test.go b/x/evm/keeper/utils_test.go index 8bd35403..36db3655 100644 --- a/x/evm/keeper/utils_test.go +++ b/x/evm/keeper/utils_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "math/big" - sdkmath "cosmossdk.io/math" "swisstronik/x/evm/keeper" evmtypes "swisstronik/x/evm/types" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -14,8 +15,8 @@ import ( func (suite *KeeperTestSuite) TestCheckSenderBalance() { hundredInt := sdkmath.NewInt(100) - zeroInt := sdk.ZeroInt() - oneInt := sdk.OneInt() + zeroInt := sdkmath.ZeroInt() + oneInt := sdkmath.OneInt() fiveInt := sdkmath.NewInt(5) fiftyInt := sdkmath.NewInt(50) negInt := sdkmath.NewInt(-10) @@ -258,7 +259,7 @@ func (suite *KeeperTestSuite) TestCheckSenderBalance() { // In practice, the two tested functions will also be sequentially executed. func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { hundredInt := sdkmath.NewInt(100) - zeroInt := sdk.ZeroInt() + zeroInt := sdkmath.ZeroInt() oneInt := sdkmath.NewInt(1) fiveInt := sdkmath.NewInt(5) fiftyInt := sdkmath.NewInt(50) diff --git a/x/evm/module.go b/x/evm/module.go index 6a810603..13d61172 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -20,12 +20,11 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -36,13 +35,20 @@ import ( "swisstronik/x/evm/client/cli" "swisstronik/x/evm/keeper" "swisstronik/x/evm/types" + + bam "github.com/cosmos/cosmos-sdk/baseapp" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.EndBlockAppModule = AppModule{} - _ module.BeginBlockAppModule = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // AppModuleBasic defines the basic application module used by the evm module. @@ -136,7 +142,7 @@ func (AppModule) Name() string { func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { } -func (am AppModule) NewHandler() sdk.Handler { +func (am AppModule) NewHandler() bam.MsgServiceHandler { return NewHandler(am.keeper) } @@ -148,23 +154,22 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // BeginBlock returns the begin block for the evm module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx, req) +func (am AppModule) BeginBlock(ctx context.Context) error { + return am.keeper.BeginBlock(ctx) } // EndBlock returns the end blocker for the evm module. It returns no validator // updates. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - return am.keeper.EndBlock(ctx, req) +func (am AppModule) EndBlock(ctx context.Context) error { + return am.keeper.EndBlock(ctx) } // InitGenesis performs genesis initialization for the evm module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.keeper, am.ak, genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the evm @@ -175,7 +180,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // RegisterStoreDecoder registers a decoder for evm module's types -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { } // ProposalContents doesn't return any content functions for governance proposals. @@ -191,3 +196,9 @@ func (AppModule) GenerateGenesisState(_ *module.SimulationState) { func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/evm/types/chain_config.go b/x/evm/types/chain_config.go index 0fbb409c..4141d3dc 100644 --- a/x/evm/types/chain_config.go +++ b/x/evm/types/chain_config.go @@ -22,7 +22,6 @@ import ( sdkmath "cosmossdk.io/math" errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" @@ -60,23 +59,23 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig { // DefaultChainConfig returns default evm parameters. func DefaultChainConfig() ChainConfig { - homesteadBlock := sdk.ZeroInt() - daoForkBlock := sdk.ZeroInt() - eip150Block := sdk.ZeroInt() - eip155Block := sdk.ZeroInt() - eip158Block := sdk.ZeroInt() - byzantiumBlock := sdk.ZeroInt() - constantinopleBlock := sdk.ZeroInt() - petersburgBlock := sdk.ZeroInt() - istanbulBlock := sdk.ZeroInt() - muirGlacierBlock := sdk.ZeroInt() - berlinBlock := sdk.ZeroInt() - londonBlock := sdk.ZeroInt() - arrowGlacierBlock := sdk.ZeroInt() - grayGlacierBlock := sdk.ZeroInt() - mergeNetsplitBlock := sdk.ZeroInt() - shanghaiBlock := sdk.ZeroInt() - cancunBlock := sdk.ZeroInt() + homesteadBlock := sdkmath.ZeroInt() + daoForkBlock := sdkmath.ZeroInt() + eip150Block := sdkmath.ZeroInt() + eip155Block := sdkmath.ZeroInt() + eip158Block := sdkmath.ZeroInt() + byzantiumBlock := sdkmath.ZeroInt() + constantinopleBlock := sdkmath.ZeroInt() + petersburgBlock := sdkmath.ZeroInt() + istanbulBlock := sdkmath.ZeroInt() + muirGlacierBlock := sdkmath.ZeroInt() + berlinBlock := sdkmath.ZeroInt() + londonBlock := sdkmath.ZeroInt() + arrowGlacierBlock := sdkmath.ZeroInt() + grayGlacierBlock := sdkmath.ZeroInt() + mergeNetsplitBlock := sdkmath.ZeroInt() + shanghaiBlock := sdkmath.ZeroInt() + cancunBlock := sdkmath.ZeroInt() return ChainConfig{ HomesteadBlock: &homesteadBlock, diff --git a/x/evm/types/dynamic_fee_tx_test.go b/x/evm/types/dynamic_fee_tx_test.go index a1513ada..e1bf8576 100644 --- a/x/evm/types/dynamic_fee_tx_test.go +++ b/x/evm/types/dynamic_fee_tx_test.go @@ -8,7 +8,6 @@ import ( "swisstronik/tests" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -40,7 +39,7 @@ func (suite *TxDataTestSuite) SetupTest() { suite.bigInt = big.NewInt(1) suite.hexBigInt = hexutil.Big(*big.NewInt(1)) suite.overflowBigInt = big.NewInt(0).Exp(big.NewInt(10), big.NewInt(256), nil) - suite.sdkZeroInt = sdk.ZeroInt() + suite.sdkZeroInt = sdkmath.ZeroInt() suite.sdkMinusOneInt = sdkmath.NewInt(-1) suite.invalidAddr = "123456" suite.addr = tests.RandomEthAddress() diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 4e64f109..1e563e5e 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -121,53 +121,53 @@ func (m *Params) GetAllowUnprotectedTxs() bool { // instead of *big.Int. type ChainConfig struct { // homestead_block switch (nil no fork, 0 = already homestead) - HomesteadBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=homestead_block,json=homesteadBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"homestead_block,omitempty" yaml:"homestead_block"` + HomesteadBlock *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=homestead_block,json=homesteadBlock,proto3,customtype=cosmossdk.io/math.Int" json:"homestead_block,omitempty" yaml:"homestead_block"` // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) - DAOForkBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=dao_fork_block,json=daoForkBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"dao_fork_block,omitempty" yaml:"dao_fork_block"` + DAOForkBlock *cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=dao_fork_block,json=daoForkBlock,proto3,customtype=cosmossdk.io/math.Int" json:"dao_fork_block,omitempty" yaml:"dao_fork_block"` // dao_fork_support defines whether the nodes supports or opposes the DAO // hard-fork DAOForkSupport bool `protobuf:"varint,3,opt,name=dao_fork_support,json=daoForkSupport,proto3" json:"dao_fork_support,omitempty" yaml:"dao_fork_support"` // eip150_block: EIP150 implements the Gas price changes // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) - EIP150Block *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=eip150_block,json=eip150Block,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"eip150_block,omitempty" yaml:"eip150_block"` + EIP150Block *cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=eip150_block,json=eip150Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip150_block,omitempty" yaml:"eip150_block"` // eip150_hash: EIP150 HF hash (needed for header only clients as only gas // pricing changed) EIP150Hash string `protobuf:"bytes,5,opt,name=eip150_hash,json=eip150Hash,proto3" json:"eip150_hash,omitempty" yaml:"byzantium_block"` // eip155_block: EIP155Block HF block - EIP155Block *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=eip155_block,json=eip155Block,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"eip155_block,omitempty" yaml:"eip155_block"` + EIP155Block *cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=eip155_block,json=eip155Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip155_block,omitempty" yaml:"eip155_block"` // eip158_block: EIP158 HF block - EIP158Block *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=eip158_block,json=eip158Block,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"eip158_block,omitempty" yaml:"eip158_block"` + EIP158Block *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=eip158_block,json=eip158Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip158_block,omitempty" yaml:"eip158_block"` // byzantium_block: Byzantium switch block (nil no fork, 0 = already on // byzantium) - ByzantiumBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=byzantium_block,json=byzantiumBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"byzantium_block,omitempty" yaml:"byzantium_block"` + ByzantiumBlock *cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=byzantium_block,json=byzantiumBlock,proto3,customtype=cosmossdk.io/math.Int" json:"byzantium_block,omitempty" yaml:"byzantium_block"` // constantinople_block: Constantinople switch block (nil no fork, 0 = already // activated) - ConstantinopleBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=constantinople_block,json=constantinopleBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"constantinople_block,omitempty" yaml:"constantinople_block"` + ConstantinopleBlock *cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=constantinople_block,json=constantinopleBlock,proto3,customtype=cosmossdk.io/math.Int" json:"constantinople_block,omitempty" yaml:"constantinople_block"` // petersburg_block: Petersburg switch block (nil same as Constantinople) - PetersburgBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=petersburg_block,json=petersburgBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"petersburg_block,omitempty" yaml:"petersburg_block"` + PetersburgBlock *cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=petersburg_block,json=petersburgBlock,proto3,customtype=cosmossdk.io/math.Int" json:"petersburg_block,omitempty" yaml:"petersburg_block"` // istanbul_block: Istanbul switch block (nil no fork, 0 = already on // istanbul) - IstanbulBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=istanbul_block,json=istanbulBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"istanbul_block,omitempty" yaml:"istanbul_block"` + IstanbulBlock *cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=istanbul_block,json=istanbulBlock,proto3,customtype=cosmossdk.io/math.Int" json:"istanbul_block,omitempty" yaml:"istanbul_block"` // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = // already activated) - MuirGlacierBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,12,opt,name=muir_glacier_block,json=muirGlacierBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"muir_glacier_block,omitempty" yaml:"muir_glacier_block"` + MuirGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,12,opt,name=muir_glacier_block,json=muirGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"muir_glacier_block,omitempty" yaml:"muir_glacier_block"` // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) - BerlinBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=berlin_block,json=berlinBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"berlin_block,omitempty" yaml:"berlin_block"` + BerlinBlock *cosmossdk_io_math.Int `protobuf:"bytes,13,opt,name=berlin_block,json=berlinBlock,proto3,customtype=cosmossdk.io/math.Int" json:"berlin_block,omitempty" yaml:"berlin_block"` // london_block: London switch block (nil = no fork, 0 = already on london) - LondonBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=london_block,json=londonBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"london_block,omitempty" yaml:"london_block"` + LondonBlock *cosmossdk_io_math.Int `protobuf:"bytes,17,opt,name=london_block,json=londonBlock,proto3,customtype=cosmossdk.io/math.Int" json:"london_block,omitempty" yaml:"london_block"` // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = // already activated) - ArrowGlacierBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,18,opt,name=arrow_glacier_block,json=arrowGlacierBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"arrow_glacier_block,omitempty" yaml:"arrow_glacier_block"` + ArrowGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,18,opt,name=arrow_glacier_block,json=arrowGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"arrow_glacier_block,omitempty" yaml:"arrow_glacier_block"` // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = // already activated) - GrayGlacierBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,20,opt,name=gray_glacier_block,json=grayGlacierBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gray_glacier_block,omitempty" yaml:"gray_glacier_block"` + GrayGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,20,opt,name=gray_glacier_block,json=grayGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"gray_glacier_block,omitempty" yaml:"gray_glacier_block"` // merge_netsplit_block: Virtual fork after The Merge to use as a network // splitter - MergeNetsplitBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,21,opt,name=merge_netsplit_block,json=mergeNetsplitBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"merge_netsplit_block,omitempty" yaml:"merge_netsplit_block"` + MergeNetsplitBlock *cosmossdk_io_math.Int `protobuf:"bytes,21,opt,name=merge_netsplit_block,json=mergeNetsplitBlock,proto3,customtype=cosmossdk.io/math.Int" json:"merge_netsplit_block,omitempty" yaml:"merge_netsplit_block"` // shanghai_block switch block (nil = no fork, 0 = already on shanghai) - ShanghaiBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,22,opt,name=shanghai_block,json=shanghaiBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shanghai_block,omitempty" yaml:"shanghai_block"` + ShanghaiBlock *cosmossdk_io_math.Int `protobuf:"bytes,22,opt,name=shanghai_block,json=shanghaiBlock,proto3,customtype=cosmossdk.io/math.Int" json:"shanghai_block,omitempty" yaml:"shanghai_block"` // cancun_block switch block (nil = no fork, 0 = already on cancun) - CancunBlock *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,23,opt,name=cancun_block,json=cancunBlock,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cancun_block,omitempty" yaml:"cancun_block"` + CancunBlock *cosmossdk_io_math.Int `protobuf:"bytes,23,opt,name=cancun_block,json=cancunBlock,proto3,customtype=cosmossdk.io/math.Int" json:"cancun_block,omitempty" yaml:"cancun_block"` } func (m *ChainConfig) Reset() { *m = ChainConfig{} } @@ -698,108 +698,107 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } var fileDescriptor_d21ecc92c8c8583e = []byte{ - // 1608 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xdd, 0x6e, 0xe3, 0xc6, - 0x15, 0xb6, 0x2d, 0xda, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0xb5, 0x8e, 0xb2, 0x8b, 0x9a, 0x2e, 0x2f, - 0x0a, 0x17, 0x48, 0xec, 0xd8, 0x81, 0xd1, 0x45, 0x82, 0x16, 0xb5, 0x76, 0x9d, 0xc4, 0xee, 0x36, - 0x35, 0xc6, 0x0e, 0x0a, 0x14, 0x28, 0x88, 0x11, 0x39, 0xa1, 0x18, 0x93, 0x1c, 0x61, 0x66, 0xa8, - 0x95, 0xda, 0x3e, 0x40, 0x8b, 0xde, 0xf4, 0x09, 0x8a, 0x3c, 0x4e, 0xd0, 0xab, 0xbd, 0x2c, 0x7a, - 0x41, 0x14, 0xde, 0x3b, 0x5f, 0xea, 0x09, 0x8a, 0xf9, 0x11, 0xf5, 0x63, 0xa3, 0xad, 0x75, 0xe5, - 0xf9, 0xce, 0x39, 0xf3, 0x7d, 0x33, 0x67, 0xce, 0x68, 0x0e, 0x0d, 0x9e, 0x13, 0xd1, 0x23, 0x2c, - 0x8d, 0x33, 0x71, 0x44, 0x06, 0xe9, 0xd1, 0xe0, 0x58, 0xfe, 0x39, 0xec, 0x33, 0x2a, 0x28, 0x74, - 0x4a, 0xdf, 0xa1, 0x34, 0x0e, 0x8e, 0x9f, 0xb7, 0x22, 0x1a, 0x51, 0xe5, 0x3c, 0x92, 0x23, 0x1d, - 0xe7, 0xfd, 0xa5, 0x02, 0x36, 0xae, 0x30, 0xc3, 0x29, 0x87, 0xc7, 0xa0, 0x4a, 0x06, 0xa9, 0x1f, - 0x92, 0x8c, 0xa6, 0xed, 0xd5, 0xfd, 0xd5, 0x83, 0x6a, 0xa7, 0x35, 0x2e, 0x5c, 0x67, 0x84, 0xd3, - 0xe4, 0x33, 0xaf, 0x74, 0x79, 0xc8, 0x26, 0x83, 0xf4, 0xb5, 0x1c, 0xc2, 0x9f, 0x83, 0x2d, 0x92, - 0xe1, 0x6e, 0x42, 0xfc, 0x80, 0x11, 0x2c, 0x48, 0x7b, 0x6d, 0x7f, 0xf5, 0xc0, 0xee, 0xb4, 0xc7, - 0x85, 0xdb, 0x32, 0xd3, 0x66, 0xdd, 0x1e, 0xaa, 0x6b, 0xfc, 0x4a, 0x41, 0xf8, 0x33, 0x50, 0x9b, - 0xf8, 0x71, 0x92, 0xb4, 0x2b, 0x6a, 0xf2, 0xee, 0xb8, 0x70, 0xe1, 0xfc, 0x64, 0x9c, 0x24, 0x1e, - 0x02, 0x66, 0x2a, 0x4e, 0x12, 0x78, 0x06, 0x00, 0x19, 0x0a, 0x86, 0x7d, 0x12, 0xf7, 0x79, 0xdb, - 0xda, 0xaf, 0x1c, 0x54, 0x3a, 0xde, 0x5d, 0xe1, 0x56, 0xcf, 0xa5, 0xf5, 0xfc, 0xe2, 0x8a, 0x8f, - 0x0b, 0x77, 0xdb, 0x90, 0x94, 0x81, 0x1e, 0xaa, 0x2a, 0x70, 0x1e, 0xf7, 0x39, 0xfc, 0x3d, 0xa8, - 0x07, 0x3d, 0x1c, 0x67, 0x7e, 0x40, 0xb3, 0x6f, 0xe3, 0xa8, 0xbd, 0xbe, 0xbf, 0x7a, 0x50, 0x3b, - 0xf9, 0xd1, 0xe1, 0x62, 0xde, 0x0e, 0x5f, 0xc9, 0xa8, 0x57, 0x2a, 0xa8, 0xf3, 0xe2, 0x87, 0xc2, - 0x5d, 0x19, 0x17, 0xee, 0x8e, 0xa6, 0x9e, 0x25, 0xf0, 0x50, 0x2d, 0x98, 0x46, 0xc2, 0x13, 0xf0, - 0x0c, 0x27, 0x09, 0x7d, 0xeb, 0xe7, 0x99, 0x4c, 0x34, 0x09, 0x04, 0x09, 0x7d, 0x31, 0xe4, 0xed, - 0x0d, 0xb9, 0x49, 0xb4, 0xa3, 0x9c, 0xdf, 0x4c, 0x7d, 0x37, 0x43, 0xee, 0xfd, 0x7d, 0x1b, 0xd4, - 0x66, 0xd4, 0x60, 0x0a, 0x9a, 0x3d, 0x9a, 0x12, 0x2e, 0x08, 0x0e, 0xfd, 0x6e, 0x42, 0x83, 0x5b, - 0x73, 0x2c, 0xaf, 0xff, 0x55, 0xb8, 0x3f, 0x89, 0x62, 0xd1, 0xcb, 0xbb, 0x87, 0x01, 0x4d, 0x8f, - 0x02, 0xca, 0x53, 0xca, 0xcd, 0x9f, 0x8f, 0x79, 0x78, 0x7b, 0x24, 0x46, 0x7d, 0xc2, 0x0f, 0x2f, - 0x32, 0x31, 0x2e, 0xdc, 0x5d, 0xbd, 0xd8, 0x05, 0x2a, 0x0f, 0x35, 0x4a, 0x4b, 0x47, 0x1a, 0xe0, - 0x08, 0x34, 0x42, 0x4c, 0xfd, 0x6f, 0x29, 0xbb, 0x35, 0x6a, 0x6b, 0x4a, 0xed, 0xfa, 0xff, 0x57, - 0xbb, 0x2b, 0xdc, 0xfa, 0xeb, 0xb3, 0xdf, 0x7c, 0x41, 0xd9, 0xad, 0xe2, 0x1c, 0x17, 0xee, 0x33, - 0xad, 0x3e, 0xcf, 0xec, 0xa1, 0x7a, 0x88, 0x69, 0x19, 0x06, 0x7f, 0x0b, 0x9c, 0x32, 0x80, 0xe7, - 0xfd, 0x3e, 0x65, 0xc2, 0x54, 0xc3, 0xc7, 0x77, 0x85, 0xdb, 0x30, 0x94, 0xd7, 0xda, 0x33, 0x2e, - 0xdc, 0x0f, 0x16, 0x48, 0xcd, 0x1c, 0x0f, 0x35, 0x0c, 0xad, 0x09, 0x85, 0x1c, 0xd4, 0x49, 0xdc, - 0x3f, 0x3e, 0xfd, 0xc4, 0xec, 0xc8, 0x52, 0x3b, 0xba, 0x7a, 0xd2, 0x8e, 0x6a, 0xe7, 0x17, 0x57, - 0xc7, 0xa7, 0x9f, 0x4c, 0x36, 0x64, 0xce, 0x7e, 0x96, 0xd6, 0x43, 0x35, 0x0d, 0xf5, 0x6e, 0x2e, - 0x80, 0x81, 0x7e, 0x0f, 0xf3, 0x9e, 0xaa, 0xac, 0x6a, 0xe7, 0xe0, 0xae, 0x70, 0x81, 0x66, 0xfa, - 0x0a, 0xf3, 0xde, 0xf4, 0x5c, 0xba, 0xa3, 0x3f, 0xe0, 0x4c, 0xc4, 0x79, 0x3a, 0xe1, 0x02, 0x7a, - 0xb2, 0x8c, 0x2a, 0xd7, 0x7f, 0x6a, 0xd6, 0xbf, 0xb1, 0xf4, 0xfa, 0x4f, 0x1f, 0x5b, 0xff, 0xe9, - 0xfc, 0xfa, 0x75, 0x4c, 0x29, 0xfa, 0xd2, 0x88, 0x6e, 0x2e, 0x2d, 0xfa, 0xf2, 0x31, 0xd1, 0x97, - 0xf3, 0xa2, 0x3a, 0x46, 0x16, 0xfb, 0x42, 0x26, 0xda, 0xf6, 0xf2, 0xc5, 0xfe, 0x20, 0xa9, 0x8d, - 0xd2, 0xa2, 0xe5, 0xfe, 0x04, 0x5a, 0x01, 0xcd, 0xb8, 0x90, 0xb6, 0x8c, 0xf6, 0x13, 0x62, 0x34, - 0xab, 0x4a, 0xf3, 0xe2, 0x49, 0x9a, 0x2f, 0xcc, 0xaf, 0xc1, 0x23, 0x7c, 0x1e, 0xda, 0x99, 0x37, - 0x6b, 0xf5, 0x3e, 0x70, 0xfa, 0x44, 0x10, 0xc6, 0xbb, 0x39, 0x8b, 0x8c, 0x32, 0x50, 0xca, 0xe7, - 0x4f, 0x52, 0x36, 0xf7, 0x60, 0x91, 0xcb, 0x43, 0xcd, 0xa9, 0x49, 0x2b, 0x7e, 0x07, 0x1a, 0xb1, - 0x5c, 0x46, 0x37, 0x4f, 0x8c, 0x5e, 0x4d, 0xe9, 0xbd, 0x7a, 0x92, 0x9e, 0xb9, 0xcc, 0xf3, 0x4c, - 0x1e, 0xda, 0x9a, 0x18, 0xb4, 0x56, 0x0e, 0x60, 0x9a, 0xc7, 0xcc, 0x8f, 0x12, 0x1c, 0xc4, 0x84, - 0x19, 0xbd, 0xba, 0xd2, 0xfb, 0xf2, 0x49, 0x7a, 0x1f, 0x6a, 0xbd, 0x87, 0x6c, 0x1e, 0x72, 0xa4, - 0xf1, 0x4b, 0x6d, 0xd3, 0xb2, 0x21, 0xa8, 0x77, 0x09, 0x4b, 0xe2, 0xcc, 0x08, 0x6e, 0x29, 0xc1, - 0xb3, 0x27, 0x09, 0x9a, 0x3a, 0x9d, 0xe5, 0xf1, 0x50, 0x4d, 0xc3, 0x52, 0x25, 0xa1, 0x59, 0x48, - 0x27, 0x2a, 0xdb, 0xcb, 0xab, 0xcc, 0xf2, 0x78, 0xa8, 0xa6, 0xa1, 0x56, 0x19, 0x82, 0x1d, 0xcc, - 0x18, 0x7d, 0xbb, 0x90, 0x43, 0xa8, 0xc4, 0xbe, 0x7a, 0x92, 0xd8, 0x73, 0x2d, 0xf6, 0x08, 0x9d, - 0x87, 0xb6, 0x95, 0x75, 0x2e, 0x8b, 0x39, 0x80, 0x11, 0xc3, 0xa3, 0x05, 0xe1, 0xd6, 0xf2, 0x87, - 0xf7, 0x90, 0xcd, 0x43, 0x8e, 0x34, 0xce, 0xc9, 0xfe, 0x11, 0xb4, 0x52, 0xc2, 0x22, 0xe2, 0x67, - 0x44, 0xf0, 0x7e, 0x12, 0x0b, 0x23, 0xfc, 0x6c, 0xf9, 0xfb, 0xf8, 0x18, 0x9f, 0x87, 0xa0, 0x32, - 0x7f, 0x6d, 0xac, 0xe5, 0xe5, 0xe0, 0x3d, 0x9c, 0x45, 0x3d, 0x1c, 0x1b, 0xd9, 0xdd, 0xe5, 0x2f, - 0xc7, 0x3c, 0x93, 0x87, 0xb6, 0x26, 0x86, 0xb2, 0x7e, 0x02, 0x9c, 0x05, 0xf9, 0xa4, 0x7e, 0x3e, - 0x58, 0xbe, 0x7e, 0x66, 0x79, 0x64, 0xfb, 0xa1, 0xa0, 0x52, 0xb9, 0xb4, 0xec, 0x86, 0xd3, 0xbc, - 0xb4, 0xec, 0xa6, 0xe3, 0x5c, 0x5a, 0xb6, 0xe3, 0x6c, 0x5f, 0x5a, 0xf6, 0x8e, 0xd3, 0x42, 0x5b, - 0x23, 0x9a, 0x50, 0x7f, 0xf0, 0xa9, 0x9e, 0x84, 0x6a, 0xe4, 0x2d, 0xe6, 0xe6, 0x37, 0x12, 0x35, - 0x02, 0x2c, 0x70, 0x32, 0xe2, 0x26, 0x55, 0xc8, 0xd1, 0x09, 0x9c, 0x79, 0xb5, 0x8f, 0xc0, 0xfa, - 0xb5, 0x90, 0x8d, 0x9b, 0x03, 0x2a, 0xb7, 0x64, 0xa4, 0xbb, 0x11, 0x24, 0x87, 0xb0, 0x05, 0xd6, - 0x07, 0x38, 0xc9, 0x75, 0x07, 0x58, 0x45, 0x1a, 0x78, 0x57, 0xa0, 0x79, 0xc3, 0x70, 0xc6, 0x71, - 0x20, 0x62, 0x9a, 0xbd, 0xa1, 0x11, 0x87, 0x10, 0x58, 0xea, 0x55, 0xd4, 0x73, 0xd5, 0x18, 0xfe, - 0x14, 0x58, 0x09, 0x8d, 0x78, 0x7b, 0x6d, 0xbf, 0x72, 0x50, 0x3b, 0x79, 0xf6, 0xb0, 0x07, 0x7b, - 0x43, 0x23, 0xa4, 0x42, 0xbc, 0x7f, 0xac, 0x81, 0xca, 0x1b, 0x1a, 0xc1, 0x36, 0xd8, 0xc4, 0x61, - 0xc8, 0x08, 0xe7, 0x86, 0x69, 0x02, 0xe1, 0x2e, 0xd8, 0x10, 0xb4, 0x1f, 0x07, 0x9a, 0xae, 0x8a, - 0x0c, 0x92, 0xc2, 0x21, 0x16, 0x58, 0xf5, 0x15, 0x75, 0xa4, 0xc6, 0xf0, 0x04, 0xd4, 0xd5, 0xce, - 0xfc, 0x2c, 0x4f, 0xbb, 0x84, 0xa9, 0xf6, 0xc0, 0xea, 0x34, 0xef, 0x0b, 0xb7, 0xa6, 0xec, 0x5f, - 0x2b, 0x33, 0x9a, 0x05, 0xf0, 0x23, 0xb0, 0x29, 0x86, 0xb3, 0x2f, 0xfb, 0xce, 0x7d, 0xe1, 0x36, - 0xc5, 0x74, 0x9b, 0xf2, 0xe1, 0x46, 0x1b, 0x62, 0xa8, 0x1e, 0xf0, 0x23, 0x60, 0x8b, 0xa1, 0x1f, - 0x67, 0x21, 0x19, 0xaa, 0xc7, 0xdb, 0xea, 0xb4, 0xee, 0x0b, 0xd7, 0x99, 0x09, 0xbf, 0x90, 0x3e, - 0xb4, 0x29, 0x86, 0x6a, 0x00, 0x3f, 0x02, 0x40, 0x2f, 0x49, 0x29, 0xe8, 0xa7, 0x77, 0xeb, 0xbe, - 0x70, 0xab, 0xca, 0xaa, 0xb8, 0xa7, 0x43, 0xe8, 0x81, 0x75, 0xcd, 0x6d, 0x2b, 0xee, 0xfa, 0x7d, - 0xe1, 0xda, 0x09, 0x8d, 0x34, 0xa7, 0x76, 0xc9, 0x54, 0x31, 0x92, 0xd2, 0x01, 0x09, 0xd5, 0xeb, - 0x66, 0xa3, 0x09, 0xf4, 0xfe, 0xba, 0x06, 0xec, 0x9b, 0x21, 0x22, 0x3c, 0x4f, 0x04, 0xfc, 0x02, - 0x38, 0x01, 0xcd, 0x04, 0xc3, 0x81, 0xf0, 0xe7, 0x52, 0xdb, 0x79, 0x31, 0x7d, 0x69, 0x16, 0x23, - 0x3c, 0xd4, 0x9c, 0x98, 0xce, 0x4c, 0xfe, 0x5b, 0x60, 0xbd, 0x9b, 0x50, 0x9a, 0xaa, 0x4a, 0xa8, - 0x23, 0x0d, 0x20, 0x52, 0x59, 0x53, 0xa7, 0x5c, 0x51, 0x9d, 0xf6, 0x8f, 0x1f, 0x9e, 0xf2, 0x42, - 0xa9, 0x74, 0x76, 0x4d, 0xb7, 0xdd, 0xd0, 0xda, 0x66, 0xbe, 0x27, 0x73, 0xab, 0x4a, 0xc9, 0x01, - 0x15, 0x46, 0x84, 0x3a, 0xb4, 0x3a, 0x92, 0x43, 0xf8, 0x1c, 0xd8, 0x8c, 0x0c, 0x08, 0x13, 0x24, - 0x54, 0x87, 0x63, 0xa3, 0x12, 0xc3, 0x0f, 0x81, 0x1d, 0x61, 0xee, 0xe7, 0x9c, 0x84, 0xfa, 0x24, - 0xd0, 0x66, 0x84, 0xf9, 0x37, 0x9c, 0x84, 0x9f, 0x59, 0x7f, 0xfe, 0xde, 0x5d, 0xf1, 0x30, 0xa8, - 0x9d, 0x05, 0x01, 0xe1, 0xfc, 0x26, 0xef, 0x27, 0xe4, 0xbf, 0x54, 0xd8, 0x09, 0xa8, 0x73, 0x41, - 0x19, 0x8e, 0x88, 0x7f, 0x4b, 0x46, 0xa6, 0xce, 0x74, 0xd5, 0x18, 0xfb, 0xaf, 0xc8, 0x88, 0xa3, - 0x59, 0x60, 0x24, 0xbe, 0xb7, 0x40, 0xed, 0x86, 0xe1, 0x80, 0x98, 0x0e, 0x5f, 0xd6, 0xaa, 0x84, - 0xcc, 0x48, 0x18, 0x24, 0xb5, 0x45, 0x9c, 0x12, 0x9a, 0x0b, 0x73, 0x9f, 0x26, 0x50, 0xce, 0x60, - 0x84, 0x0c, 0x49, 0xa0, 0xd2, 0x68, 0x21, 0x83, 0xe0, 0x29, 0xd8, 0x0a, 0x63, 0xae, 0x3e, 0x97, - 0xb8, 0xc0, 0xc1, 0xad, 0xde, 0x7e, 0xc7, 0xb9, 0x2f, 0xdc, 0xba, 0x71, 0x5c, 0x4b, 0x3b, 0x9a, - 0x43, 0xf0, 0x73, 0xd0, 0x9c, 0x4e, 0x53, 0xab, 0xd5, 0x1f, 0x28, 0x1d, 0x78, 0x5f, 0xb8, 0x8d, - 0x32, 0x54, 0x79, 0xd0, 0x02, 0x96, 0x27, 0x1d, 0x92, 0x6e, 0x1e, 0xa9, 0xe2, 0xb3, 0x91, 0x06, - 0xd2, 0x9a, 0xc4, 0x69, 0x2c, 0x54, 0xb1, 0xad, 0x23, 0x0d, 0xe0, 0xe7, 0xa0, 0x4a, 0x07, 0x84, - 0xb1, 0x38, 0x24, 0x5c, 0xb5, 0x3a, 0xff, 0xeb, 0x5b, 0x0b, 0x4d, 0xe3, 0xe5, 0xe6, 0xcc, 0xa7, - 0x60, 0x4a, 0x52, 0xca, 0x46, 0xaa, 0x77, 0x31, 0x9b, 0xd3, 0x8e, 0x5f, 0x2b, 0x3b, 0x9a, 0x43, - 0xb0, 0x03, 0xa0, 0x99, 0xc6, 0x88, 0xc8, 0x59, 0xe6, 0xab, 0xfb, 0x5f, 0x57, 0x73, 0xd5, 0x2d, - 0xd4, 0x5e, 0xa4, 0x9c, 0xaf, 0xb1, 0xc0, 0xe8, 0x81, 0x05, 0xfe, 0x02, 0x40, 0x7d, 0x26, 0xfe, - 0x77, 0x9c, 0x96, 0x1f, 0x8b, 0xba, 0xb5, 0x50, 0xfa, 0xda, 0x6b, 0xd6, 0xec, 0x68, 0x74, 0xc9, - 0xa9, 0xd9, 0xc5, 0xa5, 0x65, 0x5b, 0xce, 0xfa, 0xa5, 0x65, 0x6f, 0x3a, 0x76, 0x99, 0x3f, 0xb3, - 0x0b, 0xb4, 0x33, 0xc1, 0x33, 0xcb, 0xeb, 0xfc, 0xf2, 0x87, 0xbb, 0xbd, 0xd5, 0x77, 0x77, 0x7b, - 0xab, 0xff, 0xbe, 0xdb, 0x5b, 0xfd, 0xdb, 0xfb, 0xbd, 0x95, 0x77, 0xef, 0xf7, 0x56, 0xfe, 0xf9, - 0x7e, 0x6f, 0xe5, 0x77, 0xb3, 0xef, 0x03, 0x19, 0xc8, 0xe7, 0x61, 0xfa, 0xfd, 0x3f, 0x54, 0xff, - 0x01, 0x50, 0x6f, 0x44, 0x77, 0x43, 0x7d, 0xd9, 0x7f, 0xfa, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xe2, 0xe1, 0x18, 0x7a, 0x1f, 0x10, 0x00, 0x00, + // 1600 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4d, 0x6f, 0xe3, 0xb8, + 0x19, 0x4e, 0x62, 0x25, 0x91, 0x69, 0xc7, 0xd6, 0x30, 0x4e, 0xd6, 0x3b, 0x83, 0x46, 0xa9, 0x0e, + 0x45, 0x0a, 0x6c, 0x93, 0x49, 0xa6, 0xe9, 0x0e, 0x76, 0xd1, 0x8f, 0xf1, 0xcc, 0x6c, 0x9b, 0x74, + 0xba, 0x1d, 0x30, 0x59, 0x14, 0x2d, 0x5a, 0x08, 0xb4, 0xc4, 0x95, 0xb5, 0x91, 0x44, 0x83, 0xa4, + 0x3c, 0x76, 0x7f, 0x41, 0x8b, 0x5e, 0xfa, 0x13, 0xf6, 0xe7, 0x2c, 0x7a, 0x9a, 0x63, 0xd1, 0x83, + 0x50, 0x64, 0x6e, 0x39, 0xfa, 0x5e, 0xa0, 0xe0, 0x87, 0xe5, 0x8f, 0xa4, 0xae, 0x4f, 0xe6, 0xf3, + 0x7e, 0x3c, 0x0f, 0xf9, 0xf2, 0x95, 0x49, 0x82, 0xc7, 0x44, 0xf4, 0x08, 0x4b, 0xe3, 0x4c, 0x9c, + 0x90, 0x41, 0x7a, 0x32, 0x38, 0x95, 0x3f, 0xc7, 0x7d, 0x46, 0x05, 0x85, 0x4e, 0xe9, 0x3b, 0x96, + 0xc6, 0xc1, 0xe9, 0xe3, 0x56, 0x44, 0x23, 0xaa, 0x9c, 0x27, 0x72, 0xa4, 0xe3, 0xbc, 0xbf, 0x56, + 0xc0, 0xd6, 0x5b, 0xcc, 0x70, 0xca, 0xe1, 0x29, 0xa8, 0x92, 0x41, 0xea, 0x87, 0x24, 0xa3, 0x69, + 0x7b, 0xfd, 0x70, 0xfd, 0xa8, 0xda, 0x69, 0x8d, 0x0b, 0xd7, 0x19, 0xe1, 0x34, 0xf9, 0xcc, 0x2b, + 0x5d, 0x1e, 0xb2, 0xc9, 0x20, 0x7d, 0x25, 0x87, 0xf0, 0xa7, 0x60, 0x87, 0x64, 0xb8, 0x9b, 0x10, + 0x3f, 0x60, 0x04, 0x0b, 0xd2, 0xde, 0x38, 0x5c, 0x3f, 0xb2, 0x3b, 0xed, 0x71, 0xe1, 0xb6, 0x4c, + 0xda, 0xac, 0xdb, 0x43, 0x75, 0x8d, 0x5f, 0x2a, 0x08, 0x3f, 0x05, 0xb5, 0x89, 0x1f, 0x27, 0x49, + 0xbb, 0xa2, 0x92, 0xf7, 0xc7, 0x85, 0x0b, 0xe7, 0x93, 0x71, 0x92, 0x78, 0x08, 0x98, 0x54, 0x9c, + 0x24, 0xf0, 0x05, 0x00, 0x64, 0x28, 0x18, 0xf6, 0x49, 0xdc, 0xe7, 0x6d, 0xeb, 0xb0, 0x72, 0x54, + 0xe9, 0x78, 0xb7, 0x85, 0x5b, 0x7d, 0x2d, 0xad, 0xaf, 0x2f, 0xde, 0xf2, 0x71, 0xe1, 0x3e, 0x32, + 0x24, 0x65, 0xa0, 0x87, 0xaa, 0x0a, 0xbc, 0x8e, 0xfb, 0x1c, 0xfe, 0x09, 0xd4, 0x83, 0x1e, 0x8e, + 0x33, 0x3f, 0xa0, 0xd9, 0xd7, 0x71, 0xd4, 0xde, 0x3c, 0x5c, 0x3f, 0xaa, 0x9d, 0x7d, 0xef, 0x78, + 0xb1, 0x6e, 0xc7, 0x2f, 0x65, 0xd4, 0x4b, 0x15, 0xd4, 0x79, 0xf2, 0x5d, 0xe1, 0xae, 0x8d, 0x0b, + 0x77, 0x57, 0x53, 0xcf, 0x12, 0x78, 0xa8, 0x16, 0x4c, 0x23, 0xe1, 0x19, 0xd8, 0xc3, 0x49, 0x42, + 0xdf, 0xf9, 0x79, 0x26, 0x0b, 0x4d, 0x02, 0x41, 0x42, 0x5f, 0x0c, 0x79, 0x7b, 0x4b, 0x2e, 0x12, + 0xed, 0x2a, 0xe7, 0x57, 0x53, 0xdf, 0xf5, 0x90, 0x7b, 0xff, 0x69, 0x80, 0xda, 0x8c, 0x1a, 0xfc, + 0x23, 0x68, 0xf6, 0x68, 0x4a, 0xb8, 0x20, 0x38, 0xf4, 0xbb, 0x09, 0x0d, 0x6e, 0xcc, 0xb6, 0x3c, + 0xfb, 0x57, 0xe1, 0xee, 0x05, 0x94, 0xa7, 0x94, 0xf3, 0xf0, 0xe6, 0x38, 0xa6, 0x27, 0x29, 0x16, + 0xbd, 0xe3, 0x8b, 0x4c, 0x8c, 0x0b, 0x77, 0x5f, 0xcf, 0x6d, 0x21, 0xd3, 0x43, 0x8d, 0xd2, 0xd2, + 0x91, 0x06, 0xd8, 0x03, 0x8d, 0x10, 0x53, 0xff, 0x6b, 0xca, 0x6e, 0x0c, 0xf9, 0x86, 0x22, 0xef, + 0xfc, 0x4f, 0xf2, 0xdb, 0xc2, 0xad, 0xbf, 0x7a, 0xf1, 0xdb, 0x2f, 0x28, 0xbb, 0x51, 0x14, 0xe3, + 0xc2, 0xdd, 0xd3, 0x62, 0xf3, 0x44, 0x1e, 0xaa, 0x87, 0x98, 0x96, 0x61, 0xf0, 0x77, 0xc0, 0x29, + 0x03, 0x78, 0xde, 0xef, 0x53, 0x26, 0xcc, 0x5e, 0xff, 0xe8, 0xb6, 0x70, 0x1b, 0x86, 0xf2, 0x4a, + 0x7b, 0xc6, 0x85, 0xfb, 0xd1, 0x02, 0xa9, 0xc9, 0xf1, 0x50, 0xc3, 0xd0, 0x9a, 0x50, 0xd8, 0x05, + 0x75, 0x12, 0xf7, 0x4f, 0xcf, 0x9f, 0x9a, 0x05, 0x58, 0x6a, 0x01, 0x3f, 0x5f, 0xb6, 0x80, 0xda, + 0xeb, 0x8b, 0xb7, 0xa7, 0xe7, 0x4f, 0x27, 0xf3, 0x37, 0x1b, 0x39, 0xcb, 0xe2, 0xa1, 0x9a, 0x86, + 0x7a, 0xf2, 0x17, 0xc0, 0x40, 0xbf, 0x87, 0x79, 0x4f, 0xb5, 0x49, 0xb5, 0x73, 0x74, 0x5b, 0xb8, + 0x40, 0x33, 0xfd, 0x0a, 0xf3, 0xde, 0xb4, 0xea, 0xdd, 0xd1, 0x9f, 0x71, 0x26, 0xe2, 0x3c, 0x9d, + 0x70, 0x01, 0x9d, 0x2c, 0xa3, 0xca, 0xe9, 0x9e, 0x9b, 0xe9, 0x6e, 0xad, 0x3a, 0xdd, 0xf3, 0x87, + 0xa6, 0x7b, 0x3e, 0x3f, 0x5d, 0x1d, 0x53, 0x6a, 0x3c, 0x37, 0x1a, 0xdb, 0xab, 0x6a, 0x3c, 0x7f, + 0x48, 0xe3, 0xf9, 0xbc, 0x86, 0x8e, 0x91, 0x7d, 0xb9, 0xb0, 0xce, 0xb6, 0xbd, 0x72, 0x5f, 0xde, + 0xab, 0x50, 0xa3, 0xb4, 0x68, 0xf6, 0x1b, 0xd0, 0x0a, 0x68, 0xc6, 0x85, 0xb4, 0x65, 0xb4, 0x9f, + 0x10, 0x23, 0x51, 0x55, 0x12, 0xcf, 0x97, 0x49, 0x3c, 0x31, 0x9f, 0xe5, 0x03, 0xe9, 0x1e, 0xda, + 0x9d, 0x37, 0x6b, 0x31, 0x1f, 0x38, 0x7d, 0x22, 0x08, 0xe3, 0xdd, 0x9c, 0x45, 0x46, 0x08, 0x28, + 0xa1, 0x1f, 0x2f, 0x13, 0x32, 0x1d, 0xba, 0x98, 0xea, 0xa1, 0xe6, 0xd4, 0xa4, 0x05, 0x7e, 0x0f, + 0x1a, 0xb1, 0x54, 0xed, 0xe6, 0x89, 0xa1, 0xaf, 0x29, 0xfa, 0xb3, 0x65, 0xf4, 0xe6, 0xab, 0x9a, + 0x4f, 0xf4, 0xd0, 0xce, 0xc4, 0xa0, 0xa9, 0x43, 0x00, 0xd3, 0x3c, 0x66, 0x7e, 0x94, 0xe0, 0x20, + 0x26, 0xcc, 0xd0, 0xd7, 0x15, 0xfd, 0x4f, 0x96, 0xd1, 0x7f, 0xac, 0xe9, 0xef, 0x27, 0x7b, 0xc8, + 0x91, 0xc6, 0x5f, 0x6a, 0x9b, 0x56, 0xb9, 0x02, 0xf5, 0x2e, 0x61, 0x49, 0x9c, 0x19, 0xfe, 0x1d, + 0xc5, 0xff, 0x74, 0x19, 0xbf, 0xe9, 0xa0, 0xd9, 0x34, 0x0f, 0xd5, 0x34, 0x2c, 0x49, 0x13, 0x9a, + 0x85, 0x74, 0x42, 0xfa, 0x68, 0x65, 0xd2, 0xd9, 0x34, 0x0f, 0xd5, 0x34, 0xd4, 0xa4, 0x11, 0xd8, + 0xc5, 0x8c, 0xd1, 0x77, 0x0b, 0x05, 0x81, 0x8a, 0xfb, 0xd3, 0x65, 0xdc, 0x8f, 0x35, 0xf7, 0x03, + 0xd9, 0x1e, 0x7a, 0xa4, 0xac, 0x73, 0x25, 0x09, 0x01, 0x8c, 0x18, 0x1e, 0x2d, 0xe8, 0xb4, 0x56, + 0x2e, 0xfc, 0xfd, 0x64, 0x0f, 0x39, 0xd2, 0x38, 0xa7, 0xf2, 0x0d, 0x68, 0xa5, 0x84, 0x45, 0xc4, + 0xcf, 0x88, 0xe0, 0xfd, 0x24, 0x16, 0x46, 0x67, 0x6f, 0xe5, 0xef, 0xe0, 0xa1, 0x74, 0x0f, 0x41, + 0x65, 0xfe, 0xd2, 0x58, 0xcb, 0x2e, 0xe5, 0x3d, 0x9c, 0x45, 0x3d, 0x1c, 0x1b, 0x95, 0xfd, 0x95, + 0xbb, 0x74, 0x3e, 0xd1, 0x43, 0x3b, 0x13, 0x43, 0xb9, 0xd5, 0x01, 0xce, 0x82, 0x7c, 0xb2, 0xd5, + 0x1f, 0xad, 0xbc, 0xd5, 0xb3, 0x69, 0xf2, 0x74, 0x55, 0x50, 0x91, 0x5e, 0x5a, 0x76, 0xc3, 0x69, + 0x5e, 0x5a, 0x76, 0xd3, 0x71, 0x2e, 0x2d, 0xdb, 0x71, 0x1e, 0x5d, 0x5a, 0xf6, 0xae, 0xd3, 0x42, + 0x3b, 0x23, 0x9a, 0x50, 0x7f, 0xf0, 0x4c, 0x27, 0xa1, 0x1a, 0x79, 0x87, 0xb9, 0xf9, 0xa3, 0x41, + 0x8d, 0x00, 0x0b, 0x9c, 0x8c, 0xb8, 0x29, 0x04, 0x72, 0x74, 0x79, 0x66, 0x8e, 0xad, 0x13, 0xb0, + 0x79, 0x25, 0xe4, 0xbd, 0xc4, 0x01, 0x95, 0x1b, 0x32, 0xd2, 0x87, 0x2d, 0x92, 0x43, 0xd8, 0x02, + 0x9b, 0x03, 0x9c, 0xe4, 0xfa, 0x82, 0x53, 0x45, 0x1a, 0x78, 0x6f, 0x41, 0xf3, 0x9a, 0xe1, 0x8c, + 0xe3, 0x40, 0xc4, 0x34, 0x7b, 0x43, 0x23, 0x0e, 0x21, 0xb0, 0xd4, 0x39, 0xa1, 0x73, 0xd5, 0x18, + 0xfe, 0x10, 0x58, 0x09, 0x8d, 0x78, 0x7b, 0xe3, 0xb0, 0x72, 0x54, 0x3b, 0xdb, 0xbb, 0x7f, 0xc5, + 0x78, 0x43, 0x23, 0xa4, 0x42, 0xbc, 0x7f, 0x6c, 0x80, 0xca, 0x1b, 0x1a, 0xc1, 0x36, 0xd8, 0xc6, + 0x61, 0xc8, 0x08, 0xe7, 0x86, 0x69, 0x02, 0xe1, 0x3e, 0xd8, 0x12, 0xb4, 0x1f, 0x07, 0x9a, 0xae, + 0x8a, 0x0c, 0x92, 0xc2, 0x21, 0x16, 0x58, 0x1d, 0xac, 0x75, 0xa4, 0xc6, 0xf0, 0x0c, 0xd4, 0xd5, + 0xca, 0xfc, 0x2c, 0x4f, 0xbb, 0x84, 0xa9, 0xf3, 0xd1, 0xea, 0x34, 0xef, 0x0a, 0xb7, 0xa6, 0xec, + 0x5f, 0x2a, 0x33, 0x9a, 0x05, 0xf0, 0x13, 0xb0, 0x2d, 0x86, 0xb3, 0x67, 0xdd, 0xee, 0x5d, 0xe1, + 0x36, 0xc5, 0x74, 0x99, 0xf2, 0x28, 0x43, 0x5b, 0x62, 0xa8, 0x8e, 0xb4, 0x13, 0x60, 0x8b, 0xa1, + 0x1f, 0x67, 0x21, 0x19, 0xaa, 0xe3, 0xcc, 0xea, 0xb4, 0xee, 0x0a, 0xd7, 0x99, 0x09, 0xbf, 0x90, + 0x3e, 0xb4, 0x2d, 0x86, 0x6a, 0x00, 0x3f, 0x01, 0x40, 0x4f, 0x49, 0x29, 0xe8, 0xd3, 0x69, 0xe7, + 0xae, 0x70, 0xab, 0xca, 0xaa, 0xb8, 0xa7, 0x43, 0xe8, 0x81, 0x4d, 0xcd, 0x6d, 0x2b, 0xee, 0xfa, + 0x5d, 0xe1, 0xda, 0x09, 0x8d, 0x34, 0xa7, 0x76, 0xc9, 0x52, 0x31, 0x92, 0xd2, 0x01, 0x09, 0xd5, + 0x11, 0x61, 0xa3, 0x09, 0xf4, 0xfe, 0xb6, 0x01, 0xec, 0xeb, 0x21, 0x22, 0x3c, 0x4f, 0x04, 0xfc, + 0x02, 0x38, 0x01, 0xcd, 0x04, 0xc3, 0x81, 0xf0, 0xe7, 0x4a, 0xdb, 0x79, 0x32, 0xfd, 0x43, 0x5f, + 0x8c, 0xf0, 0x50, 0x73, 0x62, 0x7a, 0x61, 0xea, 0xdf, 0x02, 0x9b, 0xdd, 0x84, 0xd2, 0x54, 0x75, + 0x42, 0x1d, 0x69, 0x00, 0x91, 0xaa, 0x9a, 0xda, 0xe5, 0x8a, 0xba, 0x48, 0x7e, 0xff, 0xfe, 0x2e, + 0x2f, 0xb4, 0x4a, 0x67, 0xdf, 0x5c, 0x26, 0x1b, 0x5a, 0xdb, 0xe4, 0x7b, 0xb2, 0xb6, 0xaa, 0x95, + 0x1c, 0x50, 0x61, 0x44, 0xa8, 0x4d, 0xab, 0x23, 0x39, 0x84, 0x8f, 0x81, 0xcd, 0xc8, 0x80, 0x30, + 0x41, 0x42, 0xb5, 0x39, 0x36, 0x2a, 0x31, 0xfc, 0x18, 0xd8, 0x11, 0xe6, 0x7e, 0xce, 0x49, 0xa8, + 0x77, 0x02, 0x6d, 0x47, 0x98, 0x7f, 0xc5, 0x49, 0xf8, 0x99, 0xf5, 0x97, 0x6f, 0xdd, 0x35, 0x0f, + 0x83, 0xda, 0x8b, 0x20, 0x20, 0x9c, 0x5f, 0xe7, 0xfd, 0x84, 0x2c, 0xe9, 0xb0, 0x33, 0x50, 0xe7, + 0x82, 0x32, 0x1c, 0x11, 0xff, 0x86, 0x8c, 0x4c, 0x9f, 0xe9, 0xae, 0x31, 0xf6, 0x5f, 0x93, 0x11, + 0x47, 0xb3, 0xc0, 0x48, 0x7c, 0x6b, 0x81, 0xda, 0x35, 0xc3, 0x01, 0x31, 0x17, 0x58, 0xd9, 0xab, + 0x12, 0x32, 0x23, 0x61, 0x90, 0xd4, 0x16, 0x71, 0x4a, 0x68, 0x2e, 0xcc, 0xf7, 0x34, 0x81, 0x32, + 0x83, 0x11, 0x32, 0x24, 0x81, 0x2a, 0xa3, 0x85, 0x0c, 0x82, 0xe7, 0x60, 0x27, 0x8c, 0xb9, 0x7a, + 0x0d, 0x70, 0x81, 0x83, 0x1b, 0xbd, 0xfc, 0x8e, 0x73, 0x57, 0xb8, 0x75, 0xe3, 0xb8, 0x92, 0x76, + 0x34, 0x87, 0xe0, 0xe7, 0xa0, 0x39, 0x4d, 0x53, 0xb3, 0xd5, 0xf7, 0xef, 0x0e, 0xbc, 0x2b, 0xdc, + 0x46, 0x19, 0xaa, 0x3c, 0x68, 0x01, 0xcb, 0x9d, 0x0e, 0x49, 0x37, 0x8f, 0x54, 0xf3, 0xd9, 0x48, + 0x03, 0x69, 0x4d, 0xe2, 0x34, 0x16, 0xaa, 0xd9, 0x36, 0x91, 0x06, 0xf0, 0x73, 0x50, 0xa5, 0x03, + 0xc2, 0x58, 0x1c, 0x12, 0xae, 0x2e, 0x10, 0xff, 0xef, 0x29, 0x81, 0xa6, 0xf1, 0x72, 0x71, 0xe6, + 0xa5, 0x93, 0x92, 0x94, 0xb2, 0x91, 0xba, 0x22, 0x98, 0xc5, 0x69, 0xc7, 0x6f, 0x94, 0x1d, 0xcd, + 0x21, 0xd8, 0x01, 0xd0, 0xa4, 0x31, 0x22, 0x72, 0x96, 0xf9, 0xea, 0xfb, 0xaf, 0xab, 0x5c, 0xf5, + 0x15, 0x6a, 0x2f, 0x52, 0xce, 0x57, 0x58, 0x60, 0x74, 0xcf, 0x02, 0x7f, 0x06, 0xa0, 0xde, 0x13, + 0xff, 0x1b, 0x4e, 0xcb, 0xb7, 0x90, 0x3e, 0xe3, 0x95, 0xbe, 0xf6, 0x9a, 0x39, 0x3b, 0x1a, 0x5d, + 0x72, 0x6a, 0x56, 0x71, 0x69, 0xd9, 0x96, 0xb3, 0x79, 0x69, 0xd9, 0xdb, 0x8e, 0x5d, 0xd6, 0xcf, + 0xac, 0x02, 0xed, 0x4e, 0xf0, 0xcc, 0xf4, 0x3a, 0xbf, 0xf8, 0xee, 0xf6, 0x60, 0xfd, 0xfd, 0xed, + 0xc1, 0xfa, 0xbf, 0x6f, 0x0f, 0xd6, 0xff, 0xfe, 0xe1, 0x60, 0xed, 0xfd, 0x87, 0x83, 0xb5, 0x7f, + 0x7e, 0x38, 0x58, 0xfb, 0xc3, 0x0f, 0xa2, 0x58, 0xf4, 0xf2, 0xee, 0x71, 0x40, 0x53, 0xf9, 0x8e, + 0xa5, 0xfc, 0x64, 0xfa, 0xbc, 0x1d, 0xaa, 0x07, 0xae, 0x18, 0xf5, 0x09, 0xef, 0x6e, 0xa9, 0x87, + 0xeb, 0xb3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xba, 0x7f, 0x37, 0xfe, 0x0e, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -2152,7 +2151,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.HomesteadBlock = &v if err := m.HomesteadBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2188,7 +2187,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.DAOForkBlock = &v if err := m.DAOForkBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2244,7 +2243,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.EIP150Block = &v if err := m.EIP150Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2312,7 +2311,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.EIP155Block = &v if err := m.EIP155Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2348,7 +2347,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.EIP158Block = &v if err := m.EIP158Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2384,7 +2383,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ByzantiumBlock = &v if err := m.ByzantiumBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2420,7 +2419,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ConstantinopleBlock = &v if err := m.ConstantinopleBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2456,7 +2455,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.PetersburgBlock = &v if err := m.PetersburgBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2492,7 +2491,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.IstanbulBlock = &v if err := m.IstanbulBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2528,7 +2527,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.MuirGlacierBlock = &v if err := m.MuirGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2564,7 +2563,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.BerlinBlock = &v if err := m.BerlinBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2600,7 +2599,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.LondonBlock = &v if err := m.LondonBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2636,7 +2635,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ArrowGlacierBlock = &v if err := m.ArrowGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2672,7 +2671,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.GrayGlacierBlock = &v if err := m.GrayGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2708,7 +2707,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.MergeNetsplitBlock = &v if err := m.MergeNetsplitBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2744,7 +2743,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ShanghaiBlock = &v if err := m.ShanghaiBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2780,7 +2779,7 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.CancunBlock = &v if err := m.CancunBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/evm/types/interfaces.go b/x/evm/types/interfaces.go index e3d6b66c..3cdb64de 100644 --- a/x/evm/types/interfaces.go +++ b/x/evm/types/interfaces.go @@ -16,46 +16,50 @@ package types import ( + context "context" "math/big" + "cosmossdk.io/core/address" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + didtypes "swisstronik/x/did/types" feemarkettypes "swisstronik/x/feemarket/types" + "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" - didtypes "swisstronik/x/did/types" ) // AccountKeeper defines the expected account keeper interface type AccountKeeper interface { - NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress - GetAllAccounts(ctx sdk.Context) (accounts []authtypes.AccountI) - IterateAccounts(ctx sdk.Context, cb func(account authtypes.AccountI) bool) - GetSequence(sdk.Context, sdk.AccAddress) (uint64, error) - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI - SetAccount(ctx sdk.Context, account authtypes.AccountI) - RemoveAccount(ctx sdk.Context, account authtypes.AccountI) - GetParams(ctx sdk.Context) (params authtypes.Params) + GetAllAccounts(ctx context.Context) (accounts []sdk.AccountI) + IterateAccounts(ctx context.Context, cb func(account sdk.AccountI) bool) + GetSequence(context.Context, sdk.AccAddress) (uint64, error) + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + SetAccount(ctx context.Context, account sdk.AccountI) + RemoveAccount(ctx context.Context, account sdk.AccountI) + GetParams(ctx context.Context) (params authtypes.Params) + AddressCodec() address.Codec } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { authtypes.BankKeeper - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error } // StakingKeeper returns the historical headers kept in store. type StakingKeeper interface { - GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) - GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool) + GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error) + GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, err error) } // FeeMarketKeeper @@ -77,7 +81,7 @@ type DIDKeeper interface { // EvmHooks event hooks for evm tx processing type EvmHooks interface { // Must be called after tx is processed successfully, if return an error, the whole transaction is reverted. - PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error + PostTxProcessing(ctx context.Context, msg core.Message, receipt *ethtypes.Receipt) error } type ( diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index 2c8595e3..208694f5 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -18,9 +18,9 @@ package types import ( "math/big" + errortypes "cosmossdk.io/errors" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" diff --git a/x/evm/types/msg_sgxvm.go b/x/evm/types/msg_sgxvm.go index 7c354e26..b289ecb8 100644 --- a/x/evm/types/msg_sgxvm.go +++ b/x/evm/types/msg_sgxvm.go @@ -20,9 +20,13 @@ import ( "swisstronik/types" "swisstronik/crypto/deoxys" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" + protov2 "google.golang.org/protobuf/proto" ) var ( @@ -207,6 +211,12 @@ func (msg *MsgHandleTx) GetMsgs() []sdk.Msg { return []sdk.Msg{msg} } +// GetMsgs returns a single MsgHandleTx as an sdk.Msg. +func (msg *MsgHandleTx) GetMsgsV2() ([]protov2.Message, error) { + return []protov2.Message{&bankv1beta1.MsgSend{FromAddress: msg.From}}, nil + +} + // GetSigners returns the expected signers for an Ethereum transaction message. // For such a message, there should exist only a single 'signer'. // @@ -251,7 +261,8 @@ func (msg *MsgHandleTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring.Si tx := msg.AsTransaction() txHash := ethSigner.Hash(tx) - sig, _, err := keyringSigner.SignByAddress(from, txHash.Bytes()) + // TODO: need check the signing mode. + sig, _, err := keyringSigner.SignByAddress(from, txHash.Bytes(), signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) if err != nil { return err } diff --git a/x/evm/types/msg_test.go b/x/evm/types/msg_test.go index 486e15a3..6c5deff5 100644 --- a/x/evm/types/msg_test.go +++ b/x/evm/types/msg_test.go @@ -21,7 +21,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "swisstronik/app" "swisstronik/encoding" "swisstronik/x/evm/types" ) @@ -59,7 +58,7 @@ func (suite *MsgsTestSuite) SetupTest() { suite.chainID = big.NewInt(1) suite.hundredBigInt = big.NewInt(100) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) } diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index 6a091ed4..8795a0ee 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" @@ -1248,7 +1249,7 @@ var xxx_messageInfo_QueryBaseFeeRequest proto.InternalMessageInfo // QueryBaseFeeResponse returns the EIP1559 base fee. type QueryBaseFeeResponse struct { // base_fee is the EIP1559 base fee - BaseFee *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"base_fee,omitempty"` + BaseFee cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee"` } func (m *QueryBaseFeeResponse) Reset() { *m = QueryBaseFeeResponse{} } @@ -1398,101 +1399,102 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) } var fileDescriptor_e15a877459347994 = []byte{ - // 1498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0x27, 0xad, 0x99, 0xa6, 0xd4, 0x5d, 0x12, 0x3b, 0xdd, 0x36, - 0x9f, 0x4d, 0x77, 0x89, 0x41, 0x95, 0xe8, 0x85, 0xc6, 0x21, 0xfd, 0xa0, 0x1f, 0x2a, 0xa6, 0xe2, - 0x80, 0x54, 0x59, 0xe3, 0xdd, 0xe9, 0xda, 0x8a, 0xbd, 0xeb, 0xee, 0xac, 0x8d, 0xd3, 0x52, 0x84, - 0x90, 0xa8, 0x8a, 0x8a, 0x50, 0x25, 0xee, 0xa8, 0xff, 0x01, 0x47, 0xfe, 0x85, 0x1e, 0x2b, 0x71, - 0x41, 0x08, 0x15, 0xd4, 0x72, 0xe0, 0x6f, 0xe0, 0x84, 0x66, 0x76, 0xd6, 0xde, 0xf5, 0x7a, 0xed, - 0x14, 0x95, 0x13, 0xa7, 0xdd, 0x99, 0x79, 0xf3, 0xde, 0xef, 0x7d, 0xcc, 0x7b, 0x3f, 0x58, 0x20, - 0x6e, 0x8d, 0x38, 0xcd, 0xba, 0xe5, 0x6a, 0xa4, 0xd3, 0xd4, 0x3a, 0x5b, 0xda, 0x9d, 0x36, 0x71, - 0xf6, 0xd5, 0x96, 0x63, 0xbb, 0x36, 0xca, 0xf6, 0x4e, 0x55, 0xd2, 0x69, 0xaa, 0x9d, 0x2d, 0x79, - 0x43, 0xb7, 0x69, 0xd3, 0xa6, 0x5a, 0x15, 0x53, 0xe2, 0x89, 0x6a, 0x9d, 0xad, 0x2a, 0x71, 0xf1, - 0x96, 0xd6, 0xc2, 0x66, 0xdd, 0xc2, 0x6e, 0xdd, 0xb6, 0xbc, 0xdb, 0xb2, 0x1c, 0xd1, 0xcd, 0x94, - 0x78, 0x67, 0xc7, 0x23, 0x67, 0x6e, 0x57, 0x1c, 0xcd, 0x9b, 0xb6, 0x69, 0xf3, 0x5f, 0x8d, 0xfd, - 0x89, 0xdd, 0x05, 0xd3, 0xb6, 0xcd, 0x06, 0xd1, 0x70, 0xab, 0xae, 0x61, 0xcb, 0xb2, 0x5d, 0x6e, - 0x89, 0x8a, 0xd3, 0x82, 0x38, 0xe5, 0xab, 0x6a, 0xfb, 0xb6, 0xe6, 0xd6, 0x9b, 0x84, 0xba, 0xb8, - 0xd9, 0xf2, 0x04, 0x94, 0xf7, 0xe0, 0xc8, 0x47, 0x0c, 0xed, 0xb6, 0xae, 0xdb, 0x6d, 0xcb, 0x2d, - 0x93, 0x3b, 0x6d, 0x42, 0x5d, 0x94, 0x83, 0x14, 0x36, 0x0c, 0x87, 0x50, 0x9a, 0x93, 0x96, 0xa4, - 0xb5, 0x99, 0xb2, 0xbf, 0x3c, 0x97, 0x7e, 0xf8, 0xa4, 0x30, 0xf1, 0xd7, 0x93, 0xc2, 0x84, 0xa2, - 0xc3, 0x7c, 0xf8, 0x2a, 0x6d, 0xd9, 0x16, 0x25, 0xec, 0x6e, 0x15, 0x37, 0xb0, 0xa5, 0x13, 0xff, - 0xae, 0x58, 0xa2, 0xb7, 0x60, 0x46, 0xb7, 0x0d, 0x52, 0xa9, 0x61, 0x5a, 0xcb, 0x4d, 0xf2, 0xb3, - 0x34, 0xdb, 0xb8, 0x84, 0x69, 0x0d, 0xcd, 0xc3, 0x94, 0x65, 0xb3, 0x4b, 0x89, 0x25, 0x69, 0x2d, - 0x59, 0xf6, 0x16, 0xca, 0xfb, 0x70, 0x9c, 0x1b, 0xd9, 0xe1, 0xe1, 0xfd, 0x17, 0x28, 0x1f, 0x48, - 0x20, 0x0f, 0xd3, 0x20, 0xc0, 0x2e, 0xc3, 0x21, 0x2f, 0x73, 0x95, 0xb0, 0xa6, 0x39, 0x6f, 0x77, - 0xdb, 0xdb, 0x44, 0x32, 0xa4, 0x29, 0x33, 0xca, 0xf0, 0x4d, 0x72, 0x7c, 0xbd, 0x35, 0x53, 0x81, - 0x3d, 0xad, 0x15, 0xab, 0xdd, 0xac, 0x12, 0x47, 0x78, 0x30, 0x27, 0x76, 0xaf, 0xf3, 0x4d, 0xe5, - 0x0a, 0x2c, 0x70, 0x1c, 0x9f, 0xe0, 0x46, 0xdd, 0xc0, 0xae, 0xed, 0x0c, 0x38, 0x73, 0x02, 0x66, - 0x75, 0xdb, 0x1a, 0xc4, 0x91, 0x61, 0x7b, 0xdb, 0x11, 0xaf, 0x1e, 0x49, 0xb0, 0x18, 0xa3, 0x4d, - 0x38, 0xb6, 0x0a, 0x87, 0x7d, 0x54, 0x61, 0x8d, 0x3e, 0xd8, 0xd7, 0xe8, 0x9a, 0x5f, 0x44, 0x25, - 0x2f, 0xcf, 0xaf, 0x92, 0x9e, 0xb7, 0x45, 0x11, 0xf5, 0xae, 0x8e, 0x2b, 0x22, 0xe5, 0x8a, 0x30, - 0xf6, 0xb1, 0x6b, 0x3b, 0xd8, 0x1c, 0x6f, 0x0c, 0x65, 0x21, 0xb1, 0x47, 0xf6, 0x45, 0xbd, 0xb1, - 0xdf, 0x80, 0xf9, 0x4d, 0x61, 0xbe, 0xa7, 0x4c, 0x98, 0x9f, 0x87, 0xa9, 0x0e, 0x6e, 0xb4, 0x7d, - 0xe3, 0xde, 0x42, 0x39, 0x0b, 0x59, 0x51, 0x4a, 0xc6, 0x2b, 0x39, 0xb9, 0x0a, 0x6f, 0x04, 0xee, - 0x09, 0x13, 0x08, 0x92, 0xac, 0xf6, 0xf9, 0xad, 0xd9, 0x32, 0xff, 0x57, 0xee, 0x02, 0xe2, 0x82, - 0x37, 0xbb, 0x57, 0x6d, 0x93, 0xfa, 0x26, 0x10, 0x24, 0xf9, 0x8b, 0xf1, 0xf4, 0xf3, 0x7f, 0x74, - 0x01, 0xa0, 0xdf, 0x57, 0xb8, 0x6f, 0x99, 0xe2, 0x8a, 0xea, 0x15, 0xad, 0xca, 0x9a, 0x90, 0xea, - 0xf5, 0x2b, 0xd1, 0x84, 0xd4, 0x1b, 0xfd, 0x50, 0x95, 0x03, 0x37, 0x03, 0x20, 0xbf, 0x91, 0x44, - 0x60, 0x7d, 0xe3, 0x02, 0xe7, 0x3a, 0x24, 0x1b, 0xb6, 0xc9, 0xbc, 0x4b, 0xac, 0x65, 0x8a, 0x47, - 0xd5, 0xc1, 0xd6, 0xa7, 0x5e, 0xb5, 0xcd, 0x32, 0x17, 0x41, 0x17, 0x87, 0x80, 0x5a, 0x1d, 0x0b, - 0xca, 0xb3, 0x13, 0x44, 0xa5, 0xcc, 0x8b, 0x38, 0xdc, 0xc0, 0x0e, 0x6e, 0xfa, 0x71, 0x50, 0xae, - 0x09, 0x80, 0xfe, 0xae, 0x00, 0x78, 0x16, 0xa6, 0x5b, 0x7c, 0x87, 0x07, 0x28, 0x53, 0xcc, 0x45, - 0x21, 0x7a, 0x37, 0x4a, 0xc9, 0xa7, 0xcf, 0x0b, 0x13, 0x65, 0x21, 0xad, 0xfc, 0x24, 0xc1, 0xa1, - 0x5d, 0xb7, 0xb6, 0x83, 0x1b, 0x8d, 0x40, 0xa4, 0xb1, 0x63, 0x52, 0x3f, 0x27, 0xec, 0x1f, 0x1d, - 0x83, 0x94, 0x89, 0x69, 0x45, 0xc7, 0x2d, 0xf1, 0x3c, 0xa6, 0x4d, 0x4c, 0x77, 0x70, 0x0b, 0xdd, - 0x82, 0x6c, 0xcb, 0xb1, 0x5b, 0x36, 0x25, 0x4e, 0xef, 0x89, 0xb1, 0xe7, 0x31, 0x5b, 0x2a, 0xfe, - 0xfd, 0xbc, 0xa0, 0x9a, 0x75, 0xb7, 0xd6, 0xae, 0xaa, 0xba, 0xdd, 0xd4, 0xc4, 0x6c, 0xf0, 0x3e, - 0x67, 0xa8, 0xb1, 0xa7, 0xb9, 0xfb, 0x2d, 0x42, 0xd5, 0x9d, 0xfe, 0xdb, 0x2e, 0x1f, 0xf6, 0x75, - 0xf9, 0xef, 0xf2, 0x38, 0xa4, 0xf5, 0x1a, 0xae, 0x5b, 0x95, 0xba, 0x91, 0x4b, 0x2e, 0x49, 0x6b, - 0x89, 0x72, 0x8a, 0xaf, 0x2f, 0x1b, 0xca, 0x2a, 0x1c, 0xd9, 0xa5, 0x6e, 0xbd, 0x89, 0x5d, 0x72, - 0x11, 0xf7, 0x03, 0x91, 0x85, 0x84, 0x89, 0x3d, 0xf0, 0xc9, 0x32, 0xfb, 0x55, 0x7e, 0x4b, 0xf8, - 0x39, 0x75, 0xb0, 0x4e, 0x6e, 0x76, 0x7d, 0x3f, 0x35, 0x48, 0x34, 0xa9, 0x29, 0xe2, 0xb5, 0x18, - 0x8d, 0xd7, 0x35, 0x6a, 0x5e, 0xc2, 0x96, 0xd1, 0x60, 0x57, 0x98, 0x24, 0x3a, 0x0f, 0xb3, 0x2e, - 0x53, 0x51, 0xd1, 0x6d, 0xeb, 0x76, 0xdd, 0xe4, 0x7e, 0x0e, 0xbd, 0xc9, 0x0d, 0xed, 0x70, 0xa1, - 0x72, 0xc6, 0xed, 0x2f, 0xd0, 0x36, 0xcc, 0xb6, 0x1c, 0x62, 0x10, 0x9d, 0x50, 0x6a, 0x3b, 0x34, - 0x97, 0xe4, 0xe5, 0x34, 0xc6, 0x76, 0xe8, 0x0a, 0xeb, 0x90, 0xd5, 0x86, 0xad, 0xef, 0xf9, 0xbd, - 0x68, 0x8a, 0x47, 0x25, 0xc3, 0xf7, 0xbc, 0x4e, 0x84, 0x16, 0x01, 0x3c, 0x11, 0xfe, 0x60, 0xa6, - 0xf9, 0x83, 0x99, 0xe1, 0x3b, 0x7c, 0xc6, 0xec, 0xf8, 0xc7, 0x6c, 0x0c, 0xe6, 0x52, 0xdc, 0x09, - 0x59, 0xf5, 0x66, 0xa4, 0xea, 0xcf, 0x48, 0xf5, 0xa6, 0x3f, 0x23, 0x4b, 0x69, 0x56, 0x30, 0x8f, - 0x7f, 0x2f, 0x48, 0x42, 0x09, 0x3b, 0x19, 0x9a, 0xf7, 0xf4, 0x7f, 0x93, 0xf7, 0x99, 0x50, 0xde, - 0x3f, 0x4c, 0xa6, 0x27, 0xb3, 0x89, 0x72, 0xda, 0xed, 0x56, 0xea, 0x96, 0x41, 0xba, 0xca, 0x86, - 0xe8, 0x5e, 0xbd, 0xec, 0xf6, 0x5b, 0x8b, 0x81, 0x5d, 0xec, 0x97, 0x31, 0xfb, 0x57, 0xbe, 0x4d, - 0xc0, 0x9b, 0x7d, 0xe1, 0x12, 0xf3, 0x26, 0x50, 0x0d, 0x6e, 0xd7, 0x7f, 0xe0, 0xe3, 0xaa, 0xc1, - 0xed, 0xd2, 0xd7, 0x50, 0x0d, 0xff, 0xf7, 0x54, 0x2a, 0x67, 0xe0, 0x58, 0x24, 0x1b, 0x23, 0xb2, - 0x77, 0xb4, 0x37, 0x61, 0x29, 0xb9, 0x40, 0xfc, 0x4e, 0xae, 0xdc, 0xea, 0x4d, 0x4f, 0xb1, 0x2d, - 0x54, 0xec, 0x42, 0x9a, 0xb5, 0xdb, 0xca, 0x6d, 0x22, 0x26, 0x58, 0x69, 0xe3, 0xd7, 0xe7, 0x85, - 0x95, 0x03, 0xf8, 0x73, 0xd9, 0x72, 0xd9, 0xa8, 0xe5, 0xea, 0x7a, 0x6d, 0xf8, 0xba, 0x6d, 0x90, - 0x1b, 0xed, 0x6a, 0xa3, 0xae, 0x5f, 0x21, 0xfb, 0xca, 0x07, 0x82, 0x50, 0x85, 0x76, 0x7b, 0xa6, - 0x57, 0xe0, 0xb0, 0xc5, 0x38, 0x5e, 0x8b, 0x9f, 0x54, 0xd8, 0xe4, 0x15, 0x8c, 0xca, 0x0a, 0xca, - 0x17, 0xbf, 0x3c, 0x04, 0x53, 0x5c, 0x0d, 0xfa, 0x5a, 0x82, 0x94, 0x60, 0x2f, 0x68, 0x39, 0x5a, - 0x43, 0x43, 0xe8, 0xa9, 0xbc, 0x32, 0x4e, 0xcc, 0x03, 0xa3, 0x9c, 0xfe, 0xea, 0xe7, 0x3f, 0xbf, - 0x9f, 0x5c, 0x46, 0x27, 0xb5, 0x08, 0xad, 0x16, 0x0c, 0x46, 0xbb, 0x27, 0xf2, 0x7e, 0x1f, 0xfd, - 0x20, 0xc1, 0x5c, 0x88, 0x24, 0xa2, 0xd3, 0x31, 0x66, 0x86, 0x91, 0x51, 0x79, 0xf3, 0x60, 0xc2, - 0x02, 0x59, 0x91, 0x23, 0xdb, 0x44, 0x1b, 0x51, 0x64, 0x3e, 0x1f, 0x8d, 0x00, 0xfc, 0x51, 0x82, - 0xec, 0x20, 0xdf, 0x43, 0x6a, 0x8c, 0xd9, 0x18, 0x9a, 0x29, 0x6b, 0x07, 0x96, 0x17, 0x48, 0xcf, - 0x71, 0xa4, 0xef, 0xa2, 0x62, 0x14, 0x69, 0xc7, 0xbf, 0xd3, 0x07, 0x1b, 0xa4, 0xb0, 0xf7, 0xd1, - 0x03, 0x09, 0x52, 0x82, 0xd9, 0xc5, 0xa6, 0x36, 0x4c, 0x1a, 0x63, 0x53, 0x3b, 0x40, 0x10, 0x95, - 0x4d, 0x0e, 0x6b, 0x05, 0x9d, 0x8a, 0xc2, 0x12, 0x4c, 0x91, 0x06, 0x42, 0xf7, 0x48, 0x82, 0x94, - 0xe0, 0x78, 0xb1, 0x40, 0xc2, 0x84, 0x32, 0x16, 0xc8, 0x00, 0x55, 0x54, 0xb6, 0x38, 0x90, 0xd3, - 0x68, 0x3d, 0x0a, 0x84, 0x7a, 0xa2, 0x7d, 0x1c, 0xda, 0xbd, 0x3d, 0xb2, 0x7f, 0x1f, 0xdd, 0x85, - 0x24, 0xa3, 0x82, 0x48, 0x89, 0x2d, 0x99, 0x1e, 0xbf, 0x94, 0x4f, 0x8e, 0x94, 0x11, 0x18, 0xd6, - 0x39, 0x86, 0x93, 0xe8, 0xc4, 0xb0, 0x6a, 0x32, 0x42, 0x91, 0xf8, 0x0c, 0xa6, 0x3d, 0x36, 0x84, - 0x4e, 0xc5, 0x68, 0x0e, 0x91, 0x2e, 0x79, 0x79, 0x8c, 0x94, 0x40, 0xb0, 0xc4, 0x11, 0xc8, 0x28, - 0x17, 0x45, 0xe0, 0xd1, 0x2d, 0xd4, 0x85, 0x94, 0x60, 0x5b, 0x68, 0x29, 0xaa, 0x33, 0x4c, 0xc4, - 0xe4, 0xd5, 0xa1, 0x53, 0x68, 0x97, 0xed, 0x91, 0x76, 0xb3, 0x3f, 0xea, 0x14, 0x85, 0xdb, 0x5d, - 0x40, 0x72, 0xd4, 0x2e, 0x71, 0x6b, 0x15, 0x9d, 0x99, 0xfb, 0x02, 0x32, 0x01, 0xba, 0x74, 0x00, - 0xeb, 0x43, 0x7c, 0x1e, 0xc2, 0xb7, 0x94, 0x15, 0x6e, 0x7b, 0x09, 0xe5, 0x87, 0xd8, 0x16, 0xe2, - 0x15, 0x13, 0x53, 0xf4, 0x39, 0xa4, 0xc4, 0x84, 0x8e, 0xad, 0xbd, 0x30, 0x3f, 0x8b, 0xad, 0xbd, - 0x81, 0x41, 0x3f, 0xca, 0x7b, 0x6f, 0x40, 0xbb, 0x5d, 0xf4, 0x50, 0x02, 0xe8, 0x4f, 0x19, 0xb4, - 0x36, 0x4a, 0x75, 0x90, 0x16, 0xc8, 0xeb, 0x07, 0x90, 0x14, 0x38, 0x96, 0x39, 0x8e, 0x02, 0x5a, - 0x8c, 0xc3, 0xc1, 0x47, 0x2e, 0x0b, 0x84, 0x98, 0x54, 0x23, 0xba, 0x41, 0x70, 0xc0, 0x8d, 0xe8, - 0x06, 0xa1, 0x81, 0x37, 0x2a, 0x10, 0xfe, 0x20, 0x44, 0xdf, 0x49, 0x30, 0x17, 0x9a, 0x59, 0xb1, - 0x2f, 0x20, 0x24, 0x15, 0xdb, 0xd8, 0x87, 0xce, 0xbf, 0x51, 0x4f, 0x71, 0x60, 0x2e, 0x96, 0xce, - 0x3f, 0x7d, 0x91, 0x97, 0x9e, 0xbd, 0xc8, 0x4b, 0x7f, 0xbc, 0xc8, 0x4b, 0x8f, 0x5f, 0xe6, 0x27, - 0x9e, 0xbd, 0xcc, 0x4f, 0xfc, 0xf2, 0x32, 0x3f, 0xf1, 0x69, 0x70, 0x52, 0x93, 0x0e, 0x1b, 0xd4, - 0x7d, 0x65, 0x5d, 0xae, 0x8e, 0x4f, 0xeb, 0xea, 0x34, 0x27, 0x3a, 0xef, 0xfc, 0x13, 0x00, 0x00, - 0xff, 0xff, 0x9c, 0x09, 0x64, 0xb7, 0xae, 0x12, 0x00, 0x00, + // 1512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x5d, 0x6f, 0x1b, 0x45, + 0x17, 0xce, 0xc6, 0x4e, 0xec, 0x4c, 0x92, 0xd6, 0xef, 0x34, 0x7d, 0xeb, 0xee, 0x9b, 0xd8, 0xe9, + 0xb6, 0xf9, 0x6a, 0xd3, 0xdd, 0x37, 0x06, 0x55, 0xd0, 0x1b, 0x1a, 0x87, 0x7e, 0xd1, 0x0f, 0x05, + 0x53, 0x71, 0x81, 0x84, 0xac, 0xf1, 0xee, 0x74, 0xbd, 0x8a, 0xbd, 0xe3, 0xee, 0x8c, 0x8d, 0xd3, + 0x52, 0x84, 0x90, 0xa8, 0x8a, 0x8a, 0x50, 0x25, 0xee, 0x51, 0xff, 0x01, 0x97, 0xfc, 0x85, 0x5e, + 0x56, 0xe2, 0x06, 0x21, 0x54, 0x50, 0xcb, 0x05, 0xbf, 0x81, 0x2b, 0x34, 0xb3, 0xb3, 0xf6, 0xae, + 0xd7, 0x6b, 0xa7, 0xa8, 0x5c, 0x71, 0xb5, 0x3b, 0x33, 0x67, 0xce, 0x79, 0xce, 0xc7, 0x9c, 0xf3, + 0x80, 0x45, 0xcc, 0xea, 0xd8, 0x6b, 0x3a, 0x2e, 0x33, 0x70, 0xa7, 0x69, 0x74, 0xb6, 0x8c, 0x3b, + 0x6d, 0xec, 0xed, 0xeb, 0x2d, 0x8f, 0x30, 0x02, 0x73, 0xbd, 0x53, 0x1d, 0x77, 0x9a, 0x7a, 0x67, + 0x4b, 0x3d, 0x6d, 0x12, 0xda, 0x24, 0xd4, 0xa8, 0x21, 0x8a, 0x7d, 0x51, 0xa3, 0xb3, 0x55, 0xc3, + 0x0c, 0x6d, 0x19, 0x2d, 0x64, 0x3b, 0x2e, 0x62, 0x0e, 0x71, 0xfd, 0xdb, 0xaa, 0x1a, 0xd3, 0xcd, + 0x95, 0xf8, 0x67, 0xc7, 0x63, 0x67, 0xac, 0x2b, 0x8f, 0x16, 0x6c, 0x62, 0x13, 0xf1, 0x6b, 0xf0, + 0x3f, 0xb9, 0xbb, 0x68, 0x13, 0x62, 0x37, 0xb0, 0x81, 0x5a, 0x8e, 0x81, 0x5c, 0x97, 0x30, 0x61, + 0x89, 0xca, 0xd3, 0xa2, 0x3c, 0x15, 0xab, 0x5a, 0xfb, 0xb6, 0xc1, 0x9c, 0x26, 0xa6, 0x0c, 0x35, + 0x5b, 0xbe, 0x80, 0xf6, 0x36, 0x38, 0xf2, 0x3e, 0x47, 0xbb, 0x6d, 0x9a, 0xa4, 0xed, 0xb2, 0x0a, + 0xbe, 0xd3, 0xc6, 0x94, 0xc1, 0x3c, 0xc8, 0x20, 0xcb, 0xf2, 0x30, 0xa5, 0x79, 0x65, 0x59, 0x59, + 0x9f, 0xa9, 0x04, 0xcb, 0xf3, 0xd9, 0x87, 0x4f, 0x8a, 0x13, 0x7f, 0x3c, 0x29, 0x4e, 0x68, 0x26, + 0x58, 0x88, 0x5e, 0xa5, 0x2d, 0xe2, 0x52, 0xcc, 0xef, 0xd6, 0x50, 0x03, 0xb9, 0x26, 0x0e, 0xee, + 0xca, 0x25, 0xfc, 0x1f, 0x98, 0x31, 0x89, 0x85, 0xab, 0x75, 0x44, 0xeb, 0xf9, 0x49, 0x71, 0x96, + 0xe5, 0x1b, 0x57, 0x10, 0xad, 0xc3, 0x05, 0x30, 0xe5, 0x12, 0x7e, 0x29, 0xb5, 0xac, 0xac, 0xa7, + 0x2b, 0xfe, 0x42, 0x7b, 0x07, 0x1c, 0x17, 0x46, 0x76, 0x44, 0x78, 0xff, 0x06, 0xca, 0x07, 0x0a, + 0x50, 0x87, 0x69, 0x90, 0x60, 0x57, 0xc0, 0x21, 0x3f, 0x73, 0xd5, 0xa8, 0xa6, 0x79, 0x7f, 0x77, + 0xdb, 0xdf, 0x84, 0x2a, 0xc8, 0x52, 0x6e, 0x94, 0xe3, 0x9b, 0x14, 0xf8, 0x7a, 0x6b, 0xae, 0x02, + 0xf9, 0x5a, 0xab, 0x6e, 0xbb, 0x59, 0xc3, 0x9e, 0xf4, 0x60, 0x5e, 0xee, 0xde, 0x14, 0x9b, 0xda, + 0x35, 0xb0, 0x28, 0x70, 0x7c, 0x88, 0x1a, 0x8e, 0x85, 0x18, 0xf1, 0x06, 0x9c, 0x39, 0x01, 0xe6, + 0x4c, 0xe2, 0x0e, 0xe2, 0x98, 0xe5, 0x7b, 0xdb, 0x31, 0xaf, 0x1e, 0x29, 0x60, 0x29, 0x41, 0x9b, + 0x74, 0x6c, 0x0d, 0x1c, 0x0e, 0x50, 0x45, 0x35, 0x06, 0x60, 0x5f, 0xa3, 0x6b, 0x41, 0x11, 0x95, + 0xfd, 0x3c, 0xbf, 0x4a, 0x7a, 0xfe, 0x2f, 0x8b, 0xa8, 0x77, 0x75, 0x5c, 0x11, 0x69, 0xd7, 0xa4, + 0xb1, 0x0f, 0x18, 0xf1, 0x90, 0x3d, 0xde, 0x18, 0xcc, 0x81, 0xd4, 0x1e, 0xde, 0x97, 0xf5, 0xc6, + 0x7f, 0x43, 0xe6, 0x37, 0xa5, 0xf9, 0x9e, 0x32, 0x69, 0x7e, 0x01, 0x4c, 0x75, 0x50, 0xa3, 0x1d, + 0x18, 0xf7, 0x17, 0xda, 0x39, 0x90, 0x93, 0xa5, 0x64, 0xbd, 0x92, 0x93, 0x6b, 0xe0, 0x3f, 0xa1, + 0x7b, 0xd2, 0x04, 0x04, 0x69, 0x5e, 0xfb, 0xe2, 0xd6, 0x5c, 0x45, 0xfc, 0x6b, 0x77, 0x01, 0x14, + 0x82, 0xb7, 0xba, 0xd7, 0x89, 0x4d, 0x03, 0x13, 0x10, 0xa4, 0xc5, 0x8b, 0xf1, 0xf5, 0x8b, 0x7f, + 0x78, 0x09, 0x80, 0x7e, 0x5f, 0x11, 0xbe, 0xcd, 0x96, 0x56, 0x75, 0xbf, 0x68, 0x75, 0xde, 0x84, + 0x74, 0xbf, 0x5f, 0xc9, 0x26, 0xa4, 0xef, 0xf6, 0x43, 0x55, 0x09, 0xdd, 0x0c, 0x81, 0xfc, 0x4a, + 0x91, 0x81, 0x0d, 0x8c, 0x4b, 0x9c, 0x1b, 0x20, 0xdd, 0x20, 0x36, 0xf7, 0x2e, 0xb5, 0x3e, 0x5b, + 0x3a, 0xaa, 0x0f, 0xb6, 0x3e, 0xfd, 0x3a, 0xb1, 0x2b, 0x42, 0x04, 0x5e, 0x1e, 0x02, 0x6a, 0x6d, + 0x2c, 0x28, 0xdf, 0x4e, 0x18, 0x95, 0xb6, 0x20, 0xe3, 0xb0, 0x8b, 0x3c, 0xd4, 0x0c, 0xe2, 0xa0, + 0xdd, 0x90, 0x00, 0x83, 0x5d, 0x09, 0xf0, 0x1c, 0x98, 0x6e, 0x89, 0x1d, 0x11, 0xa0, 0xd9, 0x52, + 0x3e, 0x0e, 0xd1, 0xbf, 0x51, 0x4e, 0x3f, 0x7d, 0x5e, 0x9c, 0xa8, 0x48, 0x69, 0xed, 0x07, 0x05, + 0x1c, 0xba, 0xc8, 0xea, 0x3b, 0xa8, 0xd1, 0x08, 0x45, 0x1a, 0x79, 0x36, 0x0d, 0x72, 0xc2, 0xff, + 0xe1, 0x31, 0x90, 0xb1, 0x11, 0xad, 0x9a, 0xa8, 0x25, 0x9f, 0xc7, 0xb4, 0x8d, 0xe8, 0x0e, 0x6a, + 0xc1, 0x8f, 0x41, 0xae, 0xe5, 0x91, 0x16, 0xa1, 0xd8, 0xeb, 0x3d, 0x31, 0xfe, 0x3c, 0xe6, 0xca, + 0xa5, 0x3f, 0x9f, 0x17, 0x75, 0xdb, 0x61, 0xf5, 0x76, 0x4d, 0x37, 0x49, 0xd3, 0x90, 0xb3, 0xc1, + 0xff, 0x9c, 0xa5, 0xd6, 0x9e, 0xc1, 0xf6, 0x5b, 0x98, 0xea, 0x3b, 0xfd, 0xb7, 0x5d, 0x39, 0x1c, + 0xe8, 0x0a, 0xde, 0xe5, 0x71, 0x90, 0x35, 0xeb, 0xc8, 0x71, 0xab, 0x8e, 0x95, 0x4f, 0x2f, 0x2b, + 0xeb, 0xa9, 0x4a, 0x46, 0xac, 0xaf, 0x5a, 0xda, 0x1a, 0x38, 0x72, 0x91, 0x32, 0xa7, 0x89, 0x18, + 0xbe, 0x8c, 0xfa, 0x81, 0xc8, 0x81, 0x94, 0x8d, 0x7c, 0xf0, 0xe9, 0x0a, 0xff, 0xd5, 0x7e, 0x49, + 0x05, 0x39, 0xf5, 0x90, 0x89, 0x6f, 0x75, 0x03, 0x3f, 0x0d, 0x90, 0x6a, 0x52, 0x5b, 0xc6, 0x6b, + 0x29, 0x1e, 0xaf, 0x1b, 0xd4, 0xbe, 0x82, 0x5c, 0xab, 0xc1, 0xaf, 0x70, 0x49, 0x78, 0x01, 0xcc, + 0x31, 0xae, 0xa2, 0x6a, 0x12, 0xf7, 0xb6, 0x63, 0x0b, 0x3f, 0x87, 0xde, 0x14, 0x86, 0x76, 0x84, + 0x50, 0x65, 0x96, 0xf5, 0x17, 0x70, 0x1b, 0xcc, 0xb5, 0x3c, 0x6c, 0x61, 0x13, 0x53, 0x4a, 0x3c, + 0x9a, 0x4f, 0x8b, 0x72, 0x1a, 0x63, 0x3b, 0x72, 0x85, 0x77, 0xc8, 0x5a, 0x83, 0x98, 0x7b, 0x41, + 0x2f, 0x9a, 0x12, 0x51, 0x99, 0x15, 0x7b, 0x7e, 0x27, 0x82, 0x4b, 0x00, 0xf8, 0x22, 0xe2, 0xc1, + 0x4c, 0x8b, 0x07, 0x33, 0x23, 0x76, 0xc4, 0x8c, 0xd9, 0x09, 0x8e, 0xf9, 0x18, 0xcc, 0x67, 0x84, + 0x13, 0xaa, 0xee, 0xcf, 0x48, 0x3d, 0x98, 0x91, 0xfa, 0xad, 0x60, 0x46, 0x96, 0xb3, 0xbc, 0x60, + 0x1e, 0xff, 0x5a, 0x54, 0xa4, 0x12, 0x7e, 0x32, 0x34, 0xef, 0xd9, 0x7f, 0x26, 0xef, 0x33, 0x91, + 0xbc, 0xbf, 0x97, 0xce, 0x4e, 0xe6, 0x52, 0x95, 0x2c, 0xeb, 0x56, 0x1d, 0xd7, 0xc2, 0x5d, 0xed, + 0xb4, 0xec, 0x5e, 0xbd, 0xec, 0xf6, 0x5b, 0x8b, 0x85, 0x18, 0x0a, 0xca, 0x98, 0xff, 0x6b, 0x5f, + 0xa7, 0xc0, 0x7f, 0xfb, 0xc2, 0x65, 0xee, 0x4d, 0xa8, 0x1a, 0x58, 0x37, 0x78, 0xe0, 0xe3, 0xaa, + 0x81, 0x75, 0xe9, 0x6b, 0xa8, 0x86, 0x7f, 0x7b, 0x2a, 0xb5, 0xb3, 0xe0, 0x58, 0x2c, 0x1b, 0x23, + 0xb2, 0x77, 0xb4, 0x37, 0x61, 0x29, 0xbe, 0x84, 0x83, 0x4e, 0xae, 0xed, 0xf6, 0xa6, 0xa7, 0xdc, + 0x96, 0x2a, 0xde, 0x02, 0x59, 0xde, 0x6e, 0xab, 0xb7, 0xb1, 0x9c, 0x60, 0xe5, 0x25, 0xee, 0xfe, + 0xcf, 0xcf, 0x8b, 0x47, 0x7d, 0x0f, 0xa8, 0xb5, 0xa7, 0x3b, 0xc4, 0x68, 0x22, 0x56, 0xd7, 0xaf, + 0xba, 0x8c, 0x4f, 0x57, 0xa1, 0xa1, 0xd7, 0x79, 0x6f, 0x12, 0x0b, 0xef, 0xb6, 0x6b, 0x0d, 0xc7, + 0xbc, 0x86, 0xf7, 0xb5, 0x77, 0x25, 0x87, 0x8a, 0xec, 0xf6, 0xac, 0xad, 0x82, 0xc3, 0x2e, 0xa7, + 0x75, 0x2d, 0x71, 0x52, 0xe5, 0xc3, 0x56, 0x92, 0x28, 0x37, 0x2c, 0x5f, 0xfa, 0xfc, 0x10, 0x98, + 0x12, 0x6a, 0xe0, 0x97, 0x0a, 0xc8, 0x48, 0xc2, 0x02, 0x57, 0xe2, 0x65, 0x33, 0x84, 0x91, 0xaa, + 0xab, 0xe3, 0xc4, 0x7c, 0x30, 0xda, 0x99, 0x2f, 0x7e, 0xfc, 0xfd, 0xdb, 0xc9, 0x15, 0x78, 0xd2, + 0x88, 0x31, 0x69, 0x49, 0x5a, 0x8c, 0x7b, 0x32, 0xd5, 0xf7, 0xe1, 0x77, 0x0a, 0x98, 0x8f, 0xf0, + 0x42, 0x78, 0x26, 0xc1, 0xcc, 0x30, 0xfe, 0xa9, 0x6e, 0x1e, 0x4c, 0x58, 0x22, 0x2b, 0x09, 0x64, + 0x9b, 0xf0, 0x74, 0x1c, 0x59, 0x40, 0x41, 0x63, 0x00, 0xbf, 0x57, 0x40, 0x6e, 0x90, 0xe2, 0x41, + 0x3d, 0xc1, 0x6c, 0x02, 0xb3, 0x54, 0x8d, 0x03, 0xcb, 0x4b, 0xa4, 0xe7, 0x05, 0xd2, 0x37, 0x61, + 0x29, 0x8e, 0xb4, 0x13, 0xdc, 0xe9, 0x83, 0x0d, 0xb3, 0xd6, 0xfb, 0xf0, 0x81, 0x02, 0x32, 0x92, + 0xcc, 0x25, 0xa6, 0x36, 0xca, 0x13, 0x13, 0x53, 0x3b, 0xc0, 0x09, 0xb5, 0x4d, 0x01, 0x6b, 0x15, + 0x9e, 0x8a, 0xc3, 0x92, 0xe4, 0x90, 0x86, 0x42, 0xf7, 0x48, 0x01, 0x19, 0x49, 0xeb, 0x12, 0x81, + 0x44, 0x39, 0x64, 0x22, 0x90, 0x01, 0x76, 0xa8, 0x6d, 0x09, 0x20, 0x67, 0xe0, 0x46, 0x1c, 0x08, + 0xf5, 0x45, 0xfb, 0x38, 0x8c, 0x7b, 0x7b, 0x78, 0xff, 0x3e, 0xbc, 0x0b, 0xd2, 0x9c, 0xfd, 0x41, + 0x2d, 0xb1, 0x64, 0x7a, 0x94, 0x52, 0x3d, 0x39, 0x52, 0x46, 0x62, 0xd8, 0x10, 0x18, 0x4e, 0xc2, + 0x13, 0xc3, 0xaa, 0xc9, 0x8a, 0x44, 0xe2, 0x13, 0x30, 0xed, 0x13, 0x20, 0x78, 0x2a, 0x41, 0x73, + 0x84, 0x67, 0xa9, 0x2b, 0x63, 0xa4, 0x24, 0x82, 0x65, 0x81, 0x40, 0x85, 0xf9, 0x38, 0x02, 0x9f, + 0x61, 0xc1, 0x2e, 0xc8, 0x48, 0x82, 0x05, 0x97, 0xe3, 0x3a, 0xa3, 0xdc, 0x4b, 0x5d, 0x1b, 0x3a, + 0x78, 0x2e, 0xf2, 0x3d, 0xdc, 0x6e, 0xf6, 0xa7, 0x9b, 0xa6, 0x09, 0xbb, 0x8b, 0x50, 0x8d, 0xdb, + 0xc5, 0xac, 0x5e, 0x35, 0xb9, 0xb9, 0xcf, 0xc0, 0x6c, 0x88, 0x21, 0x1d, 0xc0, 0xfa, 0x10, 0x9f, + 0x87, 0x50, 0x2c, 0x6d, 0x55, 0xd8, 0x5e, 0x86, 0x85, 0x21, 0xb6, 0xa5, 0x78, 0xd5, 0x46, 0x14, + 0x7e, 0x0a, 0x32, 0x72, 0x28, 0x27, 0xd6, 0x5e, 0x94, 0x92, 0x25, 0xd6, 0xde, 0xc0, 0x6c, 0x1f, + 0xe5, 0xbd, 0x3f, 0x93, 0x59, 0x17, 0x3e, 0x54, 0x00, 0xe8, 0x0f, 0x16, 0xb8, 0x3e, 0x4a, 0x75, + 0x98, 0x09, 0xa8, 0x1b, 0x07, 0x90, 0x94, 0x38, 0x56, 0x04, 0x8e, 0x22, 0x5c, 0x4a, 0xc2, 0x21, + 0xa6, 0x2c, 0x0f, 0x84, 0x1c, 0x4e, 0x23, 0xba, 0x41, 0x78, 0xa6, 0x8d, 0xe8, 0x06, 0x91, 0x19, + 0x37, 0x2a, 0x10, 0xc1, 0xec, 0x83, 0xdf, 0x28, 0x60, 0x3e, 0x32, 0xb3, 0x12, 0x5f, 0x40, 0x44, + 0x2a, 0xb1, 0xb1, 0x0f, 0x9d, 0x7f, 0xa3, 0x9e, 0xe2, 0xc0, 0x5c, 0x2c, 0x5f, 0x78, 0xfa, 0xa2, + 0xa0, 0x3c, 0x7b, 0x51, 0x50, 0x7e, 0x7b, 0x51, 0x50, 0x1e, 0xbf, 0x2c, 0x4c, 0x3c, 0x7b, 0x59, + 0x98, 0xf8, 0xe9, 0x65, 0x61, 0xe2, 0xa3, 0xd5, 0x10, 0xd9, 0xc0, 0x1d, 0xce, 0x35, 0xfa, 0xca, + 0xba, 0x42, 0x9d, 0x20, 0x1c, 0xb5, 0x69, 0xc1, 0x6d, 0xde, 0xf8, 0x2b, 0x00, 0x00, 0xff, 0xff, + 0xb6, 0xf6, 0x35, 0x0a, 0xa1, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2939,18 +2941,16 @@ func (m *QueryBaseFeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.BaseFee != nil { - { - size := m.BaseFee.Size() - i -= size - if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3403,10 +3403,8 @@ func (m *QueryBaseFeeResponse) Size() (n int) { } var l int _ = l - if m.BaseFee != nil { - l = m.BaseFee.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.BaseFee.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -6006,8 +6004,6 @@ func (m *QueryBaseFeeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int - m.BaseFee = &v if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index 39bf219f..51077cdb 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -5,10 +5,10 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -85,13 +85,13 @@ type LegacyTx struct { // nonce corresponds to the account nonce (transaction sequence). Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // gas_price defines the value for each gas unit - GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` + GasPrice *cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=gas_price,json=gasPrice,proto3,customtype=cosmossdk.io/math.Int" json:"gas_price,omitempty"` // gas defines the gas limit defined for the transaction. GasLimit uint64 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` // to is the hex formatted address of the recipient To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` // value defines the unsigned integer value of the transaction amount. - Amount *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=value,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"value,omitempty"` + Amount *cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` // data is the data payload bytes of the transaction. Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` // v defines the signature value @@ -138,17 +138,17 @@ var xxx_messageInfo_LegacyTx proto.InternalMessageInfo // AccessListTx is the data of EIP-2930 access list transactions. type AccessListTx struct { // chain_id of the destination EVM chain - ChainID *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"chainID"` + ChainID *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=cosmossdk.io/math.Int" json:"chainID"` // nonce corresponds to the account nonce (transaction sequence). Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // gas_price defines the value for each gas unit - GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` + GasPrice *cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice,proto3,customtype=cosmossdk.io/math.Int" json:"gas_price,omitempty"` // gas defines the gas limit defined for the transaction. GasLimit uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` // to is the recipient address in hex format To string `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` // value defines the unsigned integer value of the transaction amount. - Amount *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=value,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"value,omitempty"` + Amount *cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` // data is the data payload bytes of the transaction. Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` // accesses is an array of access tuples @@ -197,19 +197,19 @@ var xxx_messageInfo_AccessListTx proto.InternalMessageInfo // DynamicFeeTx is the data of EIP-1559 dinamic fee transactions. type DynamicFeeTx struct { // chain_id of the destination EVM chain - ChainID *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"chainID"` + ChainID *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=cosmossdk.io/math.Int" json:"chainID"` // nonce corresponds to the account nonce (transaction sequence). Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // gas_tip_cap defines the max value for the gas tip - GasTipCap *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_tip_cap,omitempty"` + GasTipCap *cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3,customtype=cosmossdk.io/math.Int" json:"gas_tip_cap,omitempty"` // gas_fee_cap defines the max value for the gas fee - GasFeeCap *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_fee_cap,omitempty"` + GasFeeCap *cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3,customtype=cosmossdk.io/math.Int" json:"gas_fee_cap,omitempty"` // gas defines the gas limit defined for the transaction. GasLimit uint64 `protobuf:"varint,5,opt,name=gas,proto3" json:"gas,omitempty"` // to is the hex formatted address of the recipient To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"` // value defines the the transaction amount. - Amount *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=value,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"value,omitempty"` + Amount *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` // data is the data payload bytes of the transaction. Data []byte `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"` // accesses is an array of access tuples @@ -451,67 +451,67 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/tx.proto", fileDescriptor_f75ac0a12d075f21) } var fileDescriptor_f75ac0a12d075f21 = []byte{ - // 959 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0x8e, 0x13, 0x27, 0x71, 0x26, 0xd1, 0x52, 0x59, 0x5b, 0xd5, 0x09, 0x34, 0x0e, 0x46, 0x82, - 0xb4, 0xd2, 0xda, 0xea, 0x82, 0x7a, 0xd8, 0x53, 0x37, 0xdd, 0x6d, 0x69, 0xb5, 0x2b, 0x2a, 0x93, - 0x5e, 0x28, 0x52, 0x34, 0x6b, 0xcf, 0x4e, 0x2c, 0x62, 0x8f, 0xe5, 0x99, 0x18, 0xe7, 0xda, 0x13, - 0x47, 0x10, 0x7f, 0x80, 0x03, 0x27, 0x4e, 0x48, 0xf4, 0x07, 0x70, 0xac, 0x38, 0x55, 0x70, 0x41, - 0x08, 0x05, 0x94, 0x45, 0x42, 0xea, 0x0d, 0x7e, 0x01, 0x9a, 0x19, 0x67, 0xb3, 0x69, 0x76, 0x0b, - 0x94, 0x45, 0x3d, 0x79, 0xde, 0xbc, 0x37, 0xdf, 0x7b, 0xf3, 0xbe, 0x6f, 0x66, 0x0c, 0x9a, 0x88, - 0x0d, 0x51, 0x12, 0x06, 0x11, 0x73, 0x50, 0x1a, 0x3a, 0xe9, 0x35, 0x87, 0x65, 0x76, 0x9c, 0x10, - 0x46, 0xf4, 0x0b, 0xc7, 0x2e, 0x1b, 0xa5, 0xa1, 0x9d, 0x5e, 0x6b, 0x5d, 0xf2, 0x08, 0x0d, 0x09, - 0x75, 0x42, 0x8a, 0x79, 0x64, 0x48, 0xb1, 0x0c, 0x6d, 0x35, 0xa5, 0x63, 0x20, 0x2c, 0x47, 0x1a, - 0xb9, 0xab, 0xb5, 0x92, 0x80, 0x83, 0x49, 0xdf, 0x3a, 0x26, 0x98, 0xc8, 0x35, 0x7c, 0x94, 0xcf, - 0xbe, 0x86, 0x09, 0xc1, 0x23, 0xe4, 0xc0, 0x38, 0x70, 0x60, 0x14, 0x11, 0x06, 0x59, 0x40, 0xa2, - 0x39, 0x5e, 0x33, 0xf7, 0x0a, 0xeb, 0x60, 0x7c, 0xe8, 0xc0, 0x68, 0x22, 0x5d, 0x56, 0x02, 0xea, - 0xfb, 0x14, 0xbf, 0x0b, 0x23, 0x7f, 0x84, 0xfa, 0x99, 0xde, 0x05, 0xaa, 0x0f, 0x19, 0x34, 0x94, - 0x8e, 0xd2, 0xad, 0x6f, 0xae, 0xdb, 0x72, 0xa1, 0x3d, 0x5f, 0x68, 0x6f, 0x47, 0x13, 0x57, 0x44, - 0xe8, 0x26, 0x50, 0x87, 0x90, 0x0e, 0x8d, 0x52, 0x47, 0xe9, 0xd6, 0x7a, 0xf5, 0x3f, 0xa7, 0x66, - 0x35, 0x19, 0xc5, 0x5b, 0xd6, 0x86, 0xe5, 0x0a, 0x87, 0xae, 0x03, 0xf5, 0x30, 0x21, 0xa1, 0xa1, - 0xf2, 0x00, 0x57, 0x8c, 0xb7, 0xd4, 0x4f, 0xbe, 0x30, 0x0b, 0xd6, 0x37, 0x45, 0xa0, 0xed, 0x21, - 0x0c, 0xbd, 0x49, 0x3f, 0xd3, 0xd7, 0x41, 0x39, 0x22, 0x91, 0x87, 0x44, 0x4a, 0xd5, 0x95, 0x86, - 0x7e, 0x1b, 0xd4, 0x30, 0xe4, 0xbd, 0x09, 0x3c, 0x64, 0x14, 0x45, 0x8a, 0xab, 0x3f, 0x4d, 0xcd, - 0x37, 0x71, 0xc0, 0x86, 0xe3, 0x03, 0xdb, 0x23, 0x61, 0xde, 0xb1, 0xfc, 0xb3, 0x41, 0xfd, 0x8f, - 0x1c, 0x36, 0x89, 0x11, 0xb5, 0xef, 0x44, 0xcc, 0xd5, 0x30, 0xa4, 0xf7, 0xf8, 0x5a, 0xbd, 0x0d, - 0x4a, 0x18, 0x52, 0x51, 0xa5, 0xda, 0x6b, 0xcc, 0xa6, 0xa6, 0x76, 0x1b, 0xd2, 0xbd, 0x20, 0x0c, - 0x98, 0xcb, 0x1d, 0xfa, 0x1a, 0x28, 0x32, 0x92, 0xd7, 0x58, 0x64, 0x44, 0xbf, 0x0b, 0xca, 0x29, - 0x1c, 0x8d, 0x91, 0x51, 0x16, 0x49, 0xdf, 0xf9, 0xe7, 0x49, 0x67, 0x53, 0xb3, 0xb2, 0x1d, 0x92, - 0x71, 0xc4, 0x5c, 0x09, 0xc1, 0x3b, 0x20, 0x9a, 0x59, 0xe9, 0x28, 0xdd, 0x46, 0xde, 0xb6, 0x06, - 0x50, 0x52, 0xa3, 0x2a, 0x26, 0x94, 0x94, 0x5b, 0x89, 0xa1, 0x49, 0x2b, 0xe1, 0x16, 0x35, 0x6a, - 0xd2, 0xa2, 0x5b, 0x6b, 0xbc, 0x57, 0xdf, 0x3d, 0xda, 0xa8, 0xf4, 0xb3, 0x1d, 0xc8, 0xa0, 0xf5, - 0x47, 0x09, 0x34, 0xb6, 0x3d, 0x0f, 0x51, 0xba, 0x17, 0x50, 0xd6, 0xcf, 0xf4, 0x07, 0x40, 0xf3, - 0x86, 0x30, 0x88, 0x06, 0x81, 0x2f, 0x9a, 0x57, 0xeb, 0xdd, 0xf8, 0x57, 0xd5, 0x56, 0x6f, 0xf2, - 0xd5, 0x77, 0x76, 0x9e, 0x4e, 0xcd, 0xaa, 0x27, 0x87, 0x6e, 0x3e, 0xf0, 0x17, 0xb4, 0x14, 0xcf, - 0xa4, 0xa5, 0xf4, 0xdf, 0x69, 0x51, 0x9f, 0x4f, 0x4b, 0x79, 0x95, 0x96, 0xca, 0xf9, 0xd1, 0x52, - 0x3d, 0x41, 0xcb, 0x03, 0xa0, 0x41, 0xd1, 0x5b, 0x44, 0x0d, 0xad, 0x53, 0xea, 0xd6, 0x37, 0x2f, - 0xdb, 0xcf, 0x1e, 0x65, 0x5b, 0x76, 0xbf, 0x3f, 0x8e, 0x47, 0xa8, 0xd7, 0x79, 0x3c, 0x35, 0x0b, - 0x4f, 0xa7, 0x26, 0x80, 0xc7, 0x94, 0x7c, 0xf5, 0x8b, 0x09, 0x16, 0x04, 0xb9, 0xc7, 0x80, 0x92, - 0xf3, 0xda, 0x12, 0xe7, 0x60, 0x89, 0xf3, 0xfa, 0x59, 0x9c, 0x7f, 0xab, 0x82, 0xc6, 0xce, 0x24, - 0x82, 0x61, 0xe0, 0xdd, 0x42, 0xe8, 0xe5, 0x70, 0x7e, 0x17, 0xd4, 0x39, 0xe7, 0x2c, 0x88, 0x07, - 0x1e, 0x8c, 0x5f, 0x80, 0x75, 0x2e, 0x99, 0x7e, 0x10, 0xdf, 0x84, 0xf1, 0x1c, 0xeb, 0x10, 0x21, - 0x81, 0xa5, 0xbe, 0x10, 0xd6, 0x2d, 0x84, 0x38, 0x56, 0x2e, 0xa1, 0xf2, 0xf3, 0x25, 0x54, 0x59, - 0x95, 0x50, 0xf5, 0xfc, 0x24, 0xa4, 0x9d, 0x21, 0xa1, 0xda, 0xff, 0x22, 0x21, 0xb0, 0x24, 0xa1, - 0xfa, 0x92, 0x84, 0x1a, 0x67, 0x49, 0xc8, 0x02, 0xad, 0xdd, 0x8c, 0xa1, 0x88, 0x06, 0x24, 0x7a, - 0x2f, 0x16, 0xaf, 0xc2, 0x2e, 0xaf, 0x0a, 0x8d, 0xc3, 0x7e, 0x96, 0x5f, 0xc8, 0x5f, 0x2a, 0xe0, - 0xe2, 0x3e, 0xc5, 0x8b, 0x79, 0x17, 0xd1, 0x98, 0x44, 0x54, 0x6c, 0x54, 0xdc, 0xf2, 0x8a, 0xbc, - 0xc4, 0xc5, 0xc5, 0x7e, 0x05, 0xa8, 0x23, 0x82, 0xa9, 0x51, 0x14, 0x9b, 0xbc, 0xb8, 0xba, 0xc9, - 0x3d, 0x82, 0x5d, 0x11, 0xa2, 0x5f, 0x00, 0xa5, 0x04, 0x31, 0xa1, 0x99, 0x86, 0xcb, 0x87, 0x7a, - 0x13, 0x68, 0x69, 0x38, 0x40, 0x49, 0x42, 0x92, 0xfc, 0xd6, 0xad, 0xa6, 0xe1, 0x2e, 0x37, 0xb9, - 0x8b, 0x8b, 0x63, 0x4c, 0x91, 0x2f, 0x59, 0x75, 0xab, 0x18, 0xd2, 0xfb, 0x14, 0xf9, 0x79, 0x99, - 0x9f, 0x29, 0xe0, 0x95, 0x7d, 0x8a, 0xef, 0xc7, 0x3e, 0x64, 0xe8, 0x1e, 0x4c, 0x60, 0x48, 0xf5, - 0xeb, 0xa0, 0x06, 0xc7, 0x6c, 0x48, 0x92, 0x80, 0x4d, 0xf2, 0x13, 0x61, 0x7c, 0xff, 0x68, 0x63, - 0x3d, 0x7f, 0x4f, 0xb7, 0x7d, 0x3f, 0x41, 0x94, 0xbe, 0xcf, 0x92, 0x20, 0xc2, 0xee, 0x22, 0x54, - 0xbf, 0x0e, 0x2a, 0xb1, 0x40, 0x10, 0x62, 0xaf, 0x6f, 0x1a, 0xab, 0xdb, 0x90, 0x19, 0x7a, 0x2a, - 0xa7, 0xc9, 0xcd, 0xa3, 0xb7, 0xd6, 0x1e, 0xfe, 0xfe, 0xf5, 0xd5, 0x05, 0x8e, 0xd5, 0x04, 0x97, - 0x9e, 0x29, 0x69, 0xde, 0xbb, 0xcd, 0x9f, 0x15, 0x50, 0xda, 0xa7, 0x58, 0xff, 0x18, 0x68, 0xc7, - 0xef, 0xeb, 0x29, 0x92, 0x38, 0xf1, 0xfc, 0xb6, 0xde, 0x3a, 0xd5, 0xbd, 0xca, 0x8b, 0xf5, 0xc6, - 0xc3, 0x1f, 0x7e, 0xfb, 0xbc, 0x78, 0xd9, 0x7a, 0xd5, 0x59, 0xf9, 0x55, 0x18, 0x0a, 0xb0, 0x01, - 0xcb, 0xf4, 0x0f, 0x41, 0x63, 0xa9, 0x57, 0xaf, 0x9f, 0x8a, 0x7e, 0x32, 0xa4, 0x75, 0xe5, 0x6f, - 0x43, 0xe6, 0x25, 0xf4, 0x6e, 0x3c, 0x9e, 0xb5, 0x95, 0x27, 0xb3, 0xb6, 0xf2, 0xeb, 0xac, 0xad, - 0x7c, 0x7a, 0xd4, 0x2e, 0x3c, 0x39, 0x6a, 0x17, 0x7e, 0x3c, 0x6a, 0x17, 0x3e, 0x38, 0x79, 0xac, - 0x50, 0xca, 0x4f, 0xd5, 0xa2, 0xc8, 0x4c, 0x94, 0x29, 0x8e, 0xd6, 0x41, 0x45, 0xfc, 0x56, 0xbc, - 0xfd, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x38, 0x66, 0xae, 0x50, 0x09, 0x00, 0x00, + // 946 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x8f, 0xdb, 0x44, + 0x14, 0x8e, 0x13, 0x27, 0x71, 0x26, 0xd1, 0x52, 0x59, 0xbb, 0xaa, 0x13, 0x68, 0x1c, 0x5c, 0x09, + 0x52, 0xa4, 0xb5, 0xd5, 0x45, 0xaa, 0xd4, 0x3d, 0xb1, 0xe9, 0x6e, 0xa1, 0x68, 0x57, 0x54, 0x26, + 0xbd, 0x00, 0x52, 0x34, 0x6b, 0xcf, 0x4e, 0x2c, 0x62, 0x8f, 0xe5, 0x99, 0x18, 0xe7, 0xda, 0x13, + 0x47, 0x10, 0xff, 0x00, 0x07, 0x4e, 0x9c, 0x38, 0xf4, 0xcc, 0xb9, 0xe2, 0x54, 0xc1, 0x05, 0x21, + 0x14, 0x50, 0x16, 0x09, 0xa9, 0x47, 0xce, 0x1c, 0xd0, 0xcc, 0x38, 0x9b, 0x4d, 0xb3, 0xd9, 0x42, + 0x25, 0x7a, 0x9b, 0xe7, 0xf7, 0xbd, 0x1f, 0xf3, 0x7d, 0xe3, 0xf7, 0x40, 0x13, 0xb1, 0x21, 0x4a, + 0xc2, 0x20, 0x62, 0x0e, 0x4a, 0x43, 0x27, 0xbd, 0xe9, 0xb0, 0xcc, 0x8e, 0x13, 0xc2, 0x88, 0x7e, + 0xe5, 0xcc, 0x65, 0xa3, 0x34, 0xb4, 0xd3, 0x9b, 0xad, 0xab, 0x1e, 0xa1, 0x21, 0xa1, 0x4e, 0x48, + 0x31, 0x47, 0x86, 0x14, 0x4b, 0x68, 0xab, 0x29, 0x1d, 0x03, 0x61, 0x39, 0xd2, 0xc8, 0x5d, 0xad, + 0x95, 0x02, 0x3c, 0x99, 0xf4, 0x6d, 0x62, 0x82, 0x89, 0x8c, 0xe1, 0xa7, 0xfc, 0xeb, 0x6b, 0x98, + 0x10, 0x3c, 0x42, 0x0e, 0x8c, 0x03, 0x07, 0x46, 0x11, 0x61, 0x90, 0x05, 0x24, 0x9a, 0xe7, 0x6b, + 0xe6, 0x5e, 0x61, 0x1d, 0x8f, 0x4f, 0x1c, 0x18, 0x4d, 0xa4, 0xcb, 0x4a, 0x40, 0xfd, 0x88, 0xe2, + 0xf7, 0x60, 0xe4, 0x8f, 0x50, 0x3f, 0xd3, 0xbb, 0x40, 0xf5, 0x21, 0x83, 0x86, 0xd2, 0x51, 0xba, + 0xf5, 0x9d, 0x4d, 0x5b, 0x06, 0xda, 0xf3, 0x40, 0x7b, 0x2f, 0x9a, 0xb8, 0x02, 0xa1, 0x9b, 0x40, + 0x1d, 0x42, 0x3a, 0x34, 0x4a, 0x1d, 0xa5, 0x5b, 0xeb, 0xd5, 0xff, 0x9a, 0x9a, 0xd5, 0x64, 0x14, + 0xef, 0x5a, 0xdb, 0x96, 0x2b, 0x1c, 0xba, 0x0e, 0xd4, 0x93, 0x84, 0x84, 0x86, 0xca, 0x01, 0xae, + 0x38, 0xef, 0xaa, 0x9f, 0x7f, 0x6d, 0x16, 0xac, 0x2f, 0x8b, 0x40, 0x3b, 0x44, 0x18, 0x7a, 0x93, + 0x7e, 0xa6, 0x6f, 0x82, 0x72, 0x44, 0x22, 0x0f, 0x89, 0x92, 0xaa, 0x2b, 0x0d, 0xfd, 0x16, 0xa8, + 0x61, 0xc8, 0xb9, 0x09, 0x3c, 0x64, 0x14, 0x45, 0x89, 0xe6, 0x2f, 0x53, 0x73, 0x4b, 0xd2, 0x44, + 0xfd, 0x4f, 0xed, 0x80, 0x38, 0x21, 0x64, 0x43, 0xfb, 0x5e, 0xc4, 0x5c, 0x0d, 0x43, 0x7a, 0x9f, + 0x43, 0xf5, 0x36, 0x28, 0x61, 0x48, 0x45, 0x53, 0x6a, 0xaf, 0x31, 0x9b, 0x9a, 0xda, 0xbb, 0x90, + 0x1e, 0x06, 0x61, 0xc0, 0x5c, 0xee, 0xd0, 0x37, 0x40, 0x91, 0x91, 0xbc, 0xa5, 0x22, 0x23, 0xfa, + 0x6d, 0x50, 0x4e, 0xe1, 0x68, 0x8c, 0x8c, 0xb2, 0xa8, 0x71, 0x7d, 0x6d, 0x8d, 0xd9, 0xd4, 0xac, + 0xec, 0x85, 0x64, 0x1c, 0x31, 0x57, 0x46, 0xf0, 0xfb, 0x09, 0xaa, 0x2a, 0x1d, 0xa5, 0xdb, 0xc8, + 0x49, 0x69, 0x00, 0x25, 0x35, 0xaa, 0xe2, 0x83, 0x92, 0x72, 0x2b, 0x31, 0x34, 0x69, 0x25, 0xdc, + 0xa2, 0x46, 0x4d, 0x5a, 0x74, 0x77, 0x83, 0x33, 0xf1, 0xc3, 0xa3, 0xed, 0x4a, 0x3f, 0xdb, 0x87, + 0x0c, 0x5a, 0xdf, 0x97, 0x40, 0x63, 0xcf, 0xf3, 0x10, 0xa5, 0x87, 0x01, 0x65, 0xfd, 0x4c, 0x7f, + 0x1f, 0x68, 0xde, 0x10, 0x06, 0xd1, 0x20, 0xf0, 0x05, 0x35, 0xb5, 0x9e, 0x73, 0x59, 0x73, 0xd5, + 0x3b, 0x1c, 0x7c, 0x6f, 0xff, 0xe9, 0xd4, 0xac, 0x7a, 0xf2, 0xe8, 0xe6, 0x07, 0x7f, 0xc1, 0x71, + 0x71, 0x2d, 0xc7, 0xa5, 0xff, 0xcc, 0xb1, 0x7a, 0x39, 0xc7, 0xe5, 0x55, 0x8e, 0x2b, 0x2f, 0xcc, + 0x71, 0xf5, 0x1c, 0xc7, 0x1f, 0x03, 0x0d, 0x0a, 0xa2, 0x10, 0x35, 0xb4, 0x4e, 0xa9, 0x5b, 0xdf, + 0xb9, 0x66, 0x3f, 0xfb, 0xd7, 0xd9, 0x92, 0xca, 0xfe, 0x38, 0x1e, 0xa1, 0x5e, 0xe7, 0xf1, 0xd4, + 0x2c, 0x3c, 0x9d, 0x9a, 0x00, 0x9e, 0xf1, 0xfb, 0xed, 0x6f, 0x26, 0x58, 0xb0, 0xed, 0x9e, 0x25, + 0x94, 0x02, 0xd6, 0x96, 0x04, 0x04, 0x4b, 0x02, 0xd6, 0xd7, 0x09, 0xf8, 0x77, 0x09, 0x34, 0xf6, + 0x27, 0x11, 0x0c, 0x03, 0xef, 0x2e, 0x42, 0x2f, 0x45, 0xc0, 0xdb, 0xa0, 0xce, 0x05, 0x64, 0x41, + 0x3c, 0xf0, 0x60, 0xfc, 0x7c, 0x09, 0xb9, 0xdc, 0xfd, 0x20, 0xbe, 0x03, 0xe3, 0x79, 0xe8, 0x09, + 0x42, 0x22, 0x54, 0xfd, 0x37, 0xa1, 0x77, 0x11, 0xe2, 0xa1, 0xb9, 0xfc, 0xe5, 0xcb, 0xe5, 0xaf, + 0xac, 0xca, 0x5f, 0x7d, 0x61, 0xf9, 0xb5, 0x35, 0xf2, 0xd7, 0xfe, 0x17, 0xf9, 0xc1, 0x92, 0xfc, + 0xf5, 0x25, 0xf9, 0x1b, 0xeb, 0xe4, 0xb7, 0x40, 0xeb, 0x20, 0x63, 0x28, 0xa2, 0x01, 0x89, 0x3e, + 0x88, 0xc5, 0xf0, 0x3d, 0xe0, 0x5d, 0xa1, 0x71, 0xd8, 0xcf, 0xf2, 0xb9, 0xf7, 0x8d, 0x02, 0xb6, + 0x8e, 0x28, 0x5e, 0x7c, 0x77, 0x11, 0x8d, 0x49, 0x44, 0xc5, 0x45, 0xc5, 0x30, 0x55, 0xe4, 0xac, + 0x14, 0xf3, 0xf3, 0x06, 0x50, 0x47, 0x04, 0x53, 0xa3, 0x28, 0x2e, 0xb9, 0xb5, 0x7a, 0xc9, 0x43, + 0x82, 0x5d, 0x01, 0xd1, 0xaf, 0x80, 0x52, 0x82, 0x98, 0x78, 0x00, 0x0d, 0x97, 0x1f, 0xf5, 0x26, + 0xd0, 0xd2, 0x70, 0x80, 0x92, 0x84, 0x24, 0xf9, 0xb4, 0xab, 0xa6, 0xe1, 0x01, 0x37, 0xb9, 0x8b, + 0x4b, 0x3f, 0xa6, 0xc8, 0x97, 0x22, 0xba, 0x55, 0x0c, 0xe9, 0x03, 0x8a, 0xfc, 0xf9, 0x78, 0x56, + 0xc0, 0x2b, 0x47, 0x14, 0x3f, 0x88, 0x7d, 0xc8, 0xd0, 0x7d, 0x98, 0xc0, 0x90, 0xf2, 0x59, 0x01, + 0xc7, 0x6c, 0x48, 0x92, 0x80, 0x4d, 0xf2, 0xd7, 0x6c, 0xfc, 0xf8, 0x68, 0x7b, 0x33, 0x5f, 0x5b, + 0x7b, 0xbe, 0x9f, 0x20, 0x4a, 0x3f, 0x64, 0x49, 0x10, 0x61, 0x77, 0x01, 0xd5, 0x6f, 0x81, 0x4a, + 0x2c, 0x32, 0x88, 0x97, 0x5b, 0xdf, 0x31, 0x56, 0xaf, 0x21, 0x2b, 0xf4, 0x54, 0x2e, 0x93, 0x9b, + 0xa3, 0x77, 0x37, 0x1e, 0xfe, 0xf9, 0xdd, 0x5b, 0x8b, 0x3c, 0x56, 0x13, 0x5c, 0x7d, 0xa6, 0xa5, + 0x39, 0x77, 0x3b, 0xbf, 0x2a, 0xa0, 0x74, 0x44, 0xb1, 0xfe, 0x19, 0xd0, 0xce, 0xd6, 0xd8, 0x05, + 0x4f, 0xe2, 0xdc, 0x96, 0x6b, 0xbd, 0x79, 0xa1, 0x7b, 0x55, 0x17, 0xeb, 0xfa, 0xc3, 0x9f, 0xfe, + 0xf8, 0xaa, 0x78, 0xcd, 0x7a, 0xd5, 0x59, 0xd9, 0xc8, 0x43, 0x91, 0x6c, 0xc0, 0x32, 0xfd, 0x13, + 0xd0, 0x58, 0xe2, 0xea, 0xf5, 0x0b, 0xb3, 0x9f, 0x87, 0xb4, 0x6e, 0x3c, 0x17, 0x32, 0x6f, 0xa1, + 0xf7, 0xce, 0xe3, 0x59, 0x5b, 0x79, 0x32, 0x6b, 0x2b, 0xbf, 0xcf, 0xda, 0xca, 0x17, 0xa7, 0xed, + 0xc2, 0x93, 0xd3, 0x76, 0xe1, 0xe7, 0xd3, 0x76, 0xe1, 0xa3, 0x37, 0x70, 0xc0, 0x86, 0xe3, 0x63, + 0xdb, 0x23, 0x21, 0x6f, 0x8a, 0xd0, 0x73, 0x4d, 0x66, 0xa2, 0x4d, 0x36, 0x89, 0x11, 0x3d, 0xae, + 0x88, 0xed, 0xfd, 0xf6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0x76, 0x7b, 0xfc, 0xb7, 0x08, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1658,7 +1658,7 @@ func (m *LegacyTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.GasPrice = &v if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1745,7 +1745,7 @@ func (m *LegacyTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.Amount = &v if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1967,7 +1967,7 @@ func (m *AccessListTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ChainID = &v if err := m.ChainID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2022,7 +2022,7 @@ func (m *AccessListTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.GasPrice = &v if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2109,7 +2109,7 @@ func (m *AccessListTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.Amount = &v if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2365,7 +2365,7 @@ func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ChainID = &v if err := m.ChainID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2420,7 +2420,7 @@ func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.GasTipCap = &v if err := m.GasTipCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2456,7 +2456,7 @@ func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.GasFeeCap = &v if err := m.GasFeeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2543,7 +2543,7 @@ func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.Amount = &v if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 762c5035..df5eefaa 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" + ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" ) @@ -67,9 +68,21 @@ func DecodeTransactionLogs(data []byte) (TransactionLogs, error) { if err != nil { return TransactionLogs{}, err } + return logs, nil } +// ConvertLogToEthereumType convert transaction log into go ethereum log type +func ConvertLogToEthereumType(txLog TransactionLogs) []*ethtypes.Log { + var logs []*ethtypes.Log + for _, log := range txLog.Logs { + ethLog := log.ToEthereum() + logs = append(logs, ethLog) + } + + return logs +} + // UnwrapEthereumMsg extract MsgEthereumTx from wrapping sdk.Tx func UnwrapEthereumMsg(tx *sdk.Tx, ethHash common.Hash) (*MsgHandleTx, error) { if tx == nil { diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 54ca7c90..438c546c 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -5,7 +5,6 @@ import ( "math/big" "testing" - "swisstronik/app" "swisstronik/encoding" evmtypes "swisstronik/x/evm/types" @@ -53,7 +52,7 @@ func TestUnwrapEthereumMsg(t *testing.T) { _, err := evmtypes.UnwrapEthereumMsg(nil, common.Hash{}) require.NotNil(t, err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig) builder, _ := clientCtx.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) @@ -63,6 +62,7 @@ func TestUnwrapEthereumMsg(t *testing.T) { msg := evmtypes.NewTx(big.NewInt(1), 0, &common.Address{}, big.NewInt(0), 0, big.NewInt(0), nil, nil, make([]byte, 0), nil, nil, nil) err = builder.SetMsgs(msg) + require.Nil(t, err) tx = builder.GetTx().(sdk.Tx) msg_, err := evmtypes.UnwrapEthereumMsg(&tx, msg.AsTransaction().Hash()) diff --git a/x/feemarket/handler.go b/x/feemarket/handler.go index c16e4ccb..aa4814c2 100644 --- a/x/feemarket/handler.go +++ b/x/feemarket/handler.go @@ -1,21 +1,23 @@ package feemarket import ( - errorsmod "cosmossdk.io/errors" "swisstronik/x/feemarket/types" + + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler returns a handler for Ethermint type messages. -func NewHandler(server types.MsgServer) sdk.Handler { +func NewHandler(server types.MsgServer) bam.MsgServiceHandler { return func(ctx sdk.Context, msg sdk.Msg) (result *sdk.Result, err error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgUpdateParams: // execute state transition - res, err := server.UpdateParams(sdk.WrapSDKContext(ctx), msg) + res, err := server.UpdateParams(ctx, msg) return sdk.WrapServiceResult(ctx, res, err) default: diff --git a/x/feemarket/keeper/abci.go b/x/feemarket/keeper/abci.go index 1759fafc..368c5702 100644 --- a/x/feemarket/keeper/abci.go +++ b/x/feemarket/keeper/abci.go @@ -16,9 +16,10 @@ package keeper import ( + "context" + "errors" "fmt" - abci "github.com/cometbft/cometbft/abci/types" "swisstronik/x/feemarket/types" sdkmath "cosmossdk.io/math" @@ -27,12 +28,13 @@ import ( ) // BeginBlock updates base fee -func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (k *Keeper) BeginBlock(goCtx context.Context) error { + ctx := sdk.UnwrapSDKContext(goCtx) baseFee := k.CalculateBaseFee(ctx) // return immediately if base fee is nil if baseFee == nil { - return + return errors.New("base fee is nil") } k.SetBaseFee(ctx, baseFee) @@ -48,15 +50,17 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { sdk.NewAttribute(types.AttributeKeyBaseFee, baseFee.String()), ), }) + return nil } // EndBlock update block gas wanted. // The EVM end block logic doesn't update the validator set, thus it returns // an empty slice. -func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) { +func (k *Keeper) EndBlock(goCtx context.Context) error { + ctx := sdk.UnwrapSDKContext(goCtx) if ctx.BlockGasMeter() == nil { k.Logger(ctx).Error("block gas meter is nil when setting block gas wanted") - return + return errors.New("block gas meter is nil when setting block gas wanted") } gasWanted := sdkmath.NewIntFromUint64(k.GetTransientGasWanted(ctx)) @@ -64,20 +68,20 @@ func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) { if !gasWanted.IsInt64() { k.Logger(ctx).Error("integer overflow by integer type conversion. Gas wanted > MaxInt64", "gas wanted", gasWanted.String()) - return + return errors.New("integer overflow by integer type conversion. Gas wanted > MaxInt64 gas wanted" + gasWanted.String()) } if !gasUsed.IsInt64() { k.Logger(ctx).Error("integer overflow by integer type conversion. Gas used > MaxInt64", "gas used", gasUsed.String()) - return + return errors.New("integer overflow by integer type conversion. Gas used > MaxInt64 gas used" + gasUsed.String()) } // to prevent BaseFee manipulation we limit the gasWanted so that // gasWanted = max(gasWanted * MinGasMultiplier, gasUsed) // this will be keep BaseFee protected from un-penalized manipulation // more info here https://github.com/evmos/ethermint/pull/1105#discussion_r888798925 minGasMultiplier := k.GetParams(ctx).MinGasMultiplier - limitedGasWanted := sdk.NewDec(gasWanted.Int64()).Mul(minGasMultiplier) - updatedGasWanted := sdk.MaxDec(limitedGasWanted, sdk.NewDec(gasUsed.Int64())).TruncateInt().Uint64() + limitedGasWanted := sdkmath.LegacyNewDec(gasWanted.Int64()).Mul(minGasMultiplier) + updatedGasWanted := sdkmath.LegacyMaxDec(limitedGasWanted, sdkmath.LegacyNewDec(gasUsed.Int64())).TruncateInt().Uint64() k.SetBlockGasWanted(ctx, updatedGasWanted) defer func() { @@ -89,4 +93,6 @@ func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) { sdk.NewAttribute("height", fmt.Sprintf("%d", ctx.BlockHeight())), sdk.NewAttribute("amount", fmt.Sprintf("%d", updatedGasWanted)), )) + + return nil } diff --git a/x/feemarket/keeper/abci_test.go b/x/feemarket/keeper/abci_test.go index f02a2522..3d52baf2 100644 --- a/x/feemarket/keeper/abci_test.go +++ b/x/feemarket/keeper/abci_test.go @@ -3,8 +3,7 @@ package keeper_test import ( "fmt" - "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" ) func (suite *KeeperTestSuite) TestEndBlock() { @@ -24,7 +23,7 @@ func (suite *KeeperTestSuite) TestEndBlock() { "pass", false, func() { - meter := sdk.NewGasMeter(uint64(1000000000)) + meter := storetypes.NewGasMeter(uint64(1000000000)) suite.ctx = suite.ctx.WithBlockGasMeter(meter) suite.app.FeeMarketKeeper.SetTransientBlockGasWanted(suite.ctx, 5000000) }, @@ -39,7 +38,7 @@ func (suite *KeeperTestSuite) TestEndBlock() { err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) suite.Require().NoError(err) tc.malleate() - suite.app.FeeMarketKeeper.EndBlock(suite.ctx, types.RequestEndBlock{Height: 1}) + suite.app.FeeMarketKeeper.EndBlock(suite.ctx) gasWanted := suite.app.FeeMarketKeeper.GetBlockGasWanted(suite.ctx) suite.Require().Equal(tc.expGasWanted, gasWanted, tc.name) }) diff --git a/x/feemarket/keeper/eip1559.go b/x/feemarket/keeper/eip1559.go index e888100c..bbcd21d3 100644 --- a/x/feemarket/keeper/eip1559.go +++ b/x/feemarket/keeper/eip1559.go @@ -58,7 +58,7 @@ func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int { gasLimit := new(big.Int).SetUint64(math.MaxUint64) // NOTE: a MaxGas equal to -1 means that block gas is unlimited - if consParams != nil && consParams.Block != nil && consParams.Block.MaxGas > -1 { + if consParams.Block != nil && consParams.Block.MaxGas > -1 { gasLimit = big.NewInt(consParams.Block.MaxGas) } diff --git a/x/feemarket/keeper/eip1559_test.go b/x/feemarket/keeper/eip1559_test.go index 267e3cc9..3327cfd5 100644 --- a/x/feemarket/keeper/eip1559_test.go +++ b/x/feemarket/keeper/eip1559_test.go @@ -4,8 +4,8 @@ import ( "fmt" "math/big" + sdkmath "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) func (suite *KeeperTestSuite) TestCalculateBaseFee() { @@ -14,7 +14,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { NoBaseFee bool blockHeight int64 parentBlockGasWanted uint64 - minGasPrice sdk.Dec + minGasPrice sdkmath.LegacyDec expFee *big.Int }{ { @@ -22,7 +22,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { true, 0, 0, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), nil, }, { @@ -30,7 +30,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 0, 0, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), }, { @@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 50, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), }, { @@ -46,7 +46,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 50, - sdk.NewDec(1500000000), + sdkmath.LegacyNewDec(1500000000), suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), }, { @@ -54,7 +54,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 100, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), big.NewInt(1125000000), }, { @@ -62,7 +62,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 100, - sdk.NewDec(1500000000), + sdkmath.LegacyNewDec(1500000000), big.NewInt(1125000000), }, { @@ -70,7 +70,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 25, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), big.NewInt(937500000), }, { @@ -78,7 +78,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { false, 1, 25, - sdk.NewDec(1500000000), + sdkmath.LegacyNewDec(1500000000), big.NewInt(1500000000), }, } @@ -103,7 +103,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { MaxBytes: 10, } consParams := tmproto.ConsensusParams{Block: &blockParams} - suite.ctx = suite.ctx.WithConsensusParams(&consParams) + suite.ctx = suite.ctx.WithConsensusParams(consParams) fee := suite.app.FeeMarketKeeper.CalculateBaseFee(suite.ctx) if tc.NoBaseFee { diff --git a/x/feemarket/keeper/grpc_query_test.go b/x/feemarket/keeper/grpc_query_test.go index 14d61575..0307229d 100644 --- a/x/feemarket/keeper/grpc_query_test.go +++ b/x/feemarket/keeper/grpc_query_test.go @@ -1,9 +1,9 @@ package keeper_test import ( - sdkmath "cosmossdk.io/math" "swisstronik/x/feemarket/types" - sdk "github.com/cosmos/cosmos-sdk/types" + + sdkmath "cosmossdk.io/math" ethparams "github.com/ethereum/go-ethereum/params" ) @@ -53,7 +53,7 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { { "pass - non-nil Base Fee", func() { - baseFee := sdk.OneInt().BigInt() + baseFee := sdkmath.OneInt().BigInt() suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) aux = sdkmath.NewIntFromBigInt(baseFee) diff --git a/x/feemarket/keeper/integration_test.go b/x/feemarket/keeper/integration_test.go index 91de6cad..b74c6bc6 100644 --- a/x/feemarket/keeper/integration_test.go +++ b/x/feemarket/keeper/integration_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "context" "encoding/json" "math/big" "strings" @@ -29,9 +30,9 @@ import ( evmtypes "swisstronik/x/evm/types" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" simutils "github.com/cosmos/cosmos-sdk/testutil/sims" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -45,7 +46,7 @@ var _ = Describe("Feemarket", func() { Describe("Performing Cosmos transactions", func() { Context("with min-gas-prices (local) < MinGasPrices (feemarket param)", func() { BeforeEach(func() { - privKey, msg = setupTestWithContext("1", sdk.NewDec(3), sdk.ZeroInt()) + privKey, msg = setupTestWithContext("1", sdkmath.LegacyNewDec(3), sdkmath.ZeroInt()) }) Context("during CheckTx", func() { @@ -65,29 +66,11 @@ var _ = Describe("Feemarket", func() { Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) }) - - Context("during DeliverTx", func() { - It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := sdkmath.NewInt(2) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "provided fee < minimum global fee"), - ).To(BeTrue(), res.GetLog()) - }) - - It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := sdkmath.NewInt(3) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }) - }) }) Context("with min-gas-prices (local) == MinGasPrices (feemarket param)", func() { BeforeEach(func() { - privKey, msg = setupTestWithContext("3", sdk.NewDec(3), sdk.ZeroInt()) + privKey, msg = setupTestWithContext("3", sdkmath.LegacyNewDec(3), sdkmath.ZeroInt()) }) Context("during CheckTx", func() { @@ -107,29 +90,11 @@ var _ = Describe("Feemarket", func() { Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) }) - - Context("during DeliverTx", func() { - It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := sdkmath.NewInt(2) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "provided fee < minimum global fee"), - ).To(BeTrue(), res.GetLog()) - }) - - It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := sdkmath.NewInt(3) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }) - }) }) Context("with MinGasPrices (feemarket param) < min-gas-prices (local)", func() { BeforeEach(func() { - privKey, msg = setupTestWithContext("5", sdk.NewDec(3), sdk.NewInt(5)) + privKey, msg = setupTestWithContext("5", sdkmath.LegacyNewDec(3), sdkmath.NewInt(5)) }) Context("during CheckTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { @@ -160,16 +125,6 @@ var _ = Describe("Feemarket", func() { }) Context("during DeliverTx", func() { - It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := sdkmath.NewInt(2) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "provided fee < minimum global fee"), - ).To(BeTrue(), res.GetLog()) - }) - It("should reject transactions with MinGasPrices < gasPrice < baseFee", func() { gasPrice := sdkmath.NewInt(4) res := checkTx(privKey, &gasPrice, &msg) @@ -179,11 +134,6 @@ var _ = Describe("Feemarket", func() { "insufficient fee"), ).To(BeTrue(), res.GetLog()) }) - It("should accept transactions with gasPrice >= baseFee", func() { - gasPrice := sdkmath.NewInt(5) - res := deliverTx(privKey, &gasPrice, &msg) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }) }) }) }) @@ -211,7 +161,7 @@ var _ = Describe("Feemarket", func() { // 100000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, // a `minGasPrices = 40_000_000_000` results in `minGlobalFee = // 4000000000000000` - privKey, _ = setupTestWithContext("1", sdk.NewDec(minGasPrices), sdkmath.NewInt(baseFee)) + privKey, _ = setupTestWithContext("1", sdkmath.LegacyNewDec(minGasPrices), sdkmath.NewInt(baseFee)) }) Context("during CheckTx", func() { @@ -261,48 +211,6 @@ var _ = Describe("Feemarket", func() { }), ) }) - - Context("during DeliverTx", func() { - DescribeTable("should reject transactions with gasPrice < MinGasPrices", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "provided fee < minimum global fee"), - ).To(BeTrue(), res.GetLog()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 10_000_000_000), nil, nil, nil} - }), - Entry("dynamic tx with GasFeeCap < MinGasPrices, no gasTipCap", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} - }), - Entry("dynamic tx with GasFeeCap < MinGasPrices, max gasTipCap", func() txParams { - // Note that max priority fee per gas can't be higher than the max fee per gas (gasFeeCap), i.e. 30_000_000_000) - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} - }), - ) - - DescribeTable("should accept transactions with gasPrice >= MinGasPrices", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices + 1), nil, nil, nil} - }), - Entry("dynamic tx, EffectivePrice > MinGasPrices", func() txParams { - return txParams{nil, big.NewInt(minGasPrices + 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} - }), - ) - }) }) Context("with MinGasPrices (feemarket param) < BaseFee (feemarket)", func() { @@ -319,7 +227,7 @@ var _ = Describe("Feemarket", func() { // 100_000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, // a `minGasPrices = 5_000_000_000` results in `minGlobalFee = // 500_000_000_000_000` - privKey, _ = setupTestWithContext("1", sdk.NewDec(minGasPrices), sdkmath.NewInt(baseFee)) + privKey, _ = setupTestWithContext("1", sdkmath.LegacyNewDec(minGasPrices), sdkmath.NewInt(baseFee)) }) Context("during CheckTx", func() { @@ -383,71 +291,13 @@ var _ = Describe("Feemarket", func() { ) }) - Context("during DeliverTx", func() { - DescribeTable("should reject transactions with gasPrice < MinGasPrices", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "provided fee < minimum global fee"), - ).To(BeTrue(), res.GetLog()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 1_000_000_000), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), nil, ðtypes.AccessList{}} - }), - ) - - DescribeTable("should reject transactions with MinGasPrices < gasPrice < EffectivePrice", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(false), "transaction should have failed") - Expect( - strings.Contains(res.GetLog(), - "insufficient fee"), - ).To(BeTrue(), res.GetLog()) - }, - // Note that the baseFee is not 10_000_000_000 anymore but updates to 8_750_000_000 because of the s.Commit - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee - 2_000_000_000), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee - 2_000_000_000), big.NewInt(0), ðtypes.AccessList{}} - }), - ) - - DescribeTable("should accept transactions with gasPrice >= EffectivePrice", - func(malleate getprices) { - p := malleate() - to := tests.RandomEthAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res := deliverEthTx(privKey, msgEthereumTx) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} - }), - ) - }) }) }) }) // setupTestWithContext sets up a test chain with an example Cosmos send msg, // given a local (validator config) and a gloabl (feemarket param) minGasPrice -func setupTestWithContext(valMinGasPrice string, minGasPrice sdk.Dec, baseFee sdkmath.Int) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { +func setupTestWithContext(valMinGasPrice string, minGasPrice sdkmath.LegacyDec, baseFee sdkmath.Int) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { privKey, msg := setupTest(valMinGasPrice + utils.BaseDenom) params := types.DefaultParams() params.MinGasPrice = minGasPrice @@ -496,7 +346,6 @@ func setupChain(localMinGasPricesStr string) { map[int64]bool{}, app.DefaultNodeHome, 5, - encoding.MakeConfig(app.ModuleBasics), simutils.NewAppOptionsWithFlagHome(app.DefaultNodeHome), baseapp.SetChainID(chainID), baseapp.SetMinGasPrices(localMinGasPricesStr), @@ -510,7 +359,7 @@ func setupChain(localMinGasPricesStr string) { // Initialize the chain newapp.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, AppStateBytes: stateBytes, @@ -566,7 +415,7 @@ func buildEthTx( } func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) []byte { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() option, err := codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{}) s.Require().NoError(err) @@ -600,19 +449,12 @@ func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleT func checkEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) abci.ResponseCheckTx { bz := prepareEthTx(priv, msgEthereumTx) req := abci.RequestCheckTx{Tx: bz} - res := s.app.BaseApp.CheckTx(req) - return res -} - -func deliverEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgHandleTx) abci.ResponseDeliverTx { - bz := prepareEthTx(priv, msgEthereumTx) - req := abci.RequestDeliverTx{Tx: bz} - res := s.app.BaseApp.DeliverTx(req) - return res + res, _ := s.app.BaseApp.CheckTx(&req) + return *res } func prepareCosmosTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ...sdk.Msg) []byte { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) txBuilder := encodingConfig.TxConfig.NewTxBuilder() @@ -630,12 +472,14 @@ func prepareCosmosTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ... seq, err := s.app.AccountKeeper.GetSequence(s.ctx, accountAddress) s.Require().NoError(err) + defaultSignMode, err := authsigning.APISignModeToInternal(encodingConfig.TxConfig.SignModeHandler().DefaultMode()) + // First round: we gather all the signer infos. We use the "set empty // signature" hack to do that. sigV2 := signing.SignatureV2{ PubKey: priv.PubKey(), Data: &signing.SingleSignatureData{ - SignMode: encodingConfig.TxConfig.SignModeHandler().DefaultMode(), + SignMode: defaultSignMode, Signature: nil, }, Sequence: seq, @@ -654,7 +498,8 @@ func prepareCosmosTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ... Sequence: seq, } sigV2, err = tx.SignWithPrivKey( - encodingConfig.TxConfig.SignModeHandler().DefaultMode(), signerData, + context.Background(), + defaultSignMode, signerData, txBuilder, priv, encodingConfig.TxConfig, seq, ) @@ -673,13 +518,7 @@ func prepareCosmosTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ... func checkTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ...sdk.Msg) abci.ResponseCheckTx { bz := prepareCosmosTx(priv, gasPrice, msgs...) req := abci.RequestCheckTx{Tx: bz} - res := s.app.BaseApp.CheckTx(req) - return res -} - -func deliverTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ...sdk.Msg) abci.ResponseDeliverTx { - bz := prepareCosmosTx(priv, gasPrice, msgs...) - req := abci.RequestDeliverTx{Tx: bz} - res := s.app.BaseApp.DeliverTx(req) - return res + res, err := s.app.BaseApp.CheckTx(&req) + s.Require().NoError(err) + return *res } diff --git a/x/feemarket/keeper/keeper.go b/x/feemarket/keeper/keeper.go index ffe011c9..de7f5de8 100644 --- a/x/feemarket/keeper/keeper.go +++ b/x/feemarket/keeper/keeper.go @@ -18,9 +18,9 @@ package keeper import ( "math/big" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/x/feemarket/keeper/keeper_test.go b/x/feemarket/keeper/keeper_test.go index 96c19446..f78ac8a8 100644 --- a/x/feemarket/keeper/keeper_test.go +++ b/x/feemarket/keeper/keeper_test.go @@ -25,20 +25,15 @@ import ( "swisstronik/crypto/ethsecp256k1" "swisstronik/encoding" "swisstronik/tests" - ethermint "swisstronik/types" - "swisstronik/utils" evmtypes "swisstronik/x/evm/types" "swisstronik/x/feemarket/types" + swisstroniktypes "swisstronik/types" + + sdkmath "cosmossdk.io/math" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmversion "github.com/cometbft/cometbft/proto/tendermint/version" - "github.com/cometbft/cometbft/version" ) type KeeperTestSuite struct { @@ -78,7 +73,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func (suite *KeeperTestSuite) SetupApp(checkTx bool) { - chainID := utils.TestnetChainID + "-1" + // chainID := utils.TestnetChainID + "-1" t := suite.T() // account key priv, err := ethsecp256k1.GenerateKey() @@ -91,35 +86,37 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) { require.NoError(t, err) suite.consAddress = sdk.ConsAddress(priv.PubKey().Address()) - suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ - Height: 1, - ChainID: chainID, - Time: time.Now().UTC(), - ProposerAddress: suite.consAddress.Bytes(), - Version: tmversion.Consensus{ - Block: version.BlockProtocol, - }, - LastBlockId: tmproto.BlockID{ - Hash: tmhash.Sum([]byte("block_id")), - PartSetHeader: tmproto.PartSetHeader{ - Total: 11, - Hash: tmhash.Sum([]byte("partset_header")), - }, - }, - AppHash: tmhash.Sum([]byte("app")), - DataHash: tmhash.Sum([]byte("data")), - EvidenceHash: tmhash.Sum([]byte("evidence")), - ValidatorsHash: tmhash.Sum([]byte("validators")), - NextValidatorsHash: tmhash.Sum([]byte("next_validators")), - ConsensusHash: tmhash.Sum([]byte("consensus")), - LastResultsHash: tmhash.Sum([]byte("last_result")), - }) + // tmHeader := tmproto.Header{ + // Height: 1, + // ChainID: chainID, + // Time: time.Now().UTC(), + // ProposerAddress: suite.consAddress.Bytes(), + // Version: tmversion.Consensus{ + // Block: version.BlockProtocol, + // }, + // LastBlockId: tmproto.BlockID{ + // Hash: tmhash.Sum([]byte("block_id")), + // PartSetHeader: tmproto.PartSetHeader{ + // Total: 11, + // Hash: tmhash.Sum([]byte("partset_header")), + // }, + // }, + // AppHash: tmhash.Sum([]byte("app")), + // DataHash: tmhash.Sum([]byte("data")), + // EvidenceHash: tmhash.Sum([]byte("evidence")), + // ValidatorsHash: tmhash.Sum([]byte("validators")), + // NextValidatorsHash: tmhash.Sum([]byte("next_validators")), + // ConsensusHash: tmhash.Sum([]byte("consensus")), + // LastResultsHash: tmhash.Sum([]byte("last_result")), + // } + + suite.ctx = suite.app.BaseApp.NewContext(checkTx) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper) suite.queryClient = types.NewQueryClient(queryHelper) - acc := ðermint.EthAccount{ + acc := &swisstroniktypes.EthAccount{ BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0), CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(), } @@ -127,17 +124,17 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) { suite.app.AccountKeeper.SetAccount(suite.ctx, acc) valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(valAddr.String(), priv.PubKey(), stakingtypes.Description{}) require.NoError(t, err) validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) - err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) + err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, sdk.ValAddress(validator.GetOperator())) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) require.NoError(t, err) suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID()) suite.appCodec = encodingConfig.Codec @@ -152,17 +149,15 @@ func (suite *KeeperTestSuite) Commit() { // Commit commits a block at a given time. func (suite *KeeperTestSuite) CommitAfter(t time.Duration) { header := suite.ctx.BlockHeader() - suite.app.EndBlock(abci.RequestEndBlock{Height: header.Height}) - _ = suite.app.Commit() + suite.app.EndBlocker(suite.ctx) + suite.app.Commit() header.Height += 1 header.Time = header.Time.Add(t) - suite.app.BeginBlock(abci.RequestBeginBlock{ - Header: header, - }) + suite.app.BeginBlocker(suite.ctx) // update ctx - suite.ctx = suite.app.BaseApp.NewContext(false, header) + suite.ctx = suite.app.BaseApp.NewContext(false) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper) @@ -200,9 +195,9 @@ func (suite *KeeperTestSuite) TestSetGetGasFee() { { "with last block given", func() { - suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, sdk.OneDec().BigInt()) + suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, sdkmath.LegacyOneDec().BigInt()) }, - sdk.OneDec().BigInt(), + sdkmath.LegacyOneDec().BigInt(), }, } diff --git a/x/feemarket/keeper/params.go b/x/feemarket/keeper/params.go index 5884658d..e0c8409a 100644 --- a/x/feemarket/keeper/params.go +++ b/x/feemarket/keeper/params.go @@ -20,6 +20,7 @@ import ( "swisstronik/x/feemarket/types" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -81,7 +82,7 @@ func (k Keeper) SetBaseFee(ctx sdk.Context, baseFee *big.Int) { params := k.GetParams(ctx) ctx.Logger().Info("FeeMarket: baseFee was changed", "oldBaseFee", params.BaseFee.String(), "newBaseFee", baseFee.String()) - params.BaseFee = sdk.NewIntFromBigInt(baseFee) + params.BaseFee = sdkmath.NewIntFromBigInt(baseFee) err := k.SetParams(ctx, params) if err != nil { return diff --git a/x/feemarket/module.go b/x/feemarket/module.go index c8d40d77..4502f73d 100644 --- a/x/feemarket/module.go +++ b/x/feemarket/module.go @@ -20,12 +20,11 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -36,13 +35,20 @@ import ( "swisstronik/x/feemarket/client/cli" "swisstronik/x/feemarket/keeper" "swisstronik/x/feemarket/types" + + bam "github.com/cosmos/cosmos-sdk/baseapp" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.EndBlockAppModule = AppModule{} - _ module.BeginBlockAppModule = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // AppModuleBasic defines the basic application module used by the fee market module. @@ -140,30 +146,28 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), &am.keeper) } -func (am AppModule) NewHandler() sdk.Handler { +func (am AppModule) NewHandler() bam.MsgServiceHandler { return NewHandler(&am.keeper) } // BeginBlock returns the begin block for the fee market module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx, req) +func (am AppModule) BeginBlock(ctx context.Context) error { + return am.keeper.BeginBlock(ctx) } // EndBlock returns the end blocker for the fee market module. It returns no validator // updates. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - am.keeper.EndBlock(ctx, req) - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(ctx context.Context) error { + return am.keeper.EndBlock(ctx) } // InitGenesis performs genesis initialization for the fee market module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.keeper, genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the fee market @@ -174,7 +178,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // RegisterStoreDecoder registers a decoder for fee market module's types -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // ProposalContents doesn't return any content functions for governance proposals. func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { @@ -189,3 +193,9 @@ func (AppModule) GenerateGenesisState(_ *module.SimulationState) { func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/feemarket/types/feemarket.pb.go b/x/feemarket/types/feemarket.pb.go index 6b44cdb6..dd7da3ac 100644 --- a/x/feemarket/types/feemarket.pb.go +++ b/x/feemarket/types/feemarket.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -38,13 +38,13 @@ type Params struct { // enabled. EnableHeight int64 `protobuf:"varint,5,opt,name=enable_height,json=enableHeight,proto3" json:"enable_height,omitempty"` // base_fee for EIP-1559 blocks. - BaseFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=base_fee,json=baseFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"base_fee"` + BaseFee cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee"` // min_gas_price defines the minimum gas price value for cosmos and eth // transactions - MinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=min_gas_price,json=minGasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_price"` + MinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=min_gas_price,json=minGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_gas_price"` // min_gas_multiplier bounds the minimum gas used to be charged // to senders based on gas limit - MinGasMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=min_gas_multiplier,json=minGasMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_multiplier"` + MinGasMultiplier cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=min_gas_multiplier,json=minGasMultiplier,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_gas_multiplier"` } func (m *Params) Reset() { *m = Params{} } @@ -117,32 +117,33 @@ func init() { } var fileDescriptor_4feb8b20cf98e6e1 = []byte{ - // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xc1, 0x8a, 0xdb, 0x30, - 0x14, 0xb4, 0x9a, 0xdd, 0xac, 0x57, 0xdb, 0x40, 0x10, 0xdb, 0x62, 0x5a, 0xf0, 0x9a, 0x16, 0x16, - 0x1f, 0x5a, 0x9b, 0x65, 0xcf, 0xbd, 0xa4, 0x21, 0x6d, 0x0a, 0x85, 0xe0, 0x63, 0x29, 0x08, 0xd9, - 0x79, 0xb1, 0x45, 0x2c, 0xc9, 0x58, 0x4a, 0x68, 0xfe, 0xa2, 0x9f, 0x95, 0x63, 0x4e, 0xa5, 0xf4, - 0x10, 0x4a, 0xf2, 0x23, 0x25, 0x76, 0x62, 0xe7, 0xda, 0x3d, 0x49, 0x7a, 0x33, 0x9a, 0x79, 0xd2, - 0x1b, 0x7c, 0x0f, 0x26, 0x83, 0x52, 0x70, 0x69, 0xc2, 0x19, 0x80, 0x60, 0xe5, 0x1c, 0x4c, 0xb8, - 0x7c, 0x68, 0x0f, 0x41, 0x51, 0x2a, 0xa3, 0xc8, 0xcb, 0x86, 0x17, 0xb4, 0xd0, 0xf2, 0xe1, 0xd5, - 0x6d, 0xaa, 0x52, 0x55, 0x51, 0xc2, 0xc3, 0xae, 0x66, 0xbf, 0xf9, 0xd5, 0xc1, 0xdd, 0x09, 0x2b, - 0x99, 0xd0, 0xc4, 0xc5, 0x37, 0x52, 0xd1, 0x98, 0x69, 0xa0, 0x33, 0x00, 0x07, 0x79, 0xc8, 0xb7, - 0xa3, 0x6b, 0xa9, 0x06, 0x4c, 0xc3, 0x08, 0x80, 0x7c, 0xc0, 0xaf, 0x4f, 0x20, 0x4d, 0x32, 0x26, - 0x53, 0xa0, 0x53, 0x90, 0x4a, 0x70, 0xc9, 0x8c, 0x2a, 0x9d, 0x67, 0x1e, 0xf2, 0x7b, 0x91, 0x13, - 0xd7, 0xec, 0x8f, 0x15, 0x61, 0xd8, 0xe2, 0xe4, 0x11, 0xbf, 0x80, 0x9c, 0x69, 0xc3, 0x13, 0x6e, - 0x56, 0x54, 0x2c, 0x72, 0xc3, 0x8b, 0x9c, 0x43, 0xe9, 0x74, 0xaa, 0x8b, 0xb7, 0x2d, 0xf8, 0xb5, - 0xc1, 0xc8, 0x5b, 0xdc, 0x03, 0xc9, 0xe2, 0x1c, 0x68, 0x06, 0x3c, 0xcd, 0x8c, 0x73, 0xe9, 0x21, - 0xbf, 0x13, 0x3d, 0xaf, 0x8b, 0x9f, 0xab, 0x1a, 0x19, 0x63, 0xbb, 0xe9, 0xba, 0xeb, 0x21, 0xff, - 0x7a, 0x10, 0xac, 0xb7, 0x77, 0xd6, 0x9f, 0xed, 0xdd, 0x7d, 0xca, 0x4d, 0xb6, 0x88, 0x83, 0x44, - 0x89, 0x30, 0x51, 0x5a, 0x28, 0x7d, 0x5c, 0xde, 0xeb, 0xe9, 0x3c, 0x34, 0xab, 0x02, 0x74, 0x30, - 0x96, 0x26, 0xba, 0x3a, 0x76, 0x4d, 0x22, 0xdc, 0x13, 0x5c, 0xd2, 0x94, 0x69, 0x5a, 0x94, 0x3c, - 0x01, 0xe7, 0xea, 0xbf, 0xf5, 0x86, 0x90, 0x44, 0x37, 0x82, 0xcb, 0x4f, 0x4c, 0x4f, 0x0e, 0x12, - 0xe4, 0x3b, 0x26, 0x27, 0xcd, 0xb3, 0x57, 0xdb, 0x4f, 0x12, 0xee, 0xd7, 0xc2, 0xed, 0x0f, 0x7d, - 0xb9, 0xb0, 0x2f, 0xfa, 0x97, 0x51, 0x9f, 0x4b, 0x6e, 0x38, 0xcb, 0x9b, 0xf1, 0x0d, 0x46, 0xeb, - 0x9d, 0x8b, 0x36, 0x3b, 0x17, 0xfd, 0xdd, 0xb9, 0xe8, 0xe7, 0xde, 0xb5, 0x36, 0x7b, 0xd7, 0xfa, - 0xbd, 0x77, 0xad, 0x6f, 0xef, 0xce, 0xbc, 0x60, 0x79, 0xb0, 0x6a, 0x93, 0xf5, 0xe3, 0x2c, 0x5b, - 0x95, 0x6b, 0xdc, 0xad, 0x72, 0xf2, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xce, 0xeb, 0x97, - 0x7f, 0x02, 0x00, 0x00, + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6a, 0xdb, 0x40, + 0x14, 0x45, 0x35, 0x75, 0xe2, 0x28, 0x93, 0x1a, 0xcc, 0x90, 0x14, 0xd1, 0x50, 0x45, 0x34, 0x50, + 0xb4, 0x28, 0x12, 0x21, 0x9b, 0x6e, 0xba, 0x71, 0x43, 0xdc, 0x96, 0x16, 0x5c, 0x2d, 0xbb, 0x19, + 0x46, 0xf2, 0xb3, 0x34, 0x58, 0x33, 0x23, 0x34, 0x63, 0x53, 0xff, 0x45, 0xff, 0xa4, 0xbf, 0xe1, + 0xa5, 0x97, 0xa5, 0x0b, 0x53, 0xec, 0x1f, 0x29, 0x96, 0x6c, 0xc9, 0xd0, 0x4d, 0x76, 0xd2, 0xbb, + 0xf7, 0x5c, 0xde, 0x63, 0x2e, 0x7e, 0x03, 0x26, 0x83, 0x52, 0x70, 0x69, 0xc2, 0x09, 0x80, 0x60, + 0xe5, 0x14, 0x4c, 0x38, 0xbf, 0x6b, 0x7f, 0x82, 0xa2, 0x54, 0x46, 0x91, 0x17, 0x8d, 0x2f, 0x68, + 0xa5, 0xf9, 0xdd, 0xcb, 0xcb, 0x54, 0xa5, 0xaa, 0xb2, 0x84, 0xbb, 0xaf, 0xda, 0xfd, 0xfa, 0x57, + 0x07, 0x77, 0x47, 0xac, 0x64, 0x42, 0x13, 0x17, 0x5f, 0x48, 0x45, 0x63, 0xa6, 0x81, 0x4e, 0x00, + 0x1c, 0xe4, 0x21, 0xdf, 0x8e, 0xce, 0xa5, 0x1a, 0x30, 0x0d, 0x8f, 0x00, 0xe4, 0x3d, 0xbe, 0x3e, + 0x88, 0x34, 0xc9, 0x98, 0x4c, 0x81, 0x8e, 0x41, 0x2a, 0xc1, 0x25, 0x33, 0xaa, 0x74, 0x9e, 0x79, + 0xc8, 0xef, 0x45, 0x4e, 0x5c, 0xbb, 0x3f, 0x54, 0x86, 0x87, 0x56, 0x27, 0xf7, 0xf8, 0x0a, 0x72, + 0xa6, 0x0d, 0x4f, 0xb8, 0x59, 0x50, 0x31, 0xcb, 0x0d, 0x2f, 0x72, 0x0e, 0xa5, 0xd3, 0xa9, 0xc0, + 0xcb, 0x56, 0xfc, 0xda, 0x68, 0xe4, 0x16, 0xf7, 0x40, 0xb2, 0x38, 0x07, 0x9a, 0x01, 0x4f, 0x33, + 0xe3, 0x9c, 0x7a, 0xc8, 0xef, 0x44, 0xcf, 0xeb, 0xe1, 0xc7, 0x6a, 0x46, 0xde, 0x61, 0xbb, 0xd9, + 0xba, 0xeb, 0x21, 0xff, 0x7c, 0xf0, 0x6a, 0xb9, 0xbe, 0xb1, 0xfe, 0xac, 0x6f, 0xae, 0x12, 0xa5, + 0x85, 0xd2, 0x7a, 0x3c, 0x0d, 0xb8, 0x0a, 0x05, 0x33, 0x59, 0xf0, 0x49, 0x9a, 0xe8, 0x6c, 0xbf, + 0x24, 0x19, 0xe2, 0x9e, 0xe0, 0x92, 0xa6, 0x4c, 0xd3, 0xa2, 0xe4, 0x09, 0x38, 0x67, 0x15, 0x7e, + 0xbb, 0xc7, 0xaf, 0xff, 0xc7, 0xbf, 0x40, 0xca, 0x92, 0xc5, 0x03, 0x24, 0xd1, 0x85, 0xe0, 0x72, + 0xc8, 0xf4, 0x68, 0xc7, 0x91, 0x6f, 0x98, 0x1c, 0x82, 0x8e, 0x2e, 0xb3, 0x9f, 0x9e, 0xd6, 0xaf, + 0xd3, 0xda, 0xd3, 0x3f, 0x9f, 0xd8, 0x27, 0xfd, 0xd3, 0xa8, 0xcf, 0x25, 0x37, 0x9c, 0xe5, 0xcd, + 0xbb, 0x0c, 0x1e, 0x97, 0x1b, 0x17, 0xad, 0x36, 0x2e, 0xfa, 0xbb, 0x71, 0xd1, 0xcf, 0xad, 0x6b, + 0xad, 0xb6, 0xae, 0xf5, 0x7b, 0xeb, 0x5a, 0xdf, 0xdf, 0xa6, 0xdc, 0x64, 0xb3, 0x38, 0x48, 0x94, + 0x08, 0x61, 0x2e, 0x94, 0x0e, 0xdb, 0xca, 0xfc, 0x38, 0x2a, 0x8d, 0x59, 0x14, 0xa0, 0xe3, 0x6e, + 0x55, 0x80, 0xfb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x77, 0x52, 0x39, 0x58, 0x02, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/feemarket/types/params.go b/x/feemarket/types/params.go index 704faa3f..14868f3c 100644 --- a/x/feemarket/types/params.go +++ b/x/feemarket/types/params.go @@ -19,16 +19,15 @@ import ( "fmt" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ethereum/go-ethereum/params" ) var ( // DefaultMinGasMultiplier is 0.5 or 50% - DefaultMinGasMultiplier = sdk.NewDecWithPrec(50, 2) + DefaultMinGasMultiplier = sdkmath.LegacyNewDecWithPrec(50, 2) // DefaultMinGasPrice is 0 (i.e disabled) - DefaultMinGasPrice = sdk.ZeroDec() + DefaultMinGasPrice = sdkmath.LegacyZeroDec() // DefaultEnableHeight is 0 (i.e disabled) DefaultEnableHeight = int64(0) // DefaultNoBaseFee is false @@ -73,8 +72,8 @@ func NewParams( elasticityMultiplier uint32, baseFee uint64, enableHeight int64, - minGasPrice sdk.Dec, - minGasPriceMultiplier sdk.Dec, + minGasPrice sdkmath.LegacyDec, + minGasPriceMultiplier sdkmath.LegacyDec, ) Params { return Params{ NoBaseFee: noBaseFee, @@ -134,7 +133,7 @@ func (p *Params) IsBaseFeeEnabled(height int64) bool { } func validateMinGasPrice(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -199,7 +198,7 @@ func validateEnableHeight(i interface{}) error { } func validateMinGasMultiplier(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -213,7 +212,7 @@ func validateMinGasMultiplier(i interface{}) error { return fmt.Errorf("value cannot be negative: %s", v) } - if v.GT(sdk.OneDec()) { + if v.GT(sdkmath.LegacyOneDec()) { return fmt.Errorf("value cannot be greater than 1: %s", v) } return nil diff --git a/x/feemarket/types/params_test.go b/x/feemarket/types/params_test.go index 822fb08d..1f9c182e 100644 --- a/x/feemarket/types/params_test.go +++ b/x/feemarket/types/params_test.go @@ -5,8 +5,6 @@ import ( sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/suite" - - sdk "github.com/cosmos/cosmos-sdk/types" ) type ParamsTestSuite struct { @@ -26,7 +24,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { {"default", DefaultParams(), false}, { "valid", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdk.NewDecWithPrec(20, 4), DefaultMinGasMultiplier), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), false, }, { @@ -36,27 +34,27 @@ func (suite *ParamsTestSuite) TestParamsValidate() { }, { "base fee change denominator is 0 ", - NewParams(true, 0, 3, 2000000000, int64(544435345345435345), sdk.NewDecWithPrec(20, 4), DefaultMinGasMultiplier), + NewParams(true, 0, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), true, }, { "invalid: min gas price negative", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdk.NewDecFromInt(sdkmath.NewInt(-1)), DefaultMinGasMultiplier), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(-1)), DefaultMinGasMultiplier), true, }, { "valid: min gas multiplier zero", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdk.ZeroDec()), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdkmath.LegacyZeroDec()), false, }, { "invalid: min gas multiplier is negative", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdk.NewDecWithPrec(-5, 1)), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdkmath.LegacyNewDecWithPrec(-5, 1)), true, }, { "invalid: min gas multiplier bigger than 1", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdk.NewDecWithPrec(20, 4), sdk.NewDec(2)), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), sdkmath.LegacyNewDec(2)), true, }, } @@ -87,9 +85,9 @@ func (suite *ParamsTestSuite) TestParamsValidatePriv() { suite.Require().Error(validateEnableHeight("")) suite.Require().Error(validateEnableHeight(int64(-544435345345435345))) suite.Require().NoError(validateEnableHeight(int64(544435345345435345))) - suite.Require().Error(validateMinGasPrice(sdk.Dec{})) - suite.Require().Error(validateMinGasMultiplier(sdk.NewDec(-5))) - suite.Require().Error(validateMinGasMultiplier(sdk.Dec{})) + suite.Require().Error(validateMinGasPrice(sdkmath.LegacyDec{})) + suite.Require().Error(validateMinGasMultiplier(sdkmath.LegacyNewDec(-5))) + suite.Require().Error(validateMinGasMultiplier(sdkmath.LegacyDec{})) suite.Require().Error(validateMinGasMultiplier("")) } @@ -100,13 +98,13 @@ func (suite *ParamsTestSuite) TestParamsValidateMinGasPrice() { expError bool }{ {"default", DefaultParams().MinGasPrice, false}, - {"valid", sdk.NewDecFromInt(sdkmath.NewInt(1)), false}, + {"valid", sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1)), false}, {"invalid - wrong type - bool", false, true}, {"invalid - wrong type - string", "", true}, {"invalid - wrong type - int64", int64(123), true}, {"invalid - wrong type - sdkmath.Int", sdkmath.NewInt(1), true}, {"invalid - is nil", nil, true}, - {"invalid - is negative", sdk.NewDecFromInt(sdkmath.NewInt(-1)), true}, + {"invalid - is negative", sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(-1)), true}, } for _, tc := range testCases { diff --git a/x/feemarket/types/query.pb.go b/x/feemarket/types/query.pb.go index 59213203..ca85f597 100644 --- a/x/feemarket/types/query.pb.go +++ b/x/feemarket/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -154,7 +154,7 @@ var xxx_messageInfo_QueryBaseFeeRequest proto.InternalMessageInfo // QueryBaseFeeResponse returns the EIP1559 base fee. type QueryBaseFeeResponse struct { // base_fee is the EIP1559 base fee - BaseFee *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"base_fee,omitempty"` + BaseFee *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee,omitempty"` } func (m *QueryBaseFeeResponse) Reset() { *m = QueryBaseFeeResponse{} } @@ -288,35 +288,35 @@ func init() { } var fileDescriptor_71a07c1ffd85fde2 = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xf5, 0x12, 0x48, 0xcb, 0x72, 0x41, 0x4b, 0x5a, 0x21, 0x0b, 0x6d, 0x83, 0x91, 0xa2, 0xb6, - 0xb4, 0x5e, 0xb5, 0x5c, 0x39, 0x59, 0xa2, 0x88, 0x1b, 0x98, 0x1b, 0x12, 0xaa, 0xd6, 0x61, 0xea, - 0x5a, 0xa9, 0xbd, 0xae, 0x77, 0x13, 0xd1, 0x2b, 0x37, 0x2e, 0x08, 0xc1, 0xd7, 0xf0, 0x07, 0x39, - 0x46, 0xe2, 0x82, 0x38, 0x44, 0x28, 0xe1, 0x43, 0x90, 0x77, 0xd7, 0x49, 0x0c, 0x18, 0x72, 0xca, - 0x6a, 0xf2, 0xe6, 0xbd, 0x37, 0x6f, 0xc6, 0xd8, 0x03, 0x75, 0x0e, 0x45, 0x9a, 0x64, 0x8a, 0x9d, - 0x01, 0xa4, 0xbc, 0x18, 0x80, 0x62, 0xa3, 0x23, 0x76, 0x39, 0x84, 0xe2, 0xca, 0xcf, 0x0b, 0xa1, - 0x04, 0xd9, 0x5e, 0x60, 0xfc, 0x05, 0xc6, 0x1f, 0x1d, 0xb9, 0x9d, 0x58, 0xc4, 0x42, 0x43, 0x58, - 0xf9, 0x32, 0x68, 0xb7, 0xd7, 0xc0, 0xb8, 0x6c, 0x35, 0xb8, 0x7b, 0xb1, 0x10, 0xf1, 0x05, 0x30, - 0x9e, 0x27, 0x8c, 0x67, 0x99, 0x50, 0x5c, 0x25, 0x22, 0x93, 0xe6, 0x5f, 0xaf, 0x83, 0xc9, 0x8b, - 0xd2, 0xc2, 0x73, 0x5e, 0xf0, 0x54, 0x86, 0x70, 0x39, 0x04, 0xa9, 0xbc, 0x97, 0xf8, 0x4e, 0xad, - 0x2a, 0x73, 0x91, 0x49, 0x20, 0x8f, 0x71, 0x3b, 0xd7, 0x95, 0xbb, 0xa8, 0x8b, 0x76, 0x6f, 0x1d, - 0x53, 0xff, 0xef, 0x8e, 0x7d, 0xd3, 0x17, 0x5c, 0x1f, 0x4f, 0x77, 0x9c, 0xd0, 0xf6, 0x78, 0x5b, - 0x96, 0x34, 0xe0, 0x12, 0x4e, 0x00, 0x2a, 0xad, 0xd7, 0xb8, 0x53, 0x2f, 0x5b, 0xb1, 0x27, 0x78, - 0x33, 0xe2, 0x12, 0x4e, 0xcf, 0x00, 0xb4, 0xdc, 0xcd, 0x60, 0xff, 0xfb, 0x74, 0xa7, 0x17, 0x27, - 0xea, 0x7c, 0x18, 0xf9, 0x7d, 0x91, 0xb2, 0xbe, 0x90, 0xa9, 0x90, 0xf6, 0xe7, 0x50, 0xbe, 0x19, - 0x30, 0x75, 0x95, 0x83, 0xf4, 0x9f, 0x65, 0x2a, 0xdc, 0x88, 0x0c, 0x9d, 0xb7, 0x5d, 0xd1, 0x5f, - 0x88, 0xfe, 0xe0, 0x29, 0x5f, 0x8c, 0xb8, 0x87, 0xb7, 0x7e, 0xab, 0x5b, 0xdd, 0xdb, 0xb8, 0x15, - 0x73, 0x33, 0x61, 0x2b, 0x2c, 0x9f, 0xc7, 0x5f, 0x5a, 0xf8, 0x86, 0xc6, 0x92, 0xf7, 0x08, 0xb7, - 0xcd, 0x6c, 0x64, 0xbf, 0x69, 0xf6, 0x3f, 0xe3, 0x74, 0x1f, 0xae, 0x85, 0x35, 0xfa, 0x5e, 0xef, - 0xdd, 0xd7, 0x9f, 0x9f, 0xaf, 0x75, 0x09, 0x65, 0x0d, 0x0b, 0x36, 0x71, 0x92, 0x0f, 0x08, 0x6f, - 0xd8, 0xcc, 0xc8, 0xbf, 0x05, 0xea, 0x81, 0xbb, 0x07, 0xeb, 0x81, 0xad, 0x9d, 0x5d, 0x6d, 0xc7, - 0x23, 0xdd, 0x26, 0x3b, 0xd5, 0x92, 0xc8, 0x27, 0x84, 0x37, 0xab, 0x34, 0xc9, 0x7f, 0x44, 0xea, - 0xcb, 0x70, 0x0f, 0xd7, 0x44, 0x5b, 0x4f, 0x7b, 0xda, 0xd3, 0x03, 0x72, 0xbf, 0xd1, 0x53, 0xd9, - 0x71, 0x1a, 0x73, 0x19, 0x9c, 0x8c, 0x67, 0x14, 0x4d, 0x66, 0x14, 0xfd, 0x98, 0x51, 0xf4, 0x71, - 0x4e, 0x9d, 0xc9, 0x9c, 0x3a, 0xdf, 0xe6, 0xd4, 0x79, 0x75, 0xb0, 0x72, 0x49, 0x30, 0x2a, 0x0f, - 0x69, 0x49, 0xf6, 0x76, 0x85, 0x4e, 0xdf, 0x54, 0xd4, 0xd6, 0x9f, 0xcb, 0xa3, 0x5f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x61, 0x3c, 0x39, 0xd8, 0xc8, 0x03, 0x00, 0x00, + // 437 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x3f, 0x8f, 0xd3, 0x30, + 0x14, 0x8f, 0x29, 0xf4, 0x0e, 0xb3, 0x20, 0xd3, 0x9e, 0x20, 0x42, 0xbe, 0x12, 0xa4, 0xd3, 0x1d, + 0x1c, 0xb6, 0xee, 0x60, 0x64, 0xca, 0x70, 0x08, 0x89, 0x01, 0xc2, 0xc6, 0x52, 0x39, 0xe5, 0x35, + 0x8d, 0xda, 0xc4, 0x69, 0xec, 0x56, 0x74, 0x65, 0x63, 0x41, 0x08, 0x3e, 0x0d, 0xdf, 0xa0, 0x63, + 0x25, 0x16, 0xc4, 0x50, 0xa1, 0x96, 0x0f, 0x82, 0x12, 0x27, 0xa5, 0x01, 0x02, 0xdd, 0xac, 0x97, + 0xdf, 0xbf, 0xf7, 0x7b, 0x0a, 0x76, 0x40, 0x0f, 0x20, 0x8d, 0xc2, 0x58, 0xf3, 0x3e, 0x40, 0x24, + 0xd2, 0x21, 0x68, 0x3e, 0x3d, 0xe3, 0xe3, 0x09, 0xa4, 0x33, 0x96, 0xa4, 0x52, 0x4b, 0x72, 0xb0, + 0xc1, 0xb0, 0x0d, 0x86, 0x4d, 0xcf, 0xec, 0x56, 0x20, 0x03, 0x99, 0x43, 0x78, 0xf6, 0x32, 0x68, + 0xfb, 0xa8, 0x46, 0xf1, 0x17, 0xd5, 0xe0, 0x6e, 0x07, 0x52, 0x06, 0x23, 0xe0, 0x22, 0x09, 0xb9, + 0x88, 0x63, 0xa9, 0x85, 0x0e, 0x65, 0xac, 0xcc, 0x57, 0xa7, 0x85, 0xc9, 0x8b, 0x2c, 0xc2, 0x73, + 0x91, 0x8a, 0x48, 0x79, 0x30, 0x9e, 0x80, 0xd2, 0xce, 0x4b, 0x7c, 0xa3, 0x32, 0x55, 0x89, 0x8c, + 0x15, 0x90, 0xc7, 0xb8, 0x99, 0xe4, 0x93, 0x9b, 0xa8, 0x83, 0x8e, 0xaf, 0x9d, 0x53, 0xf6, 0xf7, + 0xc4, 0xcc, 0xf0, 0xdc, 0xcb, 0xf3, 0xe5, 0xa1, 0xe5, 0x15, 0x1c, 0xa7, 0x5d, 0x88, 0xba, 0x42, + 0xc1, 0x05, 0x40, 0xe9, 0xf5, 0x0c, 0xb7, 0xaa, 0xe3, 0xc2, 0xec, 0x11, 0xde, 0xf7, 0x85, 0x82, + 0x6e, 0x1f, 0x20, 0xb7, 0xbb, 0xea, 0xde, 0xfa, 0xb6, 0x3c, 0x6c, 0xf7, 0xa4, 0x8a, 0xa4, 0x52, + 0xaf, 0x87, 0x2c, 0x94, 0x3c, 0x12, 0x7a, 0xc0, 0x9e, 0xc6, 0xda, 0xdb, 0xf3, 0x0d, 0xdb, 0x39, + 0x28, 0xd5, 0x46, 0xb2, 0x37, 0x7c, 0x22, 0x36, 0x1b, 0x9d, 0xe0, 0xf6, 0x6f, 0xf3, 0xc2, 0xe6, + 0x3a, 0x6e, 0x04, 0xc2, 0x2c, 0xd4, 0xf0, 0xb2, 0xe7, 0xf9, 0xe7, 0x06, 0xbe, 0x92, 0x63, 0xc9, + 0x3b, 0x84, 0x9b, 0x66, 0x15, 0x72, 0xaf, 0x6e, 0xd5, 0x3f, 0xdb, 0xb3, 0xef, 0xef, 0x84, 0x35, + 0xfe, 0xce, 0xd1, 0xdb, 0x2f, 0x3f, 0x3e, 0x5d, 0xea, 0x10, 0xca, 0x6b, 0xee, 0x69, 0xda, 0x23, + 0xef, 0x11, 0xde, 0x2b, 0x2a, 0x22, 0xff, 0x36, 0xa8, 0xf6, 0x6b, 0x9f, 0xee, 0x06, 0x2e, 0xe2, + 0x1c, 0xe7, 0x71, 0x1c, 0xd2, 0xa9, 0x8b, 0x53, 0xde, 0x84, 0x7c, 0x44, 0x78, 0xbf, 0x6c, 0x93, + 0xfc, 0xc7, 0xa4, 0x7a, 0x0c, 0xfb, 0xc1, 0x8e, 0xe8, 0x22, 0xd3, 0x49, 0x9e, 0xe9, 0x2e, 0xb9, + 0x53, 0x9b, 0x29, 0x63, 0x74, 0x03, 0xa1, 0xdc, 0x8b, 0xf9, 0x8a, 0xa2, 0xc5, 0x8a, 0xa2, 0xef, + 0x2b, 0x8a, 0x3e, 0xac, 0xa9, 0xb5, 0x58, 0x53, 0xeb, 0xeb, 0x9a, 0x5a, 0xaf, 0x4e, 0x83, 0x50, + 0x0f, 0x26, 0x3e, 0xeb, 0xc9, 0x88, 0xc3, 0x34, 0x92, 0x6a, 0x4b, 0xec, 0xcd, 0x96, 0x9c, 0x9e, + 0x25, 0xa0, 0xfc, 0x66, 0xfe, 0x77, 0x3c, 0xfc, 0x19, 0x00, 0x00, 0xff, 0xff, 0x15, 0x29, 0x2d, + 0xfd, 0xb7, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -964,7 +964,7 @@ func (m *QueryBaseFeeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.BaseFee = &v if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/vesting/keeper/keeper.go b/x/vesting/keeper/keeper.go index 9459fb9b..912ca571 100644 --- a/x/vesting/keeper/keeper.go +++ b/x/vesting/keeper/keeper.go @@ -3,8 +3,8 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/x/vesting/keeper/msg_server.go b/x/vesting/keeper/msg_server.go index df8bf953..bad50d44 100644 --- a/x/vesting/keeper/msg_server.go +++ b/x/vesting/keeper/msg_server.go @@ -4,11 +4,12 @@ import ( "context" "swisstronik/x/vesting/types" - "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + metrics "github.com/hashicorp/go-metrics" errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" atypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -64,7 +65,7 @@ func (k msgServer) CreateMonthlyVestingAccount(goCtx context.Context, msg *types } // Calculate monthly amount - amount := totalCoins.QuoInt(sdk.NewInt(msg.Month)) + amount := totalCoins.QuoInt(sdkmath.NewInt(msg.Month)) var periods []atypes.Period for i := 0; i < (int)(msg.Month); i++ { @@ -74,7 +75,10 @@ func (k msgServer) CreateMonthlyVestingAccount(goCtx context.Context, msg *types baseAccount := authtypes.NewBaseAccountWithAddress(to) baseAccount = k.accountKeeper.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount) - vestingAccount := atypes.NewPeriodicVestingAccount(baseAccount, totalCoins.Sort(), msg.StartTime, periods) + vestingAccount, err := atypes.NewPeriodicVestingAccount(baseAccount, totalCoins.Sort(), msg.StartTime, periods) + if err != nil { + return nil, err + } k.accountKeeper.SetAccount(ctx, vestingAccount) diff --git a/x/vesting/keeper/msg_server_test.go b/x/vesting/keeper/msg_server_test.go index 4ac9fb93..db58533f 100644 --- a/x/vesting/keeper/msg_server_test.go +++ b/x/vesting/keeper/msg_server_test.go @@ -12,7 +12,6 @@ import ( "swisstronik/testutil" "swisstronik/utils" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" ) @@ -36,7 +35,7 @@ func TestCreatingMonthlyVestingAccount(t *testing.T) { // setup the app app, genAcc := app.SetupSwissApp(checkTx, nil, chainID) - ctx := app.BaseApp.NewContext(false, tmproto.Header{ChainID: "swisstronik_1291-1"}) + ctx := app.BaseApp.NewContext(false) msgServer := keeper.NewMsgServerImpl(app.VestingKeeper) toAcc := app.AccountKeeper.NewAccountWithAddress(ctx, to1AddrAcc) diff --git a/x/vesting/module.go b/x/vesting/module.go index e635091c..4c050003 100644 --- a/x/vesting/module.go +++ b/x/vesting/module.go @@ -7,11 +7,10 @@ import ( // this line is used by starport scaffolding # 1 + "cosmossdk.io/core/appmodule" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "swisstronik/x/vesting/client/cli" "swisstronik/x/vesting/keeper" "swisstronik/x/vesting/types" @@ -21,13 +20,19 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.EndBlockAppModule = AppModule{} - _ module.BeginBlockAppModule = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // ---------------------------------------------------------------------------- @@ -119,14 +124,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs the module's genesis initialization. It returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { var genState types.GenesisState // Initialize global index to index in genesis state cdc.MustUnmarshalJSON(gs, &genState) InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} } // ExportGenesis returns the module's exported genesis state as raw JSON bytes. @@ -139,9 +142,29 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} // EndBlock contains the logic that is automatically triggered at the end of each block -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} + +// GenerateGenesisState creates a randomized GenState of the fee market module. +func (AppModule) GenerateGenesisState(_ *module.SimulationState) { +} + +// RegisterStoreDecoder registers a decoder for fee market module's types +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// WeightedOperations returns the all the fee market module operations with their respective weights. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return nil } diff --git a/x/vesting/types/errors.go b/x/vesting/types/errors.go index 477574b9..5047a16e 100644 --- a/x/vesting/types/errors.go +++ b/x/vesting/types/errors.go @@ -3,10 +3,10 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/vesting module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrSample = errorsmod.Register(ModuleName, 1100, "sample error") ) diff --git a/x/vesting/types/expected_keepers.go b/x/vesting/types/expected_keepers.go index fd1a6297..33c9fcb6 100644 --- a/x/vesting/types/expected_keepers.go +++ b/x/vesting/types/expected_keepers.go @@ -1,22 +1,23 @@ package types import ( + context "context" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - SetAccount(ctx sdk.Context, acc types.AccountI) - NewAccount(ctx sdk.Context, acc types.AccountI) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + SetAccount(ctx context.Context, acc sdk.AccountI) + NewAccount(ctx context.Context, acc sdk.AccountI) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error - SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error + SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/vesting/types/msg.go b/x/vesting/types/msg.go index 6fe8faa8..27c1b31a 100644 --- a/x/vesting/types/msg.go +++ b/x/vesting/types/msg.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -43,7 +44,7 @@ func (msg *MsgCreateMonthlyVestingAccount) GetSignBytes() []byte { func (msg *MsgCreateMonthlyVestingAccount) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } return nil }