Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
fix pruned node integration test (#1223)
Browse files Browse the repository at this point in the history
closes: #1222
  • Loading branch information
yihuang authored and fedekunze committed Aug 3, 2022
1 parent 38c6958 commit 4271662
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpc/backend/evm_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,9 @@ func (b *Backend) SuggestGasTipCap(baseFee *big.Int) (*big.Int, error) {
func (b *Backend) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error) {
// return BaseFee if London hard fork is activated and feemarket is enabled
res, err := b.queryClient.BaseFee(types.ContextWithHeight(blockRes.Height), &evmtypes.QueryBaseFeeRequest{})
if err != nil {
// fallback to parsing from begin blocker event, could happen on pruned nodes.
if err != nil || res.BaseFee == nil {
// we can't tell if it's london HF not enabled or the state is pruned,
// in either case, we'll fallback to parsing from begin blocker event,
// faster to iterate reversely
for i := len(blockRes.BeginBlockEvents) - 1; i >= 0; i-- {
evt := blockRes.BeginBlockEvents[i]
Expand Down

0 comments on commit 4271662

Please sign in to comment.