a404944b90
When a Substrate block occurs, the coordinator is expected to emit SubstrateBlock. This causes the processor to begin a variety of plans. The processor now emits SubstrateBlockAck, explicitly listing all plan IDs, before starting signing. This lets the coordinator provide a SubstrateBlock transaction, and with it, recognize all plan IDs as valid. Prior, we would've had to have a spotty algorithm based upon the upcoming Preprocess messages, or if we immediately provided the SubstrateBlock transaction, then wait for the processor to inform us of the contained plans. This creates an explicitly proper async flow not reliant on waiting for data availability. Alternatively, we could've replaced Preprocess with (Block, Vec<Preprocess>). This would've been more efficient, yet also clunky due to the multiple usages of the Preprocess message. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE | ||
README.md |
Processor
The Serai processor scans a specified chain, communicating with the coordinator.
Key Generation
The coordinator will tell the processor if it's been included in managing a coin. If so, the processor is to begin the key generation protocol, relying on the coordinator to provided authenticated communication with the remote parties.
When the key generation protocol successfully completes, the processor is expected to inform the coordinator so it may vote on it on the Substrate chain. Once the key is voted in, it'll become active.
Scanning
The processor is expected to scan all sufficiently confirmed blocks from a given coin. This will create a list of outputs, considered pending.
Reporting
These outputs are to be placed in a Batch
, identified by the block containing
them. Batches are provided in an Update
to Serai, paired by an agreed upon
block number.
The processor will also produce an Update
if there have been no batches within
the confirmation window.
Confirmed Outputs
Once outputs have been acknowledged by Serai, they are considered confirmed. With their confirmation, the validators are ready to create actions based on them.
Actions are triggered by passing the outputs to the scheduler. The scheduler will do one of two things:
- Use the output
- Accumulate it for later usage
Burn Events
When the Serai chain issues a Burn
event, the processor should send coins
accordingly. This is done by scheduling the payments out.