chore: reintroduce receipts verification debug log (#8662)

This commit is contained in:
DaniPopes
2024-06-07 03:21:22 +02:00
committed by GitHub
parent c362fc6c36
commit c7338593aa
5 changed files with 18 additions and 6 deletions

2
Cargo.lock generated
View File

@ -6768,6 +6768,7 @@ dependencies = [
"reth-consensus", "reth-consensus",
"reth-consensus-common", "reth-consensus-common",
"reth-primitives", "reth-primitives",
"tracing",
] ]
[[package]] [[package]]
@ -7391,6 +7392,7 @@ dependencies = [
"reth-consensus", "reth-consensus",
"reth-consensus-common", "reth-consensus-common",
"reth-primitives", "reth-primitives",
"tracing",
] ]
[[package]] [[package]]

View File

@ -16,5 +16,7 @@ reth-consensus-common.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-consensus.workspace = true reth-consensus.workspace = true
tracing.workspace = true
[features] [features]
optimism = ["reth-primitives/optimism"] optimism = ["reth-primitives/optimism"]

View File

@ -19,7 +19,12 @@ pub fn validate_block_post_execution(
// transaction This was replaced with is_success flag. // transaction This was replaced with is_success flag.
// See more about EIP here: https://eips.ethereum.org/EIPS/eip-658 // See more about EIP here: https://eips.ethereum.org/EIPS/eip-658
if chain_spec.is_byzantium_active_at_block(block.header.number) { if chain_spec.is_byzantium_active_at_block(block.header.number) {
verify_receipts(block.header.receipts_root, block.header.logs_bloom, receipts)?; if let Err(error) =
verify_receipts(block.header.receipts_root, block.header.logs_bloom, receipts)
{
tracing::debug!(%error, ?receipts, "receipts verification failed");
return Err(error)
}
} }
// Check if gas used matches the value set in header. // Check if gas used matches the value set in header.

View File

@ -17,7 +17,7 @@ reth-consensus-common.workspace = true
reth-primitives.workspace = true reth-primitives.workspace = true
reth-consensus.workspace = true reth-consensus.workspace = true
tracing.workspace = true
[features] [features]
optimism = [ optimism = ["reth-primitives/optimism"]
"reth-primitives/optimism",
]

View File

@ -18,13 +18,16 @@ pub fn validate_block_post_execution(
// transaction This was replaced with is_success flag. // transaction This was replaced with is_success flag.
// See more about EIP here: https://eips.ethereum.org/EIPS/eip-658 // See more about EIP here: https://eips.ethereum.org/EIPS/eip-658
if chain_spec.is_byzantium_active_at_block(block.header.number) { if chain_spec.is_byzantium_active_at_block(block.header.number) {
verify_receipts( if let Err(error) = verify_receipts(
block.header.receipts_root, block.header.receipts_root,
block.header.logs_bloom, block.header.logs_bloom,
receipts, receipts,
chain_spec, chain_spec,
block.timestamp, block.timestamp,
)?; ) {
tracing::debug!(%error, ?receipts, "receipts verification failed");
return Err(error)
}
} }
// Check if gas used matches the value set in header. // Check if gas used matches the value set in header.