From a9bb50eeeaa4426757f16e0df9faad1ec6302c6f Mon Sep 17 00:00:00 2001 From: Wen Date: Tue, 19 May 2026 17:08:48 -0700 Subject: [PATCH 1/4] ci: add Autobahn EVM Module (CON-256) Mirrors the existing "EVM Module" CI job with AUTOBAHN=true plus the GIGA_EXECUTOR/GIGA_STORAGE/GIGA_OCC flag set used by the "Autobahn EVM GIGA Module" job. Same 4 steps as the CometBFT job: - evm_tests.sh (EVMCompatabilityTest, EVMPrecompileTest, SeiEndpointsTest, AssociateTest) - deploy_flatkv_evm_fixture.sh (seeds historical EVM state: balance, storage, code) - flatkv_evm_test.yaml (historical EVM RPC reads via cast: balance, storage, code at past block heights) - verify_flatkv_evm_store.sh (seidb dump-flatkv smoke check on the on-disk storage bucket) Complements the narrower "Autobahn EVM GIGA Module" (smoke-tests EVMGigaTest.js on native+ERC20 transfers only) by adding broader EVM-compat + Sei-precompile + sei-endpoint + association coverage plus historical-state correctness, none of which are exercised elsewhere under Autobahn. Verified locally on a 4-node Autobahn docker cluster: evm_tests.sh: 101 passing, 1 pending, 0 failing deploy_flatkv_evm_fixture.sh: fixture seeded at heights 17567/17571 (flatkv yaml + verify steps deferred to CI; the 3 flatkv components have zero -b block usages and use only EVM RPC + seid queries, so they're Autobahn-clean.) Autobahn EVM Interoperability deferred until #3406 (lib.js response-reading helper migration) lands; without it, the suite's CW-deploy setup hooks depend on unmigrated -b block helpers and CI passing would be accidental rather than verified. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/integration-test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index defd890619..e6e6c3c725 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -153,6 +153,16 @@ jobs: "docker exec sei-node-0 integration_test/contracts/verify_flatkv_evm_store.sh", ] }, + { + name: "Autobahn EVM Module", + env: "AUTOBAHN=true GIGA_EXECUTOR=true GIGA_STORAGE=true GIGA_OCC=true", + scripts: [ + "./integration_test/evm_module/scripts/evm_tests.sh", + "docker exec sei-node-0 integration_test/contracts/deploy_flatkv_evm_fixture.sh", + "python3 integration_test/scripts/runner.py integration_test/seidb/flatkv_evm_test.yaml", + "docker exec sei-node-0 integration_test/contracts/verify_flatkv_evm_store.sh", + ] + }, { name: "EVM Interoperability", env: "GIGA_STORAGE=true", From 8703660acdb2ff84aa2ec250cbf97b4ccdfab938 Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 20 May 2026 11:43:31 -0700 Subject: [PATCH 2/4] test(evm): drop string-var test asserting sei_getEvmTx reverse lookup (CON-256) Under Autobahn the cosmos tx indexer isn't wired, so sei_getEvmTx (cosmos->evm reverse lookup) can't resolve. String-variable coverage is preserved by sibling bytes/mapping/private-var cases in the same Variable Types block. Co-Authored-By: Claude Opus 4.7 (1M context) --- contracts/test/EVMCompatabilityTest.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/contracts/test/EVMCompatabilityTest.js b/contracts/test/EVMCompatabilityTest.js index 74877e0be2..f191d3ce22 100644 --- a/contracts/test/EVMCompatabilityTest.js +++ b/contracts/test/EVMCompatabilityTest.js @@ -4,7 +4,7 @@ const {uniq} = require("lodash"); const hre = require('hardhat'); const { ethers, upgrades } = hre; const { getImplementationAddress } = require('@openzeppelin/upgrades-core'); -const { deployEvmContract, setupSigners, fundAddress, getCosmosTx, getEvmTx, waitForBaseFeeToEq, waitForBaseFeeToBeGt} = require("./lib") +const { deployEvmContract, setupSigners, fundAddress, waitForBaseFeeToEq, waitForBaseFeeToBeGt} = require("./lib") const axios = require("axios"); const { default: BigNumber } = require("bignumber.js"); @@ -495,23 +495,6 @@ describe("EVM Test", function () { expect(found).to.be.true; }); - it("Should set the string correctly and emit an event", async function () { - await delay() - const txResponse = await evmTester.setStringVar("test", { gasPrice: ethers.parseUnits('100', 'gwei') }); - const receipt = await txResponse.wait(); // Wait for the transaction to be mined - - const cosmosTx = await getCosmosTx(ethers.provider, receipt.hash) - expect(cosmosTx.length).to.be.equal(64) - - const evmTx = await getEvmTx(ethers.provider, cosmosTx) - expect(evmTx).to.be.equal(receipt.hash) - - await expect(txResponse) - .to.emit(evmTester, 'StringSet') - .withArgs(owner.address, "test"); - expect(await evmTester.stringVar()).to.equal("test"); - }); - it("Should set the bytes correctly and emit an event", async function () { await delay() const txResponse = await evmTester.setBytesVar(ethers.toUtf8Bytes("test"), { gasPrice: ethers.parseUnits('100', 'gwei') }); From df033b7b0ea0ae279ceae8ed10a4c150fcaf4d28 Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 20 May 2026 13:07:36 -0700 Subject: [PATCH 3/4] evmrpc: bounds-check blockRes.TxsResults in EncodeTmBlock (CON-256) Under Autobahn, /block_results returns a stub ResultBlockResults with empty TxsResults (see sei-tendermint/internal/rpc/core/blocks.go). Indexing TxsResults[msg.index] for Wasm or bank txs trips an out-of-range access and surfaces as "method handler crashed" on sei_getBlockByNumber and sei_getBlockByHash. Bounds-check before indexing: for Wasm, fall back to receipt.GasUsed (receipt is already fetched and guaranteed by filterTransactions); for bank, skip the gas increment (no receipt is fetched in that branch). Co-Authored-By: Claude Opus 4.7 (1M context) --- evmrpc/block.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/evmrpc/block.go b/evmrpc/block.go index ad4541af70..361db3ee6c 100644 --- a/evmrpc/block.go +++ b/evmrpc/block.go @@ -467,7 +467,13 @@ func EncodeTmBlock( var bloom ethtypes.Bloom bloom.SetBytes(receipt.LogsBloom) bitutil.ORBytes(blockBloom, blockBloom, bloom[:]) - blockGasUsed += blockRes.TxsResults[msg.index].GasUsed + // TxsResults is empty under Autobahn (BlockResults returns a stub + // without per-tx results); receipt.GasUsed is the fallback source. + if msg.index < len(blockRes.TxsResults) { + blockGasUsed += blockRes.TxsResults[msg.index].GasUsed + } else { + blockGasUsed += int64(receipt.GasUsed) //nolint:gosec + } case *banktypes.MsgSend: th := sha256.Sum256(block.Block.Txs[msg.index]) if !fullTx { @@ -489,7 +495,11 @@ func EncodeTmBlock( rpcTx.TransactionIndex = (*hexutil.Uint64)(&ti) transactions = append(transactions, rpcTx) } - blockGasUsed += blockRes.TxsResults[msg.index].GasUsed + // TxsResults is empty under Autobahn; bank-send gas is omitted + // from blockGasUsed there (no receipt is fetched in this branch). + if msg.index < len(blockRes.TxsResults) { + blockGasUsed += blockRes.TxsResults[msg.index].GasUsed + } } } if len(transactions) == 0 { From 7ca496143cb09f5eb1926401654d6b6600cd5352 Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 20 May 2026 14:14:59 -0700 Subject: [PATCH 4/4] evmrpc: align with #3477 (remove blockRes from EncodeTmBlock) Supersedes df033b7b0's bounds-check fix on this branch with #3477's final shape: removes the blockRes parameter from EncodeTmBlock entirely, using receipt.GasUsed (already fetched for wasm; newly fetched for bank) as the per-tx gas source. Verifies that #3477's refactor unblocks this PR's Autobahn EVM Module CI job. Will collapse with df033b7b0 on rebase once #3477 merges. Co-Authored-By: Claude Opus 4.7 (1M context) --- evmrpc/block.go | 38 ++----- evmrpc/block_test.go | 149 ++++++++++++++++------------ evmrpc/block_txcount_parity_test.go | 13 +-- evmrpc/utils.go | 14 --- 4 files changed, 94 insertions(+), 120 deletions(-) diff --git a/evmrpc/block.go b/evmrpc/block.go index 361db3ee6c..32c3a446e3 100644 --- a/evmrpc/block.go +++ b/evmrpc/block.go @@ -226,11 +226,7 @@ func (a *BlockAPI) getBlockByHash(ctx context.Context, blockHash common.Hash, fu return nil, err } - blockRes, err := blockResultsWithRetry(ctx, a.tmClient, &block.Block.Height) - if err != nil { - return nil, err - } - return EncodeTmBlock(a.ctxProvider, a.txConfigProvider, block, blockRes, a.keeper, fullTx, a.includeBankTransfers, includeSyntheticTxs, excludeUntraceable, a.globalBlockCache, a.cacheCreationMutex) + return EncodeTmBlock(a.ctxProvider, a.txConfigProvider, block, a.keeper, fullTx, a.includeBankTransfers, includeSyntheticTxs, excludeUntraceable, a.globalBlockCache, a.cacheCreationMutex) } func (a *BlockAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (result map[string]interface{}, returnErr error) { @@ -273,11 +269,7 @@ func (a *BlockAPI) getBlockByNumber( if err != nil { return nil, err } - blockRes, err := blockResultsWithRetry(ctx, a.tmClient, &block.Block.Height) - if err != nil { - return nil, err - } - return EncodeTmBlock(a.ctxProvider, a.txConfigProvider, block, blockRes, a.keeper, fullTx, a.includeBankTransfers, includeSyntheticTxs, excludeUntraceable, a.globalBlockCache, a.cacheCreationMutex) + return EncodeTmBlock(a.ctxProvider, a.txConfigProvider, block, a.keeper, fullTx, a.includeBankTransfers, includeSyntheticTxs, excludeUntraceable, a.globalBlockCache, a.cacheCreationMutex) } func (a *BlockAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (result []map[string]interface{}, returnErr error) { @@ -374,7 +366,6 @@ func EncodeTmBlock( ctxProvider func(int64) sdk.Context, txConfigProvider func(int64) client.TxConfig, block *coretypes.ResultBlock, - blockRes *coretypes.ResultBlockResults, k *keeper.Keeper, fullTx bool, includeBankTransfers bool, @@ -467,15 +458,10 @@ func EncodeTmBlock( var bloom ethtypes.Bloom bloom.SetBytes(receipt.LogsBloom) bitutil.ORBytes(blockBloom, blockBloom, bloom[:]) - // TxsResults is empty under Autobahn (BlockResults returns a stub - // without per-tx results); receipt.GasUsed is the fallback source. - if msg.index < len(blockRes.TxsResults) { - blockGasUsed += blockRes.TxsResults[msg.index].GasUsed - } else { - blockGasUsed += int64(receipt.GasUsed) //nolint:gosec - } + blockGasUsed += int64(receipt.GasUsed) //nolint:gosec case *banktypes.MsgSend: th := sha256.Sum256(block.Block.Txs[msg.index]) + receipt, _ := getOrSetCachedReceipt(cacheCreationMutex, globalBlockCache, latestCtx, k, block, th) if !fullTx { transactions = append(transactions, "0x"+hex.EncodeToString(th[:])) } else { @@ -495,10 +481,8 @@ func EncodeTmBlock( rpcTx.TransactionIndex = (*hexutil.Uint64)(&ti) transactions = append(transactions, rpcTx) } - // TxsResults is empty under Autobahn; bank-send gas is omitted - // from blockGasUsed there (no receipt is fetched in this branch). - if msg.index < len(blockRes.TxsResults) { - blockGasUsed += blockRes.TxsResults[msg.index].GasUsed + if receipt != nil { + blockGasUsed += int64(receipt.GasUsed) //nolint:gosec } } } @@ -507,13 +491,9 @@ func EncodeTmBlock( } // Source block.gasLimit from the active ConsensusParams in the SDK - // context, not from blockRes.ConsensusParamUpdates. The latter is only - // populated when the app proposes a consensus-param update (most - // blocks: nil); it's also out-of-sync under Autobahn where /block_results - // synthesizes a placeholder. The SDK ctx always has the params that - // were in effect at this block — same place the EVM runtime reads - // `block.gaslimit` from (x/evm/keeper/keeper.go's BlockContext.GasLimit), - // so eth_getBlockByNumber.gasLimit and the GASLIMIT opcode return the + // context — same place the EVM runtime reads block.gaslimit from + // (x/evm/keeper/keeper.go's BlockContext.GasLimit), so + // eth_getBlockByNumber.gasLimit and the GASLIMIT opcode return the // same number. var gasLimit int64 if cp := ctx.ConsensusParams(); cp != nil && cp.Block != nil { diff --git a/evmrpc/block_test.go b/evmrpc/block_test.go index 0b73681181..6c83626e5c 100644 --- a/evmrpc/block_test.go +++ b/evmrpc/block_test.go @@ -8,7 +8,6 @@ import ( "testing" "time" - types2 "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types" "github.com/ethereum/go-ethereum/common" @@ -20,7 +19,6 @@ import ( "github.com/sei-protocol/sei-chain/sei-cosmos/client" sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" banktypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/bank/types" - abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" @@ -43,18 +41,9 @@ func TestEncodeTmBlock_EmptyTransactions(t *testing.T) { }, }, } - blockRes := &coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{}, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{ - MaxBytes: 100000000, - MaxGas: 200000000, - }, - }, - } // Call EncodeTmBlock with empty transactions - result, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, block, blockRes, k, true, false, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + result, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, block, k, true, false, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.Nil(t, err) // Assert txHash is equal to ethtypes.EmptyTxsHash @@ -84,23 +73,7 @@ func TestEncodeBankMsg(t *testing.T) { }, }, } - resBlockRes := coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{ - { - Data: func() []byte { - bz, _ := Encoder(tx) - return bz - }(), - }, - }, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{ - MaxBytes: 100000000, - MaxGas: 200000000, - }, - }, - } - res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, &resBlockRes, k, true, false, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, k, true, false, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.Nil(t, err) txs := res["transactions"].([]interface{}) require.Equal(t, 0, len(txs)) @@ -140,20 +113,7 @@ func TestEncodeWasmExecuteMsg(t *testing.T) { }, }, } - resBlockRes := coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{ - { - Data: bz, - }, - }, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{ - MaxBytes: 100000000, - MaxGas: 200000000, - }, - }, - } - res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, &resBlockRes, k, true, false, true, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, k, true, false, true, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.Nil(t, err) txs := res["transactions"].([]interface{}) require.Equal(t, 1, len(txs)) @@ -201,20 +161,7 @@ func TestEncodeBankTransferMsg(t *testing.T) { }, }, } - resBlockRes := coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{ - { - Data: bz, - }, - }, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{ - MaxBytes: 100000000, - MaxGas: 200000000, - }, - }, - } - res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, &resBlockRes, k, true, true, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, k, true, true, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.Nil(t, err) txs := res["transactions"].([]interface{}) require.Equal(t, 1, len(txs)) @@ -234,6 +181,84 @@ func TestEncodeBankTransferMsg(t *testing.T) { }, txs[0].(*export.RPCTransaction)) } +// Wasm-execute txs contribute receipt.GasUsed to the block's gasUsed total. +func TestEncodeWasmExecuteMsg_GasUsedFromReceipt(t *testing.T) { + k := &testkeeper.EVMTestApp.EvmKeeper + ctx := testkeeper.EVMTestApp.GetContextForDeliverTx(nil).WithBlockHeight(MockHeight8) + fromSeiAddr, fromEvmAddr := testkeeper.MockAddressPair() + toSeiAddr, _ := testkeeper.MockAddressPair() + b := TxConfig.NewTxBuilder() + b.SetMsgs(&wasmtypes.MsgExecuteContract{ + Sender: fromSeiAddr.String(), + Contract: toSeiAddr.String(), + Msg: []byte{1, 2, 3}, + }) + tx := b.GetTx() + bz, _ := Encoder(tx) + txHash := sha256.Sum256(bz) + hash := common.BytesToHash(txHash[:]) + testkeeper.MustMockReceipt(t, k, ctx, hash, &types.Receipt{ + TransactionIndex: 1, + From: fromEvmAddr.Hex(), + TxHashHex: hash.Hex(), + GasUsed: 54321, + }) + resBlock := coretypes.ResultBlock{ + BlockID: MockBlockID, + Block: &tmtypes.Block{ + Header: mockBlockHeader(MockHeight8), + Data: tmtypes.Data{ + Txs: []tmtypes.Tx{bz}, + }, + LastCommit: &tmtypes.Commit{ + Height: MockHeight8 - 1, + }, + }, + } + res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, k, true, false, true, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + require.Nil(t, err) + require.Equal(t, hexutil.Uint64(54321), res["gasUsed"]) + txs := res["transactions"].([]interface{}) + require.Equal(t, 1, len(txs)) +} + +// Bank-send txs without a matching EVM receipt contribute 0 to the block's +// gasUsed total. (This is the Autobahn case for plain MsgSend txs; under +// legacy, bank sends that emit EVM-relevant events would have a synthetic +// receipt and contribute receipt.GasUsed.) +func TestEncodeBankTransferMsg_NoReceiptGasUsedZero(t *testing.T) { + k := &testkeeper.EVMTestApp.EvmKeeper + ctx := testkeeper.EVMTestApp.GetContextForDeliverTx(nil) + fromSeiAddr, fromEvmAddr := testkeeper.MockAddressPair() + k.SetAddressMapping(ctx, fromSeiAddr, fromEvmAddr) + toSeiAddr, _ := testkeeper.MockAddressPair() + b := TxConfig.NewTxBuilder() + b.SetMsgs(&banktypes.MsgSend{ + FromAddress: fromSeiAddr.String(), + ToAddress: toSeiAddr.String(), + Amount: sdk.NewCoins(sdk.NewCoin("usei", sdk.OneInt())), + }) + tx := b.GetTx() + bz, _ := Encoder(tx) + resBlock := coretypes.ResultBlock{ + BlockID: MockBlockID, + Block: &tmtypes.Block{ + Header: mockBlockHeader(MockHeight8), + Data: tmtypes.Data{ + Txs: []tmtypes.Tx{bz}, + }, + LastCommit: &tmtypes.Commit{ + Height: MockHeight8 - 1, + }, + }, + } + res, err := evmrpc.EncodeTmBlock(func(i int64) sdk.Context { return ctx }, func(i int64) client.TxConfig { return TxConfig }, &resBlock, k, true, true, false, false, evmrpc.NewBlockCache(3000), &sync.Mutex{}) + require.Nil(t, err) + require.Equal(t, hexutil.Uint64(0), res["gasUsed"]) + txs := res["transactions"].([]interface{}) + require.Equal(t, 1, len(txs)) +} + // TestEncodeTmBlock_ExcludeUntraceable pins the block-side counterpart of the // tx-side discriminator: a correct-nonce ante failure (e.g. insufficient // funds) lands a stub receipt in the receipt store. filterTransactions's @@ -294,12 +319,6 @@ func TestEncodeTmBlock_ExcludeUntraceable(t *testing.T) { LastCommit: &tmtypes.Commit{Height: stubHeight - 1}, }, } - blockRes := &coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{{Data: anteStubBz}, {Data: nonPanicBz}}, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{MaxBytes: 100000000, MaxGas: 200000000}, - }, - } // Post-v5.8.0 ctx so filterTransactions's isReceiptFromAnteError stays // narrow (nonce-only VmError) — the production path where the stub @@ -309,7 +328,7 @@ func TestEncodeTmBlock_ExcludeUntraceable(t *testing.T) { txConfigProvider := func(int64) client.TxConfig { return TxConfig } // excludeUntraceable=true: ante stub dropped, revert kept. - res, err := evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, blockRes, k, + res, err := evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, k, false /*fullTx*/, false /*includeBankTransfers*/, false /*includeSyntheticTxs*/, true, /*excludeUntraceable*/ evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.NoError(t, err) @@ -319,7 +338,7 @@ func TestEncodeTmBlock_ExcludeUntraceable(t *testing.T) { // excludeUntraceable=false: ante stub flows through (matches regular // eth_getBlockBy* behavior per PR #2343's TestAnteFailureOthers). - res, err = evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, blockRes, k, + res, err = evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, k, false /*fullTx*/, false /*includeBankTransfers*/, false /*includeSyntheticTxs*/, false, /*excludeUntraceable*/ evmrpc.NewBlockCache(3000), &sync.Mutex{}) require.NoError(t, err) diff --git a/evmrpc/block_txcount_parity_test.go b/evmrpc/block_txcount_parity_test.go index 4cbbe3489f..c224e5f963 100644 --- a/evmrpc/block_txcount_parity_test.go +++ b/evmrpc/block_txcount_parity_test.go @@ -16,9 +16,7 @@ import ( "github.com/sei-protocol/sei-chain/evmrpc" "github.com/sei-protocol/sei-chain/sei-cosmos/client" sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" - abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" tmbytes "github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes" - types2 "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" tmmock "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client/mock" "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" @@ -107,15 +105,6 @@ func TestBlockTransactionCountMatchesGetBlockByNumber(t *testing.T) { }, }, } - blockRes := &coretypes.ResultBlockResults{ - TxsResults: []*abci.ExecTxResult{{Data: bz1}, {Data: bz2}}, - ConsensusParamUpdates: &types2.ConsensusParams{ - Block: &types2.BlockParams{ - MaxBytes: 100000000, - MaxGas: 200000000, - }, - }, - } ctxProvider := func(h int64) sdk.Context { if h == evmrpc.LatestCtxHeight { @@ -130,7 +119,7 @@ func TestBlockTransactionCountMatchesGetBlockByNumber(t *testing.T) { decodeOnly := countDecodeOnlyEvmTxs(block.Block.Txs, TxConfig.TxDecoder()) require.Equal(t, 2, decodeOnly) - encoded, err := evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, blockRes, k, false, false, false, false, cache, mu) + encoded, err := evmrpc.EncodeTmBlock(ctxProvider, txConfigProvider, block, k, false, false, false, false, cache, mu) require.NoError(t, err) list := encoded["transactions"].([]interface{}) diff --git a/evmrpc/utils.go b/evmrpc/utils.go index ed4a82a368..791d7e9599 100644 --- a/evmrpc/utils.go +++ b/evmrpc/utils.go @@ -139,20 +139,6 @@ func getAddressPrivKeyMap(kb keyring.Keyring) map[string]*ecdsa.PrivateKey { return res } -func blockResultsWithRetry(ctx context.Context, client client.LocalClient, height *int64) (*coretypes.ResultBlockResults, error) { - blockRes, err := client.BlockResults(ctx, height) - if err != nil { - // retry once, since application DB and block DB are not committed atomically so it's possible for - // receipt to exist while block results aren't committed yet - time.Sleep(1 * time.Second) - blockRes, err = client.BlockResults(ctx, height) - if err != nil { - return nil, err - } - } - return blockRes, err -} - func blockByNumberWithRetry(ctx context.Context, client client.LocalClient, height *int64, maxRetries int) (*coretypes.ResultBlock, error) { blockRes, err := client.Block(ctx, height) var retryCount = 0