fix(op-reth, rpc): eth_getBlockReceipts err for genesis block in op-reth (#16879)

This commit is contained in:
Krishang Shah
2025-06-18 14:24:37 +05:30
committed by GitHub
parent 8dbbe7bda4
commit 5dc47e149b

View File

@@ -40,7 +40,17 @@ where
let excess_blob_gas = block.excess_blob_gas();
let timestamp = block.timestamp();
let mut l1_block_info = reth_optimism_evm::extract_l1_info(block.body())?;
let mut l1_block_info = match reth_optimism_evm::extract_l1_info(block.body()) {
Ok(l1_block_info) => l1_block_info,
Err(err) => {
// If it is the genesis block (i.e block number is 0), there is no L1 info, so
// we return an empty l1_block_info.
if block_number == 0 {
return Ok(Some(vec![]));
}
return Err(err.into());
}
};
return block
.body()