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)!: just in time fee update fixes #2075

Merged
merged 18 commits into from
Aug 24, 2024

Conversation

QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented Aug 24, 2024

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}
Moved storage flags to GroveDB.
Fixed logic of splitting refunds.

How Has This Been Tested?

A lot of tests were added.

Breaking Changes

This is a breaking fix.

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

packages/rs-drive-abci/tests/strategy_tests/main.rs Outdated Show resolved Hide resolved
packages/rs-drive-abci/tests/strategy_tests/main.rs Outdated Show resolved Hide resolved
packages/rs-drive-abci/tests/strategy_tests/main.rs Outdated Show resolved Hide resolved
@QuantumExplorer
Copy link
Member Author

Some CI flakiness, but everything is really passing. Merging in.

@QuantumExplorer QuantumExplorer merged commit a38cd63 into v1.1-dev Aug 24, 2024
73 of 75 checks passed
@QuantumExplorer QuantumExplorer deleted the fix/just_in_time_fee_update_fixes branch August 24, 2024 13:49
@ogabrielides
Copy link
Contributor

post-merging approval

@thephez thephez added this to the v1.1.0 milestone Sep 18, 2024
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.

4 participants