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: non deterministic cost #256

Merged
merged 7 commits into from
Jun 2, 2023
Merged

Conversation

iammadab
Copy link
Contributor

@iammadab iammadab commented Jun 1, 2023

Issue being fixed or feature implemented

Cost values depended on the ordering of key values in the rocksdb storage layer, leading to different state roots when prefix computation changes.

What was done?

Unified the costs, regardless of the ordering in the underlying storage layer.

  • if the next key is from another merk, rather than add the cost of the key we add the max key length
  • if the next key is none, add the max key length rather than nothing.

How Has This Been Tested?

Breaking Changes

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 made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Copy link
Collaborator

@fominok fominok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gentlemen, we did it

@fominok fominok force-pushed the fix/non-deterministic-cost branch from 94b9e06 to 6539b6f Compare June 1, 2023 16:10
Copy link
Member

@QuantumExplorer QuantumExplorer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need more comments.

@QuantumExplorer QuantumExplorer merged commit 60943fa into develop Jun 2, 2023
@QuantumExplorer QuantumExplorer deleted the fix/non-deterministic-cost branch June 2, 2023 09:16
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.

3 participants