Draft: Protocol storage: optimizing global constant expansion using context trees
Context
Improved the speed of expansion of global constants in protocol storage by using local access.
Depends on !3685 (closed)
The idea
The approach is same to !3685 (closed).
All global constants are stored under the same directory /data/constants/ and may be accessed centrally when expanding.
Use local access to speed up read access during expanding.
What the MR does
Use Local_context and Make_indexed_carbonated_data_storage.Local that will be introduced by !3685 (closed).
optimizations of Global_constants_storage.expand_node
Global_constants_storage.expand_ndoe function is rewritten using these local access functions.
Gas
The path length when accessing individual constants is reduced, but the subtree must first be retrieved for local access. Total gas consumption may increase, depending on how the gas consumption for accessing the tree is estimated.
Manually testing the MR
Checklist
- Benchmark: how it really improves the performance
-
One access -
The entire tezos node
-
-
1st code review -
Gas consumption check -
Fix gas model if necessary -
Final code review