Skip to content

Conversation

@michaelsproul
Copy link
Member

Issue Addressed

Closes #2042

Proposed Changes

Pass blocks that fail gossip verification to the slasher. Blocks that are successfully verified are not passed immediately, but will be passed as part of full block verification.

@michaelsproul michaelsproul added ready-for-review The code is ready for review A0 labels Dec 4, 2020
@michaelsproul
Copy link
Member Author

Here's a sketch of how with this change, all entrypoints to block verification pass their blocks to the slasher regardless of error.

Entrypoint verify_block_for_gossip

On success: goes to process_block flow, see below.

On failure: passed to slasher via GossipVerifiedBlock::new

Entrypoint process_block

Could be called with any type implementing IntoFullyVerifiedBlock.

Each type implementing this calls into_fully_verified_block, which has a default implementation in terms of into_fully_verified_block_slashable. The default impl handles pushing blocks to the slasher, and into_fully_verified_block_slashable does different checks based on the receiver type, while producing slash info:

If GossipVerifiedBlock, gets transformed into SignatureVerifiedBlock via from_gossip_verified_block_check_slashable, which produces slash info.

If SignedBeaconBlock, gets transformed into SignatureVerifiedBlock via SignatureVerifiedBlock::check_slashable, which produces slash info.

If SignatureVerifiedBlock, does some more verification and then wraps any errors in BlockSlashInfo::SignatureValid.

Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Nice! Merge at will!

@michaelsproul
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Dec 4, 2020
## Issue Addressed

Closes #2042

## Proposed Changes

Pass blocks that fail gossip verification to the slasher. Blocks that are successfully verified are not passed immediately, but will be passed as part of full block verification.
@michaelsproul
Copy link
Member Author

Hmm that ENR test failed again

@bors
Copy link

bors bot commented Dec 4, 2020

Build failed:

@michaelsproul
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Dec 4, 2020
## Issue Addressed

Closes #2042

## Proposed Changes

Pass blocks that fail gossip verification to the slasher. Blocks that are successfully verified are not passed immediately, but will be passed as part of full block verification.
@bors
Copy link

bors bot commented Dec 4, 2020

@bors bors bot changed the title Pass failed gossip blocks to the slasher [Merged by Bors] - Pass failed gossip blocks to the slasher Dec 4, 2020
@bors bors bot closed this Dec 4, 2020
@michaelsproul michaelsproul deleted the slasher-proposers branch December 4, 2020 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0 ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants