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

Deploy Quark v2 #220

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Deploy Quark v2 #220

wants to merge 7 commits into from

Conversation

kevincheng96
Copy link
Collaborator

@kevincheng96 kevincheng96 commented Sep 19, 2024

Initial deployment of Quark v2 to mainnet, Base, Sepolia, and Base Sepolia. Since Quark v2 will be undergoing audit soon, these contracts will likely need to be deployed again, so I will keep this PR as a draft.

Contract addresses:

  Code Jar Address:  0x2b68764bCfE9fCD8d5a30a281F141f69b69Ae3C8
  =============================================================
  Quark Nonce Manager Deployed: 0x4Ce1A4a2Ed318f064764D3D1Ea23bFa9d77F1BC9
  Quark Wallet Implementation Deployed: 0xa3C3479C819856C9af486e31D946dAE1AD6B0877
  Quark Wallet Proxy Factory Deployed: 0xE7E53Db62BCaCcb4DDff584830d23aE1E266860e
  Batch Executor Deployed: 0x8214c5e562B6B993F1eEF2E49e6Bfa229f9D3511
  Deploying Core Scripts
  Ethcall Deployed: 0xb4dD0344bD3E2e58A20eD52a730a0130DFa61B9F
  Multicall Deployed: 0x42E06dEec995E3E60df8bcf53Ac71775A52366EA
  =============================================================

kevincheng96 and others added 7 commits September 12, 2024 16:36
As part of our redesign for Quark v2, we decided to scrap isolated
storage to simplify the flows for executing a Quark operation and lower
the gas overhead.

By removing isolated storage, we can remove the callback
(`setActiveNonceAndCallback`) from the `QuarkStateManager` to the
`QuarkWallet`. We can also remove the codepaths related to
`activeNonceScript`, `nonceScriptAddress`, and `walletStorage`. This
leaves only the nonce tracking logic in the `QuarkStateManager`.

We are also temporarily disabling replay functionality in this PR.
Replays will be brought back in a follow-up PR that implements the new
replay token mechanism. I've commented any tests that have to do with
replays, leaving a TODO (`// TODO: Uncomment when replay tokens are
supported`) to revisit once they are supported again.

There are also some TODOs to switch from sstore/ssload to tstore/tload.
To use tstore/tload, we need to bump up our version of Solidity to
>0.8.24. I plan to do that in a separate PR.
This code leads out the core changes for replayables with token. This
was meant to be a WIP that just showed off the core features (it still
is), but to get it to compile, I ended up converting most of the current
tests to the new framework (e.g. mostly converting them to pick a
semi-random nonce versus `nextNonce`, and checking `getNonceToken` as
opposed to `getNextNonce`). Overall, the changes to the non-test code
are very straight-forward. Most notable should be the changes to
`QuarkStateManager` (adding new nonce and replay token code), and adding
a new function to QuarkWallet
`verifySigAndExecuteReplayableQuarkOperation`.

Note: I didn't spend much time working on the outer interface for this,
and I need to consider how this works best with multi-quark operations,
but I wanted to get the outline first so we could discuss. There are
also failing test cases and absent test cases, but again, more of a
discussion point than a final product here.

---------

Co-authored-by: kevincheng96 <[email protected]>
This field is unnecessary since it is always set to `true`.
This improves the consistency of events in `QuarkNonceManager`. A nonce
could be canceled either via `cancel` or `submit`, and the two paths
currently will emit different events. This change ensures that
cancelling using either approach will always emit the same events.
Base automatically changed from kevin/quark-v2 to main September 30, 2024 17:59
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