Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anvil eth_getBlockByNumber returns incorrect block number for Arbitrum chain ID with no forking #9143

Closed
2 tasks done
michprev opened this issue Oct 19, 2024 · 2 comments · Fixed by #9151
Closed
2 tasks done
Assignees
Labels
C-anvil Command: anvil T-bug Type: bug

Comments

@michprev
Copy link
Contributor

Component

Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

anvil 0.2.0 (a8c3e9c 2024-10-19T00:20:41.820222000Z)

What command(s) is the bug in?

anvil --prune-history 100 --transaction-block-keeper 10 --steps-tracing --silent --port 63758 --chain-id 42161

Operating System

None

Describe the bug

Anvil configured with chainId 42161 with NO forking returns incorrect block number in eth_getBlockByNumber.

Relevant part of JSON-RPC communication:

INFO     2024-10-19 10:48:56,222 wake.development.json_rpc.communicator: Sending request: communicator.py:64
         {'jsonrpc': '2.0', 'method': 'eth_getBlockByNumber', 'params': ['0x1', False],                     
         'id': 17}                                                                                          
INFO     2024-10-19 10:48:56,223 wake.development.json_rpc.communicator: Received         communicator.py:68
         response:                                                                                          
         {"jsonrpc": "2.0", "id": 17, "result": {"hash":                                                    
         "0xf41355690f975fe48b4996040c8fa511e6e97bbd94c7a43f9604f0b9301e6c96",                              
         "parentHash":                                                                                      
         "0x865c37f9bd9edce7d295625b224ec50ba1275a625b32578d8bc84cc8be8cbc6a",                              
         "sha3Uncles":                                                                                      
         "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner":                     
         "0x0000000000000000000000000000000000000000", "stateRoot":                                         
         "0xcd6d4d980ed05ff9fa6576d712e54b34dd430b2491f00211c8aac7c32bf973e3",                              
         "transactionsRoot":                                                                                
         "0xa734c92b0cbaa73dbe7aa9f6e3fab29eb3f8cf00367b7ae99b0dcda0fd938cdb",                              
         "receiptsRoot":                                                                                    
         "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa",                              
         "logsBloom":                                                                                       
         "0x00000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000000000000000000000000000000000000000000000000                   
         00000000000000000000000000000000000", "difficulty": "0x0", "number": "0x2",                        
         "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "timestamp": "0x67137279",                           
         "totalDifficulty": "0x0", "extraData": "0x", "mixHash":                                            
         "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce":                     
         "0x0000000000000000", "baseFeePerGas": "0x0", "blobGasUsed": "0x0",                                
         "excessBlobGas": "0x0", "uncles": [], "transactions":                                              
         ["0xb04fa65c8d74145856ac847a19bcbb6fa15441dfaa7f32cff0592c2881ec9308"], "size":                    
         "0x22c", "l1BlockNumber": 1}}

Note that block with number 1 is requested, correct data are returned, except for "number": "0x2".

Most likely introduced in #8542.

@michprev michprev added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Oct 19, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 19, 2024
@yash-atreya yash-atreya self-assigned this Oct 21, 2024
@yash-atreya yash-atreya added C-anvil Command: anvil and removed T-needs-triage Type: this issue needs to be labelled labels Oct 21, 2024
@grandizzy
Copy link
Collaborator

@yash-atreya I have a fix for, will send a PR

@grandizzy
Copy link
Collaborator

nm, seen you already made one :)

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Oct 21, 2024
@grandizzy grandizzy moved this from Done to Completed in Foundry Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-bug Type: bug
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants