fix(drive-abci): don't add up bytes for the same epochindex #2063
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Strategy test
run_chain_insert_many_new_identity_per_block_many_document_insertions_updates_and_deletions_with_epoch_change
panickes with integer overflow when executed with 70+ blocks (default was 30: explanation why test isn't failing).Function
combine_non_base_epoch_bytes
for each epoch was adding up the same value resulting into a geometrical growth of added_bytes.combine_non_base_epoch_bytes: self:{2: 31} & rhs:{2: 31} -> {2: 62}
combine_non_base_epoch_bytes: self:{2: 62} & rhs:{2: 62} -> {2: 124}
...
What was done?
combine_non_base_epoch_bytes
was updated to keep the value of bytes fromrhs
epoch_index_map
for each corresponding epoch instead.Updated behavior:
combine_non_base_epoch_bytes: self:{2: 21} & rhs:{2: 21} -> {2: 21}
How Has This Been Tested?
With this fix, the same test succeeds for 1000 blocks.
Breaking Changes
not sure if this is breaking change
Checklist:
For repository code-owners and collaborators only