Low-latency framework for Smart Rollup kernels
Q2: Sequencer kernel
Project
The primary goal of this project is to able to implement a low latency node that accepts any operations and computes the optimist state of the rollup.
Deliverable
e2e tests with tezt scenarios that show the delayed inbox has the right behavior:
-
when a message is received by the kernel and when a sequencer is registered then this message is included in the delayed inbox -
when a sequence is received, messages are emptied from the delayed inbox and returned to the user kernel in the order specified by the sequence message -
when there isn't a registered sequencer, the delayed inbox empty itself, and messages are returned to the user kernel. That means the behavior of the kernel is the same as a kernel without sequencer
Later these scenarios can be improved by adding the low latency node to send operations to the rollup to demonstrate that everything fits perfectly.
Work breakdown
- kernel sequencer sdk
- sequencer/low latency node
Kernel sequencer sdk
The goal is to provide a macro as the kernel_entry! that will handle all the delayed inbox mechanism for the user. At the end of this step a new crates should be published on crates.io.
-
Integrate the Kernel functor traits into tezos/tezos !8517 (merged) -
Sequencer framework runtime !8626 (merged) -
Sequencer framework rooting mechanism !8668 (merged) -
Sequencer framework message definition !8669 (merged) -
Sequencer framework user kernel space !8705 (merged) -
Verify the signature of the different messages -
Sequencemessage !9082 (merged) -
SetSequencermessage
-
-
Verify that the sender of the sequence is the current sequencer !9082 (merged) -
Add message to the delayed inbox !8806 (merged) -
Verify if the delayed inbox is full !9079 (merged) -
Verify if a received sequence is good or not -
Automatically process message from the delayed inbox when the delayed inbox is full !9230 (closed) -
Process sequence message !9141 (closed) -
Publish as new feature of the tezos-smart-rollup SDK -
kernel example, to make sure everything compile !9007 (merged)
Nice to have:
-
Using the framing protocol define in this MR: !8872 (merged)
Sequencer/Low latency node
The goal is to provide a new mode to the rollup node. This mode will expose new entrypoints to send operation to the sequencer. The sequencer will accept any operations, batch them into a sequence, and send this sequence to the rollup. The sequencer will also include operations from the delayed inbox inside its sequence.
Because the sequencer knows the order of operations, we can provide an optimist state of the rollup by computing the optimist for a given sequence
-
Initialize the sequencer library: !8787 (merged) -
Add sequencer binary !9094 (merged) !8916 (merged) -
Implement sequencer batcher which batches messages from delayed inbox only !9095 (merged) -
Add kernel encodings !9096 (merged) -
Add e2e tests which spins kernel sequencer and supply Sequence messages (no user messages yet) !9098 (merged) -
Add signing of messages !9142 (merged) -
Accept messages from the user and add them to the Sequence & add e2e test for this !9448 (closed) -
Compute the optimistic state of durable storage !9448 (closed)
At this step we should have a sequencer that accepts messages and empties the delayed inbox, then we can add the low latency feature
-
Run the user kernel -
Compute the durable storage on each message -
Expose this state via rpc
Documents
- Excalidraw overview: https://link.excalidraw.com/readonly/f4Cv7wxyYlu6PzOoh6Ne
- General meeting notes: https://docs.google.com/document/d/1usMrYmx4LnovnN7dLjw74z7ePbMt3mmWUm7MtY7AMWM/edit?usp=sharing
- Design proposal 1: https://link.excalidraw.com/l/8ILYpjPL16O/1x4LkzvuOgv
- Design proposal 2: https://hackmd.io/dlix1pGmTRm61ODH3kkDzw?view