Conversation
Leo-Besancon
left a comment
There was a problem hiding this comment.
Same as the other consensus-related PR, I'm not doing deep reviews. The implementation looks fine to me.
|
That looks good to me. |
21e2b7f to
be47373
Compare
Leo-Besancon
left a comment
There was a problem hiding this comment.
LGTM, waiting on other reviews (ping @damip) before merging
damip
left a comment
There was a problem hiding this comment.
Two unrelated things in here, they get different answers.
-
mark_invalid_blockno-op when consensus has no entry: correct, keep it, and it matters more than the issue says. This is not a race on a stale wishlist entry, it is the normal missing-parent flow. Consensus wishlists a parentPit has never seen (P -> Noneinget_block_wishlist, nothing inblocks_state). Protocol fetchesP's header and keeps it to itself (wishlisted headers are not registered to consensus), then the op list, then the ops. If the committed ops exceed the max block size,gather_missing_block_opscallsmark_block_as_invalid(P)->mark_invalid_block(P)->transition_maponNone->panic!("Invalid transition from None to Discarded"). Anyone can signP(no draw check on a zero-endorsement header) and put whatever they want in its op list. A staker needs one slot to send a header withPas parent to each node, and every node that got it dies. Please say that in the PR description and add a test: mark invalid a block consensus never had, no panic. -
Turning size evictions into
Discarded(Stale): please revert, both inprune_slot_waitingand inprune_waiting_for_dependencies, and put backOption<DiscardReason>. Details inline. Short version:Discardedis a verdict, it is terminal and it is inherited by every child (check_headerdiscards a block whose parent isDiscarded). A size eviction is not a verdict. The "blackhole" from the issue is a one-slot delay: the forgotten block is refetched through the wishlist as soon as a child references it. WithDiscarded(Stale)the child is discarded instead, so the change removes the recovery path it was supposed to protect. No upside.
To be clear on severity: in practice eviction only happens in states where the node is already lost (over 2048 waiters means 32+ periods of backlog, consensus catch-up is dead after force_keep_final_periods = 5 anyway, the node ends up in NeedSync either way). So this is not a "will desync nodes" objection, it is a "wrong direction, zero benefit, don't" objection.
…s as Discarded and harden mark_invalid_block
… prune_waiting_for_dependencies
…rk_invalid_block on unknown blocks with a test
be47373 to
2910b24
Compare
|
@damip @Leo-Besancon @bilboquet |
…s as Discarded and harden mark_invalid_block
resync_checkflag