pub enum AnchorPolicy {
Never,
Always,
HighValue,
Epoch,
}Expand description
When a ProvenanceLog::record write should incur the expensive Bitcoin
block-trail anchor on top of the always-on git-mark.
The cheap tier (git-mark) runs for every policy — these variants only
govern the opt-in anchor. Pure, Copy, wasm-safe: it carries no I/O.
| Variant | Anchor behaviour |
|---|---|
Never | git-mark only — no on-chain cost. The default for ordinary writes. |
Always | anchor every write (commits the git SHA on-chain). Expensive; only for trails where every state must be externally timestamped. |
HighValue | anchor iff the resource is flagged anchor-worthy (its ACL carries a ProvenanceAnchor condition / the caller passes the high-value flag). Settlement receipts, elevation/ACSP decisions. |
Epoch | accumulate the git SHA into an EpochAccumulator; the batch root is anchored once on epoch close (one Bitcoin tx notarises many commits — ADR-059 D5). |
An anchor is attempted only when the policy says so and the
ProvenanceLog was built with an anchorer (ProvenanceLog::anchorer
is Some). With anchorer: None (the wasm / no-Bitcoin pod) every policy
degrades to git-mark-only, silently.
Variants§
Never
git-mark only; never anchor. The default for ordinary pod writes.
Always
Anchor every write — the git commit SHA is committed on-chain each time.
HighValue
Anchor only when the resource is flagged high-value (ACL carries a
ProvenanceAnchor condition). Otherwise git-mark only.
Epoch
Accumulate the commit into the current epoch; the epoch’s Merkle root is anchored once on close (amortised on-chain cost — ADR-059 D5).
Implementations§
Source§impl AnchorPolicy
impl AnchorPolicy
Sourcepub fn anchors_inline(self, high_value: bool) -> bool
pub fn anchors_inline(self, high_value: bool) -> bool
Whether this write should be anchored inline (i.e. produce a
BlockTrailAnchor on the returned mark), given whether the resource
is flagged high-value.
Never/Epoch⇒ never inline (Epochdefers to the accumulator).Always⇒ always inline.HighValue⇒ inline iffhigh_value.
Trait Implementations§
Source§impl Clone for AnchorPolicy
impl Clone for AnchorPolicy
Source§fn clone(&self) -> AnchorPolicy
fn clone(&self) -> AnchorPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AnchorPolicy
Source§impl Debug for AnchorPolicy
impl Debug for AnchorPolicy
Source§impl Default for AnchorPolicy
impl Default for AnchorPolicy
Source§fn default() -> AnchorPolicy
fn default() -> AnchorPolicy
Source§impl<'de> Deserialize<'de> for AnchorPolicy
impl<'de> Deserialize<'de> for AnchorPolicy
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>,
impl Eq for AnchorPolicy
Source§impl PartialEq for AnchorPolicy
impl PartialEq for AnchorPolicy
Source§fn eq(&self, other: &AnchorPolicy) -> bool
fn eq(&self, other: &AnchorPolicy) -> bool
self and other values to be equal, and is used by ==.