-
Notifications
You must be signed in to change notification settings - Fork 30
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
Decentralized prover #97
Conversation
Co-authored-by: Kirill Fedoseev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Outdated commentI have updated the `ZkBobPool.s.sol`, `Local.s.sol`, and `DeployZkBobPoolModules.s.sol` scripts to accommodate modifications in this PR. Additionally, I have added `DeployAllowListOperatorManager.s.sol` to independently deploy `AllowListOperatorManager`, as it is not deployed within `DeployZkBobPoolModules.s.sol`. `DeployZkBobPoolModulesTest.t.sol` includes a fork test that tests the upgrade of the USDC pool on Optimism using the `DeployZkBobPoolModules` script.Modifications in
Modifications in
The Notes:
Differences in storage layout between current pool implementation and migration/opt-BOB-to-USDC (USDC pool on Optimism)
|
|
I believe this PR is ready for the final review. Deployment plan:
Parameter Values:
Considering these values, I think a fee of 0.1 USDC should cover the tree update cost in most cases. It's still relatively low, so the overall fee impact will remain minimal. |
The motivation behind this PR is to take a step forward towards enabling permissionless operators. To achieve this objective, the PR introduces the concept of a pending commitments queue.
In this PR, the following changes were implemented:
pendingCommitments
have been added to the pool contract. It is a queue that stores all commitments waiting to be added to the Merkle tree.transact
function no longer updates merkle root and pool index or requires a tree proof and root after. Instead, it merely appends a new commitment to thependingCommitments
. This modification enables the submission of transactions in parallel since the ordering is now executed on-chain.appendDirectDeposits
function was also modified accordingly.proveTreeUpdate
has been introduced. This method accepts a tree update proof and updates the Merkle root and pool index if the proof is valid. The operator who submits the proof receives a tree update fee.proveTreeUpdate
receives the tree update fee. To ensure motivation for submitting a tree update proof, a new state variable calledminTreeUpdateFee
has been introduced.transact
calldata to prevent operator frontrunning.Currently, there is no mechanism for the
appendDirectDeposit
function to guard against front-running attacks, making such attacks still possible in this case.proveTreeUpdate
, the operator submitting the first transaction can specify a privileged prover who will have a grace period to submit the tree update proof. To support this, a new field, gracePeriod, has been added.AllowListOperatorManager
was implemented to support configuration with multiple operators.TODO:
transact
function to allow the UI to distinguish between new and old calldata versions.transact
calldata.Deploy:
setTokenSeller
after the upgrade