The indexer reads confirmed blocks from the poller in a monotonically increasing manner. This is to ensure the causal order of the events.
The indexer performs the following steps to process transactions:
- Try to parse it as a staking transaction. The staking data and parsing
details can be found in the staking tx spec.
- If a staking transaction is found, emit
ActiveStakingEvent
and persist the parsed staking transaction data in the database. TheActiveStakingEvent
specifies whether the transaction isActive
orOverflow
.
- If a staking transaction is found, emit
- Check whether the transaction spends any previous staking transactions
stored in the database.
- If a spending transaction is found, check whether it is a valid unbonding
transaction. The definition of an unbonding transaction and validation
details can be found in the unbonding tx
spec.
- If a valid unbonding transaction is found, emit
UnbondingEvent
and persist the unbonding transaction data in the database. This happens for both active and overflow staking transactions. - If the transaction is found to unlock the unbonding path but does not pass the validation, an alarm will be raised as this indicates that the covenant committee has signed on an invalid unbonding transaction.
- If a valid unbonding transaction is found, emit
- If the spending transaction does not unlock the unbonding path, then
check whether it unlocks the time-lock path. If so, emit
WithdrawEvent
. Otherwise, raise an alarm as the transaction is spent from an unexpected path. This happens for both active and overflow staking transactions.
- If a spending transaction is found, check whether it is a valid unbonding
transaction. The definition of an unbonding transaction and validation
details can be found in the unbonding tx
spec.
- If the transaction does not spend any stored staking transactions, then
check whether it spends any stored unbonding transactions.
- If a spending transaction is found, then check whether it unlocks the
output via the time-lock path. If so, emit
WithdrawEvent
. - Otherwise, raise an alarm as the transaction is spent from an unexpected path.
- If a spending transaction is found, then check whether it unlocks the
output via the time-lock path. If so, emit