Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store equivocating blocks on disk #4325

Draft
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

paulhauner
Copy link
Member

Issue Addressed

NA

Proposed Changes

Stores RepeatProposal blocks on disk if the --invalid-gossip-verified-blocks-path flag is provided.

We only store these blocks when they're received on gossip or are the result of a block lookup via RPC. Duplicates received via a batch sync won't be stored on disk. This is primarily for simplicity; we should see the blocks via gossip or on an RPC lookup if we're following the head. This feature is a debugging assistance tool, rather than a surefire way to catch slashings (use a slasher for that).

Additional Info

NA

@paulhauner paulhauner added work-in-progress PR is a work-in-progress v4.3.0 Estimated Q2 2023 labels May 24, 2023
@paulhauner paulhauner changed the base branch from stable to unstable May 24, 2023 01:52
@paulhauner
Copy link
Member Author

paulhauner commented May 24, 2023

I'm tempted to gate this feature behind another flag. There's a DoS opportunity here since we'll determine a RepeatProposal based on the block.proposer_index without checking the signature (i.e., any old fool can make us think there's been an equivocation).

Peer scoring should eventually ban peers sending us RepeatProposal blocks, but that's an imperfect safeguard.

@paulhauner paulhauner added v4.4.1 ETA August 2023 and removed v4.3.0 Estimated Q2 2023 labels Jun 28, 2023
@jmcph4
Copy link
Member

jmcph4 commented Jul 3, 2023

Just noticed this while going through the queued 4.3.1 changes; a few things to note after #4316:

Peer scoring should eventually ban peers sending us RepeatProposal blocks, but that's an imperfect safeguard.

  • BlockError::RepeatProposal is now BlockError::Slashable

/// The block is a slashable equivocation from the proposer.
///
/// ## Peer scoring
///
/// Honest peers shouldn't forward more than 1 equivocating block from the same proposer, so
/// we penalise them with a mid-tolerance error.
Slashable,

  • Peers are downscored with a MidToleranceError for submitting equivocating blocks

/* punish peer for submitting an equivocation, but not too harshly as honest peers may conceivably forward equivocating blocks to us from time to time */
self.gossip_penalize_peer(
peer_id,
PeerAction::MidToleranceError,
"gossip_block_mid",
);

@michaelsproul
Copy link
Member

To add to what Jack said, this statement is no longer true since the changes we made in #4316:

There's a DoS opportunity here since we'll determine a RepeatProposal based on the block.proposer_index without checking the signature (i.e., any old fool can make us think there's been an equivocation).

We removed the early/read-only equivocation check, because it caused the BN to forget about equivocations it had seen. Now it only returns an equivocation error (Slashable) after checking the sig

@paulhauner
Copy link
Member Author

I'm pushing this to the next release since there doesn't seem to be much demand and I don't have much bandwidth.

@paulhauner paulhauner added v4.5.0 ETA Q4 2023 and removed v4.4.1 ETA August 2023 labels Aug 24, 2023
@paulhauner paulhauner added v4.6.0 ETA Q1 2024 and removed v4.5.0 ETA Q4 2023 labels Sep 20, 2023
@michaelsproul michaelsproul added v5.0.0 Q1 2024 and removed v4.6.0 ETA Q1 2024 labels Dec 15, 2023
@paulhauner paulhauner added v5.1.0 Q2 2024 and removed v5.0.0 Q1 2024 labels Feb 14, 2024
@pawanjay176 pawanjay176 added v5.2.0 Q2 2024 and removed v5.1.0 Q2 2024 labels Mar 7, 2024
@pawanjay176
Copy link
Member

Pushed this to 5.2.0 as it doesn't seem urgent, feel free to revert if needed

@michaelsproul michaelsproul removed the v5.2.0 Q2 2024 label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress PR is a work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants