pub struct WatermarkBundle {
pub amount: u64,
pub bytes_delivered: u64,
pub chain_root: [u8; 32],
pub verified_index: u8,
pub tip: [u8; 32],
pub chunk_price: u64,
pub last_signature: Vec<u8>,
}Expand description
The node’s true watermark for a pool capability, echoed back on a gated
StreamError::VoucherRejected so a wallet-less client can self-heal
(issue #1481). amount/bytes_delivered mirror the seller-side
PoolState::last_* fields as u64 cumulative totals, for the same reason
as Voucher — matching the contract’s on-chain uint64 storage.
last_signature is the node’s stored last-accepted client signature
(r‖s‖v, exactly VOUCHER_SIG_LEN) — not a node signature over this
bundle — so the client can confirm which of its own vouchers the node
holds.
Fields§
§amount: u64Cumulative amount of the node’s last-accepted voucher.
bytes_delivered: u64Cumulative bytes delivered as of the node’s last-accepted voucher.
chain_root: [u8; 32]Root the lane is currently metering against; all-zero when the lane holds no live chain.
verified_index: u8Deepest chain index the node has verified under chain_root.
tip: [u8; 32]The preimage bytes at verified_index; all-zero when the node has
verified none. Echoed so a re-seeding signer folds
verified_index × chunk_price back into the amount it re-signs rather
than dropping the frontier (ADR 005 §Watermark bundle).
chunk_price: u64The chunk_price the node’s last-accepted voucher was signed at.
last_signature: Vec<u8>The client’s own signature (r‖s‖v, exactly VOUCHER_SIG_LEN) on the
node’s last-accepted voucher. Vec<u8> rather than a fixed array,
mirroring Voucher::signature — postcard/serde signature fields on
this wire are length-prefixed Vec<u8>, not [u8; N] (serde’s array
impls top out at N=32).
Implementations§
Source§impl WatermarkBundle
impl WatermarkBundle
Sourcepub const fn validate(&self) -> Result<(), MessageValidationError>
pub const fn validate(&self) -> Result<(), MessageValidationError>
Validate the wire-level last_signature length (VOUCHER_SIG_LEN) —
the same client-voucher-signature length Voucher::validate checks,
since this IS a client voucher signature (issue #1481). A caller MUST
call this before trusting a bundle enough to reseed a ledger from it:
the bundle rides inside an application-level StreamError, not signed
itself, so this is a shape check, not an authentication check — it stops
a malformed/truncated bundle from reaching a fixed-length conversion
downstream, nothing more.