Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(drive-abci): don't add up bytes for the same epochindex #2063

Closed
wants to merge 1 commit into from

Conversation

ogabrielides
Copy link
Collaborator

@ogabrielides ogabrielides commented Aug 19, 2024

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 from rhs 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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@ogabrielides ogabrielides marked this pull request as draft August 19, 2024 18:43
@ogabrielides ogabrielides marked this pull request as ready for review August 19, 2024 19:02
@ogabrielides ogabrielides added this to the v1.1.0 milestone Aug 19, 2024
@ogabrielides
Copy link
Collaborator Author

closing as the fix is done in grovedb

@ogabrielides ogabrielides deleted the fix_storage_fees_overflow branch August 24, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant