-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Protocol3] Decrease merkle tree depths #49
Comments
I agree with smaller trees. 20 for accounts, 8 for tokens, and 14 for trading history seems ok for the near term. In the long term, way may even allow DEX to config these numbers on exchange creation. |
Will any of these depths "configs" be visible on smart contract level? |
The only 'logic' that needs to be changed is in the withdrawFromMerkleTree where the length of the merkle proof changes. The genesis merkle root value will also change. This shouldn't be a lot of work and should decrease the number of constraints by ~10-15%. |
It's also not really possible to make these configurable for every exchange. Every different configuration would need its own set of circuits. |
I totally agree. I would only suggest these configs are somehow refected by those constant variables in the smart contract. |
Done in #115 Constraints/ring decreased from 650,000 -> 525,000, a nice 20% reduction. |
This is great. I'll close this issue then. |
Our current tree depth sizes:
Some of these are larger than needed. Updating these trees in the circuits is our main bottleneck next to data availability (which will be optional). By decreasing these we lower the number of constraints which increases our achievable throughput.
I propose the following:
The Tokens tree is updated the most frequent so lowering this is the most important, then the Accounts tree and then the TradeHistory tree.
The text was updated successfully, but these errors were encountered: