pub struct RequestExtendVote {
pub hash: Vec<u8>,
pub height: i64,
pub round: i32,
}Expand description
Extends a vote with application-side injection
§Usage
ResponseExtendVote.vote_extensionsis optional information that, if present, will be signed by Tenderdash and attached to the Precommit message.RequestExtendVote.hashcorresponds to the hash of a proposed block that was made available to the application in a previous call toProcessProposalorPrepareProposalfor the current height.ResponseExtendVote.vote_extensionswill only be attached to a non-nilPrecommit message. If Tenderdash is to precommitnil, it will not callRequestExtendVote.- The Application logic that creates the extensions can be non-deterministic.
§When does Tenderdash call it?
When a validator p is in Tenderdash consensus state prevote of round r, height h, in which q is the proposer; and p has received
- the Proposal message v for round r, height h, along with all the block parts, from q,
Prevotemessages from 2f + 1 validators’ voting power for round r, height h, prevoting for the same block id(v),
then p’s Tenderdash locks v and sends a Precommit message in the following way
- p’s Tenderdash sets lockedValue and validValue to v, and sets lockedRound and validRound to r
- p’s Tenderdash calls
RequestExtendVotewith id(v) (RequestExtendVote.hash). The call is synchronous. - The Application optionally returns an array of bytes,
ResponseExtendVote.extension, which is not interpreted by Tenderdash. - p’s Tenderdash includes
ResponseExtendVote.extensionin a field of type CanonicalVoteExtension, it then populates the other fields in CanonicalVoteExtension, and signs the populated data structure. - p’s Tenderdash constructs and signs the CanonicalVote structure.
- p’s Tenderdash constructs the Precommit message (i.e. Vote structure) using CanonicalVoteExtension and CanonicalVote.
- p’s Tenderdash broadcasts the Precommit message.
In the cases when p’s Tenderdash is to broadcast precommit nil messages (either 2f+1 prevote nil messages received,
or timeoutPrevote triggered), p’s Tenderdash does not call RequestExtendVote and will not include
a CanonicalVoteExtension field in the precommit nil message.
Fields§
§hash: Vec<u8>The header hash of the proposed block that the vote extensions is to refer to.
height: i64Height of the proposed block (for sanity check).
round: i32// Round number for the block.
Trait Implementations§
Source§impl Clone for RequestExtendVote
impl Clone for RequestExtendVote
Source§fn clone(&self) -> RequestExtendVote
fn clone(&self) -> RequestExtendVote
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestExtendVote
impl Debug for RequestExtendVote
Source§impl Default for RequestExtendVote
impl Default for RequestExtendVote
Source§impl<'de> Deserialize<'de> for RequestExtendVote
impl<'de> Deserialize<'de> for RequestExtendVote
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RequestExtendVote> for Value
impl From<RequestExtendVote> for Value
Source§fn from(value: RequestExtendVote) -> Self
fn from(value: RequestExtendVote) -> Self
Converts to this type from the input type.
Source§impl Hash for RequestExtendVote
impl Hash for RequestExtendVote
Source§impl Message for RequestExtendVote
impl Message for RequestExtendVote
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for RequestExtendVote
impl PartialEq for RequestExtendVote
Source§impl Serialize for RequestExtendVote
impl Serialize for RequestExtendVote
impl Eq for RequestExtendVote
impl StructuralPartialEq for RequestExtendVote
Auto Trait Implementations§
impl Freeze for RequestExtendVote
impl RefUnwindSafe for RequestExtendVote
impl Send for RequestExtendVote
impl Sync for RequestExtendVote
impl Unpin for RequestExtendVote
impl UnwindSafe for RequestExtendVote
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].