Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[RFC] BEEFY: add support for slashing validators voting on non-finalized forks #14520

Closed

Conversation

acatangiu
Copy link
Contributor

Description

BEEFY voters should only vote on GRANDPA finalized blocks - vote only on canonic chain/fork.

Votes on blocks from different forks should (automatically) lead to stake slashing (more aggressive slashing than GRANDPA equivocations, since this scenario is intentionally dishonest).

We should add client/voter detection of such misbehavior as well as runtime logic for reporting proofs of misbehavior and subsequent slashing consequences.

Proposed solution

Runtime side (TODO)

  • add new pallet::call to pallet_beefy similar to report_equivocation that takes InvalidPayloadProof
  • hook pallet_beefy_mmr to pallet_beefy::EquivocationReportSystem to be able to verify InvalidPayloadProof:
    • verify inner GrandpaProof to make sure the current chain fork is finalized at least up to offending vote height,
    • verify offending_vote.mmr_root != on-chain mmr_root (combined with above, it proves what we need)
  • report offense to staking so offending vote author gets slashed

Client-side

  • add "fisherman" capabilities to voter gossip - on detecting votes for historical forks, it builds the required proof of misbehavior and submits report.

Fixes paritytech/polkadot-sdk#1120

Polkadot companion TODO

@acatangiu
Copy link
Contributor Author

@andresilva please have a look and validate the proposed approach

GRANDPA finalization proof is not checked, which leads to slashing on
forks. This is fine since honest validators will not be slashed on the
chain finalized by GRANDPA, which is the only chain that ultimately
matters. The only material difference not checking GRANDPA proofs makes
is that validators are not slashed for signing BEEFY commitments prior
to the blocks committed to being finalized by GRANDPA. This is fine too,
since the slashing risk of committing to an incorrect block implies
validators will only sign blocks they *know* will be finalized by
GRANDPA.
instead of using votes as the underlying primitive, rather use
commitments since they're a more universal container for signed payloads
(for instance `SignedCommitment` is also the primitive used by ethereum relayers).
SignedCommitments are already aggregates of multiple signatures. Will
use SignedCommitment directly next.
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3340606

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3340607

@acatangiu
Copy link
Contributor Author

closing this in favor of #14744

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BEEFY: slash validators voting on non-finalized forks
3 participants