thruput_xdr/header.rs
1// -*-Rust-*-
2// Generated Code: DO NOT CHECK IN
3
4// Generated from xdrc commit: 6ab835b07c234abb4b0b50b61d687904727a4f32
5
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8#![allow(non_upper_case_globals)]
9#![allow(unused_imports)]
10#![allow(dead_code)]
11#![allow(unused_variables)]
12#![allow(clippy::unnecessary_cast)]
13
14use crate::*;
15use core::option::Option;
16use core::ops::{Deref, DerefMut};
17
18#[cfg(feature = "std")]
19use std::io::{Read, Write};
20#[cfg(feature = "xdrs")]
21use xdrs::*;
22
23
24#[cfg(feature = "serde")]
25use ::serde::{{Serialize, Deserialize}};
26
27
28
29// clang-format on
30
31/// Inputs fixed before executing a candidate block.
32///
33/// Supplied by the coordinator when it asks the scheduler to build a proposal;
34/// the parent block is identified by the surrounding RPC. `proposer` and
35/// `block_timepoint` are copied into the resulting [`ProposalHeader`].
36#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
38#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
39#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40#[repr(C)]
41pub struct ProposalContext {
42 /// Network protocol version. `ProposalHeader` has no protocol field; the
43 /// block's version is `ConsensusValue::protocol`.
44 pub protocol: Protocol,
45 /// Block proposer. Nodes missing block data fetch it from the proposer.
46 pub proposer: ValidatorID,
47 /// The block's timepoint, fixed by the coordinator before execution begins.
48 pub block_timepoint: TimePoint,
49}
50
51/// Header of a proposed block.
52///
53/// The consensus-facing summary of block execution: the fixed inputs of the
54/// proposal together with the deterministic outputs of executing its
55/// transactions. `ConsensusValue` embeds this header directly, so every field
56/// is part of the block identity.
57///
58/// Travels on network.
59#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
60#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
61#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
62#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
63#[repr(C)]
64pub struct ProposalHeader {
65 pub ext: ExtensionPoint,
66 /// The hash of the network name, separating this network's blocks from
67 /// those of other networks.
68 pub network_hash: NetworkHash,
69 /// The hash of the post-block [`ConfigHashPreimage`]: the storage cost
70 /// model, network configuration and default wallet.
71 pub config_hash: ConfigHash,
72 /// Block proposer. Nodes missing block data fetch it from the proposer.
73 pub proposer: ValidatorID,
74 /// The block's timepoint, fixed by the coordinator before execution begins.
75 pub block_timepoint: TimePoint,
76 /// The height of this block.
77 pub block_height: BlockHeight,
78 /// The Merkle root hash of the set of the block's [`TransactionHash`]es.
79 /// Body hashes, not the [`SignedTransactionHash`]es `ProposalTxs` names
80 /// the transactions by, so one body appears in the set once.
81 pub txs_hash: TxsHash,
82 /// The hash of the storage contents after this block is applied.
83 pub storage_hash: StorageShortHash,
84 /// The Merkle root hash of the events.
85 pub events_hash: EventsHash,
86}
87
88
89//
90// XDR internals below this point
91//
92
93