1

I was trying to execute a function reportEquivocation(equivocationProof, keyOwnerProof)in the babe pallet . I was stuck in filling the parameters for the same.Could anyone guide me about how to fill slot and keyOwnerProof parameter?

1 Answer 1

1

The slot is just the slot number (u64) at which the equivocation you want to report happened.

You can see the rest of the struct for the EquivocationProof here:

#[derive(Clone, Debug, Decode, Encode, PartialEq, TypeInfo, Eq)]
pub struct EquivocationProof<Header, Id> {
    /// Returns the authority id of the equivocator.
    pub offender: Id,
    /// The slot at which the equivocation happened.
    pub slot: Slot,
    /// The first header involved in the equivocation.
    pub first_header: Header,
    /// The second header involved in the equivocation.
    pub second_header: Header,
}

The keyOwnerProof is the proof of key ownership. The proof must include the session index and validator count of the session at which the equivocation occurred.

You specify it when you implement babe in your runtime, an example in Rococo runtime. In that scenario the fields you need to fill are these (see primitive here):

#[derive(Encode, Decode, Clone, Eq, PartialEq, Default, RuntimeDebug, scale_info::TypeInfo)]
pub struct MembershipProof {
    /// The session index on which the specific key is a member.
    pub session: SessionIndex,
    /// Trie nodes of a merkle proof of session membership.
    pub trie_nodes: Vec<Vec<u8>>,
    /// The validator count of the session on which the specific key is a member.
    pub validator_count: ValidatorCount,
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.