Module snapps_txn_reference_impl::sequence_event [−][src]
Expand description
Sequencing information exposed by snapp smart contract execution.
The format of this data is opaque to the Mina protocol, and is defined by each individual smart contract. A smart contract may emit zero or more ‘sequence events’, which are communicated with the transaction when it is broadcast over the Mina network.
These ‘sequence events’ are collapsed into a single hash for the purposes of the zero-knowledge proofs and cryptographic commitments in SequenceState
.
Sequence events are stored in the SequenceState
in the order that they are encountered by
block producers, storing snapshots of the latest commitment at the end of each block for the
most recent 5 blocks with updates.
For example, a snapp may be executed zero or more times in a block using sequence events:
block1:
[ {sequence_events: [A, B, C], ...}
, {sequence_events: [D], ...}
, {sequence_events: [], ...} ]
block2:
[ {sequence_events: [E, F], ...} ]
block3:
[]
block4:
[ {sequence_events: [G], ...} ]
At the end of each block, the latest sequence state would look like:
block1:
[[D], [A, B, C], ... /* Any historical events */]
block2:
[[E, F], [D], [A, B, C]], ... /* Any historical events */]
block3:
[[E, F], [D], [A, B, C]], ... /* Any historical events */]
block4:
[[G], [E, F], [D], [A, B, C]], ... /* Any historical events */]
In order to reduce the amount of data stored by nodes, this information is stored in the
snapp’s account as a cryptographic commitment instead of a constantly growing list. This update
is computed by SequenceState::push_sequence_events
.
Structs
A single sequence event emitted by a snapp. See crate::sequence_event
for more.
A hash representing a list of sequence events.
Information about all historical sequence events emmitted by snapp transactions.
A hash representing the current sequence state.
Type Definitions
A list of zero or more events, which may be emitted by a snapp. See crate::event
for more.