Struct sp_beefy::Commitment
source · pub struct Commitment<TBlockNumber> {
pub payload: Payload,
pub block_number: TBlockNumber,
pub validator_set_id: ValidatorSetId,
}
Expand description
A commitment signed by GRANDPA validators as part of BEEFY protocol.
The commitment contains a payload extracted from the finalized block at height block_number. GRANDPA validators collect signatures on commitments and a stream of such signed commitments (see SignedCommitment) forms the BEEFY protocol.
Fields§
§payload: Payload
A collection of payloads to be signed, see Payload
for details.
One of the payloads should be some form of cumulative representation of the chain (think MMR root hash). Additionally one of the payloads should also contain some details that allow the light client to verify next validator set. The protocol does not enforce any particular format of this data, nor how often it should be present in commitments, however the light client has to be provided with full validator set whenever it performs the transition (i.e. importing first block with validator_set_id incremented).
block_number: TBlockNumber
Finalized block number this commitment is for.
GRANDPA validators agree on a block they create a commitment for and start collecting signatures. This process is called a round. There might be multiple rounds in progress (depending on the block choice rule), however since the payload is supposed to be cumulative, it is not required to import all commitments. BEEFY light client is expected to import at least one commitment per epoch, but is free to import as many as it requires.
validator_set_id: ValidatorSetId
BEEFY validator set supposed to sign this commitment.
Validator set is changing once per epoch. The Light Client must be provided by details
about the validator set whenever it’s importing first commitment with a new
validator_set_id
. Validator set data MUST be verifiable, for instance using
payload information.
Trait Implementations§
source§impl<TBlockNumber: Clone> Clone for Commitment<TBlockNumber>
impl<TBlockNumber: Clone> Clone for Commitment<TBlockNumber>
source§fn clone(&self) -> Commitment<TBlockNumber>
fn clone(&self) -> Commitment<TBlockNumber>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<TBlockNumber: Debug> Debug for Commitment<TBlockNumber>
impl<TBlockNumber: Debug> Debug for Commitment<TBlockNumber>
source§impl<TBlockNumber> Decode for Commitment<TBlockNumber>where
TBlockNumber: Decode,
impl<TBlockNumber> Decode for Commitment<TBlockNumber>where TBlockNumber: Decode,
source§impl<TBlockNumber> Encode for Commitment<TBlockNumber>where
TBlockNumber: Encode,
impl<TBlockNumber> Encode for Commitment<TBlockNumber>where TBlockNumber: Encode,
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<TBlockNumber> Ord for Commitment<TBlockNumber>where
TBlockNumber: Ord,
impl<TBlockNumber> Ord for Commitment<TBlockNumber>where TBlockNumber: Ord,
source§impl<TBlockNumber: PartialEq> PartialEq<Commitment<TBlockNumber>> for Commitment<TBlockNumber>
impl<TBlockNumber: PartialEq> PartialEq<Commitment<TBlockNumber>> for Commitment<TBlockNumber>
source§fn eq(&self, other: &Commitment<TBlockNumber>) -> bool
fn eq(&self, other: &Commitment<TBlockNumber>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<TBlockNumber> PartialOrd<Commitment<TBlockNumber>> for Commitment<TBlockNumber>where
TBlockNumber: Ord,
impl<TBlockNumber> PartialOrd<Commitment<TBlockNumber>> for Commitment<TBlockNumber>where TBlockNumber: Ord,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<TBlockNumber> TypeInfo for Commitment<TBlockNumber>where
TBlockNumber: TypeInfo + 'static,
impl<TBlockNumber> TypeInfo for Commitment<TBlockNumber>where TBlockNumber: TypeInfo + 'static,
impl<TBlockNumber> EncodeLike<Commitment<TBlockNumber>> for Commitment<TBlockNumber>where TBlockNumber: Encode,
impl<TBlockNumber: Eq> Eq for Commitment<TBlockNumber>
impl<TBlockNumber> StructuralEq for Commitment<TBlockNumber>
impl<TBlockNumber> StructuralPartialEq for Commitment<TBlockNumber>
Auto Trait Implementations§
impl<TBlockNumber> RefUnwindSafe for Commitment<TBlockNumber>where TBlockNumber: RefUnwindSafe,
impl<TBlockNumber> Send for Commitment<TBlockNumber>where TBlockNumber: Send,
impl<TBlockNumber> Sync for Commitment<TBlockNumber>where TBlockNumber: Sync,
impl<TBlockNumber> Unpin for Commitment<TBlockNumber>where TBlockNumber: Unpin,
impl<TBlockNumber> UnwindSafe for Commitment<TBlockNumber>where TBlockNumber: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.