fix: make RequestsProvider method aware of in-memory state (#10252)

This commit is contained in:
Darshan Kathiriya
2024-08-13 15:57:37 -04:00
committed by GitHub
parent ac3d62ba02
commit 91c1df379d

View File

@@ -832,7 +832,15 @@ where
id: BlockHashOrNumber,
timestamp: u64,
) -> ProviderResult<Option<reth_primitives::Requests>> {
self.database.requests_by_block(id, timestamp)
if !self.database.chain_spec().is_prague_active_at_timestamp(timestamp) {
return Ok(None)
}
let Some(number) = self.convert_hash_or_number(id)? else { return Ok(None) };
if let Some(block) = self.canonical_in_memory_state.state_by_number(number) {
Ok(block.block().block().requests.clone())
} else {
self.database.requests_by_block(id, timestamp)
}
}
}