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

Experimental offchain state, pt 2 #1652

Merged
merged 29 commits into from
May 15, 2024
Merged

Experimental offchain state, pt 2 #1652

merged 29 commits into from
May 15, 2024

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented May 14, 2024

  • follow up for Experimental offchain storage pt 1 #1630
  • releases the MVP as Experimental.OffchainState
  • adds an update() method for which allows a state precondition
    • a single failed precondition causes all state changes in an entire update (method call) to be skipped
    • precondition is in the form of an Option<T> so that we can require the previous state to either exist or not exist
    • field.get() was changed to return an option, otherwise we wouldn't have access to that info
  • improve Merkle update efficiency, by first transforming actions into a flat list without dummies due to fewer actions per update
    • previously, 3 updates per batch + 2 actions per update caused 6 in-circuit merkle updates
    • now, 6 actions per batch + n actions per update (n <= 6) cause 6 in-circuit merkle updates
    • the amount of updates per batch we process is no longer uniform. instead, we process a fixed number of actions per batch

TODO:

  • make failed updates work (change Merkle update logic everywhere, not just in the offchain prover)

@mitschabaude mitschabaude changed the base branch from main to feature/experimental-offchain-state May 14, 2024 19:10
@mitschabaude mitschabaude marked this pull request as ready for review May 14, 2024 21:26
Base automatically changed from feature/experimental-offchain-state to main May 15, 2024 08:29
@Trivo25 Trivo25 merged commit 76db7d1 into main May 15, 2024
14 checks passed
@Trivo25 Trivo25 deleted the feature/offchain-state-update branch May 15, 2024 13: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.

None yet

2 participants