Lenient duplicate checks on HTTP API for block publication#5574
Lenient duplicate checks on HTTP API for block publication#5574mergify[bot] merged 35 commits intosigp:unstablefrom
Conversation
* save * save * make ProvenancedBlock concrete * delete into gossip verified block contents * get rid of IntoBlobSidecar trait * remove IntoGossipVerified trait * get tests compiling * don't check sidecar slashability in publish * remove second publish closure * drop blob bool. also prefer using message index over index of position in list
|
Ready for review, but I wouldn't recommend that relays start testing this PR until the issues with |
jimmygchen
left a comment
There was a problem hiding this comment.
I've added a few more comments. Looks great!
I wasn't expecting that much change, but looks like we do need to cover all the scenarios you've identified here. Nice tests you've added here - it helps me understand what we're trying to achieve here! 👍
Looks like I will have to rework quite a bit in PeerDAS 💀
jimmygchen
left a comment
There was a problem hiding this comment.
Just a few more minor comments, otherwise looks good to me. Would be good to get another pair of eyes on this.
There's probably some potential refactor we can do in publish_block, but perhaps we can do it in a separate PR, as this PR has a few simplifications that a few other changes depend on, e.g. PeerDAS publish block optimisations made in b0e6283. The added tests in this PR should make future refactoring easier.
|
@mergify queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 2792705 |
|
tasty insta merge finally |
* start splitting gossip verification * WIP * Gossip verify separate (#7) * save * save * make ProvenancedBlock concrete * delete into gossip verified block contents * get rid of IntoBlobSidecar trait * remove IntoGossipVerified trait * get tests compiling * don't check sidecar slashability in publish * remove second publish closure * drop blob bool. also prefer using message index over index of position in list * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix low-hanging tests * Fix tests and clean up * Clean up imports * more cleanup * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Further refine behaviour and add tests * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Remove empty line * Fix test (block is not fully imported just gossip verified) * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Update for unstable & use empty blob list * Update comment * Add test for duplicate block case * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Clarify unreachable case * Fix another publish_block case * Remove unreachable case in filter chain segment * Revert unrelated blob optimisation * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix merge conflicts * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix some compilation issues. Impl is fucked though * Support peerDAS * Fix tests * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix conflict * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Address review comments * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate
Issue Addressed
Fix the much-talked-about bug in Lighthouse's HTTP API which prevents blocks with blobs from being published if the block has already been seen on gossip
See: https://gist.github.com/benhenryhunter/7b7d9c9e3218aad52f75e3647b83a6cc
Proposed Changes
process_blobso that it takes apublish_fnwhich can be used to publish the block in the case where it is imported during blob processing.BlockIsAlreadyKnownerror into two cases so we can differentiate duplicate blocks that have already been fully imported from ones that are being imported/failed import.publish_blockso that it publishes all unseen blocks and blobs on gossip.