Skip to content
Closed
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d8964df
sc-consensus-beefy: add BEEFY fisherman to gossip network
acatangiu Jul 5, 2023
a2678a0
sp-consensus-beefy: add invalid fork vote proof and equivalent BeefyApi
acatangiu Jul 5, 2023
17398d8
pallet-beefy: add stubs for reporting invalid fork votes
acatangiu Jul 5, 2023
df31624
sc-consensus-beefy: fisherman reports invalid votes and justifications
acatangiu Jul 5, 2023
938cde1
don't check GRANDPA finality
Lederstrumpf Jul 20, 2023
fb08553
change primitive: vote -> commitment
Lederstrumpf Jul 20, 2023
39799b2
add check_signed_commitment/report_invalid_payload
Lederstrumpf Jul 27, 2023
4aa602a
update comments
Lederstrumpf Aug 2, 2023
e0e13d9
add dummy for report of invalid fork commitments
Lederstrumpf Aug 2, 2023
165d7fc
account for #14471
Lederstrumpf Aug 1, 2023
c7df83b
account for #14373
Lederstrumpf Aug 7, 2023
754ae80
EquivocationOffence.{offender->offenders}
Lederstrumpf Aug 7, 2023
6ed4e99
EquivocationProof->VoteEquivocationProof
Lederstrumpf Aug 7, 2023
1e41551
Invalid{""->Vote}EquivocationProof
Lederstrumpf Aug 7, 2023
de2ae90
check_{""->vote}_equivocation_proof
Lederstrumpf Aug 7, 2023
273f34b
InvalidForkCommitmentProof->ForkEquivocationProof
Lederstrumpf Aug 7, 2023
eb1e549
renames across submit_report_...
Lederstrumpf Aug 7, 2023
3369783
convert EquivocationEvidenceFor to enum (minimal)
Lederstrumpf Aug 7, 2023
7abbddc
handle ForkEquivocationProof enum variant
Lederstrumpf Aug 7, 2023
8acea22
reduce find_mmr_root_digest trait constraint
Lederstrumpf Aug 8, 2023
103fc53
fix fork equiv. call interfaces (vecs of sigs)
Lederstrumpf Aug 8, 2023
1509a26
check proof's payload against correct header's
Lederstrumpf Aug 8, 2023
a62cc7f
rm superfluous report_fork_equiv.correct_header
Lederstrumpf Aug 8, 2023
5445977
remove duplic. in check_{signed_commitment, proof}
Lederstrumpf Aug 8, 2023
d35a97c
update outdated comments
Lederstrumpf Aug 8, 2023
4e3e1cc
remove report_invalid_payload
Lederstrumpf Aug 8, 2023
f27a876
.+report.+{""->_vote}_equivocations
Lederstrumpf Aug 8, 2023
f641759
move correct_header hash check into primitives
Lederstrumpf Aug 9, 2023
5c4104c
create_beefy_worker: only push block if at genesis
Lederstrumpf Aug 9, 2023
a0d8b87
create_beefy_worker: opt. instantiate with TestApi
Lederstrumpf Aug 9, 2023
9126904
push to reported_fork_equivocations
Lederstrumpf Aug 9, 2023
02da07e
add generate_fork_equivocation_proof_vote to tests
Lederstrumpf Aug 9, 2023
a3b4d3f
test: Alice snitches on Bob's vote equivocation
Lederstrumpf Aug 9, 2023
d44e3c8
store reference to key_store in fisherman
Lederstrumpf Aug 10, 2023
c27579c
test: Alice doesn't snitch *own* vote equivocation
Lederstrumpf Aug 10, 2023
5516837
un-stub submit_unsigned_fork_equivocation_report
Lederstrumpf Aug 10, 2023
60a71c7
Alice reports Bob & Charlie's signed commitment
Aug 24, 2023
ec99b1a
cleanup
Lederstrumpf Aug 24, 2023
ea7dd35
remove superfluous None check
Lederstrumpf Aug 24, 2023
3185776
fixup! check proof's payload against correct header's
Lederstrumpf Aug 28, 2023
59c1c2a
fmt
Lederstrumpf Aug 28, 2023
ab3eb02
missing keystore
Lederstrumpf Aug 29, 2023
844ed67
graft https://github.com/paritytech/polkadot/pull/7634
Lederstrumpf Aug 29, 2023
6ebebed
impl equiv. runtime interfaces kusama/westend
Lederstrumpf Aug 29, 2023
efe4b2a
clone beefy pallet equivocation tests
Lederstrumpf Aug 31, 2023
d0dba3b
test renames
Lederstrumpf Aug 31, 2023
b438866
test fork equivocation (via vote) reports
Lederstrumpf Aug 31, 2023
bd856ac
handle fork equivocations in validate_unsigned & pre_dispatch
Lederstrumpf Aug 31, 2023
9e1e7b1
clone tests for fork equivocations via commitments
Lederstrumpf Aug 31, 2023
f5b1ec5
bump number of beefy authorities in tests
Lederstrumpf Sep 1, 2023
7504b96
test fork equivocation (via commitment) reports
Lederstrumpf Sep 1, 2023
036fa2f
cleanup & TODOs
Lederstrumpf Sep 3, 2023
53e8ae0
test that overlapping reports stack correctly
Lederstrumpf Sep 3, 2023
8a14649
note re. temporary equivocation proof structure
Lederstrumpf Sep 4, 2023
4074a27
Merge remote-tracking branch 'origin/master' into rhmb/beefy-slashing…
Lederstrumpf Sep 5, 2023
e5537dd
fmt
Lederstrumpf Sep 5, 2023
c815af6
cleanup & remove TODO
Lederstrumpf Sep 5, 2023
35330bb
Merge remote-tracking branch 'origin/master' into rhmb/beefy-slashing…
Lederstrumpf Sep 5, 2023
bb2e791
add reference to #1441
Lederstrumpf Sep 7, 2023
936406b
Merge remote-tracking branch 'origin/master' into rhmb/beefy-slashing…
Lederstrumpf Sep 7, 2023
16c12eb
Merge remote-tracking branch 'origin/master' into rhmb/beefy-slashing…
Lederstrumpf Oct 17, 2023
8b48fec
fixup! Merge remote-tracking branch 'origin/master' into rhmb/beefy-s…
Lederstrumpf Oct 17, 2023
7be7ba9
Merge remote-tracking branch 'origin/master' into rhmb/beefy-slashing…
Lederstrumpf Nov 28, 2023
0cd4a75
account for #2446
Lederstrumpf Nov 28, 2023
e1953eb
{correct->canonical}_header
Lederstrumpf Dec 14, 2023
26fc473
remove old logging
Lederstrumpf Dec 14, 2023
d7f553f
more {expected->canonical}_...
Lederstrumpf Dec 14, 2023
d2bf211
linearize failfast flow
Lederstrumpf Dec 14, 2023
11a16cc
debug->warn
Lederstrumpf Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions polkadot/node/service/src/fake_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ sp_api::impl_runtime_apis! {
unimplemented!()
}

fn submit_report_equivocation_unsigned_extrinsic(
_: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
_: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -251,6 +251,13 @@ sp_api::impl_runtime_apis! {
unimplemented!()
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
_: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, <Block as BlockT>::Header>,
_: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
unimplemented!()
}

fn generate_key_ownership_proof(
_: beefy_primitives::ValidatorSetId,
_: BeefyId,
Expand Down
20 changes: 16 additions & 4 deletions polkadot/runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2043,8 +2043,8 @@ sp_api::impl_runtime_apis! {
Beefy::validator_set()
}

fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
vote_equivocation_proof: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -2053,12 +2053,24 @@ sp_api::impl_runtime_apis! {
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;

Beefy::submit_unsigned_equivocation_report(
equivocation_proof,
Beefy::submit_unsigned_vote_equivocation_report(
vote_equivocation_proof,
key_owner_proof,
)
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
fork_equivocation_proof: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header>,
key_owner_proofs: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
let key_owner_proofs = key_owner_proofs.iter().cloned().map(|p| p.decode()).collect::<Option<Vec<_>>>()?;

Beefy::submit_unsigned_fork_equivocation_report(
fork_equivocation_proof,
key_owner_proofs,
)
}

fn generate_key_ownership_proof(
_set_id: beefy_primitives::ValidatorSetId,
authority_id: BeefyId,
Expand Down
14 changes: 12 additions & 2 deletions polkadot/runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1848,21 +1848,31 @@ sp_api::impl_runtime_apis! {
None
}

fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
_vote_equivocation_proof: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
>,
_key_owner_proof: beefy_primitives::OpaqueKeyOwnershipProof,
) -> Option<()> {
// dummy implementation due to lack of BEEFY pallet.
None
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
_fork_equivocation_proof: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header>,
_key_owner_proofs: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
// dummy implementation due to lack of BEEFY pallet.
None
}

fn generate_key_ownership_proof(
_set_id: beefy_primitives::ValidatorSetId,
_authority_id: BeefyId,
) -> Option<beefy_primitives::OpaqueKeyOwnershipProof> {
// dummy implementation due to lack of BEEFY pallet.
None
}
}
Expand Down
20 changes: 16 additions & 4 deletions polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1855,8 +1855,8 @@ sp_api::impl_runtime_apis! {
Beefy::validator_set()
}

fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
vote_equivocation_proof: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -1865,12 +1865,24 @@ sp_api::impl_runtime_apis! {
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;

Beefy::submit_unsigned_equivocation_report(
equivocation_proof,
Beefy::submit_unsigned_vote_equivocation_report(
vote_equivocation_proof,
key_owner_proof,
)
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
fork_equivocation_proof: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header>,
key_owner_proofs: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
let key_owner_proofs = key_owner_proofs.iter().cloned().map(|p| p.decode()).collect::<Option<Vec<_>>>()?;

Beefy::submit_unsigned_fork_equivocation_report(
fork_equivocation_proof,
key_owner_proofs,
)
}

fn generate_key_ownership_proof(
_set_id: beefy_primitives::ValidatorSetId,
authority_id: BeefyId,
Expand Down
11 changes: 9 additions & 2 deletions polkadot/runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ sp_api::impl_runtime_apis! {
None
}

fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
_vote_equivocation_proof: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -973,6 +973,13 @@ sp_api::impl_runtime_apis! {
None
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
_fork_equivocation_proof: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header>,
_key_owner_proofs: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
None
}

fn generate_key_ownership_proof(
_set_id: beefy_primitives::ValidatorSetId,
_authority_id: BeefyId,
Expand Down
20 changes: 16 additions & 4 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,8 @@ sp_api::impl_runtime_apis! {
Beefy::validator_set()
}

fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: beefy_primitives::EquivocationProof<
fn submit_report_vote_equivocation_unsigned_extrinsic(
vote_equivocation_proof: beefy_primitives::VoteEquivocationProof<
BlockNumber,
BeefyId,
BeefySignature,
Expand All @@ -1718,12 +1718,24 @@ sp_api::impl_runtime_apis! {
) -> Option<()> {
let key_owner_proof = key_owner_proof.decode()?;

Beefy::submit_unsigned_equivocation_report(
equivocation_proof,
Beefy::submit_unsigned_vote_equivocation_report(
vote_equivocation_proof,
key_owner_proof,
)
}

fn submit_report_fork_equivocation_unsigned_extrinsic(
fork_equivocation_proof: beefy_primitives::ForkEquivocationProof<BlockNumber, BeefyId, BeefySignature, Header>,
key_owner_proofs: Vec<beefy_primitives::OpaqueKeyOwnershipProof>,
) -> Option<()> {
let key_owner_proofs = key_owner_proofs.iter().cloned().map(|p| p.decode()).collect::<Option<Vec<_>>>()?;

Beefy::submit_unsigned_fork_equivocation_report(
fork_equivocation_proof,
key_owner_proofs,
)
}

fn generate_key_ownership_proof(
_set_id: beefy_primitives::ValidatorSetId,
authority_id: BeefyId,
Expand Down
Loading