Skip to content

Proto: Add Raw_carbonated_map

Andrea Cerone requested to merge andrea@scoru-pre-carbonated-map into master

Context

Messages of scoru rollups are stored in the raw context in an in-memory only map, which will need to be carbonated. However, the module Carbonated_map is above Alpha_context, as it is uses gas-consuming functions that are defined above the Alpha_context. As a consequence, Carbonated_map cannot be used as is in the raw context.

This MR introduces a new Raw_carbonated_map module type, and relative functors for constructing modules of those types. It also refactors Carbonated_map to be built using Raw_carbonated_map. The main difference with Carbonated_map is that the gas cost type and context type used by Raw_carbonated_map are generic, and the functions to retrieve and consume gas are passed via a functor when constructing a module of type Raw_carbonated_map.

Raw_carbonated_map will be used to carbonate the in-memory map of scoru inbox messages present in the raw context (See !4568 (merged)). This will require further refactoring the Raw_context and it will done in a follow-up MR.

Related: #2413 (closed).

Manually testing the MR

Relying on CI passing.

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 Andrea Cerone

Merge request reports