-
Notifications
You must be signed in to change notification settings - Fork 0
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
Nonce Cancel by New Op #213
Nonce Cancel by New Op #213
Conversation
This patch adds the ability to cancel an outstanding nonce by sending a new operation. Previously, it was required that the wallet had access to the nonce chain of the previous operation to cancel that operation. We now allow the wallet to craft a brand new operation that simply calls cancel on a different nonce chain. This could also be used in a bulk-cancelation script. Generally the process is safe as the new code (a) depends on `msg.sender` and a properly executed script, and (b) only works in the direction of cancelation.
// nonce 1 can be set manually | ||
vm.prank(address(0x123)); | ||
nonceManager.submit(nonce, false, nonce); | ||
assertEq(nonceManager.submissions(address(0x123), nonce), nonceManager.EXHAUSTED()); |
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.
maybe we already have this and I didn't see it -- but is there also a case for manually doing nonceManager.submit(nonce, true, nonce)
? That is, making it replayable before you ever actually execute an op with that nonce.
one weird case would be:
- manually
nonceManager.submit(nonce, true, nonce)
- submit an op that has
isReplayable=false
if chain length is 1, you're in a weird spot: it'll revert the first time you try to submit an op with that nonce. So you can never execute a script with that nonce (except if you find a preimage). You can clean it up by doing cancel(nonce)
from a new op, but otherwise it's kind of a weird edge case. Convoluted, but perhaps worth documenting.
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.
Interesting-- I guess i'm thinking "if a script sends a weird message to nonce manager is it that important?" as a rule of thumb. Totally smoething to consider, but can't a script also call like submit(nonce, true, 5)
or whatever that's also weird?
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
This patch bumps us up to 0.8.27 and cancun and starts using `tstore` and `tload` for transient reads and writes. Note: we still clear values mostly to ensure that post-nested calls the script will see 0 instead of the nested's own value. Note: I have not taken a stab at understanding `ALLOW_CALLBACKS` and how that should function.
42e554e
into
hayesgm/test-multi-quark-replays
This patch adds the ability to cancel an outstanding nonce by sending a new operation. Previously, it was required that the wallet had access to the nonce chain of the previous operation to cancel that operation. We now allow the wallet to craft a brand new operation that simply calls cancel on a different nonce chain. This could also be used in a bulk-cancelation script. Generally the process is safe as the new code (a) depends on
msg.sender
and a properly executed script, and (b) only works in the direction of cancelation.