Skip to content

Commit

Permalink
add dummy for report of invalid fork commitments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lederstrumpf committed Aug 7, 2023
1 parent 0642a81 commit c6c36e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions frame/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,20 @@ impl<T: Config> Pallet<T> {
T::EquivocationReportSystem::publish_evidence((equivocation_proof, key_owner_proof)).ok()
}

/// Submits an extrinsic to report an invalid fork signed by potentially
/// multiple signatories. This method will create an unsigned extrinsic with
/// a call to `report_invalid_fork_unsigned` and will push the transaction
/// to the pool. Only useful in an offchain context.
pub fn submit_unsigned_invalid_fork_report(
_invalid_fork_proof: sp_consensus_beefy::InvalidForkCommitmentProof<BlockNumberFor<T>, T::BeefyId,
<T::BeefyId as RuntimeAppPublic>::Signature,
>,
_key_owner_proofs: Vec<T::KeyOwnerProof>,
) -> Option<()> {
// T::EquivocationReportSystem::publish_evidence((invalid_fork_proof, key_owner_proofs)).ok()
None
}

fn change_authorities(
new: BoundedVec<T::BeefyId, T::MaxAuthorities>,
queued: BoundedVec<T::BeefyId, T::MaxAuthorities>,
Expand Down
2 changes: 1 addition & 1 deletion primitives/consensus/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl<AuthorityId> OnNewValidatorSet<AuthorityId> for () {
/// the runtime API boundary this type is unknown and as such we keep this
/// opaque representation, implementors of the runtime API will have to make
/// sure that all usages of `OpaqueKeyOwnershipProof` refer to the same type.
#[derive(Decode, Encode, PartialEq, TypeInfo)]
#[derive(Decode, Encode, PartialEq, TypeInfo, Clone)]
pub struct OpaqueKeyOwnershipProof(Vec<u8>);
impl OpaqueKeyOwnershipProof {
/// Create a new `OpaqueKeyOwnershipProof` using the given encoded
Expand Down

0 comments on commit c6c36e3

Please sign in to comment.