You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Check the uncle commitment and proof of work before crediting difficulty #268
HeaderWithUncles::commitment_matches existed, its doc comment called it "the whole security argument for the message", and it was called in exactly one place: the server side, on what this node sends out.
Neither client path called it.
Both took cumulative_difficulty() — the sender's arithmetic over the uncles the sender chose to send — and recorded it as proven:
path
where it lands
manager.rs (ordinary sync)
the total difficulty recorded for a header, which is the input to chain selection
snap/session.rs
walked_difficulty → established_difficulty → the OverstatedDifficulty ceiling
The second is the worse of the two: fabricated uncles would widen the one guard against an overstated claim.
Two checks, neither implying the other
ommers_hash is inside what the trunk header's proof of work commits to, so a list matching it cannot have been added to, dropped from or altered.
Each uncle's own merged-mining proof of work, because a matching commitment only proves the block's miner chose this list — not that the difficulty each uncle states was ever performed.
Failure is in the safe direction
A header failing either check still goes through as a bare header; only its uncle-derived difficulty is withheld. That understates the chain rather than overstating it, and understated is the direction that refuses a liar rather than admitting one.
Exposure
Bounded: rsk/63 carries this message and rskj speaks rsk/62, so only rustock peers could send it. That stops being true if rskj adopts RSKIP-698.
Tests
Two, one per check, each asserting the difficulty is not credited — a forged uncle list, and a committed uncle with no valid proof of work.
Activity