Proto: add storage for recorded applied messages
Context
Address #2870 (closed). This MR adds the storage layer for keeping track of processed Layer 2 messages. Those are messages added to a SCORU's outbox.
An API in Alpha_context.Sc_rollup
is provided for:
- Recording applied messages per rollup, level and message index.
- Check whether a message for a specific rollup, level and message index has been applied/recorded.
val record_applied_message :
context -> t -> Raw_level.t -> message_index:int -> (Z.t * context) tzresult Lwt.t
Not that this API itself does not enforce garbage collection. Instead gc will be enforced by limiting the number of committed states and offer an end-point that removes all recorded messages for an expired level. This is mirroring the TORU design.
Manually testing the MR
dune exec src/proto_alpha/lib_protocol/test/unit/main.exe -- test "^\[Unit\] Sc_rollup_storage.ml$"
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Joel Bjornson