Proposing State Updates
The Participating Interface's core responsibility is to listen for events from each supported blockchain and the PI's order-matching engine, feed each event into the ledger engine, and broadcast the proposed state update to the network of SDPs. The SDPs will then validate the proposed state updated and report it to the DSL smart contracts per the on-chain settlement logic and rules for SDP selection.
It is crucial that the PI performs these steps correctly, as errors can create conditions for the SDPs to report fraud and halt support for the PI.
High-Level Requirements
PI SHOULD sequence the following events into a single queue:
Deposit
andSettlementRequest
events emitted by the DSL smart contracts from each blockchain the PI supportsTrades based on matched orders coming from the PI's backend
PI MUST parse each event into one of the following
StateTransition
types:DepositParams
TradeParams
SettlementRequestParams
PI MUST perform the following actions atomically:
processStateTransition
: Process theStateTransition
by sending it to the correct function in the Ledger Engine. On success, return aStateUpdate
signSequencedStateUpdated
: SignStateUpdate
using thetradeSigningKey
and append the signature to create aSignedStateUpdate
broadcastStateUpdate:
Broadcast theSignedStateUpdate
to network of SDPs
Processing State Transitions
When the PI receives a StateTransition
to process, it must determine which type of StateTransition
it received and call the appropriate function in the ledger engine.
DepositParams
:prepareDeposit
TradeParams
:prepareTrade
SettlementRequestParams
:prepareSettlement
Last updated