Skip to content

Commit

Permalink
fix: reth rpc should provide results for pending block related queries (
Browse files Browse the repository at this point in the history
  • Loading branch information
sapinb authored Jan 21, 2025
1 parent 39b843c commit bc22c36
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/strata-reth/res/alpen-dev-chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"londonBlock": 0,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 0
"shanghaiTime": 0,
"mergeNetsplitBlock": 0
}
}
}
5 changes: 3 additions & 2 deletions bin/strata-reth/res/devnet-chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"londonBlock": 0,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 0
"shanghaiTime": 0,
"mergeNetsplitBlock": 0
}
}
}
30 changes: 30 additions & 0 deletions functional-tests/tests/el_pending_block.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import flexitest

from envs import testenv


@flexitest.register
class ElPendingBlock(testenv.StrataTester):
def __init__(self, ctx: flexitest.InitContext):
ctx.set_env("basic")

def main(self, ctx: flexitest.RunContext):
reth = ctx.get_service("reth")
address = reth.create_web3().address

rethrpc = reth.create_rpc()
block = rethrpc.eth_getBlockByNumber("pending", True)

assert block is not None, "get pending block"

gas = rethrpc.eth_estimateGas(
{
"chainId": "0x3039",
"from": address,
"to": "0x" + "00" * 20,
"nonce": "0x0",
},
"pending",
)

assert gas is not None, "estimate gas on pending block"

0 comments on commit bc22c36

Please sign in to comment.