diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2931b27153..79abf1644d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v26 with: - nix_path: nixpkgs=channel:nixos-23.11 + nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v14 @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v26 with: - nix_path: nixpkgs=channel:nixos-23.11 + nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab418bf56a..262e87b7b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,7 +99,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v26 with: - nix_path: nixpkgs=channel:nixos-23.11 + nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v14 @@ -138,7 +138,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v26 with: - nix_path: nixpkgs=channel:nixos-23.11 + nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v14 diff --git a/CHANGELOG.md b/CHANGELOG.md index fbaba4dec2..c9cf53a8f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,11 +40,15 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * (evm) [#414](https://github.com/crypto-org-chain/ethermint/pull/414) Integrate go-block-stm for parallel tx execution. +* (block-stm) [#498](https://github.com/crypto-org-chain/ethermint/pull/498) Enable incarnation cache for block-stm executor. ### State Machine Breaking * (rpc) [#443](https://github.com/crypto-org-chain/ethermint/pull/443) Keep behavior of random opcode as before. * (app) [#451](https://github.com/crypto-org-chain/ethermint/pull/451) Disable block gas meter, it's not compatible with parallel tx execution. It's safe to do as long as we checks total gas-wanted against block gas limit in process proposal, which we do in default handler. +* (ante) [#493](https://github.com/crypto-org-chain/ethermint/pull/493) Align gasWanted for process proposal mode, [#500](https://github.com/crypto-org-chain/ethermint/pull/500) Check for overflow before adding gasLimit to gasWanted. +* (ante) [#506](https://github.com/crypto-org-chain/ethermint/pull/506) Disable MsgCreatePermanentLockedAccount and MsgCreatePeriodicVestingAccount messages. +* (ante) [#513](https://github.com/crypto-org-chain/ethermint/pull/513) Avoid unnecessary GetAccount and MakeSigner in ante handlers. ### Bug Fixes @@ -59,6 +63,17 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#474](https://github.com/crypto-org-chain/ethermint/pull/474), [#476](https://github.com/crypto-org-chain/ethermint/pull/441) Align genesis related cmd. * (rpc) [#480](https://github.com/crypto-org-chain/ethermint/pull/480), [#482](https://github.com/crypto-org-chain/ethermint/pull/482) Fix parsed logs from old events. * (rpc) [#488](https://github.com/crypto-org-chain/ethermint/pull/488) Fix handling of pending transactions related APIs. +* (rpc) [#501](https://github.com/crypto-org-chain/ethermint/pull/501) Avoid invalid chain id for signer error when rpc call before chain id set in BeginBlock. +* (block-stm) [#510](https://github.com/crypto-org-chain/ethermint/pull/510) Include a fix to avoid nondeterministic account set when stm workers execute in parallel. +* (rpc) [#521](https://github.com/crypto-org-chain/ethermint/pull/521) Align hash and miner in subscribe newHeads with eth_getBlockByNumber. +* (rpc) [#516](https://github.com/crypto-org-chain/ethermint/pull/516) Avoid method eth_chainId crashed due to nil pointer on IsEIP155 check. +* (cli) [#524](https://github.com/crypto-org-chain/ethermint/pull/524) Allow tx evm raw run for generate only when offline with evm-denom flag. +* (rpc) [#527](https://github.com/crypto-org-chain/ethermint/pull/527) Fix balance consistency between trace-block and state machine. +* (rpc) [#534](https://github.com/crypto-org-chain/ethermint/pull/534), [#540](https://github.com/crypto-org-chain/ethermint/pull/540) Fix opBlockhash when no block header in abci request. +* (rpc) [#536](https://github.com/crypto-org-chain/ethermint/pull/536) Fix validate basic after transaction conversion with raw field. +* (cli) [#537](https://github.com/crypto-org-chain/ethermint/pull/537) Fix unsuppored sign mode SIGN_MODE_TEXTUAL for bank transfer. +* (cli) [#543](https://github.com/crypto-org-chain/ethermint/pull/543) Fix graceful shutdown. +* (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. ### Improvements @@ -74,6 +89,17 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (app) [#483](https://github.com/crypto-org-chain/ethermint/pull/483) Make keyring-backend client config accessible in app. * (deps) [#489](https://github.com/crypto-org-chain/ethermint/pull/489) Update cosmos-sdk to `v0.50.7`. * (rpc) [#491](https://github.com/crypto-org-chain/ethermint/pull/491) Avoid unnecessary tx decode in tx listener. +* [#496](https://github.com/crypto-org-chain/ethermint/pull/496) Set mempool MaxTx from config. +* (ante) [#497](https://github.com/crypto-org-chain/ethermint/pull/497) Enforce positive value check in eth transaction. +* (deps) [#505](https://github.com/crypto-org-chain/ethermint/pull/505) Update cometbft to v0.38.10. +* (ante) [#504](https://github.com/crypto-org-chain/ethermint/pull/504) Optimize AnteHandle method to skip checks if disabledMsgs is empty. +* [#517](https://github.com/crypto-org-chain/ethermint/pull/517) Add check for integer overflow to ensure safe conversion. +* [#522](https://github.com/crypto-org-chain/ethermint/pull/522) block-stm executor support optional pre-estimations. +* [#526](https://github.com/crypto-org-chain/ethermint/pull/526), [#535](https://github.com/crypto-org-chain/ethermint/pull/535) Avoid unnecessary block result in header related api call. +* [#533](https://github.com/crypto-org-chain/ethermint/pull/533) Bump cosmos-sdk to v0.50.10, cometbft to v0.38.13 and ibc-go to v8.5.1. +* [#546](https://github.com/crypto-org-chain/ethermint/pull/546) Introduce `--async-check-tx` flag to run check-tx async with consensus. +* [#549](https://github.com/crypto-org-chain/ethermint/pull/549) Support build without cgo. +* [#551](https://github.com/crypto-org-chain/ethermint/pull/551) Start event stream on demand. ## v0.21.x-cronos diff --git a/app/ante/authz.go b/app/ante/authz.go index 3909d0b3e1..5c71dc2cef 100644 --- a/app/ante/authz.go +++ b/app/ante/authz.go @@ -48,8 +48,12 @@ func NewAuthzLimiterDecorator(disabledMsgTypes []string) AuthzLimiterDecorator { } func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + if len(ald.disabledMsgs) == 0 { + return next(ctx, tx, simulate) + } + if err := ald.checkDisabledMsgs(tx.GetMsgs(), false, 0); err != nil { - return ctx, errorsmod.Wrapf(errortypes.ErrUnauthorized, err.Error()) + return ctx, errorsmod.Wrap(errortypes.ErrUnauthorized, err.Error()) } return next(ctx, tx, simulate) } diff --git a/app/ante/authz_test.go b/app/ante/authz_test.go index d6e52a022d..1d8ef92eac 100644 --- a/app/ante/authz_test.go +++ b/app/ante/authz_test.go @@ -255,6 +255,26 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() { }, expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), }, + { + name: "a MsgGrant with MsgCreatePermanentLockedAccount typeURL on the authorization field is blocked", + msgs: []sdk.Msg{ + newGenericMsgGrant( + testAddresses, + sdk.MsgTypeURL(&sdkvesting.MsgCreatePermanentLockedAccount{}), + ), + }, + expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), + }, + { + name: "a MsgGrant with MsgCreatePeriodicVestingAccount typeURL on the authorization field is blocked", + msgs: []sdk.Msg{ + newGenericMsgGrant( + testAddresses, + sdk.MsgTypeURL(&sdkvesting.MsgCreatePeriodicVestingAccount{}), + ), + }, + expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), + }, { name: "a MsgGrant with MsgEthereumTx typeURL on the authorization field included on EIP712 tx is blocked", msgs: []sdk.Msg{ diff --git a/app/ante/eip712.go b/app/ante/eip712.go index 2237a7910c..3ccef365f7 100644 --- a/app/ante/eip712.go +++ b/app/ante/eip712.go @@ -32,7 +32,6 @@ import ( ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" ethcrypto "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/evmos/ethermint/crypto/ethsecp256k1" "github.com/evmos/ethermint/ethereum/eip712" @@ -301,7 +300,7 @@ func VerifySignature( feePayerSig[ethcrypto.RecoveryIDOffset] -= 27 } - feePayerPubkey, err := secp256k1.RecoverPubkey(sigHash, feePayerSig) + feePayerPubkey, err := ethcrypto.Ecrecover(sigHash, feePayerSig) if err != nil { return errorsmod.Wrap(err, "failed to recover delegated fee payer from sig") } @@ -327,7 +326,7 @@ func VerifySignature( // VerifySignature of ethsecp256k1 accepts 64 byte signature [R||S] // WARNING! Under NO CIRCUMSTANCES try to use pubKey.VerifySignature there - if !secp256k1.VerifySignature(pubKey.Bytes(), sigHash, feePayerSig[:len(feePayerSig)-1]) { + if !ethcrypto.VerifySignature(pubKey.Bytes(), sigHash, feePayerSig[:len(feePayerSig)-1]) { return errorsmod.Wrap(errortypes.ErrorInvalidSigner, "unable to verify signer signature of EIP712 typed data") } diff --git a/app/ante/eth.go b/app/ante/eth.go index 8d86c3404e..67a95113e0 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -16,6 +16,7 @@ package ante import ( + "fmt" "math" "math/big" @@ -27,21 +28,46 @@ import ( ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/keeper" + "github.com/evmos/ethermint/x/evm/statedb" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" ) +type AccountGetter func(sdk.AccAddress) sdk.AccountI + +// NewCachedAccountGetter cache the account objects during the ante handler execution, +// it's safe because there's no store branching in the ante handlers, +// it also creates new account in memory if it doesn't exist in the store. +func NewCachedAccountGetter(ctx sdk.Context, ak evmtypes.AccountKeeper) AccountGetter { + accounts := make(map[string]sdk.AccountI, 1) + return func(addr sdk.AccAddress) sdk.AccountI { + acc := accounts[string(addr)] + if acc == nil { + acc = ak.GetAccount(ctx, addr) + if acc == nil { + // we create a new account in memory if it doesn't exist, + // which is only set to store when updated. + acc = ak.NewAccountWithAddress(ctx, addr) + } + accounts[string(addr)] = acc + } + return acc + } +} + // VerifyEthAccount validates checks that the sender balance is greater than the total transaction cost. -// The account will be set to store if it doesn't exis, i.e cannot be found on store. +// The account will be created in memory if it doesn't exist, i.e cannot be found on store, which will eventually set to +// store when increasing nonce. // This AnteHandler decorator will fail if: // - any of the msgs is not a MsgEthereumTx // - from address is empty // - account balance is lower than the transaction cost func VerifyEthAccount( ctx sdk.Context, tx sdk.Tx, - evmKeeper EVMKeeper, ak evmtypes.AccountKeeper, evmDenom string, + evmKeeper EVMKeeper, evmDenom string, + accountGetter AccountGetter, ) error { if !ctx.IsCheckTx() { return nil @@ -62,13 +88,9 @@ func VerifyEthAccount( } // check whether the sender address is EOA - fromAddr := common.BytesToAddress(from) - acct := evmKeeper.GetAccount(ctx, fromAddr) - - if acct == nil { - acc := ak.NewAccountWithAddress(ctx, from) - ak.SetAccount(ctx, acc) - } else if acct.IsContract() { + acct := statedb.NewAccountFromSdkAccount(accountGetter(from)) + if acct.IsContract() { + fromAddr := common.BytesToAddress(from) return errorsmod.Wrapf(errortypes.ErrInvalidType, "the sender is not EOA: address %s, codeHash <%s>", fromAddr, acct.CodeHash) } @@ -122,18 +144,15 @@ func CheckEthGasConsume( minPriority = priority } + // We can't trust the tx gas limit, because we'll refund the unused gas. gasLimit := msgEthTx.GetGas() - if ctx.IsCheckTx() && maxGasWanted != 0 { - // We can't trust the tx gas limit, because we'll refund the unused gas. - if gasLimit > maxGasWanted { - gasWanted += maxGasWanted - } else { - gasWanted += gasLimit - } - } else { - gasWanted += gasLimit + if maxGasWanted != 0 { + gasLimit = min(gasLimit, maxGasWanted) } - + if gasWanted > math.MaxInt64-gasLimit { + return ctx, fmt.Errorf("gasWanted(%d) + gasLimit(%d) overflow", gasWanted, gasLimit) + } + gasWanted += gasLimit // user balance is already checked during CheckTx so there's no need to // verify it again during ReCheckTx if ctx.IsReCheckTx() { @@ -221,15 +240,18 @@ func CheckEthCanTransfer( ) } } - + value := tx.Value() + if value == nil || value.Sign() == -1 { + return fmt.Errorf("value (%s) must be positive", value) + } from := common.BytesToAddress(msgEthTx.From) // check that caller has enough balance to cover asset transfer for **topmost** call // NOTE: here the gas consumed is from the context with the infinite gas meter - if tx.Value().Sign() > 0 && !canTransfer(ctx, evmKeeper, evmParams.EvmDenom, from, tx.Value()) { + if value.Sign() > 0 && !canTransfer(ctx, evmKeeper, evmParams.EvmDenom, from, value) { return errorsmod.Wrapf( errortypes.ErrInsufficientFunds, "failed to transfer %s from address %s using the EVM block context transfer function", - tx.Value(), + value, from, ) } @@ -244,11 +266,11 @@ func canTransfer(ctx sdk.Context, evmKeeper EVMKeeper, denom string, from common return balance.Cmp(amount) >= 0 } -// CheckEthSenderNonce handles incrementing the sequence of the signer (i.e sender). If the transaction is a +// CheckAndSetEthSenderNonce handles incrementing the sequence of the signer (i.e sender). If the transaction is a // contract creation, the nonce will be incremented during the transaction execution and not within // this AnteHandler decorator. -func CheckEthSenderNonce( - ctx sdk.Context, tx sdk.Tx, ak evmtypes.AccountKeeper, +func CheckAndSetEthSenderNonce( + ctx sdk.Context, tx sdk.Tx, ak evmtypes.AccountKeeper, unsafeUnOrderedTx bool, accountGetter AccountGetter, ) error { for _, msg := range tx.GetMsgs() { msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) @@ -259,22 +281,25 @@ func CheckEthSenderNonce( tx := msgEthTx.AsTransaction() // increase sequence of sender - acc := ak.GetAccount(ctx, msgEthTx.GetFrom()) + from := msgEthTx.GetFrom() + acc := accountGetter(from) if acc == nil { return errorsmod.Wrapf( errortypes.ErrUnknownAddress, - "account %s is nil", common.BytesToAddress(msgEthTx.GetFrom().Bytes()), + "account %s is nil", common.BytesToAddress(from.Bytes()), ) } nonce := acc.GetSequence() - // we merged the nonce verification to nonce increment, so when tx includes multiple messages - // with same sender, they'll be accepted. - if tx.Nonce() != nonce { - return errorsmod.Wrapf( - errortypes.ErrInvalidSequence, - "invalid nonce; got %d, expected %d", tx.Nonce(), nonce, - ) + if !unsafeUnOrderedTx { + // we merged the nonce verification to nonce increment, so when tx includes multiple messages + // with same sender, they'll be accepted. + if tx.Nonce() != nonce { + return errorsmod.Wrapf( + errortypes.ErrInvalidSequence, + "invalid nonce; got %d, expected %d", tx.Nonce(), nonce, + ) + } } if err := acc.SetSequence(nonce + 1); err != nil { diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index 93a3da1eea..c44863db27 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -1,10 +1,13 @@ package ante_test import ( + "errors" + "fmt" "math" "math/big" sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/protobuf/proto" storetypes "cosmossdk.io/store/types" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -89,7 +92,8 @@ func (suite *AnteTestSuite) TestNewEthAccountVerificationDecorator() { tc.malleate() suite.Require().NoError(vmdb.Commit()) - err := ante.VerifyEthAccount(suite.ctx.WithIsCheckTx(tc.checkTx), tc.tx, suite.app.EvmKeeper, suite.app.AccountKeeper, evmtypes.DefaultEVMDenom) + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) + err := ante.VerifyEthAccount(suite.ctx.WithIsCheckTx(tc.checkTx), tc.tx, suite.app.EvmKeeper, evmtypes.DefaultEVMDenom, accountGetter) if tc.expPass { suite.Require().NoError(err) @@ -144,7 +148,8 @@ func (suite *AnteTestSuite) TestEthNonceVerificationDecorator() { for _, tc := range testCases { suite.Run(tc.name, func() { tc.malleate() - err := ante.CheckEthSenderNonce(suite.ctx.WithIsReCheckTx(tc.reCheckTx), tc.tx, suite.app.AccountKeeper) + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) + err := ante.CheckAndSetEthSenderNonce(suite.ctx.WithIsReCheckTx(tc.reCheckTx), tc.tx, suite.app.AccountKeeper, false, accountGetter) if tc.expPass { suite.Require().NoError(err) @@ -155,6 +160,18 @@ func (suite *AnteTestSuite) TestEthNonceVerificationDecorator() { } } +type multiTx struct { + Msgs []sdk.Msg +} + +func (msg *multiTx) GetMsgs() []sdk.Msg { + return msg.Msgs +} + +func (msg *multiTx) GetMsgsV2() ([]proto.Message, error) { + return nil, errors.New("not implemented") +} + func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { evmParams := suite.app.EvmKeeper.GetParams(suite.ctx) chainID := suite.app.EvmKeeper.ChainID() @@ -189,6 +206,9 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { dynamicFeeTx.From = addr.Bytes() dynamicFeeTxPriority := int64(1) + maxGasLimitTx := evmtypes.NewTxContract(suite.app.EvmKeeper.ChainID(), 1, big.NewInt(10), math.MaxUint64, gasPrice, nil, nil, nil, ðtypes.AccessList{{Address: addr, StorageKeys: nil}}) + maxGasLimitTx.From = addr.Bytes() + var vmdb *statedb.StateDB testCases := []struct { @@ -199,8 +219,9 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { expPass bool expPanic bool expPriority int64 + err error }{ - {"invalid transaction type", &invalidTx{}, math.MaxUint64, func() {}, false, false, 0}, + {"invalid transaction type", &invalidTx{}, math.MaxUint64, func() {}, false, false, 0, nil}, { "sender not found", evmtypes.NewTxContract(suite.app.EvmKeeper.ChainID(), 1, big.NewInt(10), 1000, big.NewInt(1), nil, nil, nil, nil), @@ -208,6 +229,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { func() {}, false, false, 0, + nil, }, { "gas limit too low", @@ -216,6 +238,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { func() {}, false, false, 0, + nil, }, { "gas limit above block gas limit", @@ -224,6 +247,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { func() {}, false, false, 0, + nil, }, { "not enough balance for fees", @@ -232,6 +256,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { func() {}, false, false, 0, + nil, }, { "not enough tx gas", @@ -242,6 +267,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { }, false, true, 0, + nil, }, { "not enough block gas", @@ -253,6 +279,22 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { }, false, true, 0, + nil, + }, + { + "gas limit overflow", + &multiTx{ + Msgs: []sdk.Msg{maxGasLimitTx, tx2}, + }, + math.MaxUint64, + func() { + limit := new(big.Int).SetUint64(math.MaxUint64) + balance := new(big.Int).Mul(limit, gasPrice) + vmdb.AddBalance(addr, balance) + }, + false, false, + 0, + fmt.Errorf("gasWanted(%d) + gasLimit(%d) overflow", maxGasLimitTx.GetGas(), tx2.GetGas()), }, { "success - legacy tx", @@ -264,6 +306,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { }, true, false, tx2Priority, + nil, }, { "success - dynamic fee tx", @@ -275,6 +318,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { }, true, false, dynamicFeeTxPriority, + nil, }, { "success - gas limit on gasMeter is set on ReCheckTx mode", @@ -286,6 +330,7 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { }, true, false, 1, + nil, }, } @@ -313,7 +358,11 @@ func (suite *AnteTestSuite) TestEthGasConsumeDecorator() { suite.Require().NoError(err) suite.Require().Equal(tc.expPriority, ctx.Priority()) } else { - suite.Require().Error(err) + if tc.err != nil { + suite.Require().ErrorContains(err, tc.err.Error()) + } else { + suite.Require().Error(err) + } } suite.Require().Equal(tc.gasLimit, ctx.GasMeter().Limit()) }) @@ -353,11 +402,24 @@ func (suite *AnteTestSuite) TestCanTransferDecorator() { nil, ðtypes.AccessList{}, ) + tx3 := evmtypes.NewTxContract( + suite.app.EvmKeeper.ChainID(), + 1, + big.NewInt(-10), + 1000, + big.NewInt(150), + big.NewInt(200), + nil, + nil, + ðtypes.AccessList{}, + ) - tx.From = addr.Bytes() + for _, tx := range []*evmtypes.MsgEthereumTx{tx, tx3} { + tx.From = addr.Bytes() - err := tx.Sign(suite.ethSigner, tests.NewSigner(privKey)) - suite.Require().NoError(err) + err := tx.Sign(suite.ethSigner, tests.NewSigner(privKey)) + suite.Require().NoError(err) + } var vmdb *statedb.StateDB @@ -369,6 +431,7 @@ func (suite *AnteTestSuite) TestCanTransferDecorator() { }{ {"invalid transaction type", &invalidTx{}, func() {}, false}, {"AsMessage failed", tx2, func() {}, false}, + {"negative value", tx3, func() {}, false}, { "evm CanTransfer failed", tx, @@ -453,7 +516,7 @@ func (suite *AnteTestSuite) TestEthIncrementSenderSequenceDecorator() { "account not set to store", tx, func() {}, - false, false, + true, false, }, { "success - create contract", @@ -475,15 +538,16 @@ func (suite *AnteTestSuite) TestEthIncrementSenderSequenceDecorator() { for _, tc := range testCases { suite.Run(tc.name, func() { tc.malleate() + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) if tc.expPanic { suite.Require().Panics(func() { - _ = ante.CheckEthSenderNonce(suite.ctx, tc.tx, suite.app.AccountKeeper) + _ = ante.CheckAndSetEthSenderNonce(suite.ctx, tc.tx, suite.app.AccountKeeper, false, accountGetter) }) return } - err := ante.CheckEthSenderNonce(suite.ctx, tc.tx, suite.app.AccountKeeper) + err := ante.CheckAndSetEthSenderNonce(suite.ctx, tc.tx, suite.app.AccountKeeper, false, accountGetter) if tc.expPass { suite.Require().NoError(err) diff --git a/app/ante/fee_checker.go b/app/ante/fee_checker.go index 3a97ecb0b2..53b890311b 100644 --- a/app/ante/fee_checker.go +++ b/app/ante/fee_checker.go @@ -118,7 +118,10 @@ func checkTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, } feeCoins := feeTx.GetFee() - gas := feeTx.GetGas() + gas, err := ethermint.SafeInt64(feeTx.GetGas()) + if err != nil { + return nil, 0, err + } minGasPrices := ctx.MinGasPrices() // Ensure that the provided fees meet a minimum threshold for the validator, @@ -129,7 +132,7 @@ func checkTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdkmath.LegacyNewDec(int64(gas)) + glDec := sdkmath.LegacyNewDec(gas) for i, gp := range minGasPrices { fee := gp.Amount.Mul(glDec) @@ -141,7 +144,7 @@ func checkTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, } } - priority := getTxPriority(feeCoins, int64(gas)) + priority := getTxPriority(feeCoins, gas) return feeCoins, priority, nil } diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 2d50fcc3f6..ccf446a88a 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -32,6 +32,8 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" ) +const EthSigVerificationResultCacheKey = "ante:EthSigVerificationResult" + // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC // channel keeper, EVM Keeper and Fee Market Keeper. type HandlerOptions struct { @@ -50,6 +52,9 @@ type HandlerOptions struct { DisabledAuthzMsgs []string ExtraDecorators []sdk.AnteDecorator PendingTxListener PendingTxListener + + // see #494, just for benchmark, don't turn on on production + UnsafeUnorderedTx bool } func (options HandlerOptions) validate() error { @@ -82,7 +87,6 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { feemarketParams := &blockCfg.FeeMarketParams baseFee := blockCfg.BaseFee rules := blockCfg.Rules - ethSigner := ethtypes.MakeSigner(blockCfg.ChainConfig, blockCfg.BlockNumber) // all transactions must implement FeeTx _, ok := tx.(sdk.FeeTx) @@ -108,11 +112,24 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { return ctx, err } - if err := VerifyEthSig(tx, ethSigner); err != nil { + if v, ok := ctx.GetIncarnationCache(EthSigVerificationResultCacheKey); ok { + if v != nil { + err = v.(error) + } + } else { + ethSigner := ethtypes.MakeSigner(blockCfg.ChainConfig, blockCfg.BlockNumber) + err = VerifyEthSig(tx, ethSigner) + ctx.SetIncarnationCache(EthSigVerificationResultCacheKey, err) + } + if err != nil { return ctx, err } - if err := VerifyEthAccount(ctx, tx, options.EvmKeeper, options.AccountKeeper, evmDenom); err != nil { + // AccountGetter cache the account objects during the ante handler execution, + // it's safe because there's no store branching in the ante handlers. + accountGetter := NewCachedAccountGetter(ctx, options.AccountKeeper) + + if err := VerifyEthAccount(ctx, tx, options.EvmKeeper, evmDenom, accountGetter); err != nil { return ctx, err } @@ -128,7 +145,7 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { return ctx, err } - if err := CheckEthSenderNonce(ctx, tx, options.AccountKeeper); err != nil { + if err := CheckAndSetEthSenderNonce(ctx, tx, options.AccountKeeper, options.UnsafeUnorderedTx, accountGetter); err != nil { return ctx, err } diff --git a/app/app.go b/app/app.go index df5399df18..112f7f1b11 100644 --- a/app/app.go +++ b/app/app.go @@ -23,6 +23,7 @@ import ( "net/http" "os" "path/filepath" + "slices" "sort" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" @@ -31,6 +32,7 @@ import ( "cosmossdk.io/core/appmodule" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/gogoproto/proto" "github.com/gorilla/mux" @@ -75,6 +77,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/posthandler" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -120,7 +123,7 @@ import ( 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" - ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" @@ -272,9 +275,14 @@ func NewEthermintApp( // NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx // Setup Mempool and Proposal Handlers baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) { + maxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs)) + if maxTxs <= 0 { + maxTxs = srvconfig.DefaultMaxTxs + } mempool := mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{ TxPriority: mempool.NewDefaultTxPriority(), SignerExtractor: NewEthSignerExtractionAdapter(mempool.NewDefaultSignerExtractionAdapter()), + MaxTx: maxTxs, }) handler := baseapp.NewDefaultProposalHandler(mempool, app) @@ -332,18 +340,6 @@ func NewEthermintApp( okeys: okeys, } - executor := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) - switch executor { - case srvconfig.BlockExecutorBlockSTM: - sdk.SetAddrCacheEnabled(false) - workers := cast.ToInt(appOpts.Get(srvflags.EVMBlockSTMWorkers)) - app.SetTxExecutor(STMTxExecutor(app.GetStoreKeys(), workers)) - case "", srvconfig.BlockExecutorSequential: - app.SetTxExecutor(DefaultTxExecutor) - default: - panic(fmt.Errorf("unknown EVM block executor: %s", executor)) - } - // init params keeper and subspaces app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) @@ -387,6 +383,21 @@ func NewEthermintApp( authAddr, logger, ) + // optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper) + enabledSignModes := slices.Clone(authtx.DefaultSignModes) + enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err := authtx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig app.StakingKeeper = stakingkeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), @@ -798,6 +809,19 @@ func NewEthermintApp( app.ScopedIBCKeeper = scopedIBCKeeper app.ScopedTransferKeeper = scopedTransferKeeper + executor := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) + switch executor { + case srvconfig.BlockExecutorBlockSTM: + sdk.SetAddrCacheEnabled(false) + workers := cast.ToInt(appOpts.Get(srvflags.EVMBlockSTMWorkers)) + preEstimate := cast.ToBool(appOpts.Get(srvflags.EVMBlockSTMPreEstimate)) + app.SetTxExecutor(STMTxExecutor(app.GetStoreKeys(), workers, preEstimate, app.EvmKeeper, txConfig.TxDecoder())) + case "", srvconfig.BlockExecutorSequential: + app.SetTxExecutor(DefaultTxExecutor) + default: + panic(fmt.Errorf("unknown EVM block executor: %s", executor)) + } + return app } @@ -818,6 +842,8 @@ func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted u DisabledAuthzMsgs: []string{ sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), sdk.MsgTypeURL(&vestingtypes.MsgCreateVestingAccount{}), + sdk.MsgTypeURL(&vestingtypes.MsgCreatePermanentLockedAccount{}), + sdk.MsgTypeURL(&vestingtypes.MsgCreatePeriodicVestingAccount{}), }, PendingTxListener: app.onPendingTx, }) @@ -1021,6 +1047,7 @@ func (app *EthermintApp) SimulationManager() *module.SimulationManager { // API server. func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx + app.EvmKeeper.WithChainIDString(clientCtx.ChainID) // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. diff --git a/app/executor.go b/app/executor.go index 8086e49327..1cff225d61 100644 --- a/app/executor.go +++ b/app/executor.go @@ -3,53 +3,115 @@ package app import ( "context" "io" + "sync" + "sync/atomic" + "cosmossdk.io/collections" + "cosmossdk.io/log" "cosmossdk.io/store/cachemulti" storetypes "cosmossdk.io/store/types" abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" blockstm "github.com/crypto-org-chain/go-block-stm" ) +const MinimalParallelPreEstimate = 16 + func DefaultTxExecutor(_ context.Context, - blockSize int, + txs [][]byte, ms storetypes.MultiStore, - deliverTxWithMultiStore func(int, storetypes.MultiStore) *abci.ExecTxResult, + deliverTxWithMultiStore func(int, sdk.Tx, storetypes.MultiStore, map[string]any) *abci.ExecTxResult, ) ([]*abci.ExecTxResult, error) { + blockSize := len(txs) results := make([]*abci.ExecTxResult, blockSize) for i := 0; i < blockSize; i++ { - results[i] = deliverTxWithMultiStore(i, ms) + results[i] = deliverTxWithMultiStore(i, nil, ms, nil) } return evmtypes.PatchTxResponses(results), nil } -func STMTxExecutor(stores []storetypes.StoreKey, workers int) baseapp.TxExecutor { +type evmKeeper interface { + GetParams(ctx sdk.Context) evmtypes.Params +} + +func STMTxExecutor( + stores []storetypes.StoreKey, + workers int, + estimate bool, + evmKeeper evmKeeper, + txDecoder sdk.TxDecoder, +) baseapp.TxExecutor { + var authStore, bankStore int index := make(map[storetypes.StoreKey]int, len(stores)) for i, k := range stores { + switch k.Name() { + case authtypes.StoreKey: + authStore = i + case banktypes.StoreKey: + bankStore = i + } index[k] = i } return func( ctx context.Context, - blockSize int, + txs [][]byte, ms storetypes.MultiStore, - deliverTxWithMultiStore func(int, storetypes.MultiStore) *abci.ExecTxResult, + deliverTxWithMultiStore func(int, sdk.Tx, storetypes.MultiStore, map[string]any) *abci.ExecTxResult, ) ([]*abci.ExecTxResult, error) { + blockSize := len(txs) if blockSize == 0 { return nil, nil } results := make([]*abci.ExecTxResult, blockSize) - if err := blockstm.ExecuteBlock( + incarnationCache := make([]atomic.Pointer[map[string]any], blockSize) + for i := 0; i < blockSize; i++ { + m := make(map[string]any) + incarnationCache[i].Store(&m) + } + + var ( + estimates []blockstm.MultiLocations + memTxs []sdk.Tx + ) + if estimate { + // pre-estimation + evmDenom := evmKeeper.GetParams(sdk.NewContext(ms, cmtproto.Header{}, false, log.NewNopLogger())).EvmDenom + memTxs, estimates = preEstimates(txs, workers, authStore, bankStore, evmDenom, txDecoder) + } + + if err := blockstm.ExecuteBlockWithEstimates( ctx, blockSize, index, stmMultiStoreWrapper{ms}, workers, + estimates, func(txn blockstm.TxnIndex, ms blockstm.MultiStore) { - result := deliverTxWithMultiStore(int(txn), msWrapper{ms}) - results[txn] = result + var cache map[string]any + + // only one of the concurrent incarnations gets the cache if there are any, otherwise execute without + // cache, concurrent incarnations should be rare. + v := incarnationCache[txn].Swap(nil) + if v != nil { + cache = *v + } + + var memTx sdk.Tx + if memTxs != nil { + memTx = memTxs[txn] + } + results[txn] = deliverTxWithMultiStore(int(txn), memTx, msWrapper{ms}, cache) + + if v != nil { + incarnationCache[txn].Store(v) + } }, ); err != nil { return nil, err @@ -127,3 +189,68 @@ func (ms stmMultiStoreWrapper) GetKVStore(key storetypes.StoreKey) storetypes.KV func (ms stmMultiStoreWrapper) GetObjKVStore(key storetypes.StoreKey) storetypes.ObjKVStore { return ms.MultiStore.GetObjKVStore(key) } + +// preEstimates returns a static estimation of the written keys for each transaction. +// NOTE: make sure it sync with the latest sdk logic when sdk upgrade. +func preEstimates(txs [][]byte, workers, authStore, bankStore int, evmDenom string, txDecoder sdk.TxDecoder) ([]sdk.Tx, []blockstm.MultiLocations) { + memTxs := make([]sdk.Tx, len(txs)) + estimates := make([]blockstm.MultiLocations, len(txs)) + + job := func(start, end int) { + for i := start; i < end; i++ { + rawTx := txs[i] + tx, err := txDecoder(rawTx) + if err != nil { + continue + } + memTxs[i] = tx + + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + continue + } + feePayer := sdk.AccAddress(feeTx.FeePayer()) + + // account key + accKey, err := collections.EncodeKeyWithPrefix( + authtypes.AddressStoreKeyPrefix, + sdk.AccAddressKey, + feePayer, + ) + if err != nil { + continue + } + + // balance key + balanceKey, err := collections.EncodeKeyWithPrefix( + banktypes.BalancesPrefix, + collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), + collections.Join(feePayer, evmDenom), + ) + if err != nil { + continue + } + + estimates[i] = blockstm.MultiLocations{ + authStore: {accKey}, + bankStore: {balanceKey}, + } + } + } + + blockSize := len(txs) + chunk := (blockSize + workers - 1) / workers + var wg sync.WaitGroup + for i := 0; i < blockSize; i += chunk { + start := i + end := min(i+chunk, blockSize) + wg.Add(1) + go func() { + defer wg.Done() + job(start, end) + }() + } + wg.Wait() + + return memTxs, estimates +} diff --git a/app/upgrades.go b/app/upgrades.go index f6289b9e20..bc1f660a43 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -19,14 +19,28 @@ import ( "context" upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + evmtypes "github.com/evmos/ethermint/x/evm/types" ) func (app *EthermintApp) RegisterUpgradeHandlers() { planName := "sdk50" app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + m, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM) + if err != nil { + return m, err + } + sdkCtx := sdk.UnwrapSDKContext(ctx) + { + params := app.EvmKeeper.GetParams(sdkCtx) + params.HeaderHashNum = evmtypes.DefaultHeaderHashNum + if err := app.EvmKeeper.SetParams(sdkCtx, params); err != nil { + return m, err + } + } + return m, nil }, ) } diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index e8c1d48c18..eaa4cc6a98 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -140,6 +140,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -179,7 +183,6 @@ paths: name "y.z". - JSON @@ -357,6 +360,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -396,7 +403,6 @@ paths: name "y.z". - JSON @@ -574,6 +580,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -613,7 +623,6 @@ paths: name "y.z". - JSON @@ -784,6 +793,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -823,7 +836,6 @@ paths: name "y.z". - JSON @@ -1009,6 +1021,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -1048,7 +1064,6 @@ paths: name "y.z". - JSON @@ -1234,6 +1249,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -1273,7 +1292,6 @@ paths: name "y.z". - JSON @@ -1572,6 +1590,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -1611,7 +1633,6 @@ paths: name "y.z". - JSON @@ -1828,7 +1849,7 @@ paths: prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters - using *sdk.Int values + using *sdkmath.Int values instead of *big.Int. allow_unprotected_txs: @@ -1838,6 +1859,10 @@ paths: EIP155 signed) transactions can be executed on the state machine. + header_hash_num: + type: string + format: uint64 + description: header_hash_num is the number of header hash to persist. title: Params defines the EVM module parameters description: >- QueryParamsResponse defines the response type for querying x/evm @@ -1955,6 +1980,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -1994,7 +2023,6 @@ paths: name "y.z". - JSON @@ -2168,6 +2196,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -2207,7 +2239,6 @@ paths: name "y.z". - JSON @@ -2389,6 +2420,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -2428,7 +2463,6 @@ paths: name "y.z". - JSON @@ -2833,6 +2867,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -2872,7 +2910,6 @@ paths: name "y.z". - JSON @@ -3289,6 +3326,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -3328,7 +3369,6 @@ paths: name "y.z". - JSON @@ -3434,7 +3474,7 @@ paths: required: false type: number format: double - - name: msg.hash + - name: msg.deprecated_hash description: hash of the transaction in hex format. in: query required: false @@ -3455,6 +3495,12 @@ paths: required: false type: string format: byte + - name: msg.raw + description: raw is the raw bytes of the ethereum transaction. + in: query + required: false + type: string + format: byte - name: trace_config.tracer description: tracer is a custom javascript tracer. in: query @@ -3835,6 +3881,10 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -3874,7 +3924,6 @@ paths: name "y.z". - JSON @@ -4014,7 +4063,7 @@ definitions: type: string title: prague switch time (nil = no fork, 0 = already on prague) description: >- - ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int + ChainConfig defines the Ethereum ChainConfig parameters using *sdkmath.Int values instead of *big.Int. @@ -4187,6 +4236,10 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -4222,7 +4275,6 @@ definitions: name "y.z". - JSON @@ -4261,7 +4313,7 @@ definitions: type: number format: double title: size is the encoded storage size of the transaction (DEPRECATED) - hash: + deprecated_hash: type: string title: hash of the transaction in hex format deprecated_from: @@ -4276,6 +4328,10 @@ definitions: against the address derived from the signature (V, R, S) using the secp256k1 elliptic curve + raw: + type: string + format: byte + title: raw is the raw bytes of the ethereum transaction description: MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. ethermint.evm.v1.MsgEthereumTxResponse: type: object @@ -4488,8 +4544,8 @@ definitions: type: string title: prague switch time (nil = no fork, 0 = already on prague) description: >- - ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int - values + ChainConfig defines the Ethereum ChainConfig parameters using + *sdkmath.Int values instead of *big.Int. allow_unprotected_txs: @@ -4497,6 +4553,10 @@ definitions: description: |- allow_unprotected_txs defines if replay-protected (i.e non EIP155 signed) transactions can be executed on the state machine. + header_hash_num: + type: string + format: uint64 + description: header_hash_num is the number of header hash to persist. title: Params defines the EVM module parameters ethermint.evm.v1.QueryAccountResponse: type: object @@ -4685,7 +4745,7 @@ definitions: title: prague switch time (nil = no fork, 0 = already on prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using - *sdk.Int values + *sdkmath.Int values instead of *big.Int. allow_unprotected_txs: @@ -4693,6 +4753,10 @@ definitions: description: |- allow_unprotected_txs defines if replay-protected (i.e non EIP155 signed) transactions can be executed on the state machine. + header_hash_num: + type: string + format: uint64 + description: header_hash_num is the number of header hash to persist. title: Params defines the EVM module parameters description: >- QueryParamsResponse defines the response type for querying x/evm @@ -4874,8 +4938,8 @@ definitions: type: string title: prague switch time (nil = no fork, 0 = already on prague) description: >- - ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int - values + ChainConfig defines the Ethereum ChainConfig parameters using + *sdkmath.Int values instead of *big.Int. enable_memory: @@ -4986,6 +5050,10 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -5021,7 +5089,6 @@ definitions: name "y.z". - JSON @@ -5162,6 +5229,10 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } Example 3: Pack and unpack a message in Python. @@ -5197,7 +5268,6 @@ definitions: name "y.z". - JSON diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index 5d03d32d56..02501654da 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -19,6 +19,7 @@ import ( "errors" "io" "os" + "slices" "github.com/spf13/cobra" @@ -38,12 +39,12 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/crypto/keyring" sdkserver "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/client/debug" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -66,14 +67,13 @@ const ( ChainID = "ethermint_9000-1" ) -type emptyAppOptions struct{} - -func (ao emptyAppOptions) Get(_ string) interface{} { return nil } - // NewRootCmd creates a new root command for simd. It is called once in the // main function. func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { - tempApp := app.NewEthermintApp(cmtlog.NewNopLogger(), dbm.NewMemDB(), nil, true, emptyAppOptions{}) + tempApp := app.NewEthermintApp( + cmtlog.NewNopLogger(), dbm.NewMemDB(), nil, true, + simtestutil.NewAppOptionsWithFlagHome(app.DefaultNodeHome), + ) encodingConfig := tempApp.EncodingConfig() initClientCtx := client.Context{}. WithCodec(encodingConfig.Codec). @@ -87,6 +87,11 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { WithKeyringOptions(hd.EthSecp256k1Option()). WithViper(EnvPrefix) + initClientCtx, err := clientcfg.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) + if err != nil { + panic(err) + } + eip712.SetEncodingConfig(encodingConfig) rootCmd := &cobra.Command{ @@ -97,6 +102,7 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { cmd.SetOut(cmd.OutOrStdout()) cmd.SetErr(cmd.ErrOrStderr()) + initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) if err != nil { return err @@ -111,8 +117,10 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode // is only available if the client is online. if !initClientCtx.Offline { + enabledSignModes := slices.Clone(tx.DefaultSignModes) + enabledSignModes = append(enabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) txConfigOpts := tx.ConfigOptions{ - EnabledSignModes: append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL), + EnabledSignModes: enabledSignModes, TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), } txConfig, err := tx.NewTxConfigWithOptions( @@ -142,7 +150,6 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { initRootCmd(rootCmd, encodingConfig, tempApp.BasicModuleManager) autoCliOpts := tempApp.AutoCliOpts() initClientCtx, _ = clientcfg.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) - autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { panic(err) diff --git a/ethereum/eip712/domain.go b/ethereum/eip712/domain.go index 5c63df4299..6390d53e9e 100644 --- a/ethereum/eip712/domain.go +++ b/ethereum/eip712/domain.go @@ -21,11 +21,11 @@ import ( ) // createEIP712Domain creates the typed data domain for the given chainID. -func createEIP712Domain(chainID uint64) apitypes.TypedDataDomain { +func createEIP712Domain(chainID int64) apitypes.TypedDataDomain { domain := apitypes.TypedDataDomain{ Name: "Cosmos Web3", Version: "1.0.0", - ChainId: math.NewHexOrDecimal256(int64(chainID)), // #nosec G701 + ChainId: math.NewHexOrDecimal256(chainID), VerifyingContract: "cosmos", Salt: "0", } diff --git a/ethereum/eip712/eip712.go b/ethereum/eip712/eip712.go index cef97b31b1..e87de9491e 100644 --- a/ethereum/eip712/eip712.go +++ b/ethereum/eip712/eip712.go @@ -17,6 +17,7 @@ package eip712 import ( "github.com/ethereum/go-ethereum/signer/core/apitypes" + ethermint "github.com/evmos/ethermint/types" ) // WrapTxToTypedData wraps an Amino-encoded Cosmos Tx JSON SignDoc @@ -36,7 +37,11 @@ func WrapTxToTypedData( return apitypes.TypedData{}, err } - domain := createEIP712Domain(chainID) + value, err := ethermint.SafeInt64(chainID) + if err != nil { + return apitypes.TypedData{}, err + } + domain := createEIP712Domain(value) typedData := apitypes.TypedData{ Types: types, diff --git a/ethereum/eip712/eip712_legacy.go b/ethereum/eip712/eip712_legacy.go index e093065ee2..57b3376b0a 100644 --- a/ethereum/eip712/eip712_legacy.go +++ b/ethereum/eip712/eip712_legacy.go @@ -29,6 +29,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" + ethermint "github.com/evmos/ethermint/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" @@ -52,6 +53,10 @@ func LegacyWrapTxToTypedData( data []byte, feeDelegation *FeeDelegationOptions, ) (apitypes.TypedData, error) { + value, err := ethermint.SafeInt64(chainID) + if err != nil { + return apitypes.TypedData{}, err + } txData := make(map[string]interface{}) if err := json.Unmarshal(data, &txData); err != nil { @@ -61,7 +66,7 @@ func LegacyWrapTxToTypedData( domain := apitypes.TypedDataDomain{ Name: "Cosmos Web3", Version: "1.0.0", - ChainId: math.NewHexOrDecimal256(int64(chainID)), + ChainId: math.NewHexOrDecimal256(value), VerifyingContract: "cosmos", Salt: "0", } diff --git a/flake.lock b/flake.lock index d316e6910e..bf3b2f9809 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1710154385, - "narHash": "sha256-4c3zQ2YY4BZOufaBJB4v9VBBeN2dH7iVdoJw8SDNCfI=", + "lastModified": 1729448365, + "narHash": "sha256-oquZeWTYWTr5IxfwEzgsxjtD8SSFZYLdO9DaQb70vNU=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "872b63ddd28f318489c929d25f1f0a3c6039c971", + "rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c", "type": "github" }, "original": { @@ -49,11 +49,11 @@ ] }, "locked": { - "lastModified": 1703863825, - "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", "owner": "nix-community", "repo": "nix-github-actions", - "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", "type": "github" }, "original": { @@ -64,11 +64,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710283812, - "narHash": "sha256-F+s4//HwNEXtgxZ6PLoe5khDTmUukPYbjCvx7us2vww=", + "lastModified": 1730272153, + "narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "73bf415737ceb66a6298f806f600cfe4dccd0a41", + "rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", "type": "github" }, "original": { @@ -91,11 +91,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1708589824, - "narHash": "sha256-2GOiFTkvs5MtVF65sC78KNVxQSmsxtk0WmV1wJ9V2ck=", + "lastModified": 1730284601, + "narHash": "sha256-eHYcKVLIRRv3J1vjmxurS6HVdGphB53qxUeAkylYrZY=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "3c92540611f42d3fb2d0d084a6c694cd6544b609", + "rev": "43a898b4d76f7f3f70df77a2cc2d40096bc9d75e", "type": "github" }, "original": { @@ -149,11 +149,11 @@ ] }, "locked": { - "lastModified": 1708335038, - "narHash": "sha256-ETLZNFBVCabo7lJrpjD6cAbnE11eDOjaQnznmg/6hAE=", + "lastModified": 1730120726, + "narHash": "sha256-LqHYIxMrl/1p3/kvm2ir925tZ8DkI0KA10djk8wecSk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "e504621290a1fd896631ddbc5e9c16f4366c9f65", + "rev": "9ef337e492a5555d8e17a51c911ff1f02635be15", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0d86cd34d5..e48e77e182 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,7 @@ ) ) // { overlay = final: super: { - go = super.go_1_22; + go = super.go_1_23; test-env = final.callPackage ./nix/testenv.nix { }; }; }; diff --git a/go.mod b/go.mod index 9c2283c1ae..8169c56b1d 100644 --- a/go.mod +++ b/go.mod @@ -1,72 +1,73 @@ module github.com/evmos/ethermint -go 1.21 +go 1.22.7 -toolchain go1.21.5 +toolchain go1.23.1 require ( - cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.1 - cosmossdk.io/core v0.11.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/client/v2 v2.0.0-beta.5 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.1 - cosmossdk.io/x/evidence v0.1.0 - cosmossdk.io/x/feegrant v0.1.0 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.1 - github.com/btcsuite/btcd v0.23.4 - github.com/btcsuite/btcd/btcutil v1.1.3 - github.com/cometbft/cometbft v0.38.7 - github.com/cosmos/cosmos-db v1.0.2 + cosmossdk.io/store v1.1.1 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.6-0.20241003112805-ff8789a02871 + cosmossdk.io/x/upgrade v0.1.4 + github.com/btcsuite/btcd v0.24.2 + github.com/btcsuite/btcd/btcutil v1.1.6 + github.com/cometbft/cometbft v0.38.13-0.20240920204745-fdf90d16f608 + github.com/cosmos/cosmos-db v1.0.3-0.20240408151834-e75f6e4b28d8 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.12 - github.com/cosmos/ibc-go/modules/capability v1.0.0 - github.com/cosmos/ibc-go/v8 v8.1.0 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/v8 v8.5.1 github.com/cosmos/rosetta v0.50.3-1 - github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde + github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/ethereum/go-ethereum v1.10.26 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 - github.com/gorilla/websocket v1.5.1 + github.com/gorilla/websocket v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-metrics v0.5.3 github.com/improbable-eng/grpc-web v0.15.0 github.com/onsi/ginkgo/v2 v2.7.0 github.com/onsi/gomega v1.26.0 github.com/pkg/errors v0.9.1 - github.com/rs/cors v1.10.1 + github.com/rs/cors v1.11.1 github.com/spf13/cast v1.6.0 - github.com/spf13/cobra v1.8.0 - github.com/spf13/viper v1.18.2 + github.com/spf13/cobra v1.8.1 + github.com/spf13/viper v1.19.0 github.com/status-im/keycard-go v0.2.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.14.4 github.com/tidwall/sjson v1.2.5 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/net v0.24.0 - golang.org/x/sync v0.7.0 - golang.org/x/text v0.14.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + golang.org/x/net v0.29.0 + golang.org/x/sync v0.8.0 + golang.org/x/text v0.19.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 + google.golang.org/grpc v1.67.1 + google.golang.org/protobuf v1.34.2 sigs.k8s.io/yaml v1.4.0 ) require ( - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.24.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + cloud.google.com/go/iam v1.1.9 // indirect + cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -81,23 +82,24 @@ require ( 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/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/cometbft/cometbft-db v0.9.1 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.1.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect @@ -106,9 +108,8 @@ require ( github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -131,28 +132,30 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.2 // 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.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/btree v1.1.2 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // 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/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.3 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-plugin v1.6.0 // 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/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.2.0 // indirect @@ -165,38 +168,38 @@ require ( 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.17.7 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/linxGnu/grocksdb v1.8.14 // 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.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // 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.1 // indirect - github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.33.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/sasha-s/go-deadlock v0.3.5 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -213,26 +216,25 @@ require ( github.com/ulikunitz/xz v0.5.11 // 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.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.20.0 // indirect - google.golang.org/api v0.162.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + golang.org/x/tools v0.22.0 // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // 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 @@ -243,18 +245,18 @@ require ( replace ( // release/v0.50.x - cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240604100318-cf12e5ad62e4 - cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 - cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4 - github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 + cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241015015202-783e224f9517 + cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241015015202-783e224f9517 + github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20241015015202-783e224f9517 ) replace ( // use cosmos keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cockroachdb/pebble => github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 + // v0.38.x + github.com/cometbft/cometbft => github.com/crypto-org-chain/cometbft v0.0.0-20241101110921-cee5fa03c9ba // release/v1.11.x - github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 + github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20241030073450-b9cc632bc183 // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 diff --git a/go.sum b/go.sum index 72e7660c6e..34c01955a1 100644 --- a/go.sum +++ b/go.sum @@ -30,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.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= 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= @@ -46,6 +46,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -68,10 +72,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.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= -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/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -109,8 +111,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.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= 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= @@ -171,8 +173,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 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.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0= +cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= 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= @@ -184,30 +186,32 @@ 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= -cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= -cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.5 h1:0LVv3nEByn//hFDIrYLs2WvsEU3HodOelh4SDHnA/1I= +cosmossdk.io/client/v2 v2.0.0-beta.5/go.mod h1:4p0P6o0ro+FizakJUYS9SeM94RNbv0thLmkHRw5o5as= 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/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= 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/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -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/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= -cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -227,7 +231,6 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc 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= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -237,8 +240,8 @@ 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= -github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= 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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -253,7 +256,6 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd 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-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= @@ -277,20 +279,22 @@ github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5M 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.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= -github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd v0.23.4 h1:IzV6qqkfwbItOS/sg/aDfPDsjPP8twrCOE2R93hxMlQ= -github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= +github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= +github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg= 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.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -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/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/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-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= @@ -311,7 +315,6 @@ github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -339,40 +342,38 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= 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/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= -github.com/cockroachdb/datadriven v1.0.2/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/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.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= 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 v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= -github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= 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/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= -github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= -github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= 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= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 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-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/cosmos-db v1.0.3-0.20240408151834-e75f6e4b28d8 h1:QV1tpwwqSPWcs1Hy07Y5JHfa61bE/Cz+blqKtuaz86c= +github.com/cosmos/cosmos-db v1.0.3-0.20240408151834-e75f6e4b28d8/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -380,16 +381,16 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x 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.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= -github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= -github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= -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/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= +github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= 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.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -398,11 +399,9 @@ github.com/cosmos/rosetta v0.50.3-1 h1:tqBTfS2I+SIT28zmlKHV/87qPELYrj5Dr5Z68EJvv github.com/cosmos/rosetta v0.50.3-1/go.mod h1:aayFO1rJpgOENMJPTm5TKJ8S8wIZoIfDjPot9xkMS5k= 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/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.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/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= @@ -411,18 +410,18 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+FBB8cMkDE2j2VBVsbY+HCkPIu0YsJ/9bbGeQ= github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 h1:tU2H8foSm+CVtU9HPEephknr3C6mTrVeSERwRUs6yFY= -github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic= -github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240604100318-cf12e5ad62e4 h1:ucFYZpOSYOi5BE96Y782iuczZK7d6ZJVhUoQ3ijrgf4= -github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240604100318-cf12e5ad62e4/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 h1:aW5FkDdXGz+Nl9W5bkTTxkleEo3CNGLl78nU5CxikhQ= -github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4 h1:0SAVpeeKAJQLX+5aygBW57EIyVNtvYXXWs9zDusblKk= -github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY= -github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM= -github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= -github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 h1:V43F3JFcqG4MUThf9W/DytnPblpR6CcaLBw2Wx6zTgE= -github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7/go.mod h1:+a8pUj1tOyJ2RinsNQD4326YS+leSoKGiG/uVVb0x6Y= +github.com/crypto-org-chain/cometbft v0.0.0-20241101110921-cee5fa03c9ba h1:g3uPF40faoyCZsRRyS1aljDGNSZmDP44e4VjRl8k1Ik= +github.com/crypto-org-chain/cometbft v0.0.0-20241101110921-cee5fa03c9ba/go.mod h1:7v7mf87Zd7umLS1rtRs4Z4wgUqs2stVPZza0eMLWd/Y= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20241015015202-783e224f9517 h1:iRnJMiquXPE3OpVX8ENCrcstfd7mI206yC3Bkl6WeK4= +github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20241015015202-783e224f9517/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241015015202-783e224f9517 h1:y3i8TiU7E60zmbpLyo4PqrnwZaWNU3kizU+1OezuoA8= +github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241015015202-783e224f9517/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241015015202-783e224f9517 h1:CwheSMAqz+kYCFz/X4lZq3BJAWINm/hndzVkjOc/2mI= +github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241015015202-783e224f9517/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI= +github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= +github.com/crypto-org-chain/go-ethereum v1.10.20-0.20241030073450-b9cc632bc183 h1:JDBTqDkd9X9oBF2C4FKOpn0GVDQDzVkHzeS8eDWNl6A= +github.com/crypto-org-chain/go-ethereum v1.10.20-0.20241030073450-b9cc632bc183/go.mod h1:5DnkptqPQr+Mo3sy/2V3OQu+K94x1PVzFGZJZbDF8mI= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -441,9 +440,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3 github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= 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/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= 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= @@ -486,8 +484,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -569,8 +565,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= +github.com/golang/glog v1.2.2/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= @@ -614,8 +610,10 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXi github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/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= @@ -642,8 +640,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi 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/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= 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= @@ -682,8 +680,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -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/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -695,8 +693,9 @@ 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.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 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= @@ -716,8 +715,8 @@ 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.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= -github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/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= @@ -747,6 +746,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -813,10 +814,9 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= 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.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= 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/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -832,16 +832,13 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -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/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 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.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= 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/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= @@ -865,8 +862,8 @@ github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/Qd github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -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/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -888,6 +885,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 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= @@ -931,8 +930,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 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/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= 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= @@ -948,13 +947,11 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 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.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/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= @@ -975,8 +972,8 @@ 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.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= 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= @@ -991,16 +988,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 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.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= 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.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1012,13 +1009,11 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f 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.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -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/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= 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= @@ -1028,8 +1023,8 @@ github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgY 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/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 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= @@ -1038,8 +1033,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 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/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/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= @@ -1047,26 +1042,18 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ 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.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.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.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/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= 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.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= 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= @@ -1117,7 +1104,6 @@ github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqri 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/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/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= @@ -1128,7 +1114,6 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -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/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1142,8 +1127,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp 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.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= 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= @@ -1156,18 +1141,18 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1186,7 +1171,6 @@ go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1195,8 +1179,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U 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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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= @@ -1208,8 +1192,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-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= -golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= 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= @@ -1236,8 +1220,8 @@ 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.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= @@ -1298,8 +1282,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= 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= @@ -1325,8 +1309,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.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= @@ -1341,8 +1325,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.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= @@ -1351,8 +1335,6 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1361,7 +1343,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1441,13 +1422,14 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.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.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= 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= @@ -1457,10 +1439,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= 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= @@ -1529,8 +1510,8 @@ 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.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= 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= @@ -1538,8 +1519,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= 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= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= 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= @@ -1589,8 +1571,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.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= -google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= 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= @@ -1599,8 +1581,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww 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/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= @@ -1707,12 +1687,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-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= 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= @@ -1754,8 +1734,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.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= 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= @@ -1772,8 +1752,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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= diff --git a/gomod2nix.toml b/gomod2nix.toml index ec35a16cf6..f82c63568f 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -2,65 +2,67 @@ schema = 3 [mod] [mod."cloud.google.com/go"] - version = "v0.112.0" - hash = "sha256-lmNLoqmLURfxu+a6V/SeoP8xVn0Wi2SD7uxxAtSjm+o=" - [mod."cloud.google.com/go/compute"] - version = "v1.24.0" - hash = "sha256-icDjR0uxYeazRbhsBgl8Dx7z/oRZJ/iqK6CGjCtsaQQ=" + version = "v0.115.0" + hash = "sha256-FIfzk9JYArEfDnJtdXXHBrI4yTGzZPyefQm1O1ldez8=" + [mod."cloud.google.com/go/auth"] + version = "v0.6.0" + hash = "sha256-gOhYABjjNn62exyu2fzqUMJev9Tva6scdYVdaSHwrqo=" + [mod."cloud.google.com/go/auth/oauth2adapt"] + version = "v0.2.2" + hash = "sha256-rdgb3uWekFSfsMZeY7DqHr7Q8ELOwLIZO4W7t2Cvt40=" [mod."cloud.google.com/go/compute/metadata"] - version = "v0.2.3" - hash = "sha256-kYB1FTQRdTDqCqJzSU/jJYbVUGyxbkASUKbEs36FUyU=" + version = "v0.5.0" + hash = "sha256-IyVEEElHNPLTRFUMF8ymV3FfQEJQfEdTSeU5PodfOzA=" [mod."cloud.google.com/go/iam"] - version = "v1.1.6" - hash = "sha256-u91oZdyy/wgk3J8Z+4mWmn+YliSBIATu6kpyH20Dd8k=" + version = "v1.1.9" + hash = "sha256-xC4/ssYSWYXlGz9y5BrVKHizSM7bGV/gi10qvf9dvKA=" [mod."cloud.google.com/go/storage"] - version = "v1.36.0" - hash = "sha256-dRKH1NEyAfEpVo5Mma677L7z0JO9Mfd1bv1lr1uFngI=" + version = "v1.41.0" + hash = "sha256-y2/EHhY+gE/U8FdILHAfiCgZZHey8wn6e7N/smv5Yks=" [mod."cosmossdk.io/api"] - version = "v0.7.5" - hash = "sha256-Nuw697sJr56kU3EU7DV1eYNkyI76psznIVqYAV6RfbQ=" + version = "v0.7.6" + hash = "sha256-ubE78Xrsz+YQcOGyjpp/MwqUHwsGVbkcWXVzMFfFw0I=" [mod."cosmossdk.io/client/v2"] - version = "v2.0.0-20240604100318-cf12e5ad62e4" - hash = "sha256-60hmufv3Ml4Pv3zNwgn8eeqlEINOR6n9MKr2QHddoxo=" - replaced = "github.com/crypto-org-chain/cosmos-sdk/client/v2" + version = "v2.0.0-beta.5" + hash = "sha256-zivawuJLLbNn0zE9FRWjCtrpks7vlDprQ7DbNKqhwWc=" [mod."cosmossdk.io/collections"] version = "v0.4.0" hash = "sha256-minFyzgO/D+Oda4E3B1qvOAN5qd65SjS6nmjca4cp/8=" [mod."cosmossdk.io/core"] - version = "v0.11.0" - hash = "sha256-zUiOF04lWHK8OZqGhwVuzKYfig5I0107D+8fWX5/pbQ=" + version = "v0.11.1" + hash = "sha256-A857PYFy22B43qo8raLkstLOao7RRltt6TB+s3ZuuM4=" [mod."cosmossdk.io/depinject"] - version = "v1.0.0-alpha.4" - hash = "sha256-xpLH0K6ivQznFrLw2hmhWIIyYgqjstV47OhTEj/c1oQ=" + version = "v1.0.0" + hash = "sha256-dtsNfj5zUlX6e4YslzyegrebztmlLiBFvqDb2IHV+Zc=" [mod."cosmossdk.io/errors"] version = "v1.0.1" hash = "sha256-MgTocXkBzri9FKkNtkARJXPmxRrRO/diQJS5ZzvYrJY=" [mod."cosmossdk.io/log"] - version = "v1.3.1" - hash = "sha256-otkUvsz35VuuUWXoTmWBwR61+o6YzvWETGdLfwWDvwY=" + version = "v1.4.1" + hash = "sha256-pgI770MdI/OfZcK6UFmQ9iyPBgapz/ErrUe8WVO3iBg=" [mod."cosmossdk.io/math"] version = "v1.3.0" hash = "sha256-EEFK43Cr0g0ndhQhkIKher0FqV3mvkmE9z0sP7uVSHg=" [mod."cosmossdk.io/store"] - version = "v0.0.0-20240604100318-cf12e5ad62e4" - hash = "sha256-zne7cIFs9WLg11pIr9VLBBc+G+kZfKLn8UU1mP4w6BM=" + version = "v0.0.0-20241015015202-783e224f9517" + hash = "sha256-6MLZ2SPWwmpisfLmkZ9MOnL2/phjIUwo4EuVA6ORjYE=" replaced = "github.com/crypto-org-chain/cosmos-sdk/store" [mod."cosmossdk.io/tools/confix"] - version = "v0.1.1" - hash = "sha256-/Et2FFhb4XfakbLFvGQK3QxN5Y7alzO+DGfi2/EWbxo=" + version = "v0.1.2" + hash = "sha256-1VhdIdBDG7jaSiRTNYtoQ3WGaGm+vQ1Qf671zSiWAek=" [mod."cosmossdk.io/x/evidence"] - version = "v0.1.0" - hash = "sha256-ZhVrmCGOzx2yODpcgvM9c48jkqz37NwU2ln/uVuCEfc=" + version = "v0.1.1" + hash = "sha256-iSjMwFPu1InR6weF/m4hGHP+StsudOCqeDZefGPTfxw=" [mod."cosmossdk.io/x/feegrant"] - version = "v0.1.0" - hash = "sha256-/gWvrqvy6bW90+NU66T+9QysYgvG1VbwfYJZ8tkqpeA=" + version = "v0.1.1" + hash = "sha256-aps3LfnQau1TYeccGwtqHQvy1Rudc9+O+iVAwXBKyDw=" [mod."cosmossdk.io/x/tx"] - version = "v0.0.0-20240604100318-cf12e5ad62e4" - hash = "sha256-xT5IdapEx1h46ofBpxcBQfzGF2EntmC8xZl7aym/6xE=" + version = "v0.0.0-20241015015202-783e224f9517" + hash = "sha256-EEM93+QilFlUOTSR0RwbZYyyAnl70PXtJq8ZEGjxL3g=" replaced = "github.com/crypto-org-chain/cosmos-sdk/x/tx" [mod."cosmossdk.io/x/upgrade"] - version = "v0.1.1" - hash = "sha256-bM9ybpaibMH7k4M6/QAXCZ3fJcADfJHxvMgp4AVUihs=" + version = "v0.1.4" + hash = "sha256-lm0Ccc9zWs1ldWv1cArXuzRxq45zMir1ZNvoPY+9n7o=" [mod."filippo.io/edwards25519"] version = "v1.1.0" hash = "sha256-9ACANrgWZSd5HYPfDZHY8DVbPSC9LOMgy8deq3rDOoc=" @@ -105,23 +107,20 @@ schema = 3 version = "v1.8.0" hash = "sha256-ySle5MJXSGMHJa1HSf/ZMDTYXdow9ct7JXth4k5Po50=" [mod."github.com/btcsuite/btcd"] - version = "v0.23.4" - hash = "sha256-xP7TLBdOoUIjg5Q3MOjbT5P9tkCWjsd4bWgZLp539Wo=" + version = "v0.24.2" + hash = "sha256-ahlpwEr4KfyrEA899X07QtuSDnC8U+SnwL+z72DiK5E=" [mod."github.com/btcsuite/btcd/btcec/v2"] - version = "v2.3.2" - hash = "sha256-natWs+yIAuD1UI07iZtjPilroQLfXizFn3lNOiOT83U=" + version = "v2.3.4" + hash = "sha256-9fV41jYeTUrpoyu19LPuGBG/N9wFv6D6wVBE8R5WzRI=" [mod."github.com/btcsuite/btcd/btcutil"] - version = "v1.1.3" - hash = "sha256-6Y9sP1yvPBO8PhqmFVVXNV7dxsXlERDAB+TPTEfW3kI=" + version = "v1.1.6" + hash = "sha256-TYbwJLNX/+63nm+b3RqPH3ZIvTBnsm9peqJP05v9Z90=" [mod."github.com/btcsuite/btcd/chaincfg/chainhash"] - version = "v1.0.1" - hash = "sha256-vix0j/KGNvoKjhlKgVeSLY6un2FHeIEoZWMC4z3yvZ4=" + version = "v1.1.0" + hash = "sha256-F+EqvufC+KBslZV/vL8ph6MqDoVD5ic5rVaM27reDqo=" [mod."github.com/cenkalti/backoff/v4"] version = "v4.2.1" hash = "sha256-CKogmPe0pCcAdpztzPwr24rLTJZfq8QVZ9AUduwAcoA=" - [mod."github.com/cespare/xxhash"] - version = "v1.1.0" - hash = "sha256-nVDTtXH9PC3yJ0THaQZEN243UP9xgLi/clt5xRqj3+M=" [mod."github.com/cespare/xxhash/v2"] version = "v2.3.0" hash = "sha256-7hRlwSR+fos1kx4VZmJ/7snR7zHh8ZFKX+qqqqGcQpY=" @@ -132,39 +131,45 @@ schema = 3 version = "v2.0.2" hash = "sha256-UrPHkvqVF8V78+kXKmjTHl79XsgDBnqFsje5BMYh0E4=" [mod."github.com/cockroachdb/errors"] - version = "v1.11.1" - hash = "sha256-ufKtavyfW/i3ZemiqDqKGc0JM+f0IBi6bZWkZyb/jdc=" + version = "v1.11.3" + hash = "sha256-kDiT0MVVRnnQ0ugZWVHcZmv3UgwnxEW6xzt+mV22dTI=" + [mod."github.com/cockroachdb/fifo"] + version = "v0.0.0-20240606204812-0bbfbd93a7ce" + hash = "sha256-M/9/e4i7gXA2kYjSEMlQd94vijLLmWZVUXOKiFeINbk=" [mod."github.com/cockroachdb/logtags"] version = "v0.0.0-20230118201751-21c54148d20b" hash = "sha256-7dQH6j1o99fuxHKkw0RhNC5wJKkvRLMDJpUiVnDx6h8=" [mod."github.com/cockroachdb/pebble"] - version = "v0.0.0-20230209160836-829675f94811" - hash = "sha256-DpbEXN/YWWXap83lz99r6sAUUk76ixDe4fRn1GpBWpo=" - replaced = "github.com/cockroachdb/pebble" + version = "v1.1.2" + hash = "sha256-btyS8BkdGK15BtbIaPERmDQ2ayVw9S05ciJw1YhoTLk=" [mod."github.com/cockroachdb/redact"] version = "v1.1.5" hash = "sha256-0rtT7LRO0wxf9XovOK8GXRrhmx8OcbdPK/mXOKbJdog=" + [mod."github.com/cockroachdb/tokenbucket"] + version = "v0.0.0-20230807174530-cc333fc44b06" + hash = "sha256-yZdBXkTVzPxRYntI9I2Gu4gkI11m52Nwl8RNNdlXSrA=" [mod."github.com/coinbase/rosetta-sdk-go/types"] version = "v1.0.0" hash = "sha256-z/0E0NiEGo7zxM7d94ImgUf8P0/KG6hbP9T4Vuym4p0=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.7" - hash = "sha256-mN7L3Q4xZ0YcwMIRkIsodCzRPBZqrSKD7VgDHBOWM98=" + version = "v0.0.0-20241101110921-cee5fa03c9ba" + hash = "sha256-Zlu11cj2cv++ecqF9urfsGhPgfh6Q4Rk9WBlB1hcwX4=" + replaced = "github.com/crypto-org-chain/cometbft" [mod."github.com/cometbft/cometbft-db"] - version = "v0.9.1" - hash = "sha256-ftRdle5ok2aCyqT3u5rYY0jKB8WT8uDus26Pw4Mo1go=" + version = "v0.14.1" + hash = "sha256-QvWMRGsdgCsSfL+DHp3w1Bm4jXa14SeT7oRK3PiNGV0=" [mod."github.com/cosmos/btcutil"] version = "v1.0.5" hash = "sha256-t572Sr5iiHcuMKLMWa2i+LBAt192oa+G1oA371tG/eI=" [mod."github.com/cosmos/cosmos-db"] - version = "v1.0.2" - hash = "sha256-WjDoB2AGoIyEW30LlGcQX5JVACJbs0jWSY58IuJHz0M=" + version = "v1.0.3-0.20240408151834-e75f6e4b28d8" + hash = "sha256-8g+F6KqJD4UymXZjES5TG4FQ/Pyww2SjpXOOibyztRc=" [mod."github.com/cosmos/cosmos-proto"] version = "v1.0.0-beta.5" hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.0.0-20240604100318-cf12e5ad62e4" - hash = "sha256-rKHP2oF2+W7iP4jor3jkGtieHTjccX9Gm2GQ1yeomC4=" + version = "v0.50.6-0.20241015015202-783e224f9517" + hash = "sha256-CXmNDKUfGAhKLUWO1BxqcesvzvlUxVOG0xRJhqqZNC8=" replaced = "github.com/crypto-org-chain/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" @@ -173,20 +178,20 @@ schema = 3 version = "v1.2.0" hash = "sha256-Hd19V0RCiMoCL67NsqvWIsvWF8KM3LnuJTbYjWtQkEo=" [mod."github.com/cosmos/gogoproto"] - version = "v1.4.12" - hash = "sha256-e2tbfaZtzLijq+EMnNG9GWKDCG4sBj8wIVnn6/R26iM=" + version = "v1.7.0" + hash = "sha256-ZkEUImxBBo8Q/6c7tVR0rybpLbtlplzvgfLl5xvtV00=" [mod."github.com/cosmos/iavl"] - version = "v1.1.2" - hash = "sha256-fhh5fN1BMDxbF4PobERMQdIb9vIrxaSl0tRXas0WKmc=" + version = "v1.2.0" + hash = "sha256-NYSt6LOGyspP6eZXo9e5+2MFwyrWxD/rp2dRTtlWg2E=" [mod."github.com/cosmos/ibc-go/modules/capability"] - version = "v1.0.0" - hash = "sha256-xOeHJWUj6fTc2EUGiE4dgfY2WkvrqTg/FWewoUvQcvg=" + version = "v1.0.1" + hash = "sha256-iRhj2WTr99DgAl80h25pxtkO6iHYjyHflwpxKKG5b6E=" [mod."github.com/cosmos/ibc-go/v8"] - version = "v8.1.0" - hash = "sha256-uwYDKW+lFEfLR6Ro+HM3KhBi7B0mGMutH8oWdoZM7d8=" + version = "v8.5.1" + hash = "sha256-F4VZbKo1n9fLSxLSR+/ZaisbJ2v+EHjpXVpCovGTiyQ=" [mod."github.com/cosmos/ics23/go"] - version = "v0.10.0" - hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" + version = "v0.11.0" + hash = "sha256-mgU/pqp4kASmW/bP0z6PzssfjRp7GU9ioyvNlDdGC+E=" [mod."github.com/cosmos/ledger-cosmos-go"] version = "v0.13.3" hash = "sha256-4f73odipfgWku0/gK2UtXbrBXvj8kT9sg4IhnfAP/S0=" @@ -203,8 +208,8 @@ schema = 3 version = "v0.0.24" hash = "sha256-4vUukHONOjNn0qfQr4esK6TWfPWsIp+rbdz65og84lw=" [mod."github.com/crypto-org-chain/go-block-stm"] - version = "v0.0.0-20240408011717-9f11af197bde" - hash = "sha256-+UTSUoh4DxkWPQEc/j0atak1Oxq3tdP8r6ZMmB0k5KE=" + version = "v0.0.0-20240919080136-6c49aef68716" + hash = "sha256-krCdJz96mpIgmpmRI64W2+W1ycNg+EdLaqeVtAuaW4A=" [mod."github.com/danieljoos/wincred"] version = "v1.2.0" hash = "sha256-LHcvTJCc8++bFndbd8ZgMSTe4L5h2C4rN+cSWHCz54Y=" @@ -220,15 +225,12 @@ schema = 3 [mod."github.com/desertbit/timer"] version = "v0.0.0-20180107155436-c41aec40b27f" hash = "sha256-abLOtEcomAqCWLphd2X6WkD/ED764w6sa6unox4BXss=" - [mod."github.com/dgraph-io/badger/v2"] - version = "v2.2007.4" - hash = "sha256-+KwqZJZpViv8S3TqUVvPXrFoMgWFyS3NoLsi4RR5fGk=" + [mod."github.com/dgraph-io/badger/v4"] + version = "v4.2.0" + hash = "sha256-hsNONsIJIYmMzjTXdNxjheL2Zz3Z86J8Uxj2r0el/DY=" [mod."github.com/dgraph-io/ristretto"] version = "v0.1.1" hash = "sha256-Wr9ovXhGi71+n37EnrpIj2o9goyaQHtY4Vvurv6IVlY=" - [mod."github.com/dgryski/go-farm"] - version = "v0.0.0-20200201041132-a6ae2369ad13" - hash = "sha256-aOMlPwFY36bLiiIx4HonbCYRAhagk5N6HAWN7Ygif+E=" [mod."github.com/dlclark/regexp2"] version = "v1.7.0" hash = "sha256-Z/M62esiZ0fVwvueVQhwz18z0eS22LZ3DJ4O8FKp3AY=" @@ -248,8 +250,8 @@ schema = 3 version = "v1.6.1" hash = "sha256-zOpoaepCfPLmU9iQji/Ait+SVEHI9eF3rwtW0h/8lho=" [mod."github.com/ethereum/go-ethereum"] - version = "v1.10.20-0.20240425065928-ebb09502e7a7" - hash = "sha256-lE4G5FaRb3MVi9FFVn+WlwsSTOB4SbjmVboKyQ5yB0A=" + version = "v1.10.20-0.20241030073450-b9cc632bc183" + hash = "sha256-5nh0HZOZwlZBMmHv08BELlNfDZyq5zwq65ByyMzOetA=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/fatih/color"] version = "v1.16.0" @@ -303,8 +305,8 @@ schema = 3 version = "v1.3.2" hash = "sha256-pogILFrrk+cAtb0ulqn9+gRZJ7sGnnLLdtqITvxvG6c=" [mod."github.com/golang/glog"] - version = "v1.2.0" - hash = "sha256-eCWkUlsWbHSjsuTw8HcNpj3KxT+QPvW5SSIv88hAsxA=" + version = "v1.2.2" + hash = "sha256-AIPEkLcrbIw49fuTDKfDifVLCtSpFPHgujQ/c99dPqk=" [mod."github.com/golang/groupcache"] version = "v0.0.0-20210331224755-41bb18bfe9da" hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0=" @@ -318,8 +320,11 @@ schema = 3 version = "v0.0.5-0.20220116011046-fa5810519dcb" hash = "sha256-4GVLPBwJIXYFJU+Uvoa/sb5VHea7yJhwE7feABa7ucs=" [mod."github.com/google/btree"] - version = "v1.1.2" - hash = "sha256-K7V2obq3pLM71Mg0vhhHtZ+gtaubwXPQx3xcIyZDCjM=" + version = "v1.1.3" + hash = "sha256-/6Us2eNRFi2IIp7p5uPUXLridilAdk4SmZhcTYR0csw=" + [mod."github.com/google/flatbuffers"] + version = "v1.12.1" + hash = "sha256-v9/ewAmNdQ4SNBlBwgHkxn3IVJAf31D7zVlxwEK/LRs=" [mod."github.com/google/go-cmp"] version = "v0.6.0" hash = "sha256-qgra5jze4iPGP0JSTVeY5qV5AvEnEu39LYAuUCIkMtg=" @@ -336,8 +341,8 @@ schema = 3 version = "v0.3.2" hash = "sha256-wVuR3QC0mYFl5LNeKdRXdKdod7BGP5sv2h6VVib85v8=" [mod."github.com/googleapis/gax-go/v2"] - version = "v2.12.0" - hash = "sha256-ZcXS+1B11UaJHf8D15N3ZCh00fiMUncpHd+eNRffLZ4=" + version = "v2.12.5" + hash = "sha256-hqZ8F2tXqrlbMA/iN0mXw+LdDkoYsU7i2L/mt1VMQPY=" [mod."github.com/gorilla/handlers"] version = "v1.5.2" hash = "sha256-2WQeVCe7vQg+8MpNLMhOGsRdbrcWLpbtUhUX8mbiQrs=" @@ -345,8 +350,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.1" - hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" + version = "v1.5.3" + hash = "sha256-vTIGEFMEi+30ZdO6ffMNJ/kId6pZs5bbyqov8xe9BM0=" [mod."github.com/grpc-ecosystem/go-grpc-middleware"] version = "v1.4.0" hash = "sha256-0UymBjkg41C9MPqkBLz/ZY9WbimZrabpJk+8C/X63h8=" @@ -360,8 +365,8 @@ schema = 3 version = "v0.5.2" hash = "sha256-N9GOKYo7tK6XQUFhvhImtL7PZW/mr4C4Manx/yPVvcQ=" [mod."github.com/hashicorp/go-getter"] - version = "v1.7.3" - hash = "sha256-z3zrjcOsgJrZkGLwaKVauq/MFAPtulXatV/RrkKNJv4=" + version = "v1.7.4" + hash = "sha256-GtJSwcS1WXLn9lFAuTRCseIQBXJOElAywEhTtYrsfbE=" [mod."github.com/hashicorp/go-hclog"] version = "v1.5.0" hash = "sha256-u3Jqg7Qex11IZ7vbk4hRGgLy6e0cF70CCx7ERF0GUHo=" @@ -383,6 +388,9 @@ schema = 3 [mod."github.com/hashicorp/golang-lru"] version = "v1.0.2" hash = "sha256-yy+5botc6T5wXgOe2mfNXJP3wr+MkVlUZ2JBkmmrA48=" + [mod."github.com/hashicorp/golang-lru/v2"] + version = "v2.0.7" + hash = "sha256-t1bcXLgrQNOYUVyYEZ0knxcXpsTk4IuJZDjKvyJX75g=" [mod."github.com/hashicorp/hcl"] version = "v1.0.0" hash = "sha256-xsRCmYyBfglMxeWUvTZqkaRLSW+V2FvNodEDjTGg1WA=" @@ -423,8 +431,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-xEd0mDBeq3eR/GYeXjoTVb2sPs8sTCosn5ayWkcgENI=" [mod."github.com/klauspost/compress"] - version = "v1.17.7" - hash = "sha256-UkW+tAFEZYj067z9gXDQjQx0dCF8noCn5OSw/APh4oo=" + version = "v1.17.9" + hash = "sha256-FxHk4OuwsbiH1OLI+Q0oA4KpcOB786sEfik0G+GNoow=" [mod."github.com/kr/pretty"] version = "v0.3.1" hash = "sha256-DlER7XM+xiaLjvebcIPiB12oVNjyZHuJHoRGITzzpKU=" @@ -432,11 +440,8 @@ schema = 3 version = "v0.2.0" hash = "sha256-fadcWxZOORv44oak3jTxm6YcITcFxdGt4bpn869HxUE=" [mod."github.com/lib/pq"] - version = "v1.10.7" - hash = "sha256-YPUv1VBZNFVUjFxQKdYd0Djje6KYYE99Hz6FnTfrmMw=" - [mod."github.com/libp2p/go-buffer-pool"] - version = "v0.1.0" - hash = "sha256-wQqGTtRWsfR9n0O/SXHVgECebbnNmHddxJIbG63OJBQ=" + version = "v1.10.9" + hash = "sha256-Gl6dLtL+yk6UrTTWfas43aM4lP/pNa2l7+ITXnjQyKs=" [mod."github.com/linxGnu/grocksdb"] version = "v1.8.14" hash = "sha256-dT647UzB25Ye1Gv6b9JEtJZjuWKdJo4D8kw9cB0W8gA=" @@ -456,8 +461,8 @@ schema = 3 version = "v0.0.9" hash = "sha256-dK/kIPe1tcxEubwI4CWfov/HWRBgD/fqlPC3d5i30CY=" [mod."github.com/minio/highwayhash"] - version = "v1.0.2" - hash = "sha256-UeHeepKtToyA5e/w3KdmpbCn+4medesZG0cAcU6P2cY=" + version = "v1.0.3" + hash = "sha256-5M2Y3d0hnvo8JHz6910upUNbRRaUVes90F0jaIzo4pE=" [mod."github.com/mitchellh/go-homedir"] version = "v1.1.0" hash = "sha256-oduBKXHAQG8X6aqLEpqZHs5DOKe84u6WkBwi4W6cv3k=" @@ -470,6 +475,9 @@ schema = 3 [mod."github.com/mtibben/percent"] version = "v0.2.1" hash = "sha256-Zj1lpCP6mKQ0UUTMs2By4LC414ou+iJzKkK+eBHfEcc=" + [mod."github.com/munnerz/goautoneg"] + version = "v0.0.0-20191010083416-a7dc8b61c822" + hash = "sha256-79URDDFenmGc9JZu+5AXHToMrtTREHb3BC84b/gym9Q=" [mod."github.com/oasisprotocol/curve25519-voi"] version = "v0.0.0-20230904125328-1f23a7beb09a" hash = "sha256-N5MMNn4rytO3ObXVXoY34Sf7AGPkw2dTPkXjigjozls=" @@ -486,11 +494,11 @@ schema = 3 version = "v1.26.0" hash = "sha256-B18jsoJHK/oE+wudT0dOsUb41s5+ZIAu/ZBzQ5djOLE=" [mod."github.com/pelletier/go-toml/v2"] - version = "v2.1.1" - hash = "sha256-BQtflYQ8Dt7FL/yFI9OnxwvsRk0oEO37ZXuGXFveVpo=" + version = "v2.2.2" + hash = "sha256-ukxk1Cfm6cQW18g/aa19tLcUu5BnF7VmfAvrDHAOl6A=" [mod."github.com/petermattis/goid"] - version = "v0.0.0-20231207134359-e60b3f734c67" - hash = "sha256-73DbyhUTwYhqmvbcI96CNblTrfl6uz9OvM6z/h8j5TM=" + version = "v0.0.0-20240813172612-4fcff4a6cae7" + hash = "sha256-tfb/0LbMHJQsmxwaj2RItXiYn2AVd05E92Z/vp+rJhs=" [mod."github.com/pkg/errors"] version = "v0.9.1" hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw=" @@ -498,17 +506,17 @@ schema = 3 version = "v1.0.1-0.20181226105442-5d4384ee4fb2" hash = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90=" [mod."github.com/prometheus/client_golang"] - version = "v1.19.0" - hash = "sha256-YV8sxMPR+xorTUCriTfcFsaV2b7PZfPJDQmOgUYOZJo=" + version = "v1.20.5" + hash = "sha256-RbDZTBH+j2ZNLbHSMFxW0j8UStvkwc4IHTz3My9w4qo=" [mod."github.com/prometheus/client_model"] version = "v0.6.1" hash = "sha256-rIDyUzNfxRA934PIoySR0EhuBbZVRK/25Jlc/r8WODw=" [mod."github.com/prometheus/common"] - version = "v0.52.2" - hash = "sha256-XQUvk9/Kwf9NDlDUVl7mOWRD7z7z9QEbLH/rNU4D2nI=" + version = "v0.59.1" + hash = "sha256-PYoEunC2Rx1KP8vH2inTD7uBCfUlvcROfeeAGRRjXPY=" [mod."github.com/prometheus/procfs"] - version = "v0.13.0" - hash = "sha256-J31K36TkIiQU2EGOcmqDa+dkoKXiVuxafPVT4rKbEsg=" + version = "v0.15.1" + hash = "sha256-H+WXJemFFwdoglmD6p7JRjrJJZmIVAmJwYmLbZ8Q9sw=" [mod."github.com/rcrowley/go-metrics"] version = "v0.0.0-20201227073835-cf1acfcdf475" hash = "sha256-10ytHQ1SpMKYTiKuOPdEMuOVa8HVvv9ryYSIF9BHEBI=" @@ -516,11 +524,11 @@ schema = 3 version = "v1.12.0" hash = "sha256-qvDNCe3l84/LgrA8X4O15e1FeDcazyX91m9LmXGXX6M=" [mod."github.com/rs/cors"] - version = "v1.10.1" - hash = "sha256-um4INJM5/675MLK42npIsDbSQ1/Iy5ZiUNuAFReUfeM=" + version = "v1.11.1" + hash = "sha256-0z4aFR5VjuVYn+XnANbjui0ADcdG7gU56A9Y/NtrzCQ=" [mod."github.com/rs/zerolog"] - version = "v1.32.0" - hash = "sha256-9dZjtsES+wLp1cFiSVMuEUbdeXVFcgT0dgg5ACZkILk=" + version = "v1.33.0" + hash = "sha256-jT/Y/izhZiCdrDbC/ty83FGs8UQavTU+OW03O4vKFkY=" [mod."github.com/sagikazarmark/locafero"] version = "v0.4.0" hash = "sha256-7I1Oatc7GAaHgAqBFO6Tv4IbzFiYeU9bJAfJhXuWaXk=" @@ -528,8 +536,8 @@ schema = 3 version = "v0.1.0" hash = "sha256-F92BQXXmn3mCwu3mBaGh+joTRItQDSDhsjU6SofkYdA=" [mod."github.com/sasha-s/go-deadlock"] - version = "v0.3.1" - hash = "sha256-2CBEi9/iN/OMt7wEIG+hRjgDH6CRWIgibGGGy1dQ78I=" + version = "v0.3.5" + hash = "sha256-1vyxWqOTVVVeodipm/tpDgRKUMkEdkoLWSgtiVZaZmw=" [mod."github.com/shirou/gopsutil"] version = "v3.21.4-0.20210419000835-c7a38de76ee5+incompatible" hash = "sha256-oqIqyFquWabIE6DID6uTEc8oFEmM1rVu2ATn3toiCEg=" @@ -543,14 +551,14 @@ schema = 3 version = "v1.6.0" hash = "sha256-hxioqRZfXE0AE5099wmn3YG0AZF8Wda2EB4c7zHF6zI=" [mod."github.com/spf13/cobra"] - version = "v1.8.0" - hash = "sha256-oAE+fEaRfZPE541IPWE0GMeBBYgH2DMhtZNxzp7DFlY=" + version = "v1.8.1" + hash = "sha256-yDF6yAHycV1IZOrt3/hofR+QINe+B2yqkcIaVov3Ky8=" [mod."github.com/spf13/pflag"] version = "v1.0.5" hash = "sha256-w9LLYzxxP74WHT4ouBspH/iQZXjuAh2WQCHsuvyEjAw=" [mod."github.com/spf13/viper"] - version = "v1.18.2" - hash = "sha256-MXYbK6w1LEaoZ2/L/STF3WU1tbK+7NwGVxUCLKPkwks=" + version = "v1.19.0" + hash = "sha256-MZ8EAvdgpGbw6kmUz8UOaAAAMdPPGd14TrCBAY+A1T4=" [mod."github.com/status-im/keycard-go"] version = "v0.2.0" hash = "sha256-UUiGmlgaIZDeMUJv3fdZBoQ9hJeSsg2ixRGmm6TgHug=" @@ -605,83 +613,80 @@ schema = 3 version = "v0.14.3" hash = "sha256-tldEok5ebZ4R4B7H8dSlYS5oVuLvh89n9wUaVlDjYwg=" [mod."go.etcd.io/bbolt"] - version = "v1.3.8" - hash = "sha256-ekKy8198B2GfPldHLYZnvNjID6x07dUPYKgFx84TgVs=" + version = "v1.4.0-alpha.0.0.20240404170359-43604f3112c5" + hash = "sha256-U/PkBhk4m6iKFDuR0ULO4EFXb8gFnKNGgNnwMU0OGoM=" [mod."go.opencensus.io"] version = "v0.24.0" hash = "sha256-4H+mGZgG2c9I1y0m8avF4qmt8LUKxxVsTqR8mKgP4yo=" [mod."go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"] - version = "v0.47.0" - hash = "sha256-D+bP2jEZcB4S8AprlDM3qAghYtxhqc8fSKZNac6WVFs=" + version = "v0.49.0" + hash = "sha256-cgb4o14zow/ztWOKyXi7XQwVxV7OIsT2Ko8yaqQ7Lb8=" [mod."go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"] - version = "v0.47.0" - hash = "sha256-Pv1X0oIWYXyVxEaDQmgYcw+49I9+65N9Y+1wbxoXOog=" + version = "v0.49.0" + hash = "sha256-1/7YxtXZM4i75rXXIO6UN4CTY93nE/v2k2htS0uUOVg=" [mod."go.opentelemetry.io/otel"] - version = "v1.22.0" - hash = "sha256-4K70RPjaPzPpTO/VkE9ueoSo9EANuNXneDR6jEiUaJQ=" + version = "v1.24.0" + hash = "sha256-VGyV7EqJX6mRY0Ecyg+g0IZy+dt1GES4r9txQcaTNUg=" [mod."go.opentelemetry.io/otel/metric"] - version = "v1.22.0" - hash = "sha256-Lb4wdlZNmz6Ut6CljBAePSUA8X0RBEOEDyOl2oO+pL8=" + version = "v1.24.0" + hash = "sha256-KB5UQiaVmbB2VZO3al4WHb5HY79ioWaAQjaGkUKLvP8=" [mod."go.opentelemetry.io/otel/trace"] - version = "v1.22.0" - hash = "sha256-38zzkmcoOzYYeDN+rC44HmwmdnalIcEpObCS6tIvMO8=" + version = "v1.24.0" + hash = "sha256-FHP0hg+i7+wxCsM0u/5hQcgvvr3D+lq8o/7E/HkaW4s=" [mod."go.uber.org/multierr"] version = "v1.11.0" hash = "sha256-Lb6rHHfR62Ozg2j2JZy3MKOMKdsfzd1IYTR57r3Mhp0=" [mod."golang.org/x/crypto"] - version = "v0.22.0" - hash = "sha256-2+u9nd32+Bi7EEv7QFc12CRTbfV7DApNv+yKIr7+lTw=" + version = "v0.28.0" + hash = "sha256-AYjr0BcWQMwWY1u8c2hzUprtqHUmAH7RNSxHz2hhnZs=" [mod."golang.org/x/exp"] - version = "v0.0.0-20240404231335-c0f41cb1a7a0" - hash = "sha256-pBDEjILNDJVYAaUIPOoTwMetstVvMybVKtTvFbLM/tg=" + version = "v0.0.0-20240613232115-7f521ea00fb8" + hash = "sha256-QRK52QHPPhj+JIcQbd4/hI5ceEbKu3e9mR57XxocwOE=" [mod."golang.org/x/mod"] - version = "v0.17.0" - hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" + version = "v0.18.0" + hash = "sha256-zCSO2dmE0nhrScqRKzIUeqiELzCyBA6MDAW1NV1hTZw=" [mod."golang.org/x/net"] - version = "v0.24.0" - hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ=" + version = "v0.29.0" + hash = "sha256-dH9Rdf5T04KJ4B5WvIZh12ogMbADWiWgIt77nvPTk2k=" [mod."golang.org/x/oauth2"] - version = "v0.18.0" - hash = "sha256-TX4CvtvHU+SGSmqlxaQqlgJjlJiOtLGYAZa0zeBfZak=" + version = "v0.22.0" + hash = "sha256-3gmmXfCcxYBMaXmKRzGBpX01h4lMenFPkqWT9TwqIBE=" [mod."golang.org/x/sync"] - version = "v0.7.0" - hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" + version = "v0.8.0" + hash = "sha256-usvF0z7gq1vsX58p4orX+8WHlv52pdXgaueXlwj2Wss=" [mod."golang.org/x/sys"] - version = "v0.19.0" - hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" + version = "v0.26.0" + hash = "sha256-YjklsWNhx4g4TaWRWfFe1TMFKujbqiaNvZ38bfI35fM=" [mod."golang.org/x/term"] - version = "v0.19.0" - hash = "sha256-wFwEMwhtsr0C4mqjxukjMM7lxJLYPvb7gAPO95xyhyg=" + version = "v0.25.0" + hash = "sha256-vwNqnxEcgeVxQxdKBUnkb7y9jg6LlNDJxfG1GugSeRQ=" [mod."golang.org/x/text"] - version = "v0.14.0" - hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg=" + version = "v0.19.0" + hash = "sha256-C92pSYLLUQ2NKKcc60wpoSJ5UWAfnWkmd997C13fXdU=" [mod."golang.org/x/time"] version = "v0.5.0" hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU=" [mod."golang.org/x/tools"] - version = "v0.20.0" - hash = "sha256-g5T5FrNPO/cf2W1lc+/93FcFB3HftPjqI72FueD9Wt8=" + version = "v0.22.0" + hash = "sha256-07Vf9dS8pa2JAXpbNc03Kf6d3SkX1R0MdJSysRS2IOI=" [mod."google.golang.org/api"] - version = "v0.162.0" - hash = "sha256-+AsT4DPjefEmPPelZoSHuQ8nCHhmhhUWU4UGnJ/8+fg=" - [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v0.186.0" + hash = "sha256-dSr9mxKwuE4/m3OYtjTeVHMxyXw9cCgKsBwDqvBr2HU=" [mod."google.golang.org/genproto"] - version = "v0.0.0-20240227224415-6ceb2ff114de" - hash = "sha256-G+tvsCTXxzk3sS6HbBxPN1DYaN1tPOqKsa60mI05Feg=" + version = "v0.0.0-20240701130421-f6361c86f094" + hash = "sha256-5ZxSUe1BHYoiaiw0K1lLJmuobmBvk0+Y3CNkaLMnEic=" [mod."google.golang.org/genproto/googleapis/api"] - version = "v0.0.0-20240227224415-6ceb2ff114de" - hash = "sha256-H3d2ZhPJI9RH5EK9NsxUAFmT6tr2DgGV9SjZgqJ80r4=" + version = "v0.0.0-20240814211410-ddb44dafa142" + hash = "sha256-NosKwVYZLpvtvRq7oD4ldoNcodSur62X1bpujarh9t8=" [mod."google.golang.org/genproto/googleapis/rpc"] - version = "v0.0.0-20240401170217-c3f982113cda" - hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" + version = "v0.0.0-20240814211410-ddb44dafa142" + hash = "sha256-4T4DTrmFbqT4tD7PSL7Ie7u8ZN2iwGkhK02nWugssxk=" [mod."google.golang.org/grpc"] - version = "v1.63.2" - hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + version = "v1.67.1" + hash = "sha256-VqfKp80c2B1MK4m1WtHW4r7ykqdChJbqaMn+gMEYmYc=" [mod."google.golang.org/protobuf"] - version = "v1.33.0" - hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" + version = "v1.34.2" + hash = "sha256-nMTlrDEE2dbpWz50eQMPBQXCyQh4IdjrTIccaU0F3m0=" [mod."gopkg.in/ini.v1"] version = "v1.67.0" hash = "sha256-V10ahGNGT+NLRdKUyRg1dos5RxLBXBk1xutcnquc/+4=" diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index 7849418021..a4bd61d308 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -70,6 +70,10 @@ func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.ExecTxRe // record index of valid eth tx during the iteration var ethTxIndex int32 for txIndex, tx := range block.Txs { + txIdx, err := ethermint.SafeUint32(txIndex) + if err != nil { + return err + } result := txResults[txIndex] if !rpctypes.TxSuccessOrExceedsBlockGasLimit(result) { continue @@ -93,13 +97,17 @@ func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.ExecTxRe var cumulativeGasUsed uint64 for msgIndex, msg := range tx.GetMsgs() { + msgIdx, err := ethermint.SafeUint32(msgIndex) + if err != nil { + return err + } ethMsg := msg.(*evmtypes.MsgEthereumTx) var txHash common.Hash txResult := ethermint.TxResult{ Height: height, - TxIndex: uint32(txIndex), - MsgIndex: uint32(msgIndex), + TxIndex: txIdx, + MsgIndex: msgIdx, EthTxIndex: ethTxIndex, } if result.Code != abci.CodeTypeOK { @@ -182,8 +190,16 @@ func TxHashKey(hash common.Hash) []byte { // TxIndexKey returns the key for db entry: `(block number, tx index) -> tx hash` func TxIndexKey(blockNumber int64, txIndex int32) []byte { - bz1 := sdk.Uint64ToBigEndian(uint64(blockNumber)) - bz2 := sdk.Uint64ToBigEndian(uint64(txIndex)) + value, err := ethermint.SafeUint64(blockNumber) + if err != nil { + panic(err) + } + bz1 := sdk.Uint64ToBigEndian(value) + value, err = ethermint.SafeInt32ToUint64(txIndex) + if err != nil { + panic(err) + } + bz2 := sdk.Uint64ToBigEndian(value) return append(append([]byte{KeyPrefixTxIndex}, bz1...), bz2...) } @@ -243,5 +259,5 @@ func parseBlockNumberFromKey(key []byte) (int64, error) { return 0, fmt.Errorf("wrong tx index key length, expect: %d, got: %d", TxIndexKeyLength, len(key)) } - return int64(sdk.BigEndianToUint64(key[1:9])), nil + return ethermint.SafeInt64(sdk.BigEndianToUint64(key[1:9])) } diff --git a/nix/default.nix b/nix/default.nix index f3f6433c9b..ddee5400b1 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,11 +4,11 @@ import sources.nixpkgs { overlays = [ (_: pkgs: { flake-compat = import sources.flake-compat; - go = pkgs.go_1_22; + go = pkgs.go_1_23; go-ethereum = pkgs.callPackage ./go-ethereum.nix { inherit (pkgs.darwin) libobjc; inherit (pkgs.darwin.apple_sdk.frameworks) IOKit; - buildGoModule = pkgs.buildGo120Module; + buildGoModule = pkgs.buildGo121Module; }; }) # update to a version that supports eip-1559 (import "${sources.poetry2nix}/overlay.nix") @@ -24,7 +24,7 @@ import sources.nixpkgs { }) (_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; }) (_: pkgs: { - cosmovisor = pkgs.buildGo120Module rec { + cosmovisor = pkgs.buildGo121Module rec { name = "cosmovisor"; src = sources.cosmos-sdk + "/cosmovisor"; subPackages = [ "./cmd/cosmovisor" ]; diff --git a/nix/go-ethereum.nix b/nix/go-ethereum.nix index 74280075ed..d40c65dcd6 100644 --- a/nix/go-ethereum.nix +++ b/nix/go-ethereum.nix @@ -7,7 +7,8 @@ let "clef" ]; -in buildGoModule rec { +in +buildGoModule rec { pname = "go-ethereum"; version = "1.11.6"; @@ -60,4 +61,4 @@ in buildGoModule rec { license = with licenses; [ lgpl3Plus gpl3Plus ]; maintainers = with maintainers; [ adisbladis RaghavSood ]; }; -} \ No newline at end of file +} diff --git a/nix/sources.json b/nix/sources.json index 054b1ea6e1..e96b2d28a0 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": null, "owner": "nix-community", "repo": "gomod2nix", - "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", - "sha256": "1m0q0p1xidsp61xfrbj8ld1dqk3fhyrfifxj2ks36yjbnzmi1x69", + "rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c", + "sha256": "1mdwyjz43nnh7gfq4rc54kql6fy65hw17w0p4gwklnfqciwrkax2", "type": "tarball", - "url": "https://github.com/nix-community/gomod2nix/archive/30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6.tar.gz", + "url": "https://github.com/nix-community/gomod2nix/archive/5d387097aa716f35dd99d848dc26d8d5b62a104c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { @@ -36,15 +36,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "nixpkgs-unstable", + "branch": "release-24.05", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "86ef6bd96b6279e1a4a53236d341f5df1ede3803", - "sha256": "0mmgk3bg8rqs4mlsaxr5hyvzqn3sg53pqqm1aiwq00kmcnhds7nx", + "rev": "50286248f2d7283682bdd47ba14af33a9233b88b", + "sha256": "19sqfs6pamknhlg3mqpqs3wj0wj1ynj5icfmhqmjjvq08byfc2hl", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/86ef6bd96b6279e1a4a53236d341f5df1ede3803.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/50286248f2d7283682bdd47ba14af33a9233b88b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "poetry2nix": { diff --git a/proto/ethermint/evm/v1/params.proto b/proto/ethermint/evm/v1/params.proto index c4c64323aa..48c0c944ce 100644 --- a/proto/ethermint/evm/v1/params.proto +++ b/proto/ethermint/evm/v1/params.proto @@ -22,4 +22,6 @@ message Params { // allow_unprotected_txs defines if replay-protected (i.e non EIP155 // signed) transactions can be executed on the state machine. bool allow_unprotected_txs = 6; + // header_hash_num is the number of header hash to persist. + uint64 header_hash_num = 7; } \ No newline at end of file diff --git a/rpc/backend/account_info.go b/rpc/backend/account_info.go index ea4c130179..fe3af58b88 100644 --- a/rpc/backend/account_info.go +++ b/rpc/backend/account_info.go @@ -16,8 +16,6 @@ package backend import ( - "fmt" - "math" "math/big" errorsmod "cosmossdk.io/errors" @@ -29,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" rpctypes "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/pkg/errors" ) @@ -60,7 +59,7 @@ func (b *Backend) GetProof(address common.Address, storageKeys []string, blockNr } height := blockNum.Int64() - _, err = b.TendermintBlockByNumber(blockNum) + _, err = b.TendermintHeaderByNumber(blockNum) if err != nil { // the error message imitates geth behavior return nil, errors.New("header not found") @@ -74,11 +73,10 @@ func (b *Backend) GetProof(address common.Address, storageKeys []string, blockNr return nil, err } - if bn > math.MaxInt64 { - return nil, fmt.Errorf("not able to query block number greater than MaxInt64") + height, err = ethermint.SafeHexToInt64(bn) + if err != nil { + return nil, err } - - height = int64(bn) } clientCtx := b.clientCtx.WithHeight(height) @@ -165,7 +163,7 @@ func (b *Backend) GetBalance(address common.Address, blockNrOrHash rpctypes.Bloc Address: address.String(), } - _, err = b.TendermintBlockByNumber(blockNum) + _, err = b.TendermintHeaderByNumber(blockNum) if err != nil { return nil, err } @@ -195,8 +193,11 @@ func (b *Backend) GetTransactionCount(address common.Address, blockNum rpctypes. if err != nil { return &n, err } + currentHeight, err := ethermint.SafeHexToInt64(bn) + if err != nil { + return nil, err + } height := blockNum.Int64() - currentHeight := int64(bn) if height > currentHeight { return &n, errorsmod.Wrapf( sdkerrors.ErrInvalidHeight, diff --git a/rpc/backend/account_info_test.go b/rpc/backend/account_info_test.go index 200cf36385..e3a7abe018 100644 --- a/rpc/backend/account_info_test.go +++ b/rpc/backend/account_info_test.go @@ -97,7 +97,8 @@ func (suite *BackendTestSuite) TestGetProof() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNrInvalid}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + height := bn.Int64() + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterAccount(queryClient, addr, blockNrInvalid.Int64()) }, @@ -111,7 +112,8 @@ func (suite *BackendTestSuite) TestGetProof() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNrInvalid}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockError(client, bn.Int64()) + height := bn.Int64() + RegisterHeaderError(client, &height) }, false, &rpctypes.AccountResult{}, @@ -122,12 +124,12 @@ func (suite *BackendTestSuite) TestGetProof() { []string{"0x0"}, rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { - suite.backend.ctx = rpctypes.ContextWithHeight(bn.Int64()) - + height := bn.Int64() + suite.backend.ctx = rpctypes.ContextWithHeight(height) client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterAccount(queryClient, addr, bn.Int64()) + RegisterAccount(queryClient, addr, height) // Use the IAVL height if a valid tendermint height is passed in. iavlHeight := bn.Int64() @@ -270,7 +272,8 @@ func (suite *BackendTestSuite) TestGetBalance() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockError(client, bn.Int64()) + height := bn.Int64() + RegisterHeaderError(client, &height) }, false, nil, @@ -281,7 +284,8 @@ func (suite *BackendTestSuite) TestGetBalance() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + height := bn.Int64() + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBalanceError(queryClient, addr, bn.Int64()) }, @@ -294,7 +298,8 @@ func (suite *BackendTestSuite) TestGetBalance() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + height := bn.Int64() + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBalanceInvalid(queryClient, addr, bn.Int64()) }, @@ -307,7 +312,8 @@ func (suite *BackendTestSuite) TestGetBalance() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + height := bn.Int64() + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBalanceNegative(queryClient, addr, bn.Int64()) }, @@ -320,7 +326,8 @@ func (suite *BackendTestSuite) TestGetBalance() { rpctypes.BlockNumberOrHash{BlockNumber: &blockNr}, func(bn rpctypes.BlockNumber, addr common.Address) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, bn.Int64(), nil) + height := bn.Int64() + RegisterHeader(client, &height, nil) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBalance(queryClient, addr, bn.Int64()) }, diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index fe946ebfc1..131c8407ff 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -30,6 +30,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/trie" rpctypes "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/pkg/errors" "google.golang.org/grpc" @@ -172,14 +173,9 @@ func (b *Backend) GetBlockTransactionCount(block *tmrpctypes.ResultBlock) *hexut // TendermintBlockByNumber returns a Tendermint-formatted block for a given // block number func (b *Backend) TendermintBlockByNumber(blockNum rpctypes.BlockNumber) (*tmrpctypes.ResultBlock, error) { - height := blockNum.Int64() - if height <= 0 { - // fetch the latest block number from the app state, more accurate than the tendermint block store state. - n, err := b.BlockNumber() - if err != nil { - return nil, err - } - height = int64(n) + height, err := b.getHeightByBlockNum(blockNum) + if err != nil { + return nil, err } resBlock, err := b.clientCtx.Client.Block(b.ctx, &height) if err != nil { @@ -195,6 +191,36 @@ func (b *Backend) TendermintBlockByNumber(blockNum rpctypes.BlockNumber) (*tmrpc return resBlock, nil } +func (b *Backend) getHeightByBlockNum(blockNum rpctypes.BlockNumber) (int64, error) { + height := blockNum.Int64() + if height <= 0 { + // fetch the latest block number from the app state, more accurate than the tendermint block store state. + n, err := b.BlockNumber() + if err != nil { + return 0, err + } + height, err = ethermint.SafeHexToInt64(n) + if err != nil { + return 0, err + } + } + return height, nil +} + +// TendermintHeaderByNumber returns a Tendermint-formatted header for a given +// block number +func (b *Backend) TendermintHeaderByNumber(blockNum rpctypes.BlockNumber) (*tmrpctypes.ResultHeader, error) { + height, err := b.getHeightByBlockNum(blockNum) + if err != nil { + return nil, err + } + sc, ok := b.clientCtx.Client.(tmrpcclient.SignClient) + if !ok { + return nil, errors.New("invalid rpc client") + } + return sc.Header(b.ctx, &height) +} + // TendermintBlockResultByNumber returns a Tendermint-formatted block result // by block number func (b *Backend) TendermintBlockResultByNumber(height *int64) (*tmrpctypes.ResultBlockResults, error) { @@ -245,14 +271,18 @@ func (b *Backend) BlockNumberFromTendermint(blockNrOrHash rpctypes.BlockNumberOr // BlockNumberFromTendermintByHash returns the block height of given block hash func (b *Backend) BlockNumberFromTendermintByHash(blockHash common.Hash) (*big.Int, error) { - resBlock, err := b.TendermintBlockByHash(blockHash) + sc, ok := b.clientCtx.Client.(tmrpcclient.SignClient) + if !ok { + b.logger.Error("invalid rpc client") + } + resHeader, err := sc.HeaderByHash(b.ctx, blockHash.Bytes()) if err != nil { return nil, err } - if resBlock == nil { - return nil, errors.Errorf("block not found for hash %s", blockHash.Hex()) + if resHeader.Header == nil { + return nil, errors.Errorf("header not found for hash %s", blockHash.Hex()) } - return big.NewInt(resBlock.Block.Height), nil + return big.NewInt(resHeader.Header.Height), nil } // EthMsgsFromTendermintBlock returns all real MsgEthereumTxs from a @@ -297,62 +327,71 @@ func (b *Backend) EthMsgsFromTendermintBlock( // HeaderByNumber returns the block header identified by height. func (b *Backend) HeaderByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Header, error) { - resBlock, err := b.TendermintBlockByNumber(blockNum) + res, err := b.TendermintHeaderByNumber(blockNum) if err != nil { return nil, err } - if resBlock == nil { - return nil, errors.Errorf("block not found for height %d", blockNum) + if res == nil || res.Header == nil { + return nil, errors.Errorf("header not found for height %d", blockNum) } - blockRes, err := b.TendermintBlockResultByNumber(&resBlock.Block.Height) + blockRes, err := b.TendermintBlockResultByNumber(&res.Header.Height) if err != nil { - return nil, fmt.Errorf("block result not found for height %d", resBlock.Block.Height) + return nil, fmt.Errorf("header result not found for height %d", res.Header.Height) } bloom, err := b.BlockBloom(blockRes) if err != nil { - b.logger.Debug("HeaderByNumber BlockBloom failed", "height", resBlock.Block.Height) + b.logger.Debug("HeaderByNumber BlockBloom failed", "height", res.Header.Height) } baseFee, err := b.BaseFee(blockRes) if err != nil { // handle the error for pruned node. - b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", resBlock.Block.Height, "error", err) + b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", res.Header.Height, "error", err) } - - ethHeader := rpctypes.EthHeaderFromTendermint(resBlock.Block.Header, bloom, baseFee) + validator, err := b.getValidatorAccount(res.Header) + if err != nil { + return nil, err + } + ethHeader := rpctypes.EthHeaderFromTendermint(*res.Header, bloom, baseFee, validator) return ethHeader, nil } // HeaderByHash returns the block header identified by hash. func (b *Backend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error) { - resBlock, err := b.TendermintBlockByHash(blockHash) + sc, ok := b.clientCtx.Client.(tmrpcclient.SignClient) + if !ok { + b.logger.Error("invalid rpc client") + } + resHeader, err := sc.HeaderByHash(b.ctx, blockHash.Bytes()) if err != nil { return nil, err } - if resBlock == nil { - return nil, errors.Errorf("block not found for hash %s", blockHash.Hex()) + if resHeader.Header == nil { + return nil, errors.Errorf("header not found for hash %s", blockHash.Hex()) } - - blockRes, err := b.TendermintBlockResultByNumber(&resBlock.Block.Height) + blockRes, err := b.TendermintBlockResultByNumber(&resHeader.Header.Height) if err != nil { - return nil, errors.Errorf("block result not found for height %d", resBlock.Block.Height) + return nil, errors.Errorf("block result not found for height %d", resHeader.Header.Height) } bloom, err := b.BlockBloom(blockRes) if err != nil { - b.logger.Debug("HeaderByHash BlockBloom failed", "height", resBlock.Block.Height) + b.logger.Debug("HeaderByHash BlockBloom failed", "height", resHeader.Header.Height) } baseFee, err := b.BaseFee(blockRes) if err != nil { // handle the error for pruned node. - b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", resBlock.Block.Height, "error", err) + b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", resHeader.Header.Height, "error", err) } - - ethHeader := rpctypes.EthHeaderFromTendermint(resBlock.Block.Header, bloom, baseFee) + validator, err := b.getValidatorAccount(resHeader.Header) + if err != nil { + return nil, err + } + ethHeader := rpctypes.EthHeaderFromTendermint(*resHeader.Header, bloom, baseFee, validator) return ethHeader, nil } @@ -381,7 +420,10 @@ func (b *Backend) RPCBlockFromTendermintBlock( ) (map[string]interface{}, error) { ethRPCTxs := []interface{}{} block := resBlock.Block - + height, err := ethermint.SafeUint64(block.Height) + if err != nil { + return nil, err + } baseFee, err := b.BaseFee(blockRes) if err != nil { // handle the error for pruned node. @@ -394,12 +436,15 @@ func (b *Backend) RPCBlockFromTendermintBlock( ethRPCTxs = append(ethRPCTxs, ethMsg.Hash()) continue } - + index, err := ethermint.SafeIntToUint64(txIndex) + if err != nil { + return nil, err + } rpcTx, err := rpctypes.NewRPCTransaction( ethMsg, common.BytesToHash(block.Hash()), - uint64(block.Height), - uint64(txIndex), + height, + index, baseFee, b.chainID, ) @@ -446,15 +491,18 @@ func (b *Backend) RPCBlockFromTendermintBlock( b.logger.Error("failed to query consensus params", "error", err.Error()) } - gasUsed := uint64(0) - + var gasUsed uint64 for _, txsResult := range blockRes.TxsResults { // workaround for cosmos-sdk bug. https://github.com/cosmos/cosmos-sdk/issues/10832 if ShouldIgnoreGasUsed(txsResult) { // block gas limit has exceeded, other txs must have failed with same reason. break } - gasUsed += uint64(txsResult.GetGasUsed()) + gas, err := ethermint.SafeUint64(txsResult.GetGasUsed()) + if err != nil { + return nil, err + } + gasUsed += gas } formattedBlock := rpctypes.FormatBlock( @@ -502,8 +550,11 @@ func (b *Backend) EthBlockFromTendermintBlock( // handle error for pruned node and log b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", height, "error", err) } - - ethHeader := rpctypes.EthHeaderFromTendermint(block.Header, bloom, baseFee) + validator, err := b.getValidatorAccount(&resBlock.Block.Header) + if err != nil { + return nil, err + } + ethHeader := rpctypes.EthHeaderFromTendermint(block.Header, bloom, baseFee, validator) msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes) txs := make([]*ethtypes.Transaction, len(msgs)) diff --git a/rpc/backend/blocks_test.go b/rpc/backend/blocks_test.go index 431a10629c..f40e96d6c8 100644 --- a/rpc/backend/blocks_test.go +++ b/rpc/backend/blocks_test.go @@ -1,6 +1,7 @@ package backend import ( + "encoding/json" "fmt" "math/big" @@ -326,7 +327,6 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) resBlock, _ = RegisterBlockByHash(client, hash, txBz) - blockRes, _ = RegisterBlockResults(client, height) RegisterConsensusParams(client, height) @@ -674,7 +674,7 @@ func (suite *BackendTestSuite) TestTendermintBlockResultByNumber() { } func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { - var resBlock *tmrpctypes.ResultBlock + var resHeader *tmrpctypes.ResultHeader _, bz := suite.buildEthereumTx() block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) @@ -701,7 +701,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { &blockHash, func(hash *common.Hash) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockByHashError(client, *hash, bz) + RegisterHeaderByHashError(client, *hash, bz) }, false, }, @@ -711,7 +711,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { &blockHash, func(hash *common.Hash) { client := suite.backend.clientCtx.Client.(*mocks.Client) - resBlock, _ = RegisterBlockByHash(client, *hash, bz) + resHeader, _ = RegisterHeaderByHash(client, *hash, bz) }, true, }, @@ -740,7 +740,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { if tc.hash == nil { suite.Require().Equal(*tc.blockNum, blockNum) } else { - expHeight := ethrpc.NewBlockNumber(big.NewInt(resBlock.Block.Height)) + expHeight := ethrpc.NewBlockNumber(big.NewInt(resHeader.Header.Height)) suite.Require().Equal(expHeight, blockNum) } } else { @@ -751,7 +751,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { } func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { - var resBlock *tmrpctypes.ResultBlock + var resHeader *tmrpctypes.ResultHeader _, bz := suite.buildEthereumTx() block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) @@ -768,7 +768,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { common.BytesToHash(block.Hash()), func(hash common.Hash) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockByHashError(client, hash, bz) + RegisterHeaderByHashError(client, hash, bz) }, false, }, @@ -777,7 +777,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { common.BytesToHash(emptyBlock.Hash()), func(hash common.Hash) { client := suite.backend.clientCtx.Client.(*mocks.Client) - resBlock, _ = RegisterBlockByHash(client, hash, bz) + resHeader, _ = RegisterHeaderByHash(client, hash, bz) }, true, }, @@ -786,7 +786,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { common.BytesToHash(block.Hash()), func(hash common.Hash) { client := suite.backend.clientCtx.Client.(*mocks.Client) - resBlock, _ = RegisterBlockByHash(client, hash, bz) + resHeader, _ = RegisterHeaderByHash(client, hash, bz) }, true, }, @@ -798,7 +798,7 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { tc.registerMock(tc.hash) blockNum, err := suite.backend.BlockNumberFromTendermintByHash(tc.hash) if tc.expPass { - expHeight := big.NewInt(resBlock.Block.Height) + expHeight := big.NewInt(resHeader.Header.Height) suite.Require().NoError(err) suite.Require().Equal(expHeight, blockNum) } else { @@ -1178,15 +1178,23 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { suite.SetupTest() // reset test and queries msgs := suite.backend.EthMsgsFromTendermintBlock(tc.resBlock, tc.blockRes) - suite.Require().Equal(tc.expMsgs, msgs) + suite.Require().Equal(len(tc.expMsgs), len(msgs)) + for i, expMsg := range tc.expMsgs { + expBytes, err := json.Marshal(expMsg) + suite.Require().Nil(err) + bytes, err := json.Marshal(msgs[i]) + suite.Require().Nil(err) + suite.Require().Equal(expBytes, bytes) + } }) } } func (suite *BackendTestSuite) TestHeaderByNumber() { - var expResultBlock *tmrpctypes.ResultBlock + var expResultHeader *tmrpctypes.ResultHeader _, bz := suite.buildEthereumTx() + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) testCases := []struct { name string @@ -1202,29 +1210,29 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockError(client, height) + RegisterHeaderError(client, &height) }, false, }, { - "fail - block not found for height", + "fail - header not found for height", ethrpc.BlockNumber(1), sdkmath.NewInt(1).BigInt(), func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockNotFound(client, height) + RegisterHeaderNotFound(client, height) }, false, }, { - "fail - block not found for height", + "fail - header not found for height", ethrpc.BlockNumber(1), sdkmath.NewInt(1).BigInt(), func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlock(client, height, nil) + RegisterHeader(client, &height, nil) RegisterBlockResultsError(client, height) }, false, @@ -1236,11 +1244,12 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlock(client, height, nil) + expResultHeader, _ = RegisterHeader(client, &height, nil) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFeeError(queryClient) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1251,11 +1260,12 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlock(client, height, nil) + expResultHeader, _ = RegisterHeader(client, &height, nil) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1266,11 +1276,12 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { func(blockNum ethrpc.BlockNumber, baseFee sdkmath.Int) { height := blockNum.Int64() client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlock(client, height, bz) + expResultHeader, _ = RegisterHeader(client, &height, bz) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1283,7 +1294,7 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { header, err := suite.backend.HeaderByNumber(tc.blockNumber) if tc.expPass { - expHeader := ethrpc.EthHeaderFromTendermint(expResultBlock.Block.Header, ethtypes.Bloom{}, tc.baseFee) + expHeader := ethrpc.EthHeaderFromTendermint(*expResultHeader.Header, ethtypes.Bloom{}, tc.baseFee, validator) suite.Require().NoError(err) suite.Require().Equal(expHeader, header) } else { @@ -1294,11 +1305,13 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { } func (suite *BackendTestSuite) TestHeaderByHash() { - var expResultBlock *tmrpctypes.ResultBlock + var resHeader *tmrpctypes.ResultHeader _, bz := suite.buildEthereumTx() block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + emptyBlock.Header.ProposerAddress = validator.Bytes() testCases := []struct { name string @@ -1313,17 +1326,17 @@ func (suite *BackendTestSuite) TestHeaderByHash() { sdkmath.NewInt(1).BigInt(), func(hash common.Hash, baseFee sdkmath.Int) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockByHashError(client, hash, bz) + RegisterHeaderByHashError(client, hash, bz) }, false, }, { - "fail - block not found for height", + "fail - header not found for height", common.BytesToHash(block.Hash()), sdkmath.NewInt(1).BigInt(), func(hash common.Hash, baseFee sdkmath.Int) { client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockByHashNotFound(client, hash, bz) + RegisterHeaderByHashNotFound(client, hash, bz) }, false, }, @@ -1334,7 +1347,7 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) - RegisterBlockByHash(client, hash, bz) + RegisterHeaderByHash(client, hash, bz) RegisterBlockResultsError(client, height) }, false, @@ -1346,11 +1359,12 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlockByHash(client, hash, bz) + resHeader, _ = RegisterHeaderByHash(client, hash, bz) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFeeError(queryClient) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1361,11 +1375,12 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlockByHash(client, hash, nil) + resHeader, _ = RegisterHeaderByHash(client, hash, bz) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1376,11 +1391,12 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func(hash common.Hash, baseFee sdkmath.Int) { height := int64(1) client := suite.backend.clientCtx.Client.(*mocks.Client) - expResultBlock, _ = RegisterBlockByHash(client, hash, bz) + resHeader, _ = RegisterHeaderByHash(client, hash, bz) RegisterBlockResults(client, height) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, true, }, @@ -1393,7 +1409,7 @@ func (suite *BackendTestSuite) TestHeaderByHash() { header, err := suite.backend.HeaderByHash(tc.hash) if tc.expPass { - expHeader := ethrpc.EthHeaderFromTendermint(expResultBlock.Block.Header, ethtypes.Bloom{}, tc.baseFee) + expHeader := ethrpc.EthHeaderFromTendermint(*resHeader.Header, ethtypes.Bloom{}, tc.baseFee, validator) suite.Require().NoError(err) suite.Require().Equal(expHeader, header) } else { @@ -1406,6 +1422,8 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func (suite *BackendTestSuite) TestEthBlockByNumber() { msgEthereumTx, bz := suite.buildEthereumTx() emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + emptyBlock.Header.ProposerAddress = validator.Bytes() testCases := []struct { name string @@ -1449,12 +1467,14 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) baseFee := sdkmath.NewInt(1) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, sdkmath.NewInt(1).BigInt(), + validator, ), []*ethtypes.Transaction{}, nil, @@ -1475,12 +1495,14 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) baseFee := sdkmath.NewInt(1) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, sdkmath.NewInt(1).BigInt(), + validator, ), []*ethtypes.Transaction{msgEthereumTx.AsTransaction()}, nil, @@ -1520,6 +1542,9 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { msgEthereumTx, bz := suite.buildEthereumTx() emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + emptyBlock.Header.ProposerAddress = validator.Bytes() + consAddress := sdk.ConsAddress(emptyBlock.Header.ProposerAddress).String() testCases := []struct { name string @@ -1543,12 +1568,14 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { func(baseFee sdkmath.Int, blockNum int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccountWithConsAddress(queryClient, validator, consAddress) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, sdkmath.NewInt(1).BigInt(), + validator, ), []*ethtypes.Transaction{}, nil, @@ -1578,12 +1605,14 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { func(baseFee sdkmath.Int, blockNum int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, ethtypes.NewBlock( ethrpc.EthHeaderFromTendermint( emptyBlock.Header, ethtypes.Bloom{}, sdkmath.NewInt(1).BigInt(), + validator, ), []*ethtypes.Transaction{msgEthereumTx.AsTransaction()}, nil, diff --git a/rpc/backend/call_tx.go b/rpc/backend/call_tx.go index f9be170c78..c42a33fda1 100644 --- a/rpc/backend/call_tx.go +++ b/rpc/backend/call_tx.go @@ -333,7 +333,7 @@ func (b *Backend) EstimateGas(args evmtypes.TransactionArgs, blockNrOptional *rp return 0, err } - header, err := b.TendermintBlockByNumber(blockNr) + header, err := b.TendermintHeaderByNumber(blockNr) if err != nil { // the error message imitates geth behavior return 0, errors.New("header not found") @@ -342,7 +342,7 @@ func (b *Backend) EstimateGas(args evmtypes.TransactionArgs, blockNrOptional *rp req := evmtypes.EthCallRequest{ Args: bz, GasCap: b.RPCGasCap(), - ProposerAddress: sdk.ConsAddress(header.Block.ProposerAddress), + ProposerAddress: sdk.ConsAddress(header.Header.ProposerAddress), ChainId: b.chainID.Int64(), } @@ -369,12 +369,11 @@ func (b *Backend) DoCall( if err != nil { return nil, err } - header, err := b.TendermintBlockByNumber(blockNr) + header, err := b.TendermintHeaderByNumber(blockNr) if err != nil { // the error message imitates geth behavior return nil, errors.New("header not found") } - var bzOverrides []byte if overrides != nil { bzOverrides = *overrides @@ -383,7 +382,7 @@ func (b *Backend) DoCall( req := evmtypes.EthCallRequest{ Args: bz, GasCap: b.RPCGasCap(), - ProposerAddress: sdk.ConsAddress(header.Block.ProposerAddress), + ProposerAddress: sdk.ConsAddress(header.Header.ProposerAddress), ChainId: b.chainID.Int64(), Overrides: bzOverrides, } diff --git a/rpc/backend/call_tx_test.go b/rpc/backend/call_tx_test.go index dc2865791d..dd1a377913 100644 --- a/rpc/backend/call_tx_test.go +++ b/rpc/backend/call_tx_test.go @@ -6,6 +6,7 @@ import ( "math/big" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rlp" @@ -22,6 +23,8 @@ func (suite *BackendTestSuite) TestResend() { gasPrice := new(hexutil.Big) toAddr := tests.GenerateAddress() chainID := (*hexutil.Big)(suite.backend.chainID) + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + height := int64(1) callArgs := evmtypes.TransactionArgs{ From: nil, To: &toAddr, @@ -63,10 +66,11 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) RegisterBlockResults(client, 1) RegisterBaseFeeDisabled(queryClient) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -84,11 +88,12 @@ func (suite *BackendTestSuite) TestResend() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) feeMarketClient := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterFeeMarketParams(feeMarketClient, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterParams(queryClient, &header, height) + RegisterFeeMarketParams(feeMarketClient, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -104,10 +109,11 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFeeDisabled(queryClient) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -140,8 +146,8 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterBlockError(client, 1) + RegisterParams(queryClient, &header, height) + RegisterHeaderError(client, &height) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -157,10 +163,11 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -180,10 +187,11 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -201,13 +209,14 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) RegisterEstimateGas(queryClient, callArgs) - RegisterParams(queryClient, &header, 1) - RegisterParamsWithoutHeader(queryClient, 1) + RegisterParams(queryClient, &header, height) + RegisterParamsWithoutHeader(queryClient, height) RegisterUnconfirmedTxsError(client, nil) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -229,13 +238,14 @@ func (suite *BackendTestSuite) TestResend() { var header metadata.MD client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) RegisterEstimateGas(queryClient, callArgs) - RegisterParams(queryClient, &header, 1) - RegisterParamsWithoutHeader(queryClient, 1) + RegisterParams(queryClient, &header, height) + RegisterParamsWithoutHeader(queryClient, height) RegisterUnconfirmedTxsEmpty(client, nil) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ Nonce: &txNonce, @@ -396,7 +406,8 @@ func (suite *BackendTestSuite) TestDoCall() { func() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterBlock(client, 1, bz) + height := int64(1) + RegisterHeader(client, &height, bz) RegisterEthCallError(queryClient, &evmtypes.EthCallRequest{Args: argsBz, ChainId: suite.backend.chainID.Int64()}) }, rpctypes.BlockNumber(1), @@ -409,7 +420,8 @@ func (suite *BackendTestSuite) TestDoCall() { func() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterBlock(client, 1, bz) + height := int64(1) + RegisterHeader(client, &height, bz) RegisterEthCall(queryClient, &evmtypes.EthCallRequest{Args: argsBz, ChainId: suite.backend.chainID.Int64()}) }, rpctypes.BlockNumber(1), @@ -437,7 +449,8 @@ func (suite *BackendTestSuite) TestDoCall() { func (suite *BackendTestSuite) TestGasPrice() { defaultGasPrice := (*hexutil.Big)(big.NewInt(1)) - + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + height := int64(1) testCases := []struct { name string registerMock func() @@ -451,11 +464,12 @@ func (suite *BackendTestSuite) TestGasPrice() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) feeMarketClient := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) - RegisterFeeMarketParams(feeMarketClient, 1) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterFeeMarketParams(feeMarketClient, height) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, sdkmath.NewInt(1)) + RegisterValidatorAccount(queryClient, validator) }, defaultGasPrice, true, @@ -467,11 +481,12 @@ func (suite *BackendTestSuite) TestGasPrice() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) feeMarketClient := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) - RegisterFeeMarketParamsError(feeMarketClient, 1) - RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterFeeMarketParamsError(feeMarketClient, height) + RegisterParams(queryClient, &header, height) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, sdkmath.NewInt(1)) + RegisterValidatorAccount(queryClient, validator) }, defaultGasPrice, false, diff --git a/rpc/backend/chain_info.go b/rpc/backend/chain_info.go index 883b062544..4f9d4c4d67 100644 --- a/rpc/backend/chain_info.go +++ b/rpc/backend/chain_info.go @@ -41,18 +41,20 @@ import ( // ChainID is the EIP-155 replay-protection chain id for the current ethereum chain config. func (b *Backend) ChainID() (*hexutil.Big, error) { - eip155ChainID, err := ethermint.ParseChainID(b.clientCtx.ChainID) - if err != nil { - panic(err) - } // if current block is at or past the EIP-155 replay-protection fork block, return chainID from config bn, err := b.BlockNumber() if err != nil { b.logger.Debug("failed to fetch latest block number", "error", err.Error()) - return (*hexutil.Big)(eip155ChainID), nil + return (*hexutil.Big)(b.chainID), nil + } + + config := b.ChainConfig() + if config == nil { + // assume eip-155 is enabled + return (*hexutil.Big)(b.chainID), nil } - if config := b.ChainConfig(); config.IsEIP155(new(big.Int).SetUint64(uint64(bn))) { + if config.IsEIP155(new(big.Int).SetUint64(uint64(bn))) { return (*hexutil.Big)(config.ChainID), nil } @@ -182,18 +184,25 @@ func (b *Backend) FeeHistory( return nil, fmt.Errorf("%w: #%d:%f > #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p) } } - blockNumber, err := b.BlockNumber() + blkNumber, err := b.BlockNumber() + if err != nil { + return nil, err + } + blockNumber, err := ethermint.SafeHexToInt64(blkNumber) if err != nil { return nil, err } blockEnd := int64(lastBlock) if blockEnd < 0 { - blockEnd = int64(blockNumber) - } else if int64(blockNumber) < blockEnd { - return nil, fmt.Errorf("%w: requested %d, head %d", errRequestBeyondHead, blockEnd, int64(blockNumber)) + blockEnd = blockNumber + } else if blockNumber < blockEnd { + return nil, fmt.Errorf("%w: requested %d, head %d", errRequestBeyondHead, blockEnd, blockNumber) } - blocks := int64(userBlockCount) + blocks, err := ethermint.SafeInt64(uint64(userBlockCount)) + if err != nil { + return nil, err + } maxBlockCount := int64(b.cfg.JSONRPC.FeeHistoryCap) if blocks > maxBlockCount { return nil, fmt.Errorf("FeeHistory user block count %d higher than %d", blocks, maxBlockCount) @@ -226,6 +235,10 @@ func (b *Backend) FeeHistory( if blockID+int64(i) >= blockEnd+1 { break } + value := blockID - blockStart + int64(i) + if value > math.MaxInt32 || value < math.MinInt32 { + return nil, fmt.Errorf("integer overflow: calculated value %d exceeds int32 limits", value) + } wg.Add(1) go func(index int32) { defer func() { @@ -282,7 +295,7 @@ func (b *Backend) FeeHistory( } } } - }(int32(blockID - blockStart + int64(i))) + }(int32(value)) } go func() { wg.Wait() diff --git a/rpc/backend/client_test.go b/rpc/backend/client_test.go index a48df59a57..0e1d8b2a36 100644 --- a/rpc/backend/client_test.go +++ b/rpc/backend/client_test.go @@ -270,6 +270,48 @@ func RegisterBlockByHashNotFound(client *mocks.Client, hash common.Hash, tx []by Return(nil, nil) } +// HeaderByHash +func RegisterHeaderByHash( + client *mocks.Client, + hash common.Hash, + tx []byte, +) (*tmrpctypes.ResultHeader, error) { + block := types.MakeBlock(1, []types.Tx{tx}, nil, nil) + resHeader := &tmrpctypes.ResultHeader{Header: &block.Header} + + client.On("HeaderByHash", rpc.ContextWithHeight(1), bytes.HexBytes(hash.Bytes())). + Return(resHeader, nil) + return resHeader, nil +} + +func RegisterHeaderByHashError(client *mocks.Client, hash common.Hash, tx []byte) { + client.On("HeaderByHash", rpc.ContextWithHeight(1), bytes.HexBytes(hash.Bytes())). + Return(nil, errortypes.ErrInvalidRequest) +} + +func RegisterHeaderByHashNotFound(client *mocks.Client, hash common.Hash, tx []byte) { + client.On("HeaderByHash", rpc.ContextWithHeight(1), bytes.HexBytes(hash.Bytes())). + Return(&tmrpctypes.ResultHeader{Header: nil}, nil) +} + +// Header +func RegisterHeader(client *mocks.Client, height *int64, tx []byte) (*tmrpctypes.ResultHeader, error) { + block := types.MakeBlock(*height, []types.Tx{tx}, nil, nil) + resHeader := &tmrpctypes.ResultHeader{Header: &block.Header} + client.On("Header", rpc.ContextWithHeight(*height), height).Return(resHeader, nil) + return resHeader, nil +} + +func RegisterHeaderError(client *mocks.Client, height *int64) { + client.On("Header", rpc.ContextWithHeight(*height), height).Return(nil, errortypes.ErrInvalidRequest) +} + +// Header not found +func RegisterHeaderNotFound(client *mocks.Client, height int64) { + client.On("Header", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")). + Return(&tmrpctypes.ResultHeader{Header: nil}, nil) +} + func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path string, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions) { client.On("ABCIQueryWithOptions", context.Background(), path, data, opts). Return(&tmrpctypes.ResultABCIQuery{ diff --git a/rpc/backend/evm_query_client_test.go b/rpc/backend/evm_query_client_test.go index 357901a5fc..0b73443436 100644 --- a/rpc/backend/evm_query_client_test.go +++ b/rpc/backend/evm_query_client_test.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "slices" "strconv" "testing" @@ -35,13 +36,48 @@ var _ evmtypes.QueryClient = &mocks.EVMQueryClient{} func RegisterTraceTransactionWithPredecessors(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx, predecessors []*evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} queryClient.On("TraceTx", rpc.ContextWithHeight(1), - &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, Predecessors: predecessors, ChainId: 9000}). + mock.MatchedBy(func(req *evmtypes.QueryTraceTxRequest) bool { + if req.BlockNumber != 1 { + return false + } + bytes, _ := json.Marshal(msgEthTx) + bytes2, _ := json.Marshal(req.Msg) + if slices.Compare(bytes, bytes2) != 0 { + return false + } + if len(req.Predecessors) != len(predecessors) { + return false + } + bytes, _ = json.Marshal(req.Predecessors) + bytes2, _ = json.Marshal(predecessors) + if slices.Compare(bytes, bytes2) != 0 { + return false + } + if req.ChainId != 9000 { + return false + } + return true + })). Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil) } func RegisterTraceTransaction(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} - queryClient.On("TraceTx", rpc.ContextWithHeight(1), &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: 9000}). + queryClient.On("TraceTx", rpc.ContextWithHeight(1), + mock.MatchedBy(func(req *evmtypes.QueryTraceTxRequest) bool { + if req.BlockNumber != 1 { + return false + } + bytes, _ := json.Marshal(msgEthTx) + bytes2, _ := json.Marshal(req.Msg) + if slices.Compare(bytes, bytes2) != 0 { + return false + } + if req.ChainId != 9000 { + return false + } + return true + })). Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil) } @@ -54,7 +90,20 @@ func RegisterTraceTransactionError(queryClient *mocks.EVMQueryClient, msgEthTx * func RegisterTraceBlock(queryClient *mocks.EVMQueryClient, txs []*evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} queryClient.On("TraceBlock", rpc.ContextWithHeight(1), - &evmtypes.QueryTraceBlockRequest{Txs: txs, BlockNumber: 1, TraceConfig: &evmtypes.TraceConfig{}, ChainId: 9000}). + mock.MatchedBy(func(req *evmtypes.QueryTraceBlockRequest) bool { + if req.BlockNumber != 1 { + return false + } + bytes, _ := json.Marshal(txs) + bytes2, _ := json.Marshal(req.Txs) + if slices.Compare(bytes, bytes2) != 0 { + return false + } + if req.ChainId != 9000 { + return false + } + return true + })). Return(&evmtypes.QueryTraceBlockResponse{Data: data}, nil) } @@ -206,6 +255,13 @@ func RegisterValidatorAccount(queryClient *mocks.EVMQueryClient, validator sdk.A Return(&evmtypes.QueryValidatorAccountResponse{AccountAddress: validator.String()}, nil) } +func RegisterValidatorAccountWithConsAddress(queryClient *mocks.EVMQueryClient, validator sdk.AccAddress, consAddress string) { + queryClient.On("ValidatorAccount", rpc.ContextWithHeight(1), &evmtypes.QueryValidatorAccountRequest{ + ConsAddress: consAddress, + }). + Return(&evmtypes.QueryValidatorAccountResponse{AccountAddress: validator.String()}, nil) +} + func RegisterValidatorAccountError(queryClient *mocks.EVMQueryClient) { queryClient.On("ValidatorAccount", rpc.ContextWithHeight(1), &evmtypes.QueryValidatorAccountRequest{}). Return(nil, status.Error(codes.InvalidArgument, "empty request")) diff --git a/rpc/backend/node_info.go b/rpc/backend/node_info.go index 94745a040b..764ec1c1fc 100644 --- a/rpc/backend/node_info.go +++ b/rpc/backend/node_info.go @@ -78,10 +78,17 @@ func (b *Backend) Syncing() (interface{}, error) { if !status.SyncInfo.CatchingUp { return false, nil } - + start, err := ethermint.SafeUint64(status.SyncInfo.EarliestBlockHeight) + if err != nil { + return false, err + } + current, err := ethermint.SafeUint64(status.SyncInfo.LatestBlockHeight) + if err != nil { + return false, err + } return map[string]interface{}{ - "startingBlock": hexutil.Uint64(status.SyncInfo.EarliestBlockHeight), - "currentBlock": hexutil.Uint64(status.SyncInfo.LatestBlockHeight), + "startingBlock": hexutil.Uint64(start), + "currentBlock": hexutil.Uint64(current), // "highestBlock": nil, // NA // "pulledStates": nil, // NA // "knownStates": nil, // NA diff --git a/rpc/backend/sign_tx_test.go b/rpc/backend/sign_tx_test.go index 6d1dce3dc7..d555bc995e 100644 --- a/rpc/backend/sign_tx_test.go +++ b/rpc/backend/sign_tx_test.go @@ -35,9 +35,9 @@ func (suite *BackendTestSuite) TestSendTransaction() { Gas: &gas, Nonce: &nonce, } - hash := common.Hash{} - + validator := sdk.AccAddress(tests.GenerateAddress().Bytes()) + height := int64(1) testCases := []struct { name string registerMock func() @@ -60,8 +60,8 @@ func (suite *BackendTestSuite) TestSendTransaction() { client := suite.backend.clientCtx.Client.(*mocks.Client) armor := crypto.EncryptArmorPrivKey(priv, "", "eth_secp256k1") suite.backend.clientCtx.Keyring.ImportPrivKey("test_key", armor, "") - RegisterParams(queryClient, &header, 1) - RegisterBlockError(client, 1) + RegisterParams(queryClient, &header, height) + RegisterHeaderError(client, &height) }, callArgsDefault, hash, @@ -76,9 +76,10 @@ func (suite *BackendTestSuite) TestSendTransaction() { armor := crypto.EncryptArmorPrivKey(priv, "", "eth_secp256k1") suite.backend.clientCtx.Keyring.ImportPrivKey("test_key", armor, "") RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) + RegisterValidatorAccount(queryClient, validator) }, evmtypes.TransactionArgs{ From: &from, @@ -99,10 +100,10 @@ func (suite *BackendTestSuite) TestSendTransaction() { armor := crypto.EncryptArmorPrivKey(priv, "", "eth_secp256k1") suite.backend.clientCtx.Keyring.ImportPrivKey("test_key", armor, "") RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) - RegisterParamsWithoutHeader(queryClient, 1) + RegisterParamsWithoutHeader(queryClient, height) ethSigner := ethtypes.LatestSigner(suite.backend.ChainConfig()) msg := callArgsDefault.ToTransaction() msg.Sign(ethSigner, suite.backend.clientCtx.Keyring) @@ -110,6 +111,7 @@ func (suite *BackendTestSuite) TestSendTransaction() { txEncoder := suite.backend.clientCtx.TxConfig.TxEncoder() txBytes, _ := txEncoder(tx) RegisterBroadcastTxError(client, txBytes) + RegisterValidatorAccount(queryClient, validator) }, callArgsDefault, common.Hash{}, @@ -124,10 +126,10 @@ func (suite *BackendTestSuite) TestSendTransaction() { armor := crypto.EncryptArmorPrivKey(priv, "", "eth_secp256k1") suite.backend.clientCtx.Keyring.ImportPrivKey("test_key", armor, "") RegisterParams(queryClient, &header, 1) - RegisterBlock(client, 1, nil) - RegisterBlockResults(client, 1) + RegisterHeader(client, &height, nil) + RegisterBlockResults(client, height) RegisterBaseFee(queryClient, baseFee) - RegisterParamsWithoutHeader(queryClient, 1) + RegisterParamsWithoutHeader(queryClient, height) ethSigner := ethtypes.LatestSigner(suite.backend.ChainConfig()) msg := callArgsDefault.ToTransaction() msg.Sign(ethSigner, suite.backend.clientCtx.Keyring) @@ -135,6 +137,7 @@ func (suite *BackendTestSuite) TestSendTransaction() { txEncoder := suite.backend.clientCtx.TxConfig.TxEncoder() txBytes, _ := txEncoder(tx) RegisterBroadcastTx(client, txBytes) + RegisterValidatorAccount(queryClient, validator) }, callArgsDefault, hash, diff --git a/rpc/backend/tracing.go b/rpc/backend/tracing.go index 2b80baba1d..fe70f9eca7 100644 --- a/rpc/backend/tracing.go +++ b/rpc/backend/tracing.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" rpctypes "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/pkg/errors" ) @@ -48,9 +49,12 @@ func (b *Backend) TraceTransaction(hash common.Hash, config *rpctypes.TraceConfi b.logger.Debug("block not found", "height", transaction.Height) return nil, err } - + total, err := ethermint.SafeUint32(len(blk.Block.Txs)) + if err != nil { + return nil, err + } // check tx index is not out of bound - if uint32(len(blk.Block.Txs)) < transaction.TxIndex { + if total < transaction.TxIndex { b.logger.Debug("tx index out of bounds", "index", transaction.TxIndex, "hash", hash.String(), "height", blk.Block.Height) return nil, fmt.Errorf("transaction not included in block %v", blk.Block.Height) } @@ -227,7 +231,7 @@ func (b *Backend) TraceCall( if err != nil { return nil, err } - blk, err := b.TendermintBlockByNumber(blockNr) + header, err := b.TendermintHeaderByNumber(blockNr) if err != nil { // the error message imitates geth behavior return nil, errors.New("header not found") @@ -236,10 +240,10 @@ func (b *Backend) TraceCall( traceCallRequest := evmtypes.QueryTraceCallRequest{ Args: bz, GasCap: b.RPCGasCap(), - ProposerAddress: sdk.ConsAddress(blk.Block.ProposerAddress), - BlockNumber: blk.Block.Height, - BlockHash: common.Bytes2Hex(blk.BlockID.Hash), - BlockTime: blk.Block.Time, + ProposerAddress: sdk.ConsAddress(header.Header.ProposerAddress), + BlockNumber: header.Header.Height, + BlockHash: common.Bytes2Hex(header.Header.Hash()), + BlockTime: header.Header.Time, ChainId: b.chainID.Int64(), } @@ -248,7 +252,7 @@ func (b *Backend) TraceCall( } // get the context of provided block - contextHeight := blk.Block.Height + contextHeight := header.Header.Height if contextHeight < 1 { // 0 is a special value in `ContextWithHeight` contextHeight = 1 diff --git a/rpc/backend/tracing_test.go b/rpc/backend/tracing_test.go index 78f2284aaa..1cf69ffe61 100644 --- a/rpc/backend/tracing_test.go +++ b/rpc/backend/tracing_test.go @@ -307,7 +307,8 @@ func (suite *BackendTestSuite) TestDebugTraceCall() { func() { client := suite.backend.clientCtx.Client.(*mocks.Client) queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) - RegisterBlock(client, 1, bz) + height := int64(1) + RegisterHeader(client, &height, bz) RegisterTraceCall( queryClient, &evmtypes.QueryTraceCallRequest{Args: argsBz, ChainId: suite.backend.chainID.Int64(), BlockNumber: 1}, diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 2e626e2565..b33ccab66f 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -38,7 +38,10 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransac if err != nil { return b.getTransactionByHashPending(txHash) } - + height, err := ethermint.SafeUint64(res.Height) + if err != nil { + return nil, err + } block, err := b.TendermintBlockByNumber(rpctypes.BlockNumber(res.Height)) if err != nil { return nil, err @@ -65,8 +68,12 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransac // Fallback to find tx index by iterating all valid eth transactions msgs := b.EthMsgsFromTendermintBlock(block, blockRes) for i := range msgs { + idx, err := ethermint.SafeIntToInt32(i) + if err != nil { + return nil, err + } if msgs[i].Hash() == txHash { - res.EthTxIndex = int32(i) + res.EthTxIndex = idx break } } @@ -75,18 +82,20 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransac if res.EthTxIndex == -1 { return nil, errors.New("can't find index of ethereum tx") } - + index, err := ethermint.SafeInt32ToUint64(res.EthTxIndex) + if err != nil { + return nil, err + } baseFee, err := b.BaseFee(blockRes) if err != nil { // handle the error for pruned node. b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", blockRes.Height, "error", err) } - return rpctypes.NewTransactionFromMsg( msg, common.BytesToHash(block.BlockID.Hash.Bytes()), - uint64(res.Height), - uint64(res.EthTxIndex), + height, + index, baseFee, b.chainID, ) @@ -167,14 +176,18 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ return nil, err } - cumulativeGasUsed := uint64(0) + var cumulativeGasUsed uint64 blockRes, err := b.TendermintBlockResultByNumber(&res.Height) if err != nil { b.logger.Debug("failed to retrieve block results", "height", res.Height, "error", err.Error()) return nil, nil } for _, txResult := range blockRes.TxsResults[0:res.TxIndex] { - cumulativeGasUsed += uint64(txResult.GasUsed) + gas, err := ethermint.SafeUint64(txResult.GasUsed) + if err != nil { + return nil, err + } + cumulativeGasUsed += gas } cumulativeGasUsed += res.CumulativeGasUsed @@ -194,12 +207,16 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ return nil, err } + height, err := ethermint.SafeUint64(blockRes.Height) + if err != nil { + return nil, err + } // parse tx logs from events logs, err := evmtypes.DecodeMsgLogsFromEvents( blockRes.TxsResults[res.TxIndex].Data, blockRes.TxsResults[res.TxIndex].Events, int(res.MsgIndex), - uint64(blockRes.Height), + height, ) if err != nil { b.logger.Debug("failed to parse logs", "hash", hash, "error", err.Error()) @@ -209,8 +226,12 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ // Fallback to find tx index by iterating all valid eth transactions msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes) for i := range msgs { + idx, err := ethermint.SafeIntToInt32(i) + if err != nil { + return nil, err + } if msgs[i].Hash() == hash { - res.EthTxIndex = int32(i) + res.EthTxIndex = idx break } } @@ -220,6 +241,14 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ return nil, errors.New("can't find index of ethereum tx") } + blockNumber, err := ethermint.SafeUint64(res.Height) + if err != nil { + return nil, err + } + transactionIndex, err := ethermint.SafeInt32ToUint64(res.EthTxIndex) + if err != nil { + return nil, err + } receipt := map[string]interface{}{ // Consensus fields: These fields are defined by the Yellow Paper "status": status, @@ -236,8 +265,8 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ // Inclusion information: These fields provide information about the inclusion of the // transaction corresponding to this receipt. "blockHash": common.BytesToHash(resBlock.Block.Header.Hash()).Hex(), - "blockNumber": hexutil.Uint64(res.Height), - "transactionIndex": hexutil.Uint64(res.EthTxIndex), + "blockNumber": hexutil.Uint64(blockNumber), + "transactionIndex": hexutil.Uint64(transactionIndex), // sender and receiver (contract or EOA) addreses "from": from, @@ -328,9 +357,17 @@ 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, i uint) (*ethermint.TxResult, error) { + index, err := ethermint.SafeUintToInt32(i) + if err != nil { + return nil, err + } + idx, err := ethermint.SafeInt(i) + if err != nil { + return nil, err + } if b.indexer != nil { - return b.indexer.GetByBlockAndIndex(height, int32(index)) + return b.indexer.GetByBlockAndIndex(height, index) } // fallback to tendermint tx indexer @@ -339,7 +376,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult, evmtypes.AttributeKeyTxIndex, index, ) txResult, err := b.queryTendermintTxIndexer(query, func(txs *rpctypes.ParsedTxs) *rpctypes.ParsedTx { - return txs.GetTxByTxIndex(int(index)) + return txs.GetTxByTxIndex(idx) }) if err != nil { return nil, errorsmod.Wrapf(err, "GetTxByTxIndex %d %d", height, index) @@ -398,7 +435,10 @@ func (b *Backend) GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, i return nil, nil } } else { - i := int(idx) + i, err := ethermint.SafeHexToInt(idx) + if err != nil { + return nil, err + } ethMsgs := b.EthMsgsFromTendermintBlock(block, blockRes) if i >= len(ethMsgs) { b.logger.Debug("block txs index out of bound", "index", i) @@ -414,10 +454,15 @@ func (b *Backend) GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, i b.logger.Error("failed to fetch Base Fee from prunned block. Check node prunning configuration", "height", block.Block.Height, "error", err) } + height, err := ethermint.SafeUint64(block.Block.Height) + if err != nil { + return nil, err + } + return rpctypes.NewTransactionFromMsg( msg, common.BytesToHash(block.Block.Hash()), - uint64(block.Block.Height), + height, uint64(idx), baseFee, b.chainID, diff --git a/rpc/backend/utils.go b/rpc/backend/utils.go index 46760319f0..db5b3b6f4b 100644 --- a/rpc/backend/utils.go +++ b/rpc/backend/utils.go @@ -36,9 +36,11 @@ import ( abci "github.com/cometbft/cometbft/abci/types" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" ) @@ -244,7 +246,10 @@ func (b *Backend) processBlock( b.logger.Debug("failed to decode transaction in block", "height", blockHeight, "error", err.Error()) continue } - txGasUsed := uint64(eachTendermintTxResult.GasUsed) + txGasUsed, err := ethermint.SafeUint64(eachTendermintTxResult.GasUsed) + if err != nil { + return err + } for _, msg := range tx.GetMsgs() { ethMsg, ok := msg.(*evmtypes.MsgEthereumTx) if !ok { @@ -290,9 +295,13 @@ func ShouldIgnoreGasUsed(res *abci.ExecTxResult) bool { // GetLogsFromBlockResults returns the list of event logs from the tendermint block result response func GetLogsFromBlockResults(blockRes *tmrpctypes.ResultBlockResults) ([][]*ethtypes.Log, error) { + height, err := ethermint.SafeUint64(blockRes.Height) + if err != nil { + return nil, err + } blockLogs := [][]*ethtypes.Log{} for _, txResult := range blockRes.TxsResults { - logs, err := evmtypes.DecodeTxLogsFromEvents(txResult.Data, txResult.Events, uint64(blockRes.Height)) + logs, err := evmtypes.DecodeTxLogsFromEvents(txResult.Data, txResult.Events, height) if err != nil { return nil, err } @@ -317,3 +326,16 @@ func GetHexProofs(proof *crypto.ProofOps) []string { } return proofs } + +func (b *Backend) getValidatorAccount(header *cmttypes.Header) (sdk.AccAddress, error) { + res, err := b.queryClient.ValidatorAccount( + types.ContextWithHeight(header.Height), + &evmtypes.QueryValidatorAccountRequest{ + ConsAddress: sdk.ConsAddress(header.ProposerAddress).String(), + }, + ) + if err != nil { + return nil, fmt.Errorf("failed to get validator account %w", err) + } + return sdk.AccAddressFromBech32(res.AccountAddress) +} diff --git a/rpc/namespaces/ethereum/debug/api.go b/rpc/namespaces/ethereum/debug/api.go index bfdae08af9..7860f915ee 100644 --- a/rpc/namespaces/ethereum/debug/api.go +++ b/rpc/namespaces/ethereum/debug/api.go @@ -29,8 +29,8 @@ import ( "github.com/davecgh/go-spew/spew" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" - stderrors "github.com/pkg/errors" "github.com/cosmos/cosmos-sdk/server" @@ -128,26 +128,41 @@ func (a *API) TraceCall( return a.backend.TraceCall(args, blockNrOrHash, config) } +func parseDuration(nsec uint) (time.Duration, error) { + if nsec > uint(time.Duration(1<<63-1)/time.Second) { + return time.Duration(0), fmt.Errorf("value %d exceeds maximum duration for time.Duration", nsec) + } + return time.Duration(nsec) * time.Second, nil +} + // BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to // file. It uses a profile rate of 1 for most accurate information. If a different rate is // desired, set the rate and write the profile manually. func (a *API) BlockProfile(file string, nsec uint) error { + d, err := parseDuration(nsec) + if err != nil { + return err + } a.logger.Debug("debug_blockProfile", "file", file, "nsec", nsec) runtime.SetBlockProfileRate(1) defer runtime.SetBlockProfileRate(0) - time.Sleep(time.Duration(nsec) * time.Second) + time.Sleep(d) return writeProfile("block", file, a.logger) } // CpuProfile turns on CPU profiling for nsec seconds and writes // profile data to file. func (a *API) CpuProfile(file string, nsec uint) error { //nolint: golint, stylecheck, revive + d, err := parseDuration(nsec) + if err != nil { + return err + } a.logger.Debug("debug_cpuProfile", "file", file, "nsec", nsec) if err := a.StartCPUProfile(file); err != nil { return err } - time.Sleep(time.Duration(nsec) * time.Second) + time.Sleep(d) return a.StopCPUProfile() } @@ -162,11 +177,15 @@ func (a *API) GcStats() *debug.GCStats { // GoTrace turns on tracing for nsec seconds and writes // trace data to file. func (a *API) GoTrace(file string, nsec uint) error { + d, err := parseDuration(nsec) + if err != nil { + return err + } a.logger.Debug("debug_goTrace", "file", file, "nsec", nsec) if err := a.StartGoTrace(file); err != nil { return err } - time.Sleep(time.Duration(nsec) * time.Second) + time.Sleep(d) return a.StopGoTrace() } @@ -280,9 +299,13 @@ func (a *API) WriteMemProfile(file string) error { // It uses a profile rate of 1 for most accurate information. If a different rate is // desired, set the rate and write the profile manually. func (a *API) MutexProfile(file string, nsec uint) error { + d, err := parseDuration(nsec) + if err != nil { + return err + } a.logger.Debug("debug_mutexProfile", "file", file, "nsec", nsec) runtime.SetMutexProfileFraction(1) - time.Sleep(time.Duration(nsec) * time.Second) + time.Sleep(d) defer runtime.SetMutexProfileFraction(0) return writeProfile("mutex", file, a.logger) } @@ -314,7 +337,11 @@ func (a *API) SetGCPercent(v int) int { // GetHeaderRlp retrieves the RLP encoded for of a single header. func (a *API) GetHeaderRlp(number uint64) (hexutil.Bytes, error) { - header, err := a.backend.HeaderByNumber(rpctypes.BlockNumber(number)) + value, err := ethermint.SafeInt64(number) + if err != nil { + return nil, err + } + header, err := a.backend.HeaderByNumber(rpctypes.BlockNumber(value)) if err != nil { return nil, err } @@ -324,7 +351,11 @@ func (a *API) GetHeaderRlp(number uint64) (hexutil.Bytes, error) { // GetBlockRlp retrieves the RLP encoded for of a single block. func (a *API) GetBlockRlp(number uint64) (hexutil.Bytes, error) { - block, err := a.backend.EthBlockByNumber(rpctypes.BlockNumber(number)) + value, err := ethermint.SafeInt64(number) + if err != nil { + return nil, err + } + block, err := a.backend.EthBlockByNumber(rpctypes.BlockNumber(value)) if err != nil { return nil, err } @@ -334,17 +365,24 @@ func (a *API) GetBlockRlp(number uint64) (hexutil.Bytes, error) { // PrintBlock retrieves a block and returns its pretty printed form. func (a *API) PrintBlock(number uint64) (string, error) { - block, err := a.backend.EthBlockByNumber(rpctypes.BlockNumber(number)) + value, err := ethermint.SafeInt64(number) + if err != nil { + return "", err + } + block, err := a.backend.EthBlockByNumber(rpctypes.BlockNumber(value)) if err != nil { return "", err } - return spew.Sdump(block), nil } // SeedHash retrieves the seed hash of a block. func (a *API) SeedHash(number uint64) (string, error) { - _, err := a.backend.HeaderByNumber(rpctypes.BlockNumber(number)) + value, err := ethermint.SafeInt64(number) + if err != nil { + return "", err + } + _, err = a.backend.HeaderByNumber(rpctypes.BlockNumber(value)) if err != nil { return "", err } diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index df9c8577a3..2572f1726e 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -448,13 +448,16 @@ func (e *PublicAPI) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, err e.logger.Debug("block result not found", "number", res.Height, "error", err.Error()) return nil, nil } - + height, err := ethermint.SafeUint64(resBlockResult.Height) + if err != nil { + return nil, err + } // parse tx logs from events logs, err := evmtypes.DecodeMsgLogsFromEvents( resBlockResult.TxsResults[res.TxIndex].Data, resBlockResult.TxsResults[res.TxIndex].Events, int(res.MsgIndex), - uint64(resBlockResult.Height), + height, ) if err != nil { e.logger.Debug("failed to parse tx logs", "error", err.Error()) diff --git a/rpc/stream/rpc.go b/rpc/stream/rpc.go index d23388ada7..5e4d1bb78c 100644 --- a/rpc/stream/rpc.go +++ b/rpc/stream/rpc.go @@ -14,7 +14,9 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" + "google.golang.org/grpc" ) const ( @@ -44,39 +46,57 @@ type RPCHeader struct { Hash common.Hash } +type validatorAccountFunc func( + ctx context.Context, in *evmtypes.QueryValidatorAccountRequest, opts ...grpc.CallOption, +) (*evmtypes.QueryValidatorAccountResponse, error) + // RPCStream provides data streams for newHeads, logs, and pendingTransactions. +// it's only started on demand, so there's no overhead if the filter apis are not called at all. type RPCStream struct { evtClient rpcclient.EventsClient logger log.Logger txDecoder sdk.TxDecoder - headerStream *Stream[RPCHeader] + // headerStream/logStream are backed by cometbft event subscription + headerStream *Stream[RPCHeader] + logStream *Stream[*ethtypes.Log] + + // pendingTxStream is backed by check-tx ante handler pendingTxStream *Stream[common.Hash] - logStream *Stream[*ethtypes.Log] - wg sync.WaitGroup + wg sync.WaitGroup + validatorAccount validatorAccountFunc } 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), - pendingTxStream: NewStream[common.Hash](txStreamSegmentSize, txStreamCapacity), - logStream: NewStream[*ethtypes.Log](logStreamSegmentSize, logStreamCapacity), + validatorAccount validatorAccountFunc, +) *RPCStream { + return &RPCStream{ + evtClient: evtClient, + logger: logger, + txDecoder: txDecoder, + validatorAccount: validatorAccount, + pendingTxStream: NewStream[common.Hash](txStreamSegmentSize, txStreamCapacity), + } +} + +func (s *RPCStream) initSubscriptions() { + if s.headerStream != nil { + // already initialized + return } + s.headerStream = NewStream[RPCHeader](headerStreamSegmentSize, headerStreamCapacity) + s.logStream = NewStream[*ethtypes.Log](logStreamSegmentSize, logStreamCapacity) + ctx := context.Background() chBlocks, err := s.evtClient.Subscribe(ctx, streamSubscriberName, blockEvents, subscribBufferSize) if err != nil { - return nil, err + panic(err) } chLogs, err := s.evtClient.Subscribe(ctx, streamSubscriberName, evmEvents, subscribBufferSize) @@ -84,15 +104,18 @@ func NewRPCStreams( if err := s.evtClient.UnsubscribeAll(context.Background(), streamSubscriberName); err != nil { s.logger.Error("failed to unsubscribe", "err", err) } - return nil, err + panic(err) } go s.start(&s.wg, chBlocks, chLogs) - - return s, nil } func (s *RPCStream) Close() error { + if s.headerStream == nil { + // not initialized + return nil + } + if err := s.evtClient.UnsubscribeAll(context.Background(), streamSubscriberName); err != nil { return err } @@ -101,6 +124,7 @@ func (s *RPCStream) Close() error { } func (s *RPCStream) HeaderStream() *Stream[RPCHeader] { + s.initSubscriptions() return s.headerStream } @@ -109,12 +133,13 @@ func (s *RPCStream) PendingTxStream() *Stream[common.Hash] { } func (s *RPCStream) LogStream() *Stream[*ethtypes.Log] { + s.initSubscriptions() return s.logStream } // ListenPendingTx is a callback passed to application to listen for pending transactions in CheckTx. func (s *RPCStream) ListenPendingTx(hash common.Hash) { - s.pendingTxStream.Add(hash) + s.PendingTxStream().Add(hash) } func (s *RPCStream) start( @@ -145,9 +170,23 @@ func (s *RPCStream) start( } baseFee := types.BaseFeeFromEvents(data.ResultFinalizeBlock.Events) - + res, err := s.validatorAccount( + types.ContextWithHeight(data.Block.Height), + &evmtypes.QueryValidatorAccountRequest{ + ConsAddress: sdk.ConsAddress(data.Block.Header.ProposerAddress).String(), + }, + ) + if err != nil { + s.logger.Error("failed to get validator account", "err", err) + continue + } + validator, err := sdk.AccAddressFromBech32(res.AccountAddress) + if err != nil { + s.logger.Error("failed to convert validator account", "err", err) + continue + } // TODO: fetch bloom from events - header := types.EthHeaderFromTendermint(data.Block.Header, ethtypes.Bloom{}, baseFee) + header := types.EthHeaderFromTendermint(data.Block.Header, ethtypes.Bloom{}, baseFee, validator) s.headerStream.Add(RPCHeader{EthHeader: header, Hash: common.BytesToHash(data.Block.Header.Hash())}) case ev, ok := <-chLogs: @@ -167,7 +206,11 @@ func (s *RPCStream) start( s.logger.Error("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue } - txLogs, err := evmtypes.DecodeTxLogsFromEvents(dataTx.TxResult.Result.Data, dataTx.TxResult.Result.Events, uint64(dataTx.TxResult.Height)) + height, err := ethermint.SafeUint64(dataTx.TxResult.Height) + if err != nil { + continue + } + txLogs, err := evmtypes.DecodeTxLogsFromEvents(dataTx.TxResult.Result.Data, dataTx.TxResult.Result.Events, height) if err != nil { s.logger.Error("fail to decode evm tx response", "error", err.Error()) continue diff --git a/rpc/types/block.go b/rpc/types/block.go index 9f4b533950..eeaf5d1557 100644 --- a/rpc/types/block.go +++ b/rpc/types/block.go @@ -20,7 +20,6 @@ import ( "encoding/json" "errors" "fmt" - "math" "math/big" "strings" @@ -103,11 +102,11 @@ func (bn *BlockNumber) UnmarshalJSON(data []byte) error { } else if err != nil { return err } - - if blckNum > math.MaxInt64 { - return fmt.Errorf("block number larger than int64") + b, err := ethermint.SafeInt64(blckNum) + if err != nil { + return err } - *bn = BlockNumber(blckNum) + *bn = BlockNumber(b) return nil } diff --git a/rpc/types/events.go b/rpc/types/events.go index a0ce40a56a..0b53f5e282 100644 --- a/rpc/types/events.go +++ b/rpc/types/events.go @@ -135,7 +135,11 @@ func ParseTxResult(result *abci.ExecTxResult, tx sdk.Tx) (*ParsedTxs, error) { // some old versions miss some events, fill it with tx result if len(p.Txs) == 1 { - p.Txs[0].GasUsed = uint64(result.GasUsed) + value, err := ethermint.SafeUint64(result.GasUsed) + if err != nil { + return nil, err + } + p.Txs[0].GasUsed = value } // this could only happen if tx exceeds block gas limit @@ -162,11 +166,14 @@ func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func( if parsedTx == nil { return nil, fmt.Errorf("ethereum tx not found in msgs: block %d, index %d", txResult.Height, txResult.Index) } - + msgIndex, err := ethermint.SafeUint32(parsedTx.MsgIndex) + if err != nil { + return nil, err + } return ðermint.TxResult{ Height: txResult.Height, TxIndex: txResult.Index, - MsgIndex: uint32(parsedTx.MsgIndex), + MsgIndex: msgIndex, EthTxIndex: parsedTx.EthTxIndex, Failed: parsedTx.Failed, GasUsed: parsedTx.GasUsed, @@ -251,7 +258,11 @@ func fillTxAttribute(tx *ParsedTx, key []byte, value []byte) error { if err != nil { return err } - tx.EthTxIndex = int32(txIndex) + txIdx, err := ethermint.SafeUint64ToInt32(txIndex) + if err != nil { + return err + } + tx.EthTxIndex = txIdx case evmtypes.AttributeKeyTxGasUsed: gasUsed, err := strconv.ParseUint(string(value), 10, 64) if err != nil { diff --git a/rpc/types/utils.go b/rpc/types/utils.go index fb7b0facfc..c0ae4b4e2e 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -26,6 +26,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" evmtypes "github.com/evmos/ethermint/x/evm/types" @@ -37,6 +38,7 @@ import ( "github.com/ethereum/go-ethereum/common/math" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + ethermint "github.com/evmos/ethermint/types" ) // ExceedBlockGasLimitError defines the error message when tx execution exceeds the block gas limit. @@ -63,16 +65,26 @@ func RawTxToEthTx(clientCtx client.Context, txBz tmtypes.Tx) ([]*evmtypes.MsgEth // EthHeaderFromTendermint is an util function that returns an Ethereum Header // from a tendermint Header. -func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFee *big.Int) *ethtypes.Header { +func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFee *big.Int, miner sdk.AccAddress) *ethtypes.Header { txHash := ethtypes.EmptyRootHash if len(header.DataHash) == 0 { txHash = common.BytesToHash(header.DataHash) } - + var ( + blockTime uint64 + err error + ) + time := header.Time + if !time.IsZero() { + blockTime, err = ethermint.SafeUint64(time.Unix()) + if err != nil { + panic(err) + } + } return ðtypes.Header{ ParentHash: common.BytesToHash(header.LastBlockID.Hash.Bytes()), UncleHash: ethtypes.EmptyUncleHash, - Coinbase: common.BytesToAddress(header.ProposerAddress), + Coinbase: common.BytesToAddress(miner), Root: common.BytesToHash(header.AppHash), TxHash: txHash, ReceiptHash: ethtypes.EmptyRootHash, @@ -81,7 +93,7 @@ func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFe Number: big.NewInt(header.Height), GasLimit: 0, GasUsed: 0, - Time: uint64(header.Time.UTC().Unix()), + Time: blockTime, Extra: []byte{}, MixDigest: common.Hash{}, Nonce: ethtypes.BlockNonce{}, @@ -125,9 +137,28 @@ func FormatBlock( } else { transactionsRoot = common.BytesToHash(header.DataHash) } - + number, err := ethermint.SafeUint64(header.Height) + if err != nil { + panic(err) + } + limit, err := ethermint.SafeUint64(gasLimit) + if err != nil { + panic(err) + } + time := header.Time + var blockTime uint64 + if !time.IsZero() { + blockTime, err = ethermint.SafeUint64(time.Unix()) + if err != nil { + panic(err) + } + } + s, err := ethermint.SafeIntToUint64(size) + if err != nil { + panic(err) + } result := map[string]interface{}{ - "number": hexutil.Uint64(header.Height), + "number": hexutil.Uint64(number), "hash": hexutil.Bytes(header.Hash()), "parentHash": common.BytesToHash(header.LastBlockID.Hash.Bytes()), "nonce": ethtypes.BlockNonce{}, // PoW specific @@ -138,10 +169,10 @@ func FormatBlock( "mixHash": common.Hash{}, "difficulty": (*hexutil.Big)(big.NewInt(0)), "extraData": "0x", - "size": hexutil.Uint64(size), - "gasLimit": hexutil.Uint64(gasLimit), // Static gas limit + "size": hexutil.Uint64(s), + "gasLimit": hexutil.Uint64(limit), // Static gas limit "gasUsed": (*hexutil.Big)(gasUsed), - "timestamp": hexutil.Uint64(header.Time.Unix()), + "timestamp": hexutil.Uint64(blockTime), "transactionsRoot": transactionsRoot, "receiptsRoot": ethtypes.EmptyRootHash, diff --git a/rpc/websockets.go b/rpc/websockets.go index 0268f9797f..b4d34b2283 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -33,6 +33,7 @@ import ( "github.com/pkg/errors" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rpc" @@ -85,7 +86,9 @@ type websocketsServer struct { logger log.Logger } -func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, stream *stream.RPCStream, cfg *config.Config) WebsocketsServer { +func NewWebsocketsServer( + ctx context.Context, 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) @@ -94,7 +97,7 @@ func NewWebsocketsServer(clientCtx client.Context, logger log.Logger, stream *st wsAddr: cfg.JSONRPC.WsAddress, certFile: cfg.TLS.CertificatePath, keyFile: cfg.TLS.KeyPath, - api: newPubSubAPI(clientCtx, logger, stream), + api: newPubSubAPI(ctx, clientCtx, logger, stream), logger: logger, } } @@ -346,18 +349,20 @@ 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 *stream.RPCStream - logger log.Logger - clientCtx client.Context + events *stream.RPCStream + logger log.Logger + clientCtx client.Context + cancelContext context.Context } // newPubSubAPI creates an instance of the ethereum PubSub API. -func newPubSubAPI(clientCtx client.Context, logger log.Logger, stream *stream.RPCStream) *pubSubAPI { +func newPubSubAPI(ctx context.Context, clientCtx client.Context, logger log.Logger, stream *stream.RPCStream) *pubSubAPI { logger = logger.With("module", "websocket-client") return &pubSubAPI{ - events: stream, - logger: logger, - clientCtx: clientCtx, + events: stream, + logger: logger, + clientCtx: clientCtx, + cancelContext: ctx, } } @@ -385,18 +390,63 @@ func (api *pubSubAPI) subscribe(wsConn *wsConn, subID rpc.ID, params []interface } } +// https://github.com/ethereum/go-ethereum/blob/release/1.11/core/types/gen_header_json.go#L18 +type Header struct { + ParentHash common.Hash `json:"parentHash" gencodec:"required"` + UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"` + // update string avoid lost checksumed miner after MarshalText + Coinbase string `json:"miner"` + Root common.Hash `json:"stateRoot" gencodec:"required"` + TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` + ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` + Bloom ethtypes.Bloom `json:"logsBloom" gencodec:"required"` + Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"` + Number *hexutil.Big `json:"number" gencodec:"required"` + GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"` + GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"` + Time hexutil.Uint64 `json:"timestamp" gencodec:"required"` + Extra hexutil.Bytes `json:"extraData" gencodec:"required"` + MixDigest common.Hash `json:"mixHash"` + Nonce ethtypes.BlockNonce `json:"nonce"` + BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"` + WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"` + // overwrite rlpHash + Hash common.Hash `json:"hash"` +} + func (api *pubSubAPI) subscribeNewHeads(wsConn *wsConn, subID rpc.ID) (context.CancelFunc, error) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(api.cancelContext) + //nolint: errcheck go api.events.HeaderStream().Subscribe(ctx, func(headers []stream.RPCHeader, _ int) error { for _, header := range headers { + h := header.EthHeader + var enc Header + enc.ParentHash = h.ParentHash + enc.UncleHash = h.UncleHash + enc.Coinbase = h.Coinbase.Hex() + enc.Root = h.Root + enc.TxHash = h.TxHash + enc.ReceiptHash = h.ReceiptHash + enc.Bloom = h.Bloom + enc.Difficulty = (*hexutil.Big)(h.Difficulty) + enc.Number = (*hexutil.Big)(h.Number) + enc.GasLimit = hexutil.Uint64(h.GasLimit) + enc.GasUsed = hexutil.Uint64(h.GasUsed) + enc.Time = hexutil.Uint64(h.Time) + enc.Extra = h.Extra + enc.MixDigest = h.MixDigest + enc.Nonce = h.Nonce + enc.BaseFee = (*hexutil.Big)(h.BaseFee) + enc.WithdrawalsHash = h.WithdrawalsHash + enc.Hash = header.Hash // write to ws conn res := &SubscriptionNotification{ Jsonrpc: "2.0", Method: "eth_subscription", Params: &SubscriptionResult{ Subscription: subID, - Result: header.EthHeader, + Result: enc, }, } @@ -524,7 +574,7 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac } } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(api.cancelContext) //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) @@ -544,6 +594,7 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac err := wsConn.WriteJSON(res) if err != nil { + api.logger.Error("error writing header, will drop peer", "error", err.Error()) try(func() { if err != websocket.ErrCloseSent { _ = wsConn.Close() @@ -560,7 +611,7 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac } func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn, subID rpc.ID) (context.CancelFunc, error) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(api.cancelContext) //nolint: errcheck go api.events.PendingTxStream().Subscribe(ctx, func(items []common.Hash, _ int) error { for _, hash := range items { diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index e867e392a9..869b079cf1 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -15,8 +15,8 @@ TESTS_TO_RUN="${TESTS_TO_RUN:-all}" if [[ "$TESTS_TO_RUN" == "all" ]]; then echo "run all tests" - pytest -vv -s + pytest -vv -s --session-timeout=3600 --timeout=3600 else echo "run tests matching $TESTS_TO_RUN" - pytest -vv -s -m "$TESTS_TO_RUN" + pytest -vv -s --session-timeout=1800 --timeout=1800 -m "$TESTS_TO_RUN" fi diff --git a/server/config/config.go b/server/config/config.go index 8e9167719b..7fb16d37a5 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -100,6 +100,7 @@ const ( BlockExecutorSequential = "sequential" BlockExecutorBlockSTM = "block-stm" + DefaultMaxTxs = 3000 ) var ( @@ -133,6 +134,8 @@ type EVMConfig struct { BlockExecutor string `mapstructure:"block-executor"` // BlockSTMWorkers is the number of workers for block-stm execution, `0` means using all available CPUs. BlockSTMWorkers int `mapstructure:"block-stm-workers"` + // BlockSTMPreEstimate is the flag to enable pre-estimation for block-stm execution. + BlockSTMPreEstimate bool `mapstructure:"block-stm-pre-estimate"` } // JSONRPCConfig defines configuration for the EVM RPC server. @@ -257,7 +260,7 @@ func (c EVMConfig) Validate() error { return fmt.Errorf("invalid tracer type %s, available types: %v", c.Tracer, evmTracers) } - if !strings.StringInSlice(c.BlockExecutor, blockExecutors) { + if c.BlockExecutor != "" && !strings.StringInSlice(c.BlockExecutor, blockExecutors) { return fmt.Errorf("invalid block executor type %s, available types: %v", c.BlockExecutor, blockExecutors) } @@ -406,10 +409,11 @@ func GetConfig(v *viper.Viper) (Config, error) { return Config{ Config: cfg, EVM: EVMConfig{ - Tracer: v.GetString("evm.tracer"), - MaxTxGasWanted: v.GetUint64("evm.max-tx-gas-wanted"), - BlockExecutor: v.GetString("evm.block-executor"), - BlockSTMWorkers: v.GetInt("evm.block-stm-workers"), + Tracer: v.GetString("evm.tracer"), + MaxTxGasWanted: v.GetUint64("evm.max-tx-gas-wanted"), + BlockExecutor: v.GetString("evm.block-executor"), + BlockSTMWorkers: v.GetInt("evm.block-stm-workers"), + BlockSTMPreEstimate: v.GetBool("evm.block-stm-pre-estimate"), }, JSONRPC: JSONRPCConfig{ Enable: v.GetBool("json-rpc.enable"), diff --git a/server/config/toml.go b/server/config/toml.go index b82d492c7f..31b07d50a1 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -35,6 +35,8 @@ max-tx-gas-wanted = {{ .EVM.MaxTxGasWanted }} block-executor = "{{ .EVM.BlockExecutor }}" # BlockSTMWorkers is the number of workers for block-stm execution, 0 means using all available CPUs. block-stm-workers = {{ .EVM.BlockSTMWorkers }} +# BlockSTMPreEstimate is the flag to enable pre-estimation for block-stm execution. +block-stm-pre-estimate = {{ .EVM.BlockSTMPreEstimate }} ############################################################################### ### JSON RPC Configuration ### diff --git a/server/flags/flags.go b/server/flags/flags.go index 02dc161342..c795013c15 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -76,10 +76,11 @@ const ( // EVM flags const ( - EVMTracer = "evm.tracer" - EVMMaxTxGasWanted = "evm.max-tx-gas-wanted" - EVMBlockExecutor = "evm.block-executor" - EVMBlockSTMWorkers = "evm.block-stm-workers" + EVMTracer = "evm.tracer" + EVMMaxTxGasWanted = "evm.max-tx-gas-wanted" + EVMBlockExecutor = "evm.block-executor" + EVMBlockSTMWorkers = "evm.block-stm-workers" + EVMBlockSTMPreEstimate = "evm.block-stm-pre-estimate" ) // TLS flags diff --git a/server/json_rpc.go b/server/json_rpc.go index 9a18e14333..326353c049 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -16,6 +16,7 @@ package server import ( + "context" "fmt" "net/http" "time" @@ -32,47 +33,36 @@ import ( "github.com/evmos/ethermint/app/ante" "github.com/evmos/ethermint/rpc" "github.com/evmos/ethermint/rpc/stream" + rpctypes "github.com/evmos/ethermint/rpc/types" "github.com/evmos/ethermint/server/config" ethermint "github.com/evmos/ethermint/types" ) -const ( - ServerStartTime = 5 * time.Second - MaxRetry = 6 -) +const ServerStartTime = 5 * time.Second type AppWithPendingTxStream interface { RegisterPendingTxListener(listener ante.PendingTxListener) } // StartJSONRPC starts the JSON-RPC server -func StartJSONRPC(srvCtx *server.Context, +func StartJSONRPC( + ctx context.Context, + srvCtx *server.Context, clientCtx client.Context, g *errgroup.Group, config *config.Config, indexer ethermint.EVMTxIndexer, app AppWithPendingTxStream, -) (*http.Server, chan struct{}, error) { +) (*http.Server, error) { 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) + return 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) - } + queryClient := rpctypes.NewQueryClient(clientCtx) + rpcStream := stream.NewRPCStreams(evtClient, logger, clientCtx.TxConfig.TxDecoder(), queryClient.ValidatorAccount) app.RegisterPendingTxListener(rpcStream.ListenPendingTx) @@ -102,7 +92,7 @@ func StartJSONRPC(srvCtx *server.Context, "namespace", api.Namespace, "service", api.Service, ) - return nil, nil, err + return nil, err } } @@ -126,12 +116,29 @@ func StartJSONRPC(srvCtx *server.Context, ln, err := Listen(httpSrv.Addr, config) if err != nil { - return nil, nil, err + return nil, err } g.Go(func() error { srvCtx.Logger.Info("Starting JSON-RPC server", "address", config.JSONRPC.Address) - if err := httpSrv.Serve(ln); err != nil { + errCh := make(chan error) + go func() { + errCh <- httpSrv.Serve(ln) + }() + + // Start a blocking select to wait for an indication to stop the server or that + // the server failed to start properly. + select { + case <-ctx.Done(): + // The calling process canceled or closed the provided context, so we must + // gracefully stop the JSON-RPC server. + logger.Info("stopping JSON-RPC server...", "address", config.JSONRPC.Address) + if err := httpSrv.Shutdown(context.Background()); err != nil { + logger.Error("failed to shutdown JSON-RPC server", "error", err.Error()) + } + return nil + + case err := <-errCh: if err == http.ErrServerClosed { close(httpSrvDone) } @@ -139,12 +146,11 @@ func StartJSONRPC(srvCtx *server.Context, srvCtx.Logger.Error("failed to start JSON-RPC server", "error", err.Error()) return err } - return nil }) srvCtx.Logger.Info("Starting JSON WebSocket server", "address", config.JSONRPC.WsAddress) - wsSrv := rpc.NewWebsocketsServer(clientCtx, srvCtx.Logger, rpcStream, config) + wsSrv := rpc.NewWebsocketsServer(ctx, clientCtx, srvCtx.Logger, rpcStream, config) wsSrv.Start() - return httpSrv, httpSrvDone, nil + return httpSrv, nil } diff --git a/server/start.go b/server/start.go index e1a5854ac6..9a0d934e9e 100644 --- a/server/start.go +++ b/server/start.go @@ -20,11 +20,9 @@ import ( "fmt" "io" "net" - "net/http" "os" "path/filepath" "runtime/pprof" - "time" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -71,6 +69,8 @@ import ( ethermint "github.com/evmos/ethermint/types" ) +const FlagAsyncCheckTx = "async-check-tx" + // DBOpener is a function to open `application.db`, potentially with customized options. type DBOpener func(opts types.AppOptions, rootDir string, backend dbm.BackendType) (dbm.DB, error) @@ -227,6 +227,9 @@ 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") + cmd.Flags().Int(server.FlagMempoolMaxTxs, config.DefaultMaxTxs, "Sets MaxTx value for the app-side mempool") + + cmd.Flags().Bool(FlagAsyncCheckTx, false, "Enable async check tx [experimental]") // add support for all CometBFT-specific command line options tcmd.AddNodeFlags(cmd) @@ -243,12 +246,6 @@ func startStandAlone(svrCtx *server.Context, opts StartOptions) error { return err } - defer func() { - if err := db.Close(); err != nil { - svrCtx.Logger.Error("error closing db", "error", err.Error()) - } - }() - traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { @@ -316,12 +313,6 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start return err } - defer func() { - if err := db.Close(); err != nil { - logger.With("error", err).Error("error closing db") - } - }() - traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { @@ -368,12 +359,21 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start logger.Info("starting node with ABCI CometBFT in-process") cmtApp := server.NewCometABCIWrapper(app) + + var clientCreator proxy.ClientCreator + if svrCtx.Viper.GetBool(FlagAsyncCheckTx) { + logger.Info("enabling async check tx") + clientCreator = proxy.NewConsensusSyncLocalClientCreator(cmtApp) + } else { + clientCreator = proxy.NewLocalClientCreator(cmtApp) + } + tmNode, err = node.NewNodeWithContext( ctx, cfg, pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()), nodeKey, - proxy.NewLocalClientCreator(cmtApp), + clientCreator, genDocProvider, cmtcfg.DefaultDBProvider, node.DefaultMetricsProvider(cfg.Instrumentation), @@ -430,10 +430,11 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start idxer = indexer.NewKVIndexer(idxDB, idxLogger, clientCtx) indexerService := NewEVMIndexerService(idxer, clientCtx.Client.(rpcclient.Client), config.JSONRPC.AllowIndexerGap) indexerService.SetLogger(servercmtlog.CometLoggerWrapper{Logger: idxLogger}) - - g.Go(func() error { - return indexerService.Start() - }) + go func() { + if err := indexerService.Start(); err != nil { + logger.Error("failed to start evm indexer service", "error", err.Error()) + } + }() } if config.API.Enable || config.JSONRPC.Enable { @@ -454,30 +455,12 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start if err != nil { return err } - if grpcSrv != nil { - defer grpcSrv.GracefulStop() - } - apiSrv := startAPIServer(ctx, svrCtx, clientCtx, g, config.Config, app, grpcSrv, metrics) - if apiSrv != nil { - defer apiSrv.Close() - } + startAPIServer(ctx, svrCtx, clientCtx, g, config.Config, app, grpcSrv, metrics) - clientCtx, httpSrv, httpSrvDone, err := startJSONRPCServer(svrCtx, clientCtx, g, config, genDocProvider, idxer, app) - if httpSrv != nil { - defer func() { - shutdownCtx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second) - defer cancelFn() - if err := httpSrv.Shutdown(shutdownCtx); err != nil { - logger.Error("HTTP server shutdown produced a warning", "error", err.Error()) - } else { - logger.Info("HTTP server shut down, waiting 5 sec") - select { - case <-time.Tick(5 * time.Second): - case <-httpSrvDone: - } - } - }() + clientCtx, err = startJSONRPCServer(ctx, svrCtx, clientCtx, g, config, genDocProvider, idxer, app) + if err != nil { + return err } // At this point it is safe to block the process if we're in query only mode as @@ -591,7 +574,7 @@ func startGrpcServer( } // if gRPC is enabled, configure gRPC client for gRPC gateway and json-rpc - grpcClient, err := grpc.Dial( + grpcClient, err := grpc.NewClient( config.Address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions( @@ -630,9 +613,9 @@ func startAPIServer( app types.Application, grpcSrv *grpc.Server, metrics *telemetry.Metrics, -) *api.Server { +) { if !svrCfg.API.Enable { - return nil + return } apiSrv := api.New(clientCtx, svrCtx.Logger.With("server", "api"), grpcSrv) @@ -645,10 +628,10 @@ func startAPIServer( g.Go(func() error { return apiSrv.Start(ctx, svrCfg) }) - return apiSrv } func startJSONRPCServer( + stdCtx context.Context, svrCtx *server.Context, clientCtx client.Context, g *errgroup.Group, @@ -656,7 +639,7 @@ func startJSONRPCServer( genDocProvider node.GenesisDocProvider, idxer ethermint.EVMTxIndexer, app types.Application, -) (ctx client.Context, httpSrv *http.Server, httpSrvDone chan struct{}, err error) { +) (ctx client.Context, err error) { ctx = clientCtx if !config.JSONRPC.Enable { return @@ -664,19 +647,16 @@ func startJSONRPCServer( txApp, ok := app.(AppWithPendingTxStream) if !ok { - return ctx, httpSrv, httpSrvDone, fmt.Errorf("json-rpc server requires AppWithPendingTxStream") + return ctx, fmt.Errorf("json-rpc server requires AppWithPendingTxStream") } genDoc, err := genDocProvider() if err != nil { - return ctx, httpSrv, httpSrvDone, err + return ctx, err } ctx = clientCtx.WithChainID(genDoc.ChainID) - g.Go(func() error { - httpSrv, httpSrvDone, err = StartJSONRPC(svrCtx, clientCtx, g, &config, idxer, txApp) - return err - }) + _, err = StartJSONRPC(stdCtx, svrCtx, clientCtx, g, &config, idxer, txApp) return } diff --git a/tests/integration_tests/configs/cosmovisor.jsonnet b/tests/integration_tests/configs/cosmovisor.jsonnet index 4630f9a5ab..34ec86b27c 100644 --- a/tests/integration_tests/configs/cosmovisor.jsonnet +++ b/tests/integration_tests/configs/cosmovisor.jsonnet @@ -13,6 +13,11 @@ config { }, }, app_state+: { + evm+: { + params+: { + header_hash_num:: super.header_hash_num, + }, + }, feemarket+: { params+: { base_fee:: super.base_fee, diff --git a/tests/integration_tests/configs/default.jsonnet b/tests/integration_tests/configs/default.jsonnet index fba86f6d22..e43a490b55 100644 --- a/tests/integration_tests/configs/default.jsonnet +++ b/tests/integration_tests/configs/default.jsonnet @@ -6,9 +6,6 @@ 'app-config': { 'minimum-gas-prices': '0aphoton', 'index-events': ['ethereum_tx.ethereumTxHash'], - evm: { - 'block-executor': 'block-stm', - }, 'json-rpc': { address: '127.0.0.1:{EVMRPC_PORT}', 'ws-address': '127.0.0.1:{EVMRPC_PORT_WS}', @@ -22,11 +19,24 @@ validators: [{ coins: '1000000000000000000stake,10000000000000000000000aphoton', staked: '1000000000000000000stake', - mnemonic: mnemonic, + mnemonic: '${VALIDATOR1_MNEMONIC}', + client_config: { + 'broadcast-mode': 'sync', + }, + 'app-config': { + evm: { + 'block-executor': 'block-stm', + 'block-stm-workers': 32, + }, + }, + }, { + coins: '1000000000000000000stake,10000000000000000000000aphoton', + staked: '1000000000000000000stake', + mnemonic: '${VALIDATOR2_MNEMONIC}', client_config: { 'broadcast-mode': 'sync', }, - } for mnemonic in ['${VALIDATOR1_MNEMONIC}', '${VALIDATOR2_MNEMONIC}']], + }], accounts: [{ name: 'community', coins: '10000000000000000000000aphoton', @@ -47,9 +57,6 @@ max_bytes: '1048576', max_gas: '81500000', }, - abci: { - vote_extensions_enable_height: '1', - }, }, }, app_state: { @@ -81,6 +88,7 @@ params: { no_base_fee: false, base_fee: '100000000000', + min_gas_multiplier: '0.5', }, }, }, diff --git a/tests/integration_tests/cosmoscli.py b/tests/integration_tests/cosmoscli.py index e6435997c6..2b2e96c2eb 100644 --- a/tests/integration_tests/cosmoscli.py +++ b/tests/integration_tests/cosmoscli.py @@ -204,6 +204,18 @@ def account(self, addr): ) ) + def account_by_num(self, num): + return json.loads( + self.raw( + "q", + "auth", + "address-by-acc-num", + num, + output="json", + node=self.node_rpc, + ) + ) + def tx_search(self, events: str): "/tx_search" return json.loads( @@ -264,7 +276,7 @@ def staking_pool(self, bonded=True): def transfer(self, from_, to, coins, generate_only=False, **kwargs): kwargs.setdefault("gas_prices", DEFAULT_GAS_PRICE) - return json.loads( + rsp = json.loads( self.raw( "tx", "bank", @@ -278,6 +290,9 @@ def transfer(self, from_, to, coins, generate_only=False, **kwargs): **kwargs, ) ) + if not generate_only and rsp["code"] == 0: + rsp = self.event_query_tx_for(rsp["txhash"]) + return rsp def get_delegated_amount(self, which_addr): return json.loads( @@ -384,7 +399,7 @@ def withdraw_all_rewards(self, from_delegator): ) def make_multisig(self, name, signer1, signer2): - self.raw( + return self.raw( "keys", "add", name, @@ -498,9 +513,12 @@ def combine_batch_multisig_tx( def broadcast_tx(self, tx_file, **kwargs): kwargs.setdefault("broadcast_mode", "sync") kwargs.setdefault("output", "json") - return json.loads( + rsp = json.loads( self.raw("tx", "broadcast", tx_file, node=self.node_rpc, **kwargs) ) + if rsp["code"] == 0: + rsp = self.event_query_tx_for(rsp["txhash"]) + return rsp def broadcast_tx_json(self, tx, **kwargs): with tempfile.NamedTemporaryFile("w") as fp: @@ -857,3 +875,43 @@ def submit_gov_proposal(self, proposal, **kwargs): **(default_kwargs | kwargs), ) ) + + def query_grant(self, granter, grantee): + "query grant details by granter and grantee addresses" + res = json.loads( + self.raw( + "query", + "feegrant", + "grant", + granter, + grantee, + home=self.data_dir, + node=self.node_rpc, + output="json", + ) + ) + res = res.get("allowance") or res + return res + + def grant(self, granter, grantee, limit, **kwargs): + default_kwargs = self.get_default_kwargs() + rsp = json.loads( + self.raw( + "tx", + "feegrant", + "grant", + granter, + grantee, + "--period", + "60", + "--period-limit", + limit, + "-y", + home=self.data_dir, + stderr=subprocess.DEVNULL, + **(default_kwargs | kwargs), + ) + ) + if rsp["code"] == 0: + rsp = self.event_query_tx_for(rsp["txhash"]) + return rsp diff --git a/tests/integration_tests/hardhat/contracts/TestBlockTxProperties.sol b/tests/integration_tests/hardhat/contracts/TestBlockTxProperties.sol new file mode 100644 index 0000000000..07d5b0d20d --- /dev/null +++ b/tests/integration_tests/hardhat/contracts/TestBlockTxProperties.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract TestBlockTxProperties { + function getBlockHash(uint256 blockNumber) public view returns (bytes32) { + return blockhash(blockNumber); + } +} diff --git a/tests/integration_tests/poetry.lock b/tests/integration_tests/poetry.lock index eec61d6f31..274ce7075b 100644 --- a/tests/integration_tests/poetry.lock +++ b/tests/integration_tests/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohttp" @@ -1636,7 +1636,6 @@ python-dateutil = "^2.8" python-dotenv = "^1.0" pyyaml = "^6.0" pyyaml-include = "^1.3" -rpds-py = "^0.17.0" supervisor = "^4.2" tomlkit = "^0" @@ -1644,7 +1643,7 @@ tomlkit = "^0" type = "git" url = "https://github.com/crypto-com/pystarport.git" reference = "main" -resolved_reference = "4704c4a27b159eaa4d434ef44b9bf1046e81da1b" +resolved_reference = "a7dac7f485b9acef30540d803b53fadaf1a1850a" [[package]] name = "pytest" @@ -1682,6 +1681,20 @@ files = [ [package.dependencies] pytest = ">=4.0.0" +[[package]] +name = "pytest-timeout" +version = "2.3.1" +description = "pytest plugin to abort hanging tests" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-timeout-2.3.1.tar.gz", hash = "sha256:12397729125c6ecbdaca01035b9e5239d4db97352320af155b3f5de1ba5165d9"}, + {file = "pytest_timeout-2.3.1-py3-none-any.whl", hash = "sha256:68188cb703edfc6a18fad98dc25a3c61e9f24d644b0b70f33af545219fc7813e"}, +] + +[package.dependencies] +pytest = ">=7.0.0" + [[package]] name = "python-dateutil" version = "2.8.2" @@ -1745,62 +1758,64 @@ files = [ [[package]] name = "pyyaml" -version = "6.0.1" +version = "6.0.2" description = "YAML parser and emitter for Python" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, - {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, - {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, - {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, - {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, - {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, - {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, - {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, - {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, - {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, - {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, - {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, - {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, - {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, ] [[package]] @@ -2438,4 +2453,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e2b24f3af2972f3799b6b7877084e48158b3dde1833c5837d32701f7ce81c42c" +content-hash = "250de604d40c8546d723cca7b74a237ac10d99d4c525f91be84783430f2f2267" diff --git a/tests/integration_tests/pyproject.toml b/tests/integration_tests/pyproject.toml index 01528df262..eff0e248ea 100644 --- a/tests/integration_tests/pyproject.toml +++ b/tests/integration_tests/pyproject.toml @@ -27,6 +27,8 @@ flaky = "^3.7" eth-bloom = "^3.0" eth-hash = "^0" jedi-language-server = "^0.41.3" +pytest-timeout = "^2.3.1" +pyyaml = "^6.0.2rc1" [tool.poetry.dev-dependencies] diff --git a/tests/integration_tests/test_batch.py b/tests/integration_tests/test_batch.py index ce006669a3..b43934a5b4 100644 --- a/tests/integration_tests/test_batch.py +++ b/tests/integration_tests/test_batch.py @@ -72,3 +72,62 @@ def test_batch_tx(ethermint): txs = w3.eth.get_block(receipts[0].blockNumber, True).transactions for i in range(3): assert txs[i].transactionIndex == i + + +def test_multisig(ethermint, tmp_path): + cli = ethermint.cosmos_cli() + cli.make_multisig("multitest1", "signer1", "signer2") + multi_addr = cli.address("multitest1") + signer1 = cli.address("signer1") + denom = "aphoton" + amt = 2000000000000000000 + rsp = cli.transfer(signer1, multi_addr, f"{amt}{denom}") + assert rsp["code"] == 0, rsp["raw_log"] + assert cli.balance(multi_addr, denom=denom) == amt + + acc = cli.account(multi_addr)["account"]["value"]["base_account"] + res = cli.account_by_num(acc["account_number"]) + assert res["account_address"] == multi_addr + + m_txt = tmp_path / "m.txt" + p1_txt = tmp_path / "p1.txt" + p2_txt = tmp_path / "p2.txt" + tx_txt = tmp_path / "tx.txt" + amt = 1 + signer2 = cli.address("signer2") + multi_tx = cli.transfer( + multi_addr, + signer2, + f"{amt}{denom}", + generate_only=True, + ) + json.dump(multi_tx, m_txt.open("w")) + signature1 = cli.sign_multisig_tx(m_txt, multi_addr, "signer1") + json.dump(signature1, p1_txt.open("w")) + signature2 = cli.sign_multisig_tx(m_txt, multi_addr, "signer2") + json.dump(signature2, p2_txt.open("w")) + final_multi_tx = cli.combine_multisig_tx( + m_txt, + "multitest1", + p1_txt, + p2_txt, + ) + json.dump(final_multi_tx, tx_txt.open("w")) + rsp = cli.broadcast_tx(tx_txt) + assert rsp["code"] == 0, rsp["raw_log"] + assert ( + cli.account(multi_addr)["account"]["value"]["base_account"]["address"] + == acc["address"] + ) + + +def test_textual(ethermint): + cli = ethermint.cosmos_cli() + rsp = cli.transfer( + cli.address("validator"), + cli.address("signer2"), + "1aphoton", + sign_mode="textual", + ) + print("mm-rsp", rsp) + assert rsp["code"] == 0, rsp["raw_log"] diff --git a/tests/integration_tests/test_block.py b/tests/integration_tests/test_block.py new file mode 100644 index 0000000000..b8c1facc32 --- /dev/null +++ b/tests/integration_tests/test_block.py @@ -0,0 +1,11 @@ +from .utils import CONTRACTS, deploy_contract, w3_wait_for_new_blocks + + +def test_call(ethermint): + w3 = ethermint.w3 + contract, res = deploy_contract(w3, CONTRACTS["TestBlockTxProperties"]) + height = w3.eth.get_block_number() + w3_wait_for_new_blocks(w3, 1) + res = contract.caller.getBlockHash(height).hex() + blk = w3.eth.get_block(height) + assert f"0x{res}" == blk.hash.hex(), res diff --git a/tests/integration_tests/test_debug_traceblock.py b/tests/integration_tests/test_debug_traceblock.py index 2e83fdd069..906d14c078 100644 --- a/tests/integration_tests/test_debug_traceblock.py +++ b/tests/integration_tests/test_debug_traceblock.py @@ -5,6 +5,7 @@ derive_new_account, send_transaction, sign_transaction, + w3_wait_for_block, wait_for_new_blocks, ) @@ -56,3 +57,4 @@ def trace_blk(blk): if total < expected: total += len(trace_blk(blk + 1)) assert total == expected + w3_wait_for_block(w3, w3.eth.block_number + 3, timeout=30) diff --git a/tests/integration_tests/test_fee_history.py b/tests/integration_tests/test_fee_history.py index 22f21d5b9b..3f65fa7fae 100644 --- a/tests/integration_tests/test_fee_history.py +++ b/tests/integration_tests/test_fee_history.py @@ -1,5 +1,4 @@ import hashlib -import json from concurrent.futures import ThreadPoolExecutor, as_completed from pathlib import Path @@ -9,9 +8,9 @@ from .network import setup_custom_ethermint from .utils import ( ADDRS, - approve_proposal, eth_to_bech32, send_transaction, + submit_gov_proposal, w3_wait_for_block, w3_wait_for_new_blocks, ) @@ -167,27 +166,21 @@ def update_feemarket_param(node, tmp_path, new_multiplier=2, new_denominator=200 p["base_fee"] = new_base_fee p["elasticity_multiplier"] = new_multiplier p["base_fee_change_denominator"] = new_denominator - proposal = tmp_path / "proposal.json" + # governance module account as signer data = hashlib.sha256("gov".encode()).digest()[:20] - signer = eth_to_bech32(data) - proposal_src = { - "messages": [ + authority = eth_to_bech32(data) + submit_gov_proposal( + node, + tmp_path, + messages=[ { "@type": "/ethermint.feemarket.v1.MsgUpdateParams", - "authority": signer, + "authority": authority, "params": p, } ], - "deposit": "2aphoton", - "title": "title", - "summary": "summary", - } - proposal.write_text(json.dumps(proposal_src)) - rsp = cli.submit_gov_proposal(proposal, from_="community") - assert rsp["code"] == 0, rsp["raw_log"] - approve_proposal(node, rsp) - print("check params have been updated now") + ) p = cli.get_params("feemarket")["params"] assert p["base_fee"] == new_base_fee assert p["elasticity_multiplier"] == new_multiplier diff --git a/tests/integration_tests/test_gas.py b/tests/integration_tests/test_gas.py index 9ab4c5480f..99f88eea2f 100644 --- a/tests/integration_tests/test_gas.py +++ b/tests/integration_tests/test_gas.py @@ -119,4 +119,4 @@ def discard(request, tmp_path_factory): def test_discard_abci_responses(discard): with pytest.raises(ValueError) as exc: discard.w3.eth.gas_price - assert "block result not found for height" in str(exc) + assert "header result not found for height" in str(exc) diff --git a/tests/integration_tests/test_grpc_only.py b/tests/integration_tests/test_grpc_only.py index 1fb0105c30..ecb207a57f 100644 --- a/tests/integration_tests/test_grpc_only.py +++ b/tests/integration_tests/test_grpc_only.py @@ -78,7 +78,7 @@ def test_grpc_mode(custom_ethermint): api_port = ports.api_port(custom_ethermint.base_port(1)) def expect_cb(rsp): - ret = rsp["ret"] + ret = rsp.get("ret") valid = ret is not None return valid and 9000 == int.from_bytes(base64.b64decode(ret.encode()), "big") diff --git a/tests/integration_tests/test_priority.py b/tests/integration_tests/test_priority.py index b899fcf22d..e1191e138b 100644 --- a/tests/integration_tests/test_priority.py +++ b/tests/integration_tests/test_priority.py @@ -3,7 +3,14 @@ import pytest from .network import setup_ethermint -from .utils import ADDRS, KEYS, eth_to_bech32, sign_transaction, wait_for_new_blocks +from .utils import ( + ADDRS, + KEYS, + eth_to_bech32, + send_transaction, + sign_transaction, + wait_for_new_blocks, +) PRIORITY_REDUCTION = 1000000 @@ -202,3 +209,18 @@ def test_native_tx_priority(ethermint): def get_max_priority_price(max_priority_price): "default to max int64 if None" return max_priority_price if max_priority_price is not None else sys.maxsize + + +def test_validate(ethermint): + w3 = ethermint.w3 + gas = int(1.2 * w3.eth.gas_price) + tx = { + "to": "0x0000000000000000000000000000000000000000", + "value": 1, + "gas": 21000, + "maxFeePerGas": gas, + "maxPriorityFeePerGas": gas + 1, + } + with pytest.raises(ValueError) as exc: + send_transaction(w3, tx) + assert "max priority fee per gas higher than max fee per gas" in str(exc) diff --git a/tests/integration_tests/test_tracers.py b/tests/integration_tests/test_tracers.py index eedb0f031d..ea1c051641 100644 --- a/tests/integration_tests/test_tracers.py +++ b/tests/integration_tests/test_tracers.py @@ -113,8 +113,7 @@ def process(w3): assert res[0] == res[-1] == EXPECTED_CONTRACT_CREATE_TRACER, res -def fund_acc(w3, acc): - fund = 3000000000000000000 +def fund_acc(w3, acc, fund=3000000000000000000): addr = acc.address if w3.eth.get_balance(addr, "latest") == 0: tx = {"to": addr, "value": fund, "gasPrice": w3.eth.gas_price} @@ -459,6 +458,100 @@ def process(w3): assert res[0] == res[-1] == balance, res +def test_refund_unused_gas_when_contract_tx_reverted(ethermint): + w3 = ethermint.w3 + test_revert, _ = deploy_contract(w3, CONTRACTS["TestRevert"]) + gas = 1000000 + gas_price = 6060000000000 + acc = derive_new_account(10) + fund_acc(w3, acc, fund=10000000000000000000) + p = ethermint.cosmos_cli().get_params("feemarket")["params"] + min_gas_multiplier = float(p["min_gas_multiplier"]) + sender = acc.address.lower() + tx_res = w3.provider.make_request( + "debug_traceCall", + [ + { + "value": "0x0", + "to": test_revert.address, + "from": sender, + "data": "0x9ffb86a5", + "gas": hex(gas), + "gasPrice": hex(gas_price), + }, + "latest", + { + "tracer": "prestateTracer", + "tracerConfig": { + "diffMode": True, + }, + }, + ], + ) + assert "result" in tx_res + tx_res = tx_res["result"] + pre = int(tx_res["pre"][sender]["balance"], 16) + post = int(tx_res["post"][sender]["balance"], 16) + diff = pre - gas * gas_price * min_gas_multiplier - post + assert diff == 0, diff + + pre = w3.eth.get_balance(acc.address) + receipt = send_transaction( + w3, + test_revert.functions.revertWithMsg().build_transaction( + { + "gas": gas, + "gasPrice": gas_price, + } + ), + key=acc.key, + ) + assert receipt["status"] == 0, receipt["status"] + post = w3.eth.get_balance(acc.address) + diff = pre - gas * gas_price * min_gas_multiplier - post + assert diff == 0, diff + + +def test_refund_unused_gas_when_contract_tx_reverted_state_overrides(ethermint): + w3 = ethermint.w3 + test_revert, _ = deploy_contract(w3, CONTRACTS["TestRevert"]) + gas = 21000 + gas_price = 6060000000000 + acc = derive_new_account(10) + fund_acc(w3, acc, fund=10000000000000000000) + sender = acc.address.lower() + balance = 10000000000000000000000 + nonce = 1000 + tx_res = w3.provider.make_request( + "debug_traceCall", + [ + { + "value": "0x1", + "to": test_revert.address, + "from": sender, + "gas": hex(gas), + "gasPrice": hex(gas_price), + }, + "latest", + { + "tracer": "prestateTracer", + "stateOverrides": { + sender: { + "balance": hex(balance), + "nonce": hex(nonce), + } + } + }, + ], + ) + assert "result" in tx_res + tx_res = tx_res["result"] + balance_af = int(tx_res[sender]["balance"], 16) + nonce_af = tx_res[sender]["nonce"] + assert balance_af == balance, balance_af + assert nonce_af == nonce, nonce_af + + def test_debug_tracecall_return_revert_data_when_call_failed(ethermint, geth): expected = "08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a46756e6374696f6e20686173206265656e207265766572746564000000000000" # noqa: E501 diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index da02f3b4b2..c230a16ef7 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -1,4 +1,5 @@ import configparser +import hashlib import json import re import subprocess @@ -14,7 +15,9 @@ CONTRACTS, approve_proposal, deploy_contract, + eth_to_bech32, send_transaction, + submit_gov_proposal, wait_for_block, wait_for_port, ) @@ -84,7 +87,7 @@ def custom_ethermint(tmp_path_factory): ) -def test_cosmovisor_upgrade(custom_ethermint: Ethermint): +def test_cosmovisor_upgrade(custom_ethermint: Ethermint, tmp_path): """ - propose an upgrade and pass it - wait for it to happen @@ -166,3 +169,36 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): ) ) assert p == {"allowed_clients": ["06-solomachine", "07-tendermint", "09-localhost"]} + + p = cli.get_params("evm")["params"] + header_hash_num = "20" + p["header_hash_num"] = header_hash_num + # governance module account as signer + data = hashlib.sha256("gov".encode()).digest()[:20] + authority = eth_to_bech32(data) + submit_gov_proposal( + custom_ethermint, + tmp_path, + messages=[ + { + "@type": "/ethermint.evm.v1.MsgUpdateParams", + "authority": authority, + "params": p, + } + ], + ) + p = cli.get_params("evm")["params"] + assert p["header_hash_num"] == header_hash_num, p + contract, _ = deploy_contract(w3, CONTRACTS["TestBlockTxProperties"]) + for h in [target_height - 1, target_height, target_height + 1]: + res = contract.caller.getBlockHash(h).hex() + blk = w3.eth.get_block(h) + assert f"0x{res}" == blk.hash.hex(), res + + height = w3.eth.block_number + for h in [ + height - int(header_hash_num) - 1, # num64 < lower + height + 100, # num64 >= upper + ]: + res = contract.caller.getBlockHash(h).hex() + assert f"0x{res}" == "0x" + "0" * 64, res diff --git a/tests/integration_tests/test_websockets.py b/tests/integration_tests/test_websockets.py index ffe9e2542c..5c127c4b40 100644 --- a/tests/integration_tests/test_websockets.py +++ b/tests/integration_tests/test_websockets.py @@ -100,6 +100,19 @@ async def assert_unsubscribe(c: Client, sub_id): # unsubscribe again return False assert not await c.unsubscribe(sub_id) + async def subscriber_test(c: Client, w3): + sub_id = await c.subscribe("newHeads") + # wait for three new blocks + msgs = [await c.recv_subscription(sub_id) for i in range(3)] + # check blocks are consecutive + assert int(msgs[1]["number"], 0) == int(msgs[0]["number"], 0) + 1 + assert int(msgs[2]["number"], 0) == int(msgs[1]["number"], 0) + 1 + for msg in msgs: + b = w3.eth.get_block(msg["number"]) + assert HexBytes(msg["hash"]) == b["hash"] + assert msg["miner"] == b["miner"] + await assert_unsubscribe(c, sub_id) + async def logs_test(c: Client, w3, contract): method = "Transfer(address,address,uint256)" topic = f"0x{abi.event_signature_to_log_topic(method).hex()}" @@ -136,6 +149,8 @@ async def async_test(): async with websockets.connect(ethermint.w3_ws_endpoint) as ws: c = Client(ws) t = asyncio.create_task(c.receive_loop()) + # run three subscribers concurrently + await asyncio.gather(*[subscriber_test(c, ethermint.w3) for i in range(3)]) # run send concurrently await asyncio.gather(*[c.send(id) for id in ["0", 1, 2.0]]) contract, _ = deploy_contract(ethermint.w3, CONTRACTS["TestERC20A"]) diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index 4eb1fdcfa3..9d5e9a15b2 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -43,6 +43,7 @@ "Calculator": "Calculator.sol", "Caller": "Caller.sol", "Random": "Random.sol", + "TestBlockTxProperties": "TestBlockTxProperties.sol", } @@ -356,6 +357,21 @@ def cb(attrs): assert proposal["status"] == "PROPOSAL_STATUS_PASSED", proposal +def submit_gov_proposal(ethermint, tmp_path, **kwargs): + proposal = tmp_path / "proposal.json" + proposal_src = { + "title": "title", + "summary": "summary", + "deposit": "2aphoton", + **kwargs, + } + proposal.write_text(json.dumps(proposal_src)) + rsp = ethermint.cosmos_cli().submit_gov_proposal(proposal, from_="community") + assert rsp["code"] == 0, rsp["raw_log"] + approve_proposal(ethermint, rsp) + print("check params have been updated now") + + class ContractAddress(rlp.Serializable): fields = [ ("from", rlp.sedes.Binary()), diff --git a/tests/rpc/utils.go b/tests/rpc/utils.go index 77539af10d..f1c5055c79 100644 --- a/tests/rpc/utils.go +++ b/tests/rpc/utils.go @@ -149,7 +149,7 @@ func CallWithError(method string, params interface{}) (*Response, error) { } if rpcRes.Error != nil { - return nil, fmt.Errorf(rpcRes.Error.Message) + return nil, errors.New(rpcRes.Error.Message) } return rpcRes, nil diff --git a/testutil/base_test_suite.go b/testutil/base_test_suite.go index 4136d45268..ab74ece864 100644 --- a/testutil/base_test_suite.go +++ b/testutil/base_test_suite.go @@ -61,7 +61,7 @@ func (suite *BaseTestSuite) MintFeeCollectorVirtual(coins sdk.Coins) { func addVirtualCoins(store storetypes.ObjKVStore, txIndex int, addr sdk.AccAddress, amt sdk.Coins) { key := make([]byte, len(addr)+8) copy(key, addr) - binary.BigEndian.PutUint64(key[len(addr):], uint64(txIndex)) + binary.BigEndian.PutUint64(key[len(addr):], uint64(txIndex)) //nolint:gosec // test only var coins sdk.Coins value := store.Get(key) diff --git a/testutil/network/network.go b/testutil/network/network.go index e3d5e0c52d..08652cb6e4 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -196,14 +196,13 @@ type ( RPCClient tmrpcclient.Client JSONRPCClient *ethclient.Client - tmNode *node.Node - api *api.Server - grpc *grpc.Server - grpcWeb *http.Server - jsonrpc *http.Server - jsonrpcDone chan struct{} - errGroup *errgroup.Group - cancelFn context.CancelFunc + tmNode *node.Node + api *api.Server + grpc *grpc.Server + grpcWeb *http.Server + jsonrpc *http.Server + errGroup *errgroup.Group + cancelFn context.CancelFunc } ) @@ -648,18 +647,7 @@ func (n *Network) Cleanup() { } if v.jsonrpc != nil { - shutdownCtx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second) - defer cancelFn() - - if err := v.jsonrpc.Shutdown(shutdownCtx); err != nil { - v.tmNode.Logger.Error("HTTP server shutdown produced a warning", "error", err.Error()) - } else { - v.tmNode.Logger.Info("HTTP server shut down, waiting 5 sec") - select { - case <-time.Tick(5 * time.Second): - case <-v.jsonrpcDone: - } - } + _ = v.jsonrpc.Close() } } diff --git a/testutil/network/util.go b/testutil/network/util.go index ebc5e1e044..9b8721fe19 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -143,8 +143,8 @@ func startInProcess(cfg Config, val *Validator) error { return fmt.Errorf("validator %s context is nil", val.Moniker) } - val.jsonrpc, val.jsonrpcDone, err = server.StartJSONRPC( - val.Ctx, val.ClientCtx, val.errGroup, val.AppConfig, + val.jsonrpc, err = server.StartJSONRPC( + ctx, val.Ctx, val.ClientCtx, val.errGroup, val.AppConfig, nil, app.(server.AppWithPendingTxStream), ) if err != nil { diff --git a/testutil/tx/cosmos.go b/testutil/tx/cosmos.go index 91ce574057..43f9d51191 100644 --- a/testutil/tx/cosmos.go +++ b/testutil/tx/cosmos.go @@ -67,7 +67,8 @@ func PrepareCosmosTx( var fees sdk.Coins if args.GasPrice != nil { - fees = sdk.Coins{{Denom: evmtypes.DefaultEVMDenom, Amount: args.GasPrice.MulRaw(int64(args.Gas))}} + gas := int64(args.Gas) //nolint:gosec // test only + fees = sdk.Coins{{Denom: evmtypes.DefaultEVMDenom, Amount: args.GasPrice.MulRaw(gas)}} } else { fees = sdk.Coins{DefaultFee} } diff --git a/types/account_test.go b/types/account_test.go index 9afac71ebc..21458827a6 100644 --- a/types/account_test.go +++ b/types/account_test.go @@ -7,15 +7,18 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" + "cosmossdk.io/x/tx/signing/aminojson" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - cryptocodec "github.com/evmos/ethermint/crypto/codec" "github.com/evmos/ethermint/crypto/ethsecp256k1" ethermintcodec "github.com/evmos/ethermint/encoding/codec" "github.com/evmos/ethermint/types" + ethermint "github.com/evmos/ethermint/types" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/anypb" ) func init() { @@ -56,3 +59,19 @@ func (suite *AccountTestSuite) TestAccountType() { suite.account.CodeHash = common.BytesToHash(crypto.Keccak256([]byte{1, 2, 3})).Hex() suite.Require().Equal(types.AccountTypeContract, suite.account.Type()) } + +func TestAminoMarshal(t *testing.T) { + registry := codectypes.NewInterfaceRegistry() + ethermint.RegisterInterfaces(registry) + value := "\n\x86\x02\n+tcrc1l8h07yxmwvc963tg08at7k9882d5ha4t34guxe\x12\xd2\x01\n)/cosmos.crypto.multisig.LegacyAminoPubKey\x12\xa4\x01\x08\x02\x12O\n(/ethermint.crypto.v1.ethsecp256k1.PubKey\x12#\n!\x03һ\xfb\x81\x1a\xb40E\xc0\x16\xf4\x17\xfba\xe5V\x10\xfd]\x8d\x19m\x08\xe0\xc6i\x83\xf9S\x9e\x1b\xd8\x12O\n(/ethermint.crypto.v1.ethsecp256k1.PubKey\x12#\n!\x02\x19]\xed\xa5\x84:\xae\xa2\x0fȌ\xb6MKR\xfc\xc5\xc8SD1\x0cSn\x83|P\xad'\xf7\xa8\x8d\x18\x12 \x02\x12B0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + msg := &anypb.Any{ + TypeUrl: "/ethermint.types.v1.EthAccount", + Value: []byte(value), + } + aj := aminojson.NewEncoder(aminojson.EncoderOptions{ + FileResolver: registry, + Indent: " ", + }) + _, err := aj.Marshal(msg) + require.NoError(t, err) +} diff --git a/types/int.go b/types/int.go index 9342b836c6..de02539067 100644 --- a/types/int.go +++ b/types/int.go @@ -21,9 +21,8 @@ import ( "math/big" "math/bits" - errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - errortypes "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common/hexutil" ) const ( @@ -40,20 +39,104 @@ func init() { // SafeInt64 checks for overflows while casting a uint64 to int64 value. func SafeInt64(value uint64) (int64, error) { if value > uint64(math.MaxInt64) { - return 0, errorsmod.Wrapf(errortypes.ErrInvalidHeight, "uint64 value %v cannot exceed %v", value, int64(math.MaxInt64)) + return 0, fmt.Errorf("uint64 value %v cannot exceed %v", value, math.MaxInt64) } return int64(value), nil } +func SafeUint64ToInt32(value uint64) (int32, error) { + if value > uint64(math.MaxInt64) { + return 0, fmt.Errorf("uint64 value %v cannot exceed %v", value, math.MaxInt64) + } + + return int32(value), nil //nolint:gosec // checked +} + +func SafeUint64ToInt(value uint64) (int, error) { + if value > uint64(math.MaxInt64) { + return 0, fmt.Errorf("uint64 value %v cannot exceed %v", value, math.MaxInt64) + } + + return int(value), nil +} + +func SafeHexToInt64(value hexutil.Uint64) (int64, error) { + if value > math.MaxInt64 { + return 0, fmt.Errorf("hexutil.Uint64 value %v cannot exceed %v", value, math.MaxInt64) + } + + return int64(value), nil //nolint:gosec // checked +} + +func SafeUint32(value int) (uint32, error) { + if value > math.MaxUint32 { + return 0, fmt.Errorf("int value %v cannot exceed %v", value, math.MaxUint32) + } + + return uint32(value), nil //nolint:gosec // checked +} + +func SafeUint64(value int64) (uint64, error) { + if value < 0 { + return 0, fmt.Errorf("invalid value: %d", value) + } + return uint64(value), nil +} + +func SafeIntToUint64(value int) (uint64, error) { + if value < 0 { + return 0, fmt.Errorf("invalid value: %d", value) + } + return uint64(value), nil +} + +func SafeInt32ToUint64(value int32) (uint64, error) { + if value < 0 { + return 0, fmt.Errorf("invalid value: %d", value) + } + return uint64(value), nil +} + +func SafeUint(value int) (uint, error) { + if value < 0 { + return 0, fmt.Errorf("invalid value: %d", value) + } + return uint(value), nil +} + +func SafeUintToInt32(value uint) (int32, error) { + if value > uint(math.MaxInt32) { + return 0, fmt.Errorf("uint value %v cannot exceed %v", value, math.MaxUint32) + } + + return int32(value), nil +} + +func SafeIntToInt32(value int) (int32, error) { + if value > int(math.MaxInt32) { + return 0, fmt.Errorf("int value %v cannot exceed %v", value, math.MaxUint32) + } + + return int32(value), nil //nolint:gosec // checked +} + func SafeInt(value uint) (int, error) { if value > uint(math.MaxInt64) { - return 0, errorsmod.Wrapf(errortypes.ErrInvalidHeight, "uint value %v cannot exceed %v", value, int(math.MaxInt64)) + return 0, fmt.Errorf("uint value %v cannot exceed %v", value, math.MaxInt64) } return int(value), nil } +func SafeHexToInt(value hexutil.Uint) (int, error) { + if value > hexutil.Uint(math.MaxInt) { + return 0, fmt.Errorf("hexutil.Uint value %v cannot exceed %v", value, math.MaxInt) + } + + return int(value), nil //nolint:gosec // checked +} + // SafeNewIntFromBigInt constructs Int from big.Int, return error if more than 256bits func SafeNewIntFromBigInt(i *big.Int) (sdkmath.Int, error) { if !IsValidInt256(i) { diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index 3e14f9547c..08144f8b94 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -33,6 +33,8 @@ import ( "github.com/evmos/ethermint/x/evm/types" ) +const FlagEvmDenom = "evm-denom" + // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ @@ -77,12 +79,20 @@ func NewRawTxCmd() *cobra.Command { return err } - rsp, err := rpctypes.NewQueryClient(clientCtx).Params(cmd.Context(), &types.QueryParamsRequest{}) + evmDenom, err := cmd.Flags().GetString(FlagEvmDenom) if err != nil { return err } - tx, err := msg.BuildTx(clientCtx.TxConfig.NewTxBuilder(), rsp.Params.EvmDenom) + if evmDenom == "" { + rsp, err := rpctypes.NewQueryClient(clientCtx).Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + evmDenom = rsp.Params.EvmDenom + } + + tx, err := msg.BuildTx(clientCtx.TxConfig.NewTxBuilder(), evmDenom) if err != nil { return err } @@ -129,5 +139,6 @@ func NewRawTxCmd() *cobra.Command { } flags.AddTxFlagsToCmd(cmd) + cmd.Flags().String(FlagEvmDenom, "", "defines the EVM denomination which could be used for generate only when offline") return cmd } diff --git a/x/evm/keeper/abci.go b/x/evm/keeper/abci.go index d890eb53f3..04c6d1442d 100644 --- a/x/evm/keeper/abci.go +++ b/x/evm/keeper/abci.go @@ -17,6 +17,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + ethermint "github.com/evmos/ethermint/types" ) // BeginBlock sets the sdk Context and EIP155 chain id to the Keeper. @@ -24,10 +25,22 @@ func (k *Keeper) BeginBlock(ctx sdk.Context) error { k.WithChainID(ctx) // cache parameters that's common for the whole block. - if _, err := k.EVMBlockConfig(ctx, k.ChainID()); err != nil { + cfg, err := k.EVMBlockConfig(ctx, k.ChainID()) + if err != nil { return err } - + k.SetHeaderHash(ctx) + headerHashNum, err := ethermint.SafeInt64(cfg.Params.GetHeaderHashNum()) + if err != nil { + panic(err) + } + if i := ctx.BlockHeight() - headerHashNum; i > 0 { + h, err := ethermint.SafeUint64(i) + if err != nil { + panic(err) + } + k.DeleteHeaderHash(ctx, h) + } return nil } diff --git a/x/evm/keeper/config.go b/x/evm/keeper/config.go index 4a19709975..fb9f1fc6d3 100644 --- a/x/evm/keeper/config.go +++ b/x/evm/keeper/config.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" rpctypes "github.com/evmos/ethermint/rpc/types" + ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/statedb" "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" @@ -85,8 +86,14 @@ func (k *Keeper) EVMBlockConfig(ctx sdk.Context, chainID *big.Int) (*EVMBlockCon baseFee = new(big.Int) } } - - blockTime := uint64(ctx.BlockHeader().Time.Unix()) + time := ctx.BlockHeader().Time + var blockTime uint64 + if !time.IsZero() { + blockTime, err = ethermint.SafeUint64(time.Unix()) + if err != nil { + return nil, err + } + } blockNumber := big.NewInt(ctx.BlockHeight()) rules := ethCfg.Rules(blockNumber, ethCfg.MergeNetsplitBlock != nil, blockTime) @@ -111,6 +118,13 @@ func (k *Keeper) RemoveParamsCache(ctx sdk.Context) { ctx.ObjectStore(k.objectKey).Delete(types.KeyPrefixObjectParams) } +func (cfg EVMConfig) GetTracer() vm.EVMLogger { + if _, ok := cfg.Tracer.(*types.NoOpTracer); ok { + return nil + } + return cfg.Tracer +} + // EVMConfig creates the EVMConfig based on current state func (k *Keeper) EVMConfig(ctx sdk.Context, chainID *big.Int, txHash common.Hash) (*EVMConfig, error) { blockCfg, err := k.EVMBlockConfig(ctx, chainID) @@ -148,12 +162,8 @@ func (k Keeper) VMConfig(ctx sdk.Context, cfg *EVMConfig) vm.Config { noBaseFee = cfg.FeeMarketParams.NoBaseFee } - if _, ok := cfg.Tracer.(*types.NoOpTracer); ok { - cfg.Tracer = nil - } - return vm.Config{ - Tracer: cfg.Tracer, + Tracer: cfg.GetTracer(), NoBaseFee: noBaseFee, ExtraEips: cfg.Params.EIPs(), } diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 30bed2e3b8..12179d35f4 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -315,7 +315,10 @@ func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*type // Query block gas limit params := ctx.ConsensusParams() if params.Block != nil && params.Block.MaxGas > 0 { - hi = uint64(params.Block.MaxGas) + hi, err = ethermint.SafeUint64(params.Block.MaxGas) + if err != nil { + return nil, err + } } else { hi = req.GasCap } @@ -491,7 +494,10 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ continue } cfg.TxConfig.TxHash = ethTx.Hash() - cfg.TxConfig.TxIndex = uint(i) + cfg.TxConfig.TxIndex, err = ethermint.SafeUint(i) + if err != nil { + continue + } rsp, err := k.ApplyMessageWithConfig(ctx, msg, cfg, true) if err != nil { continue @@ -558,7 +564,10 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) result := types.TxTraceResult{} ethTx := tx.AsTransaction() cfg.TxConfig.TxHash = ethTx.Hash() - cfg.TxConfig.TxIndex = uint(i) + cfg.TxConfig.TxIndex, err = ethermint.SafeUint(i) + if err != nil { + return nil, err + } msg, err := core.TransactionToMessage(ethTx, signer, cfg.BaseFee) if err != nil { result.Error = status.Error(codes.Internal, err.Error()).Error() diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index 5ce91aa026..fcf5b06014 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -899,6 +899,20 @@ func (suite *GRPCServerTestSuiteSuite) TestTraceTx() { } predecessors = []*types.MsgEthereumTx{} }, + expPass: false, + enableFeemarket: true, + }, + { + msg: "default trace with enableFeemarket and sufficient balance", + malleate: func() { + suite.App.EvmKeeper.SetBalance(suite.Ctx, suite.Address, big.NewInt(1000000000000000000), types.DefaultEVMDenom) + traceConfig = &types.TraceConfig{ + DisableStack: true, + DisableStorage: true, + EnableMemory: false, + } + predecessors = []*types.MsgEthereumTx{} + }, expPass: true, traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", enableFeemarket: true, @@ -911,6 +925,18 @@ func (suite *GRPCServerTestSuiteSuite) TestTraceTx() { } predecessors = []*types.MsgEthereumTx{} }, + expPass: false, + enableFeemarket: true, + }, + { + msg: "javascript tracer with enableFeemarket and sufficient balance", + malleate: func() { + suite.App.EvmKeeper.SetBalance(suite.Ctx, suite.Address, big.NewInt(1000000000000000000), types.DefaultEVMDenom) + traceConfig = &types.TraceConfig{ + Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", + } + predecessors = []*types.MsgEthereumTx{} + }, expPass: true, traceResponse: "[]", enableFeemarket: true, diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 56acb834f5..8689485435 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -120,9 +120,14 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return sdkCtx.Logger().With("module", "x/"+types.ModuleName) } -// WithChainID sets the chain id to the local variable in the keeper +// WithChainID sets the chain ID for the keeper by extracting it from the provided context func (k *Keeper) WithChainID(ctx sdk.Context) { - chainID, err := ethermint.ParseChainID(ctx.ChainID()) + k.WithChainIDString(ctx.ChainID()) +} + +// WithChainIDString sets the chain ID for the keeper after parsing the provided string value +func (k *Keeper) WithChainIDString(value string) { + chainID, err := ethermint.ParseChainID(value) if err != nil { panic(err) } @@ -211,17 +216,7 @@ func (k *Keeper) GetAccount(ctx sdk.Context, addr common.Address) *statedb.Accou if acct == nil { return nil } - - codeHash := types.EmptyCodeHash - ethAcct, ok := acct.(ethermint.EthAccountI) - if ok { - codeHash = ethAcct.GetCodeHash().Bytes() - } - - return &statedb.Account{ - Nonce: acct.GetSequence(), - CodeHash: codeHash, - } + return statedb.NewAccountFromSdkAccount(acct) } // GetAccountOrEmpty returns empty account if not exist, returns error if it's not `EthAccount` @@ -310,3 +305,25 @@ func (k Keeper) AddTransientGasUsed(ctx sdk.Context, gasUsed uint64) (uint64, er k.SetTransientGasUsed(ctx, result) return result, nil } + +// SetHeaderHash stores the hash of the current block header in the store. +func (k Keeper) SetHeaderHash(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + height, err := ethermint.SafeUint64(ctx.BlockHeight()) + if err != nil { + panic(err) + } + store.Set(types.GetHeaderHashKey(height), ctx.HeaderHash()) +} + +// GetHeaderHash retrieves the hash of a block header from the store by height. +func (k Keeper) GetHeaderHash(ctx sdk.Context, height uint64) []byte { + store := ctx.KVStore(k.storeKey) + return store.Get(types.GetHeaderHashKey(height)) +} + +// DeleteHeaderHash removes the hash of a block header from the store by height +func (k Keeper) DeleteHeaderHash(ctx sdk.Context, height uint64) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.GetHeaderHashKey(height)) +} diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index cb23aad6fc..ed799c6ea7 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -31,6 +31,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/hashicorp/go-metrics" + ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/types" ) @@ -75,8 +76,15 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t // Observe which users define a gas limit >> gas used. Note, that // gas_limit and gas_used are always > 0 - gasLimit := sdkmath.LegacyNewDec(int64(tx.Gas())) - gasRatio, err := gasLimit.QuoInt64(int64(response.GasUsed)).Float64() + gasLimit, err := ethermint.SafeInt64(tx.Gas()) + if err != nil { + k.Logger(ctx).Error("failed to cast gas to int64", "error", err) + } + gasUsed, err := ethermint.SafeInt64(response.GasUsed) + if err != nil { + k.Logger(ctx).Error("failed to cast gasUsed to int64", "error", err) + } + gasRatio, err := sdkmath.LegacyNewDec(gasLimit).QuoInt64(gasUsed).Float64() if err == nil { telemetry.SetGaugeWithLabels( []string{"tx", "msg", "ethereum_tx", "gas_limit", "per", "gas_used"}, diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 0c7189f1e0..3b4906246e 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -21,8 +21,6 @@ import ( "math/big" "sort" - cmttypes "github.com/cometbft/cometbft/types" - errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,6 +28,7 @@ import ( "github.com/evmos/ethermint/x/evm/statedb" "github.com/evmos/ethermint/x/evm/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -92,59 +91,52 @@ func (k *Keeper) NewEVM( return evm } -// GetHashFn implements vm.GetHashFunc for Ethermint. It handles 3 cases: -// 1. The requested height matches the current height from context (and thus same epoch number) -// 2. The requested height is from an previous height from the same chain epoch -// 3. The requested height is from a height greater than the latest one +// GetHashFn implements vm.GetHashFunc for Ethermint. It returns hash for 3 cases: +// 1. The requested height matches current block height from the context. +// 2. The requested height is within the valid range, retrieve the hash from GetHeaderHash for heights after sdk50. +// 3. The requested height is within the valid range, retrieve the hash from GetHistoricalInfo for heights before sdk50. func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { - return func(height uint64) common.Hash { - h, err := ethermint.SafeInt64(height) + return func(num64 uint64) common.Hash { + h, err := ethermint.SafeInt64(num64) if err != nil { - k.Logger(ctx).Error("failed to cast height to int64", "error", err) return common.Hash{} } - - switch { - case ctx.BlockHeight() == h: - // Case 1: The requested height matches the one from the context so we can retrieve the header - // hash directly from the context. - // Note: The headerHash is only set at begin block, it will be nil in case of a query context + upper, err := ethermint.SafeUint64(ctx.BlockHeight()) + if err != nil { + return common.Hash{} + } + if upper == num64 { headerHash := ctx.HeaderHash() - if len(headerHash) != 0 { + if len(headerHash) > 0 { return common.BytesToHash(headerHash) } - - // only recompute the hash if not set (eg: checkTxState) - contextBlockHeader := ctx.BlockHeader() - header, err := cmttypes.HeaderFromProto(&contextBlockHeader) - if err != nil { - k.Logger(ctx).Error("failed to cast tendermint header from proto", "error", err) - return common.Hash{} - } - - headerHash = header.Hash() - return common.BytesToHash(headerHash) - - 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, err := k.stakingKeeper.GetHistoricalInfo(ctx, h) - if err != nil { - k.Logger(ctx).Debug("historical info not found", "height", h, "err", err.Error()) - return common.Hash{} - } - - header, err := cmttypes.HeaderFromProto(&histInfo.Header) - if err != nil { - k.Logger(ctx).Error("failed to cast tendermint header from proto", "error", err) - return common.Hash{} - } - - return common.BytesToHash(header.Hash()) - default: - // Case 3: heights greater than the current one returns an empty hash. + } + // Align check with https://github.com/ethereum/go-ethereum/blob/release/1.11/core/vm/instructions.go#L433 + headerNum := k.GetParams(ctx).HeaderHashNum + var lower uint64 + if upper <= headerNum { + lower = 0 + } else { + lower = upper - headerNum + } + if num64 < lower || num64 >= upper { + return common.Hash{} + } + hash := k.GetHeaderHash(ctx, num64) + if len(hash) > 0 { + return common.BytesToHash(hash) + } + histInfo, err := k.stakingKeeper.GetHistoricalInfo(ctx, h) + if err != nil { + k.Logger(ctx).Debug("historical info not found", "height", h, "err", err.Error()) + return common.Hash{} + } + header, err := cmttypes.HeaderFromProto(&histInfo.Header) + if err != nil { + k.Logger(ctx).Error("failed to cast tendermint header from proto", "error", err) return common.Hash{} } + return common.BytesToHash(header.Hash()) } } @@ -330,22 +322,25 @@ func (k *Keeper) ApplyMessageWithConfig( } } evm = k.NewEVM(ctx, msg, cfg, stateDB) + // Allow the tracer captures the tx level events, mainly the gas consumption. leftoverGas := msg.GasLimit sender := vm.AccountRef(msg.From) - // Allow the tracer captures the tx level events, mainly the gas consumption. - vmCfg := evm.Config - if vmCfg.Tracer != nil { + tracer := cfg.GetTracer() + if tracer != nil { if cfg.DebugTrace { - // msg.GasPrice should have been set to effective gas price - stateDB.SubBalance(sender.Address(), new(big.Int).Mul(msg.GasPrice, new(big.Int).SetUint64(msg.GasLimit))) + amount := new(big.Int).Mul(msg.GasPrice, new(big.Int).SetUint64(msg.GasLimit)) + stateDB.SubBalance(sender.Address(), amount) + if err := stateDB.Error(); err != nil { + return nil, err + } stateDB.SetNonce(sender.Address(), stateDB.GetNonce(sender.Address())+1) } - vmCfg.Tracer.CaptureTxStart(leftoverGas) + tracer.CaptureTxStart(leftoverGas) defer func() { if cfg.DebugTrace { stateDB.AddBalance(sender.Address(), new(big.Int).Mul(msg.GasPrice, new(big.Int).SetUint64(leftoverGas))) } - vmCfg.Tracer.CaptureTxEnd(leftoverGas) + tracer.CaptureTxEnd(leftoverGas) }() } @@ -418,7 +413,11 @@ func (k *Keeper) ApplyMessageWithConfig( // calculate a minimum amount of gas to be charged to sender if GasLimit // is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics // for more info https://github.com/evmos/ethermint/issues/1085 - gasLimit := sdkmath.LegacyNewDec(int64(msg.GasLimit)) + limit, err := ethermint.SafeInt64(msg.GasLimit) + if err != nil { + return nil, err + } + gasLimit := sdkmath.LegacyNewDec(limit) minGasMultiplier := cfg.FeeMarketParams.MinGasMultiplier if minGasMultiplier.IsNil() { // in case we are executing eth_call on a legacy block, returns a zero value. @@ -429,8 +428,12 @@ func (k *Keeper) ApplyMessageWithConfig( if msg.GasLimit < leftoverGas { return nil, errorsmod.Wrapf(types.ErrGasOverflow, "message gas limit < leftover gas (%d < %d)", msg.GasLimit, leftoverGas) } + tempGasUsed, err := ethermint.SafeInt64(temporaryGasUsed) + if err != nil { + return nil, err + } - gasUsed := sdkmath.LegacyMaxDec(minimumGasUsed, sdkmath.LegacyNewDec(int64(temporaryGasUsed))).TruncateInt().Uint64() + gasUsed := sdkmath.LegacyMaxDec(minimumGasUsed, sdkmath.LegacyNewDec(tempGasUsed)).TruncateInt().Uint64() // reset leftoverGas, to be used by the tracer leftoverGas = msg.GasLimit - gasUsed diff --git a/x/evm/keeper/state_transition_test.go b/x/evm/keeper/state_transition_test.go index bdc95a1f87..01c8278c02 100644 --- a/x/evm/keeper/state_transition_test.go +++ b/x/evm/keeper/state_transition_test.go @@ -5,12 +5,16 @@ import ( "math" "math/big" "testing" + "time" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtrand "github.com/cometbft/cometbft/libs/rand" + cmtversion "github.com/cometbft/cometbft/proto/tendermint/version" tmtypes "github.com/cometbft/cometbft/types" + "github.com/cometbft/cometbft/version" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -29,6 +33,7 @@ import ( "github.com/evmos/ethermint/x/evm/keeper" "github.com/evmos/ethermint/x/evm/statedb" "github.com/evmos/ethermint/x/evm/types" + evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -84,86 +89,104 @@ func TestStateTransitionTestSuite(t *testing.T) { suite.Run(t, new(StateTransitionTestSuite)) } +func makeRandHeader(height uint64) tmtypes.Header { + chainID := "test" + t := time.Now() + randBytes := cmtrand.Bytes(tmhash.Size) + randAddress := cmtrand.Bytes(cmtcrypto.AddressSize) + h := tmtypes.Header{ + Version: cmtversion.Consensus{Block: version.BlockProtocol, App: 1}, + ChainID: chainID, + Height: int64(height), + Time: t, + LastBlockID: tmtypes.BlockID{}, + LastCommitHash: randBytes, + DataHash: randBytes, + ValidatorsHash: randBytes, + NextValidatorsHash: randBytes, + ConsensusHash: randBytes, + AppHash: randBytes, + LastResultsHash: randBytes, + EvidenceHash: randBytes, + ProposerAddress: randAddress, + } + return h +} + +func (suite *StateTransitionTestSuite) registerHeader(header tmtypes.Header) { + suite.Ctx.WithBlockHeight(header.Height) + suite.Ctx.WithHeaderHash(header.Hash()) + suite.App.EvmKeeper.SetHeaderHash(suite.Ctx) +} + func (suite *StateTransitionTestSuite) TestGetHashFn() { - header := suite.Ctx.BlockHeader() - h, _ := tmtypes.HeaderFromProto(&header) - hash := h.Hash() + height := uint64(evmtypes.DefaultHeaderHashNum + 2) + header := makeRandHeader(height) + hash := header.Hash() testCases := []struct { msg string height uint64 - malleate func() + malleate func(int64) expHash common.Hash }{ { - "case 1.1: context hash cached", - uint64(suite.Ctx.BlockHeight()), - func() { - suite.Ctx = suite.Ctx.WithHeaderHash(tmhash.Sum([]byte("header"))).WithConsensusParams(*testutil.DefaultConsensusParams) + "use cached header hash", + height, + func(_ int64) { + suite.Ctx = suite.Ctx.WithHeaderHash(hash) }, - common.BytesToHash(tmhash.Sum([]byte("header"))), + common.BytesToHash(hash), }, { - "case 1.2: failed to cast Tendermint header", - uint64(suite.Ctx.BlockHeight()), - func() { - header := tmproto.Header{} - header.Height = suite.Ctx.BlockHeight() - suite.Ctx = suite.Ctx.WithBlockHeader(header).WithConsensusParams(*testutil.DefaultConsensusParams) + "header after sdk50 found", + height - 1, + func(height int64) { + suite.Ctx = suite.Ctx.WithBlockHeight(height).WithHeaderHash(header.Hash()) + suite.App.EvmKeeper.SetHeaderHash(suite.Ctx) }, - common.Hash{}, + common.BytesToHash(hash), }, { - "case 1.3: hash calculated from Tendermint header", - uint64(suite.Ctx.BlockHeight()), - func() { - suite.Ctx = suite.Ctx.WithBlockHeader(header).WithConsensusParams(*testutil.DefaultConsensusParams) + "header before sdk50 found", + height - 1, + func(height int64) { + suite.App.StakingKeeper.SetHistoricalInfo(suite.Ctx, height, &stakingtypes.HistoricalInfo{ + Header: *header.ToProto(), + }) }, common.BytesToHash(hash), }, { - "case 2.1: height lower than current one, hist info not found", - 1, - func() { - suite.Ctx = suite.Ctx.WithBlockHeight(10).WithConsensusParams(*testutil.DefaultConsensusParams) - }, + "header in context not found with current height", + height, + func(_ int64) {}, common.Hash{}, }, { - "case 2.2: height lower than current one, invalid hist info header", - 1, - func() { - suite.App.StakingKeeper.SetHistoricalInfo(suite.Ctx, 1, &stakingtypes.HistoricalInfo{}) - suite.Ctx = suite.Ctx.WithBlockHeight(10).WithConsensusParams(*testutil.DefaultConsensusParams) - }, + "height greater than current height", + height + 1, + func(_ int64) {}, common.Hash{}, }, { - "case 2.3: height lower than current one, calculated from hist info header", - 1, - func() { - histInfo := &stakingtypes.HistoricalInfo{ - Header: header, - } - suite.App.StakingKeeper.SetHistoricalInfo(suite.Ctx, 1, histInfo) - suite.Ctx = suite.Ctx.WithBlockHeight(10).WithConsensusParams(*testutil.DefaultConsensusParams) - }, - common.BytesToHash(hash), + "height less than header hash num range", + height - evmtypes.DefaultHeaderHashNum - 1, + func(_ int64) {}, + common.Hash{}, }, { - "case 3: height greater than current one", - 200, - func() {}, + "header not found in stores", + height - 1, + func(_ int64) {}, common.Hash{}, }, } - for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { suite.SetupTest() // reset - - tc.malleate() - + tc.malleate(int64(tc.height)) + suite.Ctx = suite.Ctx.WithBlockHeight(header.Height) hash := suite.App.EvmKeeper.GetHashFn(suite.Ctx)(tc.height) suite.Require().Equal(tc.expHash, hash) }) diff --git a/x/evm/keeper/utils.go b/x/evm/keeper/utils.go index d2b1257692..1da011225c 100644 --- a/x/evm/keeper/utils.go +++ b/x/evm/keeper/utils.go @@ -169,7 +169,7 @@ func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc sdk.AccountI, } if ctx.BlockHeight() > 0 { if err := bankKeeper.SendCoinsFromAccountToModuleVirtual(ctx, acc.GetAddress(), authtypes.FeeCollectorName, fees); err != nil { - return errorsmod.Wrapf(errortypes.ErrInsufficientFunds, err.Error()) + return errorsmod.Wrap(errortypes.ErrInsufficientFunds, err.Error()) } } return nil diff --git a/x/evm/simulation/operations.go b/x/evm/simulation/operations.go index 89ed26009a..d09603496d 100644 --- a/x/evm/simulation/operations.go +++ b/x/evm/simulation/operations.go @@ -215,7 +215,7 @@ func CreateRandomValidEthTx(ctx *simulateContext, return nil, err } // we suppose that gasLimit should be larger than estimateGas to ensure tx validity - gasLimit := estimateGas + uint64(ctx.rand.Intn(int(sdktx.MaxGasWanted-estimateGas))) + gasLimit := estimateGas + uint64(ctx.rand.Intn(int(sdktx.MaxGasWanted-estimateGas))) //nolint:gosec // test only ethChainID := ctx.keeper.ChainID() chainConfig := ctx.keeper.GetParams(ctx.context).ChainConfig.EthereumConfig(ethChainID) gasPrice := ctx.keeper.GetBaseFee(ctx.context, chainConfig) @@ -256,7 +256,7 @@ func EstimateGas(ctx *simulateContext, from, to *common.Address, data *hexutil.B // Transferable amount is between the range [0, spendable), spendable = balance - gasFeeCap * GasLimit. func RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, gasFeeCap *big.Int) (amount *big.Int, err error) { balance := ctx.keeper.GetEVMDenomBalance(ctx.context, address) - feeLimit := new(big.Int).Mul(gasFeeCap, big.NewInt(int64(estimateGas))) + feeLimit := new(big.Int).Mul(gasFeeCap, big.NewInt(int64(estimateGas))) //nolint:gosec // test only if (feeLimit.Cmp(balance)) > 0 { return nil, ErrNoEnoughBalance } diff --git a/x/evm/statedb/state_object.go b/x/evm/statedb/state_object.go index a9cffe6525..30b60b6554 100644 --- a/x/evm/statedb/state_object.go +++ b/x/evm/statedb/state_object.go @@ -19,8 +19,10 @@ import ( "bytes" "sort" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + ethermint "github.com/evmos/ethermint/types" ) var emptyCodeHash = crypto.Keccak256(nil) @@ -39,6 +41,18 @@ func NewEmptyAccount() *Account { } } +// NewAccountFromSdkAccount extracts the nonce and code hash from the provided SDK account. +func NewAccountFromSdkAccount(acct sdk.AccountI) *Account { + acc := NewEmptyAccount() + acc.Nonce = acct.GetSequence() + + if ethAcct, ok := acct.(ethermint.EthAccountI); ok { + acc.CodeHash = ethAcct.GetCodeHash().Bytes() + } + + return acc +} + // IsContract returns if the account contains contract code. func (acct Account) IsContract() bool { return !bytes.Equal(acct.CodeHash, emptyCodeHash) diff --git a/x/evm/statedb/statedb.go b/x/evm/statedb/statedb.go index b5f3caf027..ab4f7ac414 100644 --- a/x/evm/statedb/statedb.go +++ b/x/evm/statedb/statedb.go @@ -637,6 +637,10 @@ func (s *StateDB) RevertToSnapshot(revid int) { s.validRevisions = s.validRevisions[:idx] } +func (s *StateDB) Error() error { + return s.err +} + // Commit writes the dirty states to keeper // the StateDB object should be discarded after committed. func (s *StateDB) Commit() error { diff --git a/x/evm/types/eth.go b/x/evm/types/eth.go index e1fb2655bf..4ac6e9fbaa 100644 --- a/x/evm/types/eth.go +++ b/x/evm/types/eth.go @@ -21,7 +21,11 @@ func (tx EthereumTx) Size() int { if tx.Transaction == nil { return 0 } - return int(tx.Transaction.Size()) + size, err := types.SafeUint64ToInt(tx.Transaction.Size()) + if err != nil { + panic(err) + } + return size } func (tx EthereumTx) MarshalTo(dst []byte) (int, error) { @@ -68,17 +72,24 @@ func (tx EthereumTx) Validate() error { if tx.Gas() == 0 { return errorsmod.Wrap(ErrInvalidGasLimit, "gas limit must not be zero") } - if !types.IsValidInt256(tx.GasPrice()) { + if tx.GasPrice().BitLen() > 256 { return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") } - if !types.IsValidInt256(tx.GasFeeCap()) { + if tx.GasFeeCap().BitLen() > 256 { return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") } - if !types.IsValidInt256(tx.GasTipCap()) { + if tx.GasTipCap().BitLen() > 256 { return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") } - if !types.IsValidInt256(tx.Cost()) { + if tx.Cost().BitLen() > 256 { return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") } + if tx.GasFeeCapIntCmp(tx.GasTipCap()) < 0 { + return errorsmod.Wrapf( + ErrInvalidGasCap, + "max priority fee per gas higher than max fee per gas (%s > %s)", + tx.GasTipCap(), tx.GasFeeCap(), + ) + } return nil } diff --git a/x/evm/types/key.go b/x/evm/types/key.go index 51b19a469a..569ce7bb90 100644 --- a/x/evm/types/key.go +++ b/x/evm/types/key.go @@ -19,6 +19,7 @@ import ( "encoding/binary" "github.com/ethereum/go-ethereum/common" + ethermint "github.com/evmos/ethermint/types" ) const ( @@ -43,6 +44,7 @@ const ( prefixCode = iota + 1 prefixStorage prefixParams + prefixHeaderHash ) // prefix bytes for the EVM object store @@ -54,9 +56,10 @@ const ( // KVStore key prefixes var ( - KeyPrefixCode = []byte{prefixCode} - KeyPrefixStorage = []byte{prefixStorage} - KeyPrefixParams = []byte{prefixParams} + KeyPrefixCode = []byte{prefixCode} + KeyPrefixStorage = []byte{prefixStorage} + KeyPrefixParams = []byte{prefixParams} + KeyPrefixHeaderHash = []byte{prefixHeaderHash} ) // Object Store key prefixes @@ -80,14 +83,39 @@ func StateKey(address common.Address, key []byte) []byte { func ObjectGasUsedKey(txIndex int) []byte { var key [1 + 8]byte key[0] = prefixObjectGasUsed - binary.BigEndian.PutUint64(key[1:], uint64(txIndex)) + if txIndex < 0 { + return key[:] + } + idx, err := ethermint.SafeIntToUint64(txIndex) + if err != nil { + panic(err) + } + binary.BigEndian.PutUint64(key[1:], idx) return key[:] } func ObjectBloomKey(txIndex, msgIndex int) []byte { var key [1 + 8 + 8]byte key[0] = prefixObjectBloom - binary.BigEndian.PutUint64(key[1:], uint64(txIndex)) - binary.BigEndian.PutUint64(key[9:], uint64(msgIndex)) + if txIndex < 0 || msgIndex < 0 { + return key[:] + } + value, err := ethermint.SafeIntToUint64(txIndex) + if err != nil { + panic(err) + } + binary.BigEndian.PutUint64(key[1:], value) + value, err = ethermint.SafeIntToUint64(msgIndex) + if err != nil { + panic(err) + } + binary.BigEndian.PutUint64(key[9:], value) + return key[:] +} + +func GetHeaderHashKey(height uint64) []byte { + var key [1 + 8]byte + key[0] = prefixHeaderHash + binary.BigEndian.PutUint64(key[1:], height) return key[:] } diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index c2089b18f9..7d11751ee6 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -178,11 +178,9 @@ func (msg MsgEthereumTx) ValidateBasic() error { if msg.Data != nil { return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "tx data is deprecated in favor of Raw") } - if err := msg.Raw.Validate(); err != nil { return err } - return nil } @@ -403,8 +401,3 @@ func (m *MsgUpdateParams) ValidateBasic() error { return m.Params.Validate() } - -// GetSignBytes implements the LegacyMsg interface. -func (m MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} diff --git a/x/evm/types/msg_test.go b/x/evm/types/msg_test.go index fbaaa66d49..f2ff8992f2 100644 --- a/x/evm/types/msg_test.go +++ b/x/evm/types/msg_test.go @@ -19,6 +19,7 @@ import ( "github.com/evmos/ethermint/crypto/ethsecp256k1" "github.com/evmos/ethermint/encoding" "github.com/evmos/ethermint/tests" + ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/types" ) @@ -782,3 +783,98 @@ func assertEqual(orig *ethtypes.Transaction, cpy *ethtypes.Transaction) error { } return nil } + +func (suite *MsgsTestSuite) TestValidateEthereumTx() { + maxInt256 := ethermint.MaxInt256 + maxInt256Plus1 := new(big.Int).Add(ethermint.MaxInt256, big.NewInt(1)) + normal := big.NewInt(100) + gasLimit := uint64(21000) + testCases := []struct { + name string + tx types.EthereumTx + expError bool + }{ + { + "valid transaction", + types.NewTxWithData(ðtypes.LegacyTx{ + Gas: gasLimit, + GasPrice: normal, + Value: normal, + }).Raw, + false, + }, + { + "zero gas limit", + types.NewTxWithData(ðtypes.LegacyTx{ + Gas: 0, + GasPrice: normal, + Value: normal, + }).Raw, + true, + }, + { + "gas price exceeds int256 limit", + types.NewTxWithData(ðtypes.LegacyTx{ + Value: normal, + Gas: gasLimit, + GasPrice: maxInt256Plus1, + }).Raw, + true, + }, + { + "gas fee cap exceeds int256 limit", + types.NewTxWithData(ðtypes.DynamicFeeTx{ + Value: normal, + Gas: gasLimit, + GasFeeCap: maxInt256Plus1, + }).Raw, + true, + }, + { + "gas tip cap exceeds int256 limit", + types.NewTxWithData(ðtypes.DynamicFeeTx{ + Value: normal, + Gas: gasLimit, + GasFeeCap: normal, + GasTipCap: maxInt256Plus1, + }).Raw, + true, + }, + { + "LegacyTx cost exceeds int256 limit", + types.NewTxWithData(ðtypes.LegacyTx{ + Gas: gasLimit, + GasPrice: maxInt256, + Value: normal, + }).Raw, + true, + }, + { + "DynamicFeeTx cost exceeds int256 limit", + types.NewTxWithData(ðtypes.DynamicFeeTx{ + Gas: gasLimit, + Value: maxInt256Plus1, + }).Raw, + true, + }, + { + "AccessListTx cost exceeds int256 limit", + types.NewTxWithData(ðtypes.AccessListTx{ + Gas: gasLimit, + GasPrice: maxInt256, + Value: normal, + }).Raw, + true, + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.tx.Validate() + if tc.expError { + suite.Require().Error(err, tc.name) + } else { + suite.Require().NoError(err, tc.name) + } + }) + } +} diff --git a/x/evm/types/params.go b/x/evm/types/params.go index 27d84155cd..2dd5563988 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -34,6 +34,8 @@ var ( DefaultEnableCreate = true // DefaultEnableCall enables contract calls (i.e true) DefaultEnableCall = true + // DefaultHeaderHashNum defines the default number of header hash to persist. + DefaultHeaderHashNum = uint64(256) ) // NewParams creates a new Params instance @@ -58,6 +60,7 @@ func DefaultParams() Params { EnableCall: DefaultEnableCall, ChainConfig: config, AllowUnprotectedTxs: DefaultAllowUnprotectedTxs, + HeaderHashNum: DefaultHeaderHashNum, } } diff --git a/x/evm/types/params.pb.go b/x/evm/types/params.pb.go index ed314c775e..165d458898 100644 --- a/x/evm/types/params.pb.go +++ b/x/evm/types/params.pb.go @@ -39,6 +39,8 @@ type Params struct { // allow_unprotected_txs defines if replay-protected (i.e non EIP155 // signed) transactions can be executed on the state machine. AllowUnprotectedTxs bool `protobuf:"varint,6,opt,name=allow_unprotected_txs,json=allowUnprotectedTxs,proto3" json:"allow_unprotected_txs,omitempty"` + // header_hash_num is the number of header hash to persist. + HeaderHashNum uint64 `protobuf:"varint,7,opt,name=header_hash_num,json=headerHashNum,proto3" json:"header_hash_num,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -116,6 +118,13 @@ func (m *Params) GetAllowUnprotectedTxs() bool { return false } +func (m *Params) GetHeaderHashNum() uint64 { + if m != nil { + return m.HeaderHashNum + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "ethermint.evm.v1.Params") } @@ -123,32 +132,34 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/params.proto", fileDescriptor_e7d3c06c1322f20f) } var fileDescriptor_e7d3c06c1322f20f = []byte{ - // 391 bytes of a gzipped FileDescriptorProto + // 423 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x41, 0x8b, 0xd3, 0x40, - 0x18, 0x86, 0x93, 0xed, 0x5a, 0x36, 0xd3, 0x15, 0xd6, 0xb1, 0x4a, 0x58, 0xd8, 0x24, 0x44, 0x90, - 0x9c, 0x12, 0xba, 0x1e, 0x04, 0x41, 0xd0, 0xd4, 0x0a, 0xde, 0x96, 0xa0, 0x17, 0x2f, 0x61, 0x9a, - 0x7e, 0xa6, 0x81, 0x99, 0x4c, 0xc8, 0x4c, 0x63, 0xfa, 0x2f, 0xfc, 0x59, 0x3d, 0xf6, 0xe8, 0x29, - 0x48, 0xfa, 0x0f, 0xf2, 0x0b, 0x24, 0xd3, 0xda, 0x56, 0xbd, 0xcd, 0xf7, 0x3d, 0xef, 0xfb, 0xc1, - 0xbc, 0x2f, 0xba, 0x03, 0xb9, 0x84, 0x92, 0x65, 0xb9, 0x0c, 0xa0, 0x62, 0x41, 0x35, 0x09, 0x0a, - 0x52, 0x12, 0x26, 0xfc, 0xa2, 0xe4, 0x92, 0xe3, 0x9b, 0x23, 0xf6, 0xa1, 0x62, 0x7e, 0x35, 0xb9, - 0x1d, 0xa7, 0x3c, 0xe5, 0x0a, 0x06, 0xfd, 0x6b, 0xaf, 0xbb, 0x7d, 0xf1, 0xdf, 0x99, 0x64, 0x49, - 0xb2, 0x3c, 0x4e, 0x78, 0xfe, 0x2d, 0x4b, 0xf7, 0x22, 0xb7, 0xbb, 0x40, 0xc3, 0x07, 0x75, 0x1d, - 0x4f, 0x90, 0x01, 0x15, 0x8b, 0x17, 0x90, 0x73, 0x66, 0xea, 0x8e, 0xee, 0x19, 0xe1, 0xb8, 0x6b, - 0xec, 0x9b, 0x35, 0x61, 0xf4, 0x8d, 0x7b, 0x44, 0x6e, 0x74, 0x05, 0x15, 0xfb, 0xd0, 0x3f, 0xf1, - 0x5b, 0xf4, 0x18, 0x72, 0x32, 0xa7, 0x10, 0x27, 0x25, 0x10, 0x09, 0xe6, 0x85, 0xa3, 0x7b, 0x57, - 0xa1, 0xd9, 0x35, 0xf6, 0xf8, 0x60, 0x3b, 0xc7, 0x6e, 0x74, 0xbd, 0x9f, 0xa7, 0x6a, 0xc4, 0xaf, - 0xd1, 0xe8, 0x0f, 0x27, 0x94, 0x9a, 0x03, 0x65, 0x7e, 0xde, 0x35, 0x36, 0xfe, 0xdb, 0x4c, 0x28, - 0x75, 0x23, 0x74, 0xb0, 0x12, 0x4a, 0xf1, 0x7b, 0x84, 0xa0, 0x96, 0x25, 0x89, 0x21, 0x2b, 0x84, - 0x79, 0xe9, 0x0c, 0xbc, 0x41, 0xe8, 0xb6, 0x8d, 0x6d, 0xcc, 0xfa, 0xed, 0xec, 0xd3, 0x83, 0xe8, - 0x1a, 0xfb, 0xc9, 0xe1, 0xc8, 0x51, 0xe8, 0x46, 0x86, 0x1a, 0x66, 0x59, 0x21, 0xf0, 0x47, 0x74, - 0x7d, 0x1e, 0x87, 0xf9, 0xc8, 0xd1, 0xbd, 0xd1, 0xfd, 0x9d, 0xff, 0x6f, 0xb8, 0xfe, 0xb4, 0x57, - 0x4d, 0x95, 0x28, 0xbc, 0xdc, 0x34, 0xb6, 0x16, 0x8d, 0x92, 0xd3, 0x0a, 0xdf, 0xa3, 0x67, 0x84, - 0x52, 0xfe, 0x3d, 0x5e, 0xe5, 0x7d, 0xa2, 0x90, 0x48, 0x58, 0xc4, 0xb2, 0x16, 0xe6, 0xb0, 0xff, - 0x4d, 0xf4, 0x54, 0xc1, 0x2f, 0x27, 0xf6, 0xb9, 0x16, 0xe1, 0xbb, 0x4d, 0x6b, 0xe9, 0xdb, 0xd6, - 0xd2, 0x7f, 0xb5, 0x96, 0xfe, 0x63, 0x67, 0x69, 0xdb, 0x9d, 0xa5, 0xfd, 0xdc, 0x59, 0xda, 0xd7, - 0x97, 0x69, 0x26, 0x97, 0xab, 0xb9, 0x9f, 0x70, 0xd6, 0x97, 0xc6, 0x45, 0x70, 0x2a, 0xb1, 0x56, - 0x35, 0xca, 0x75, 0x01, 0x62, 0x3e, 0x54, 0xed, 0xbd, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x51, - 0x16, 0x95, 0xc2, 0x2b, 0x02, 0x00, 0x00, + 0x18, 0x86, 0x1b, 0x5b, 0xeb, 0x76, 0xba, 0x8b, 0xeb, 0x58, 0x65, 0x58, 0xd8, 0x24, 0x44, 0x58, + 0x72, 0x4a, 0xe8, 0x7a, 0x10, 0x04, 0x41, 0x53, 0x2b, 0x7a, 0x91, 0x25, 0xe8, 0xc5, 0xcb, 0x30, + 0x4d, 0x3f, 0x9b, 0xc0, 0x4c, 0x26, 0x64, 0xa6, 0xb1, 0xfb, 0x2f, 0x3c, 0xfb, 0x8b, 0xf6, 0xb8, + 0x47, 0x4f, 0x41, 0xda, 0x7f, 0xd0, 0x5f, 0x20, 0x99, 0xd4, 0x76, 0xd5, 0xdb, 0x7c, 0xdf, 0xf3, + 0xbe, 0x1f, 0xcc, 0xfb, 0xa2, 0x73, 0xd0, 0x29, 0x94, 0x22, 0xcb, 0x75, 0x08, 0x95, 0x08, 0xab, + 0x71, 0x58, 0xb0, 0x92, 0x09, 0x15, 0x14, 0xa5, 0xd4, 0x12, 0x9f, 0xee, 0x71, 0x00, 0x95, 0x08, + 0xaa, 0xf1, 0xd9, 0x68, 0x21, 0x17, 0xd2, 0xc0, 0xb0, 0x79, 0xb5, 0xba, 0xb3, 0x67, 0xff, 0x9d, + 0x49, 0x52, 0x96, 0xe5, 0x34, 0x91, 0xf9, 0xd7, 0x6c, 0xd1, 0x8a, 0xbc, 0x1f, 0x5d, 0xd4, 0xbf, + 0x32, 0xd7, 0xf1, 0x18, 0x0d, 0xa0, 0x12, 0x74, 0x0e, 0xb9, 0x14, 0xc4, 0x72, 0x2d, 0x7f, 0x10, + 0x8d, 0xb6, 0xb5, 0x73, 0x7a, 0xcd, 0x04, 0x7f, 0xe9, 0xed, 0x91, 0x17, 0x1f, 0x41, 0x25, 0xde, + 0x36, 0x4f, 0xfc, 0x0a, 0x9d, 0x40, 0xce, 0x66, 0x1c, 0x68, 0x52, 0x02, 0xd3, 0x40, 0xee, 0xb9, + 0x96, 0x7f, 0x14, 0x91, 0x6d, 0xed, 0x8c, 0x76, 0xb6, 0xbb, 0xd8, 0x8b, 0x8f, 0xdb, 0x79, 0x62, + 0x46, 0xfc, 0x02, 0x0d, 0xff, 0x70, 0xc6, 0x39, 0xe9, 0x1a, 0xf3, 0xd3, 0x6d, 0xed, 0xe0, 0xbf, + 0xcd, 0x8c, 0x73, 0x2f, 0x46, 0x3b, 0x2b, 0xe3, 0x1c, 0xbf, 0x41, 0x08, 0x56, 0xba, 0x64, 0x14, + 0xb2, 0x42, 0x91, 0x9e, 0xdb, 0xf5, 0xbb, 0x91, 0xb7, 0xae, 0x9d, 0xc1, 0xb4, 0xd9, 0x4e, 0x3f, + 0x5c, 0xa9, 0x6d, 0xed, 0x3c, 0xda, 0x1d, 0xd9, 0x0b, 0xbd, 0x78, 0x60, 0x86, 0x69, 0x56, 0x28, + 0xfc, 0x0e, 0x1d, 0xdf, 0x8d, 0x83, 0xdc, 0x77, 0x2d, 0x7f, 0x78, 0x79, 0x1e, 0xfc, 0x1b, 0x6e, + 0x30, 0x69, 0x54, 0x13, 0x23, 0x8a, 0x7a, 0x37, 0xb5, 0xd3, 0x89, 0x87, 0xc9, 0x61, 0x85, 0x2f, + 0xd1, 0x13, 0xc6, 0xb9, 0xfc, 0x46, 0x97, 0x79, 0x93, 0x28, 0x24, 0x1a, 0xe6, 0x54, 0xaf, 0x14, + 0xe9, 0x37, 0xbf, 0x89, 0x1f, 0x1b, 0xf8, 0xf9, 0xc0, 0x3e, 0xad, 0x14, 0xbe, 0x40, 0x0f, 0x53, + 0x60, 0x73, 0x28, 0x69, 0xca, 0x54, 0x4a, 0xf3, 0xa5, 0x20, 0x0f, 0x5c, 0xcb, 0xef, 0xc5, 0x27, + 0xed, 0xfa, 0x3d, 0x53, 0xe9, 0xc7, 0xa5, 0x88, 0x5e, 0xdf, 0xac, 0x6d, 0xeb, 0x76, 0x6d, 0x5b, + 0xbf, 0xd6, 0xb6, 0xf5, 0x7d, 0x63, 0x77, 0x6e, 0x37, 0x76, 0xe7, 0xe7, 0xc6, 0xee, 0x7c, 0xb9, + 0x58, 0x64, 0x3a, 0x5d, 0xce, 0x82, 0x44, 0x8a, 0xa6, 0x5c, 0xa9, 0xc2, 0x43, 0xd9, 0x2b, 0x53, + 0xb7, 0xbe, 0x2e, 0x40, 0xcd, 0xfa, 0xa6, 0xe5, 0xe7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, + 0xa5, 0x92, 0x40, 0x53, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -171,6 +182,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.HeaderHashNum != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.HeaderHashNum)) + i-- + dAtA[i] = 0x38 + } if m.AllowUnprotectedTxs { i-- if m.AllowUnprotectedTxs { @@ -279,6 +295,9 @@ func (m *Params) Size() (n int) { if m.AllowUnprotectedTxs { n += 2 } + if m.HeaderHashNum != 0 { + n += 1 + sovParams(uint64(m.HeaderHashNum)) + } return n } @@ -518,6 +537,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.AllowUnprotectedTxs = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeaderHashNum", wireType) + } + m.HeaderHashNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeaderHashNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/feemarket/keeper/abci.go b/x/feemarket/keeper/abci.go index d721496da9..be02d8e151 100644 --- a/x/feemarket/keeper/abci.go +++ b/x/feemarket/keeper/abci.go @@ -17,13 +17,13 @@ package keeper import ( "fmt" - "math" "github.com/evmos/ethermint/x/feemarket/types" sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + ethermint "github.com/evmos/ethermint/types" ) // BeginBlock updates base fee @@ -56,14 +56,13 @@ func (k *Keeper) BeginBlock(ctx sdk.Context) error { // an empty slice. func (k *Keeper) EndBlock(ctx sdk.Context) error { gasWanted := ctx.BlockGasWanted() - gasUsed := ctx.BlockGasUsed() - - if gasWanted > math.MaxInt64 { - return fmt.Errorf("integer overflow by integer type conversion. Gas wanted %d > MaxInt64", gasWanted) + gw, err := ethermint.SafeInt64(gasWanted) + if err != nil { + return err } - - if gasUsed > math.MaxInt64 { - return fmt.Errorf("integer overflow by integer type conversion. Gas used %d > MaxInt64", gasUsed) + gasUsed, err := ethermint.SafeInt64(ctx.BlockGasUsed()) + if err != nil { + return err } // to prevent BaseFee manipulation we limit the gasWanted so that @@ -71,8 +70,8 @@ func (k *Keeper) EndBlock(ctx sdk.Context) error { // 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 := sdkmath.LegacyNewDec(int64(gasWanted)).Mul(minGasMultiplier) - gasWanted = sdkmath.LegacyMaxDec(limitedGasWanted, sdkmath.LegacyNewDec(int64(gasUsed))).TruncateInt().Uint64() + limitedGasWanted := sdkmath.LegacyNewDec(gw).Mul(minGasMultiplier) + gasWanted = sdkmath.LegacyMaxDec(limitedGasWanted, sdkmath.LegacyNewDec(gasUsed)).TruncateInt().Uint64() k.SetBlockGasWanted(ctx, gasWanted) defer func() { diff --git a/x/feemarket/keeper/grpc_query.go b/x/feemarket/keeper/grpc_query.go index 82ea42b6bd..d77be6d5ff 100644 --- a/x/feemarket/keeper/grpc_query.go +++ b/x/feemarket/keeper/grpc_query.go @@ -21,6 +21,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/feemarket/types" ) @@ -54,9 +55,11 @@ func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types // BlockGas implements the Query/BlockGas gRPC method func (k Keeper) BlockGas(c context.Context, _ *types.QueryBlockGasRequest) (*types.QueryBlockGasResponse, error) { ctx := sdk.UnwrapSDKContext(c) - gas := k.GetBlockGasWanted(ctx) - + gas, err := ethermint.SafeInt64(k.GetBlockGasWanted(ctx)) + if err != nil { + return nil, err + } return &types.QueryBlockGasResponse{ - Gas: int64(gas), + Gas: gas, }, nil } diff --git a/x/feemarket/types/msg.go b/x/feemarket/types/msg.go index 71d49fdbc9..f24cef817f 100644 --- a/x/feemarket/types/msg.go +++ b/x/feemarket/types/msg.go @@ -7,12 +7,6 @@ import ( var _ sdk.Msg = &MsgUpdateParams{} -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr := sdk.MustAccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { @@ -21,8 +15,3 @@ func (m *MsgUpdateParams) ValidateBasic() error { return m.Params.Validate() } - -// GetSignBytes implements the LegacyMsg interface. -func (m MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -}