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

CS6.2 - Event improvements #225

Merged
merged 5 commits into from
Oct 18, 2024
Merged

CS6.2 - Event improvements #225

merged 5 commits into from
Oct 18, 2024

Conversation

kevincheng96
Copy link
Collaborator

@kevincheng96 kevincheng96 commented Oct 15, 2024

Some small improvements to events:

  • Adds an index on the wallet and nonce fields in the NonceSubmitted event
  • Non-replayable operations now emit EXHAUSTED as the submissionToken value in the NonceSubmitted event

Copy link
Collaborator

@fluffywaffles fluffywaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, might want to look into the gas snapshot regression. I don't think it's important. The test with a gas use regression is apparently testClaimsSequentialNonces, which honestly doesn't even seem like a relevant test anymore based on its name?

// Note: even with a valid submission token, we always set non-replayables to exhausted (e.g. for cancellations)
submissions[msg.sender][nonce] = isReplayable ? submissionToken : EXHAUSTED;
// Note: Even with a valid submission token, we always set non-replayables to exhausted (e.g. for cancellations)
submissionToken = isReplayable ? submissionToken : EXHAUSTED;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call this a new variable name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to finalSubmissionToken.

@kevincheng96 kevincheng96 changed the title CS 6.2 - Event improvements CS6.2 - Event improvements Oct 16, 2024
@@ -19,7 +19,7 @@ contract QuarkNonceManager {
error InvalidNonce(address wallet, bytes32 nonce);
error InvalidSubmissionToken(address wallet, bytes32 nonce, bytes32 submissionToken);

event NonceSubmitted(address wallet, bytes32 nonce, bytes32 submissionToken);
event NonceSubmitted(address indexed wallet, bytes32 indexed nonce, bytes32 submissionToken);
Copy link
Collaborator Author

@kevincheng96 kevincheng96 Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also just added an index on nonce since it could be useful for replayable operations.

@kevincheng96 kevincheng96 merged commit 4e5ba95 into main Oct 18, 2024
4 checks passed
@kevincheng96 kevincheng96 deleted the kevin/improve-events branch October 18, 2024 03:53
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.

3 participants