Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(zktrie): copy trie properly for concurrent access #747

Merged
merged 2 commits into from
May 13, 2024

Conversation

omerfirmak
Copy link

1. Purpose or design rationale of this PR

as reported by @colinlyguo here

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

@omerfirmak omerfirmak force-pushed the omerfirmak/flakey-zktrie-test branch from 9eae752 to cb35e59 Compare May 13, 2024 07:12
@omerfirmak omerfirmak changed the title fix(zktrie): flaky zktrie test fix(zktrie): copy trie properly for concurrent access May 13, 2024
colinlyguo
colinlyguo previously approved these changes May 13, 2024
Copy link
Member

@colinlyguo colinlyguo left a comment

Choose a reason for hiding this comment

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

What's the rationale for this fix?

@omerfirmak
Copy link
Author

What's the rationale for this fix?

New ZkTrie has some internal fields that need to be deep copied. Simply dereferencing the pointer to the trie only creates a shallow copy.

0xmountaintop
0xmountaintop previously approved these changes May 13, 2024
@github-actions github-actions bot dismissed stale reviews from 0xmountaintop and colinlyguo via 989ca7b May 13, 2024 08:54
@omerfirmak omerfirmak merged commit 6038ac8 into develop May 13, 2024
@omerfirmak omerfirmak deleted the omerfirmak/flakey-zktrie-test branch May 13, 2024 12:57
0xmountaintop added a commit that referenced this pull request Jun 13, 2024
* feat(zktrie): bump to `v0.8.4`

* fix(zktrie): copy trie properly for concurrent access (#747)

* fix `ZkTrie` `Commit`

* some fixes

---------

Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants