From a49dbf9774db0867501a652702f0b45389ffbc47 Mon Sep 17 00:00:00 2001 From: Jeremy Wei Date: Tue, 19 Nov 2024 15:37:20 -0500 Subject: [PATCH] In simulate.go StateAtBlock, still err out on second error --- evmrpc/simulate.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/evmrpc/simulate.go b/evmrpc/simulate.go index ba7de81afe..a552771ac3 100644 --- a/evmrpc/simulate.go +++ b/evmrpc/simulate.go @@ -365,12 +365,10 @@ func (b *Backend) StateAtTransaction(ctx context.Context, block *ethtypes.Block, } func (b *Backend) StateAtBlock(ctx context.Context, block *ethtypes.Block, reexec uint64, base vm.StateDB, readOnly bool, preferDisk bool) (vm.StateDB, tracers.StateReleaseFunc, error) { - fmt.Println("DEBUG: In simulate.go: StateAtBlock") emptyRelease := func() {} statedb := state.NewDBImpl(b.ctxProvider(block.Number().Int64()-1), b.keeper, true) signer := ethtypes.MakeSigner(b.ChainConfig(), block.Number(), block.Time()) for _, tx := range block.Transactions() { - fmt.Println("DEBUG: In simulate.go: StateAtBlock: tx", tx) msg, _ := core.TransactionToMessage(tx, signer, block.BaseFee()) // set address association for the sender if not present. Note that here we take the shortcut @@ -378,19 +376,14 @@ func (b *Backend) StateAtBlock(ctx context.Context, block *ethtypes.Block, reexe // at all then its association must be present in the latest height _, associated := b.keeper.GetSeiAddress(statedb.Ctx(), msg.From) if !associated { - fmt.Println("DEBUG: In simulate.go: StateAtBlock: !associated") seiAddr, associatedNow := b.keeper.GetSeiAddress(b.ctxProvider(LatestCtxHeight), msg.From) if !associatedNow { - fmt.Println("DEBUG: In simulate.go: StateAtBlock: !associatedNow, continuing") err := types.NewAssociationMissingErr(msg.From.Hex()) metrics.IncrementAssociationError("state_at_block", err) - continue - // return nil, emptyRelease, err + continue // don't return error, just continue bc we want to process the rest of the txs and return the statedb } if err := helpers.NewAssociationHelper(b.keeper, b.keeper.BankKeeper(), b.keeper.AccountKeeper()).AssociateAddresses(statedb.Ctx(), seiAddr, msg.From, nil); err != nil { - fmt.Println("DEBUG: In simulate.go: StateAtBlock: AssociateAddresses error", err, "continuing") - continue - // return nil, emptyRelease, err + return nil, emptyRelease, err } } }