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

Use IndexedMerkleMap for OffchainState #1672

Merged
merged 15 commits into from
Jun 5, 2024

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Jun 4, 2024

This follows #1666 and #1671 and uses the new IndexedMerkleMap for OffchainState.

Also:

  • Fixes IndexedMerkleMap.clone() (cherry-picked in previous PR)
  • Adds IndexedMerkleMap.{overwrite, overwriteIf}

TODO:

  • Make tree height, actions per update and actions per batch parameters that can be overriden
  • Fix proving when there are multiple settlement proofs in a row

accounts: OffchainState.Map(PublicKey, UInt64),
totalSupply: OffchainState.Field(UInt64),
},
{ logTotalCapacity: 10, maxActionsPerProof: 5 }
Copy link
Member Author

Choose a reason for hiding this comment

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

we change the defaults, mainly to check that this works and to exercise the case that settling needs multiple proofs

@state(OffchainStateCommitments) offchainState = State(
OffchainStateCommitments.empty()
);
@state(OffchainState.Commitments) offchainState = offchainState.commitments();
Copy link
Member Author

Choose a reason for hiding this comment

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

this looks a bit nicer now, and was necessary because the empty state now depends on the tree size which is part of the offchain state config

Base automatically changed from feature/indexed-merkle-map-2 to main June 4, 2024 18:14
@mitschabaude mitschabaude merged commit c573569 into main Jun 5, 2024
13 checks passed
@mitschabaude mitschabaude deleted the feature/offchain-state-with-indexed-map branch June 5, 2024 19:22
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