pub trait ChainAuthority: CustodyAuthority {
// Required methods
fn authenticated_head(
&mut self,
root: &Path,
chain_id: &[u8; 32],
) -> Result<ChainHead, ChainAuthorityError>;
fn compare_and_commit(
&mut self,
root: &Path,
chain_id: &[u8; 32],
expected: ChainHead,
next: ChainHead,
receipt: &SidecarReceipt,
) -> HeadCommit;
}Expand description
Host boundary for an exact root and chain. Implementations must provide an
authenticated, complete, anti-rollback head and maintain the exclusive
chain lease through publication and commit. compare_and_commit must be
atomic with respect to competing writers and check current Store policy;
the host must hold a policy lease through the complete head update so
expiry and revocation checks do not race a blocking commit;
on uncertain completion it must return Indeterminate, never Committed.
Durability and trusted freshness are host obligations, not checked here.
Required Methods§
fn authenticated_head( &mut self, root: &Path, chain_id: &[u8; 32], ) -> Result<ChainHead, ChainAuthorityError>
fn compare_and_commit( &mut self, root: &Path, chain_id: &[u8; 32], expected: ChainHead, next: ChainHead, receipt: &SidecarReceipt, ) -> HeadCommit
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".