Skip to content

Lenient duplicate checks on HTTP API for block publication#5574

Merged
mergify[bot] merged 35 commits intosigp:unstablefrom
michaelsproul:gossip-verify-separate
Sep 24, 2024
Merged

Lenient duplicate checks on HTTP API for block publication#5574
mergify[bot] merged 35 commits intosigp:unstablefrom
michaelsproul:gossip-verify-separate

Conversation

@michaelsproul
Copy link
Member

@michaelsproul michaelsproul commented Apr 12, 2024

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

  • Change the signature of process_blob so that it takes a publish_fn which can be used to publish the block in the case where it is imported during blob processing.
  • Split the BlockIsAlreadyKnown error into two cases so we can differentiate duplicate blocks that have already been fully imported from ones that are being imported/failed import.
  • Extensively re-work publish_block so that it publishes all unseen blocks and blobs on gossip.
  • Add new tests to cover scenarios involving partial publication of block & blobs on gossip.

realbigsean and others added 3 commits March 27, 2024 18:39
* 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
@michaelsproul michaelsproul added work-in-progress PR is a work-in-progress HTTP-API labels Apr 12, 2024
@michaelsproul michaelsproul added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels May 14, 2024
@michaelsproul
Copy link
Member Author

Ready for review, but I wouldn't recommend that relays start testing this PR until the issues with unstable and v5.2.0 are resolved.

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. v5.3.0 Q3 2024 release with database changes! and removed ready-for-review The code is ready for review labels Jun 27, 2024
@michaelsproul michaelsproul added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 19, 2024
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 💀

@michaelsproul michaelsproul added the ready-for-review The code is ready for review label Sep 10, 2024
@michaelsproul michaelsproul removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Sep 23, 2024
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Sep 23, 2024
Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@michaelsproul michaelsproul added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Sep 24, 2024
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Sep 24, 2024
@michaelsproul
Copy link
Member Author

@mergify queue

@mergify
Copy link

mergify bot commented Sep 24, 2024

queue

✅ The pull request has been merged automatically

Details

The pull request has been merged automatically at 2792705

@mergify mergify bot merged commit 2792705 into sigp:unstable Sep 24, 2024
@michaelsproul michaelsproul deleted the gossip-verify-separate branch September 24, 2024 05:05
@michaelsproul
Copy link
Member Author

tasty insta merge

finally

chong-he pushed a commit to chong-he/lighthouse that referenced this pull request Nov 26, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HTTP-API ready-for-merge This PR is ready to merge. v6.0.0 New major release for hierarchical state diffs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants