diff --git a/crates/storage/codecs/src/alloy/header.rs b/crates/storage/codecs/src/alloy/header.rs index 526bc69b1369..3a17ed1fdcd2 100644 --- a/crates/storage/codecs/src/alloy/header.rs +++ b/crates/storage/codecs/src/alloy/header.rs @@ -181,4 +181,14 @@ mod tests { let len = header.to_compact(&mut encoded_header); assert_eq!(header, Header::from_compact(&encoded_header, len).0); } + + #[test] + fn test_extra_fields_missing() { + let mut header = HOLESKY_BLOCK; + header.extra_fields = None; + + let mut encoded_header = vec![]; + let len = header.to_compact(&mut encoded_header); + assert_eq!(header, Header::from_compact(&encoded_header, len).0); + } } diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 1afd4da3fa8c..767f92db98f2 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -2151,10 +2151,8 @@ impl RequestsProvider ) -> ProviderResult> { if self.chain_spec.is_prague_active_at_timestamp(timestamp) { if let Some(number) = self.convert_hash_or_number(id)? { - // If we are past Prague, then all blocks should have a requests list, even if - // empty - let requests = self.tx.get::(number)?.unwrap_or_default(); - return Ok(Some(requests)) + let requests = self.tx.get::(number)?; + return Ok(requests) } } Ok(None) @@ -3483,10 +3481,8 @@ impl(block_number, requests)?; - durations_recorder.record_relative(metrics::Action::InsertBlockRequests); - } + self.tx.put::(block_number, requests)?; + durations_recorder.record_relative(metrics::Action::InsertBlockRequests); } let block_indices = StoredBlockBodyIndices { first_tx_num, tx_count };