pub struct RequestProcessProposal {Show 14 fields
pub txs: Vec<Vec<u8>>,
pub proposed_last_commit: Option<CommitInfo>,
pub misbehavior: Vec<Misbehavior>,
pub hash: Vec<u8>,
pub height: i64,
pub round: i32,
pub time: Option<Timestamp>,
pub next_validators_hash: Vec<u8>,
pub core_chain_locked_height: u32,
pub core_chain_lock_update: Option<CoreChainLock>,
pub proposer_pro_tx_hash: Vec<u8>,
pub proposed_app_version: u64,
pub version: Option<Consensus>,
pub quorum_hash: Vec<u8>,
}Expand description
Process prepared proposal.
§Usage
- Contains fields from the proposed block.
- The Application may fully execute the block as though it was handling
RequestFinalizeBlock. However, any resulting state changes must be kept as candidate state, and the Application should be ready to backtrack/discard it in case the decided block is different.
- The Application may fully execute the block as though it was handling
- The height and timestamp values match the values from the header of the proposed block.
- If
ResponseProcessProposal.statusisREJECT, Tenderdash assumes the proposal received is not valid. - In same-block execution mode, the Application is required to fully execute the block and provide values
for parameters
ResponseProcessProposal.app_hash,ResponseProcessProposal.tx_results,ResponseProcessProposal.validator_updates, andResponseProcessProposal.consensus_param_updates, so that Tenderdash can then verify the hashes in the block’s header are correct. If the hashes mismatch, Tenderdash will reject the block even ifResponseProcessProposal.statuswas set toACCEPT. - The implementation of
ProcessProposalMUST be deterministic. Moreover, the value ofResponseProcessProposal.statusMUST exclusively depend on the parameters passed in the call toRequestProcessProposal, and the last committed Application state (see Requirements section). - Moreover, application implementors SHOULD always set
ResponseProcessProposal.statustoACCEPT, unless they really know what the potential liveness implications of returningREJECTare.
§When does Tenderdash call it?
When a validator p enters Tenderdash consensus round r, height h, in which q is the proposer (possibly p = q):
- p sets up timer
ProposeTimeout. - If p is the proposer, p executes steps 1-6 in PrepareProposal.
- Upon reception of Proposal message (which contains the header) for round r, height h from q, p’s Tenderdash verifies the block header.
- Upon reception of Proposal message, along with all the block parts, for round r, height h from q, p’s Tenderdash follows its algorithm
to check whether it should prevote for the block just received, or
nil - If Tenderdash should prevote for the block just received
- Tenderdash calls
RequestProcessProposalwith the block. The call is synchronous. - The Application checks/processes the proposed block, which is read-only, and returns true (accept) or false (reject) in
ResponseProcessProposal.accept.- The Application, depending on its needs, may call
ResponseProcessProposal- either after it has completely processed the block (the simpler case),
- or immediately (after doing some basic checks), and process the block asynchronously. In this case the Application will
not be able to reject the block, or force prevote/precommit
nilafterwards.
- The Application, depending on its needs, may call
- If the returned value is
- accept, Tenderdash prevotes on this proposal for round r, height h.
- reject, Tenderdash prevotes
nil.
- Tenderdash calls
Fields§
§txs: Vec<Vec<u8>>List of transactions that have been picked as part of the proposed
proposed_last_commit: Option<CommitInfo>Info about the last commit, obtained from the information in the proposed block.
misbehavior: Vec<Misbehavior>List of information about validators that acted incorrectly.
hash: Vec<u8>The block header’s hash of the proposed block. It is computed as a Merkle tree from the header fields.
height: i64The height of the proposed block.
round: i32Round number for the block
time: Option<Timestamp>Timestamp included in the proposed block.
next_validators_hash: Vec<u8>Merkle root of the next validator set.
core_chain_locked_height: u32Core chain lock height to be used when signing this block.
core_chain_lock_update: Option<CoreChainLock>Next core-chain-lock-update for validation in ABCI.
proposer_pro_tx_hash: Vec<u8>ProTxHash of the original proposer of the block.
proposed_app_version: u64Proposer’s latest available app protocol version.
version: Option<Consensus>App and block version used to generate the block. App version MUST be verified by the app.
quorum_hash: Vec<u8>quorum_hash contains hash of validator quorum that will sign the block
Trait Implementations§
Source§impl Clone for RequestProcessProposal
impl Clone for RequestProcessProposal
Source§fn clone(&self) -> RequestProcessProposal
fn clone(&self) -> RequestProcessProposal
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestProcessProposal
impl Debug for RequestProcessProposal
Source§impl Default for RequestProcessProposal
impl Default for RequestProcessProposal
Source§impl<'de> Deserialize<'de> for RequestProcessProposal
impl<'de> Deserialize<'de> for RequestProcessProposal
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>,
Source§impl From<RequestProcessProposal> for Value
impl From<RequestProcessProposal> for Value
Source§fn from(value: RequestProcessProposal) -> Self
fn from(value: RequestProcessProposal) -> Self
Source§impl Message for RequestProcessProposal
impl Message for RequestProcessProposal
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
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,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
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,
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,
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,
self.Source§impl PartialEq for RequestProcessProposal
impl PartialEq for RequestProcessProposal
Source§impl Serialize for RequestProcessProposal
impl Serialize for RequestProcessProposal
impl StructuralPartialEq for RequestProcessProposal
Auto Trait Implementations§
impl Freeze for RequestProcessProposal
impl RefUnwindSafe for RequestProcessProposal
impl Send for RequestProcessProposal
impl Sync for RequestProcessProposal
impl Unpin for RequestProcessProposal
impl UnwindSafe for RequestProcessProposal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>,
Layered].