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 fees due to data contract cache #444

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Jun 22, 2022

Issue being fixed or feature implemented

Drive calculates different fees for a state transition depending on the data contract cache state. If a data contract is cached, then the read operation will be skipped. Since the data contract cache is not deterministic this could lead to a chain halt.

What was done?

  • Calculate fees for a data contract read even if the contract is already cached.
  • StateRepository#removeDocument now accepts Data Contract to remove additional read operation.

How Has This Been Tested?

With tests

Breaking Changes

None

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

@shumkov shumkov added this to the v0.23.0 milestone Jun 22, 2022
@shumkov shumkov requested a review from antouhou as a code owner June 22, 2022 06:30
@shumkov shumkov force-pushed the non-determinsitc-fees-data-contract-cache branch from 4625ab2 to 40eb9b9 Compare June 22, 2022 06:38
@shumkov shumkov requested a review from shuplenkov June 22, 2022 09:32
@shumkov shumkov merged commit 8fc04c0 into v0.23-dev Jun 22, 2022
@shumkov shumkov deleted the non-determinsitc-fees-data-contract-cache branch June 22, 2022 13:28
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.

2 participants