Skip to main content

Module apply

Module apply 

Source
Expand description

Block apply driver.

For each event in a block:

  1. Publish the event’s payload as a Cap::Data blob in σ’s cache via put_cap(&Cap::data_inline(...)).
  2. CoW-promote the chain’s root cnode and rebind slot[0] to the payload’s CapHash; settle to a fresh cnode hash.
  3. Republish the chain InstanceCap with the new root cnode hash; the chain instance’s hash updates monotonically per event.
  4. Drive Vm::invoke_cached(&mut σ.caps, chain_instance_hash, ...).
  5. Translate CallResultEventOutcome. Post-HALT, the call’s post_instance_hash becomes the new chain_instance_hash.

Structs§

Block
A block: an ordered sequence of events the chain applies in turn.
Event
One on-chain event in a block.

Enums§

EventOutcome
Outcome of one event apply.

Functions§

apply_block
Apply a whole block.
apply_event
Apply one event against the chain Instance. Mutates state.caps and advances chain_instance_hash to a fresh value reflecting the post-call state.