Skip to content

Commit

Permalink
eth_getLogs to fix fee cap less than block base fee error (#12640)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Nov 6, 2024
1 parent 3d01204 commit f948fb4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'

- name: Install golangci-lint
if: runner.os == 'Linux'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/qa-rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
# Run RPC integration test runner via http
python3 ./run_tests.py -p 8545 --continue -f --json-diff -x \
# Erigon2 and Erigon3 never supported this api methods
trace_rawTransaction,\
# false positives: Erigon return expected response. but rpc-test somehow doesn't see 1 field.
erigon_getHeaderByHash,erigon_getHeaderByNumber,eth_feeHistory,\
# total difficulty field was removed, then added back
Expand All @@ -109,9 +111,6 @@ jobs:
engine_getClientVersionV1/test_1.json,\
erigon_getBalanceChangesInBlock,\
eth_createAccessList/test_16.json,\
trace_filter/test_16.json,\
trace_rawTransaction/test_01.json,\
trace_rawTransaction/test_03.json,\
admin_nodeInfo/test_01.json,\
admin_peers/test_01.json,\
erigon_nodeInfo/test_1.json,\
Expand Down
5 changes: 3 additions & 2 deletions cmd/state/exec3/trace_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ func NewTraceWorker(tx kv.TemporalTx, cc *chain.Config, engine consensus.EngineR
stateReader: stateReader,
tracer: tracer,
evm: vm.NewEVM(evmtypes.BlockContext{}, evmtypes.TxContext{}, nil, cc, vm.Config{}),
vmConfig: &vm.Config{},
vmConfig: &vm.Config{NoBaseFee: true},
ibs: state.New(stateReader),
}
if tracer != nil {
ie.vmConfig = &vm.Config{Debug: true, Tracer: tracer}
ie.vmConfig.Debug = true
ie.vmConfig.Tracer = tracer
}
return ie
}
Expand Down
5 changes: 5 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ func (evm *EVM) Reset(txCtx evmtypes.TxContext, ibs evmtypes.IntraBlockState) {
}

func (evm *EVM) ResetBetweenBlocks(blockCtx evmtypes.BlockContext, txCtx evmtypes.TxContext, ibs evmtypes.IntraBlockState, vmConfig Config, chainRules *chain.Rules) {
if vmConfig.NoBaseFee {
if txCtx.GasPrice.IsZero() {
blockCtx.BaseFee = new(uint256.Int)
}
}
evm.Context = blockCtx
evm.TxContext = txCtx
evm.intraBlockState = ibs
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/Giulio2002/bls v0.0.0-20241013174947-019133587795
github.com/Masterminds/sprig/v3 v3.2.3
github.com/RoaringBitmap/roaring v1.9.4
github.com/alecthomas/atomic v0.1.0-alpha2
github.com/alecthomas/kong v0.8.1
github.com/anacrolix/sync v0.5.1
github.com/anacrolix/torrent v1.52.6-0.20231201115409-7ea994b6bbd8
Expand Down Expand Up @@ -107,6 +106,7 @@ require (
)

require (
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
github.com/elastic/go-freelru v0.13.0 // indirect
github.com/erigontech/speedtest v0.0.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand Down
4 changes: 0 additions & 4 deletions turbo/jsonrpc/eth_receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@ func (api *BaseAPI) getLogsV3(ctx context.Context, tx kv.TemporalTx, begin, end
continue
}
blockHash = header.Hash()

if err != nil {
return nil, err
}
exec.ChangeBlock(header)
}

Expand Down

0 comments on commit f948fb4

Please sign in to comment.