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