Proto: storage maps with carbonated and uncarbonated functions
Context
This request solves this part of issue #3294 (closed):
adding maps with carbonated and uncarbonated functions, because it greatly eases switching a map from uncarbonated to carbonated accesses;
It does so mainly through some functor refactoring.
First, the data access in maps is parameterized. This is because carbonated maps have the data stored one level deeper than uncarbonated maps, which can be seen here for carbonated maps, and here (N.name is used everywhere) for uncarbonated ones.
The added depth of data_name for carbonated maps is used to keep the size of the data (len_name) next to its contents in the map. This size information is unused in uncarbonated maps, hence the fact that there isn't an added depth to store the contents.
What we want, is to avoid using the extra depth of data_name in uncarbonated maps when they are used alone (i.e. not along carbonated functions); this is the purpose of the added parameter to the functor.
Then, a Make_carbonated_map_with_uncarbonated_accesses_INTERNAL module is added with internal uses, where carbonated and uncarbonated functions live in the module.
Finally, some functors are added and expose to create maps with carbonated and uncarbonated functions, relying on Make_carbonated_map_with_uncarbonated_accesses_INTERNAL.
Manually testing the MR
The changes should preserve semantics, so continuous integration should be enough.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines). I kept the same level of documentation in the files (which is none 😅 ). -
Document any change to the user interface, including configuration parameters (see node configuration)Not applicable. -
Provide automatic testing (see the testing guide).Not applicable. -
For new features and bug fixes, add an item in the appropriate changelog (Not applicable.docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR