pub struct SubnetExportPolicy {
pub version: u8,
pub scope: SubnetRef,
pub topology_epoch: u32,
pub issuer: EntityId,
pub exported_channels: Vec<ChannelHash>,
pub revision: u64,
pub not_before: u64,
pub not_after: u64,
pub signature: [u8; 64],
}Expand description
Root-signed statement of EXACTLY which channels are exported at a subtree’s boundary.
The set replaces wholesale — like a gateway credential set — so a revoked export cannot survive inside a merged remainder. An empty set is meaningful: “nothing is exported here”.
Like the advertisement, this is policy DISTRIBUTION, not export
authority: the boundary gateway still needs its own EXPORT
credential at the boundary scope (D6). The fact tells a gateway
what the authority wants exported; the credential is what lets it.
Fields§
§version: u8Wire version; only 1 decodes.
scope: SubnetRefThe boundary subtree the policy applies to.
topology_epoch: u32Topology epoch the policy belongs to.
issuer: EntityIdSigning root.
exported_channels: Vec<ChannelHash>Canonical 64-bit channel hashes exported at this boundary.
At most MAX_EXPORTED_CHANNELS; order is not significant
but IS signed, so decode preserves it.
revision: u64Per-(SubnetRef, kind) ordering revision; replay/reorder safe.
not_before: u64Validity window start (unix seconds).
not_after: u64Validity window end (unix seconds, exclusive).
signature: [u8; 64]ed25519 over SUBNET_EXPORT_POLICY_SIG_DOMAIN ‖ payload.
Implementations§
Source§impl SubnetExportPolicy
impl SubnetExportPolicy
Sourcepub fn try_issue(
root_keypair: &EntityKeypair,
scope: SubnetRef,
topology_epoch: u32,
exported_channels: Vec<ChannelHash>,
revision: u64,
not_before: u64,
not_after: u64,
) -> Result<Self, SubnetAuthError>
pub fn try_issue( root_keypair: &EntityKeypair, scope: SubnetRef, topology_epoch: u32, exported_channels: Vec<ChannelHash>, revision: u64, not_before: u64, not_after: u64, ) -> Result<Self, SubnetAuthError>
Issue signed by root_keypair (issuer is set from it).
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SubnetAuthError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SubnetAuthError>
Strict decode; signature NOT verified here. The count byte must match the exact remaining length — a count that disagrees with the buffer is a forgery attempt or corruption either way.
Sourcepub fn verify(&self) -> Result<(), SubnetAuthError>
pub fn verify(&self) -> Result<(), SubnetAuthError>
Signature verification against self.issuer.
Sourcepub fn check_time_bounds_at(
&self,
now: u64,
skew_secs: u64,
) -> Result<(), SubnetAuthError>
pub fn check_time_bounds_at( &self, now: u64, skew_secs: u64, ) -> Result<(), SubnetAuthError>
Window check with saturating skew, the family discipline.
Trait Implementations§
Source§impl Clone for SubnetExportPolicy
impl Clone for SubnetExportPolicy
Source§fn clone(&self) -> SubnetExportPolicy
fn clone(&self) -> SubnetExportPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubnetExportPolicy
impl Debug for SubnetExportPolicy
impl Eq for SubnetExportPolicy
Source§impl PartialEq for SubnetExportPolicy
impl PartialEq for SubnetExportPolicy
impl StructuralPartialEq for SubnetExportPolicy
Auto Trait Implementations§
impl Freeze for SubnetExportPolicy
impl RefUnwindSafe for SubnetExportPolicy
impl Send for SubnetExportPolicy
impl Sync for SubnetExportPolicy
impl Unpin for SubnetExportPolicy
impl UnsafeUnpin for SubnetExportPolicy
impl UnwindSafe for SubnetExportPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.