Repository navigation
Description
Hey, third one from me today. This one is in the consensus app layer, the sync path.
Problem
In get_decided_blocks (crates/malachite-app/src/handlers/get_decided_values.rs:203-263), when the CL store has no decided block for a height, the code fetches the execution payload from the EL by block number and the certificate from the CL store, then pairs them with no check that they agree:
blocks[index] = Some(DecidedBlock::new(execution_payload, certificate));DecidedBlock::new (crates/types/src/block.rs:175-189) asserts the pairing:
assert_eq!(
payload_block_hash, certificate_block_hash,
"Block hash in the execution payload does not match the hash in the commit certificate"
);Every sibling branch in the same function fails closed with warn! + continue. No payload, skip. No certificate, skip. Store or certificate errors, skip. This one branch is the only place two independently sourced values are combined with an assert_eq! instead of a comparison.
What breaks
If the EL serves a different block at that height than the certificate commits to, EL on another fork, stale or reorged EL, EL amnesia, the assert fires and the spawned sync task panics.
Impact is bounded, and I am stating that plainly. The panic kills only the detached spawned task. handle() drops the JoinHandle, so the panic does not propagate to the app request dispatcher and does not shut the node down. No panic = "abort" anywhere in the workspace. The sync reply is simply never sent, so the requesting peer treats this node as unhelpful for that range and retries another host. But it is repeatable per request while the divergence persists, each request spawns a fresh task that panics, so it is a sync availability problem on this node for that range, plus panic log spam. No safety impact, no wrong value served, the assert fires before anything is sent.
The EL fallback is the normal path for older heights, not a rare edge. commit() in decided.rs prunes decided blocks unconditionally, while certificates are retained, so for older heights the EL fallback is what runs.
Reproduction
Temporary test appended to crates/malachite-app/src/handlers/get_decided_values.rs: el_fallback_payload_hash_mismatch_panics (#[should_panic(expected = "does not match the hash in the commit certificate")]). Mocks: decided block store returns None, certificate store returns the stored certificate for height 11, EL returns a payload for height 11 whose block_hash was rewritten to 0xAB... (a different block at the same height). The test calls get_decided_values and expects the panic from DecidedBlock::new.
Output (cargo test -p arc-node-consensus --lib): 1 passed, 491 filtered out.
Fix
Compare before constructing, in the same fail-closed style as the sibling branches:
if execution_payload.payload_inner.payload_inner.block_hash
!= certificate.value_id.block_hash()
{
warn!(%height, "EL payload hash does not match commit certificate, skipping");
continue;
}
blocks[index] = Some(DecidedBlock::new(execution_payload, certificate));What this is not
This is not a node crash, and it is not about the stored pairing. The store only pairs a payload and certificate that were written together, so a mismatched pair can never be stored. This is only the EL fallback, the one unvalidated pairing in the codebase. It continues the robustness direction from the v0.8.0 changelog, fail closed instead of crashing.
Activity
osr21 commentedon Nov 13, 2026
I checked the release/0.8 code. The fallback does pass the EL payload and stored certificate directly to DecidedBlock::new, whose hash assertion can panic. The impact description is appropriately scoped: this runs inside the detached GetDecidedValues task, and the handler only sends a reply for a successful result, so the observable failure is a dropped sync reply/retry rather than a node-wide crash.
A caller-side hash comparison followed by warn-and-continue looks like the right fail-closed fix. I would keep DecidedBlock::new's assertion as an invariant for already-validated pairs rather than weakening it globally. For the regression test, assert that a mismatching height remains None without panicking and that a subsequent matching height in the same requested batch is still returned; that checks both isolation and vector alignment. Logging the height and both hashes would also make EL/CL divergence diagnosable.
References: fallback in get_decided_values.rs · DecidedBlock invariant.
osr21 commentedon Nov 17, 2026
I’d be happy to work on this. Could a maintainer assign the issue to me? I’ll add a block-hash check at the EL fallback boundary, safely skip and log mismatched payload/certificate pairs while preserving the constructor invariant, and add a regression test for the mismatch case.
Jr-kenny commentedon Nov 18, 2026
I filed this one — the repro is verified, the mismatch panics the spawned sync task. I have the fix ready (hash check at the EL fallback boundary, skip and log, same fail-closed style as the sibling branches) and I'm happy to put up a PR for it.