Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Jun 25, 2025

Description

  1. To align fee_history in test_basic
  • fixes broken earliest/latest block tag handling
  • aligns blockCount as hexOrDecimal64 for EIP-1559 compatibility that breaks contract deploy in Foundry
  • ensures proper baseFeePerGas array length calculations
  • corrects oldestBlock return value (-1 discrepancy) with go-ethereum
  1. correct handling of next block fee for historical block should not change based on latest block in test_change
  2. rejects requests beyond current head block in test_beyond_head
  3. error handling for invalid reward percentile in test_percentiles
  4. ensures consistent results across concurrent block fetches in test_concurrent
  5. ensures update parameter changes not breaking historical data consistency in test_param_change

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

resolve EarliestBlockNumber from 0 to -5

for more info, ethereum/go-ethereum@bc36f2d
@mmsqe mmsqe marked this pull request as ready for review June 26, 2025 01:37
Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the contribution! One small fix on my end - using block 0 will yield the latest block, and not the earliest block, as it's coded right now. Let's fix the code for that and add a test case for the correct behaviour. Rest lgtm!


switch lastBlock {
case rpc.EarliestBlockNumber:
blockEnd = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earliest should be 1 here. If we use 0, then line 242's call to TendermintBlockByNumber will return the latest block:

evm/rpc/backend/blocks.go

Lines 164 to 168 in e6fe094

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Height in TendermintBlockByNumber returns 1 on 0 to handle earliest block case

},
},
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a testcase for earliest block time (0).

@vladjdk vladjdk requested a review from aljo242 July 4, 2025 15:35
@mmsqe mmsqe requested a review from vladjdk July 9, 2025 10:43
@vladjdk vladjdk merged commit cb64292 into cosmos:main Jul 14, 2025
15 checks passed
mmsqe added a commit to mmsqe/evm that referenced this pull request Aug 2, 2025
* fix: align eth_feeHistory with geth

resolve EarliestBlockNumber from 0 to -5

for more info, ethereum/go-ethereum@bc36f2d

* cleanup

* Apply suggestions from code review

---------

Co-authored-by: Alex | Interchain Labs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants