Draft
Conversation
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 <kevincheng96@hotmail.com>
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
From compound-finance/quark#220 via @kevincheng96