Sigil documentation
ReferenceRust referencesigil-execution

sigil-execution · zone

Source declarations, signatures and documentation for zone.

Source: sigil/node/sigil-execution/src/zone.rs. SHA-256: 398f86918f41155452c3c17c31132ec61f0fc8f34bff777a150a01364343aaad.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

zone::ZoneStatus

Status of an Organization Zone.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ZoneStatus {
    /// Zone is active and accepting transactions.
    Active,
    /// Zone is suspended (e.g., by governance action).
    Suspended,
    /// Zone is being migrated to a new state root.
    Migrating,
    /// Zone has been archived and is read-only.
    Archived,
}

Source line: 13.

zone::DeployedModule

A WASM module deployed within an Organization Zone.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DeployedModule {
/// Unique module identifier within the zone.

pub module_id: String,
/// BLAKE3 hash of the WASM bytecode.

pub module_hash: SigilHash,
/// Human-readable module name.

pub name: String,
/// Semantic version string (e.g., "1.0.0").

pub version: String,
/// Size of the WASM bytecode in bytes.

pub wasm_size: u64,
/// Block height at which this module was deployed.

pub deployed_height: u64,
/// OAS DID of the entity that deployed this module.

pub deployer_did: String
}

Source line: 26.

zone::OrganizationZone

An Organization Zone — independent WASM execution environment for a single organization.

Each zone maintains its own Merkle state root, a set of deployed WASM modules, and cumulative gas accounting.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct OrganizationZone {
/// Unique zone identifier (derived from org DID + creation height).

pub zone_id: String,
/// OAS DID of the organization that owns this zone.

pub org_did: String,
/// Current Merkle root of the zone's state tree.

pub state_root: SigilHash,
/// WASM modules currently deployed in this zone.

pub deployed_modules: Vec<DeployedModule>,
/// Current zone status.

pub status: ZoneStatus,
/// Block height at which this zone was created.

pub created_height: u64,
/// Block height of the most recent transaction in this zone.

pub last_active_height: u64,
/// Cumulative gas consumed by all executions in this zone.

pub gas_used_total: u64
}

Source line: 49.

zone::CzacRouteTarget

Routing information for a cross-zone CZAC message targeting this zone.

When a CZAC envelope arrives at the execution layer, the router resolves the target zone and constructs a CzacRouteTarget so the zone executor knows which module (if any) should handle the message.

#[cfg(feature = "czac")]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CzacRouteTarget {
/// Target zone ID.

pub zone_id: String,
/// OAS DID of the target organization.

pub target_org_did: String,
/// Optional specific module within the zone to handle the message.

pub target_module_id: Option<String>,
/// CZAC channel ID through which the message arrived.

pub channel_id: String,
/// Message sequence number within the channel.

pub sequence: u64
}

Source line: 75.

zone::OrganizationZone::new

Create a new Organization Zone for the given OAS DID at the given block height.

The zone ID is derived as the BLAKE3 hash of org_did || height.

pub fn new(org_did: impl Into<String>, height: u64) -> Self;

Source line: 92.

zone::OrganizationZone::deploy_module

Deploy a new WASM module into this zone.

Returns an error if the zone is not active or a module with the same ID is already deployed.

pub fn deploy_module(&mut self, module: DeployedModule) -> Result<(), ExecutionError>;

Source line: 115.

zone::OrganizationZone::remove_module

Remove a deployed module by ID.

Returns an error if the zone is not active or the module is not found.

pub fn remove_module(&mut self, module_id: &str) -> Result<DeployedModule, ExecutionError>;

Source line: 141.

zone::OrganizationZone::find_module

Find a deployed module by ID.

pub fn find_module(&self, module_id: &str) -> Option<&DeployedModule>;

Source line: 164.

zone::OrganizationZone::is_active

Returns true if the zone status is Active.

pub fn is_active(&self) -> bool;

Source line: 171.

zone::OrganizationZone::update_state_root

Update the zone's Merkle state root.

pub fn update_state_root(&mut self, new_root: SigilHash);

Source line: 176.

zone::OrganizationZone::resolve_czac_route

Resolve a CZAC message to a route target within this zone.

If module_id is Some, validates that the module exists in this zone. If None, the zone itself is the target (no specific module).

#[cfg(feature = "czac")]
pub fn resolve_czac_route(
        &self,
        channel_id: String,
        sequence: u64,
        module_id: Option<String>,
    ) -> Result<CzacRouteTarget, ExecutionError>;

Source line: 185.

On this page