optimism icon indicating copy to clipboard operation
optimism copied to clipboard

`eth_getBlockByNumber` returns `transaction type not supported` if number is same as current block

Open cyborgdennett opened this issue 3 years ago • 1 comments

Describe the bug Calling BlockByNumber() on Optimism-bedrock (eth_getBlockByNumber in JSON-RPC), returns transaction type not supported.

On Optimism legacy, this function worked as expected.

To Reproduce Steps to reproduce the behavior:

  1. Run ops-bedrock
  2. Dial to ethclient to localhost:8545
  3. Call BlockByNumber()
blockNumber, err := client.BlockNumber(context.Background())
if err != nil {
	Log.Warn().Msg("failed to get blocknumber")
	return
}
block, err := client.BlockByNumber(context.Background(), big.NewInt(int64(blockNumber)))
if err != nil {
	Log.Warn().Msg("failed to get block") <-- Error occurs here
	return
}

The current block from client.BlockNumber = 4045.

current behavior of client.BlockByNumber:

If I use 4044: I get the block. If I use 4045: I get transaction type not supported error If I use 4046: I get not found error

Expected behavior I expect this function to give me a block

System Specs:

  • OS: WSL2
  • Package Version (or commit hash): c1ebc9592a9da9cc9f0eebcc10e9a8930b6f29a0

cyborgdennett avatar Nov 02 '22 10:11 cyborgdennett

Perhaps there is something here that we missed with the deposit transaction deserialization

tynes avatar Nov 03 '22 00:11 tynes

is this solved?I use geth client still have this problem

coderbradlee avatar Aug 10 '23 02:08 coderbradlee