pub struct BlockLogHeader {
pub batch_seq: u64,
pub prev_block_hash: [u8; 32],
pub commands_hash: [u8; 32],
pub batch_root: [u8; 32],
pub command_count: u64,
pub first_seq: u64,
pub timestamp: u64,
pub signer: [u8; 20],
pub signature: Vec<u8>,
}Expand description
Serializable signed block header stored in the WAL block log.
The header commits to an ordered batch of engine commands through
commands_hash, and to the previous block through prev_block_hash.
The signature is stored next to the signed fields, but is intentionally
excluded from block_hash().
Fields§
§batch_seq: u64Monotonic block number, starting at zero.
prev_block_hash: [u8; 32]Hash of the previous block header. Zero for the genesis block.
commands_hash: [u8; 32]keccak256(cmd1_identity_hash || cmd2_identity_hash || ...).
batch_root: [u8; 32]Composite commitment root for state, risk, command, obligation, and intent roots.
command_count: u64Number of commands committed by this block.
first_seq: u64Global command sequence number of the first command in this block.
timestamp: u64Timestamp in milliseconds when the block was finalized.
signer: [u8; 20]Public address of the signer encoded as raw EVM address bytes.
signature: Vec<u8>Signature bytes over block_hash(). Empty means unsigned.
Implementations§
Source§impl BlockLogHeader
impl BlockLogHeader
Sourcepub fn unsigned_from_identity_hashes(
batch_seq: u64,
prev_block_hash: [u8; 32],
identity_hashes: &[[u8; 32]],
batch_root: [u8; 32],
first_seq: u64,
timestamp: u64,
signer: [u8; 20],
) -> Self
pub fn unsigned_from_identity_hashes( batch_seq: u64, prev_block_hash: [u8; 32], identity_hashes: &[[u8; 32]], batch_root: [u8; 32], first_seq: u64, timestamp: u64, signer: [u8; 20], ) -> Self
Build an unsigned block-log header from ordered command identity hashes.
This is intentionally pure. Callers provide sequencing, timestamp, signer identity, and batch root. The function derives only the command commitment and command count.
Sourcepub fn block_hash(&self) -> [u8; 32]
pub fn block_hash(&self) -> [u8; 32]
Compute the block hash over the signed fields. The signature is excluded.
Sourcepub fn validator_rsm_metadata_hash(&self, directive_hash: [u8; 32]) -> [u8; 32]
pub fn validator_rsm_metadata_hash(&self, directive_hash: [u8; 32]) -> [u8; 32]
Compute the Solidity ValidatorRsm.blockHash(metadata) value for this header.
This is intentionally distinct from block_hash(). The WAL block hash signs
local log metadata, including timestamp and signer, while ValidatorRsm commits
to the on-chain directive hash instead.
Trait Implementations§
Source§impl Clone for BlockLogHeader
impl Clone for BlockLogHeader
Source§fn clone(&self) -> BlockLogHeader
fn clone(&self) -> BlockLogHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more