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.7 - Remove unreachable code #227

Merged
merged 2 commits into from
Oct 17, 2024
Merged

CS6.7 - Remove unreachable code #227

merged 2 commits into from
Oct 17, 2024

Conversation

kevincheng96
Copy link
Collaborator

From ChainSecurity audit: "The submissionToken will never be equal to EXHAUSTED in this context, as this is the value provided by the user of the wallet and submitted to the nonce manager, which asserts that it is different from EXHAUSTED."

This appears to be true, so we can remove this check.

Copy link
Contributor

@hayesgm hayesgm left a comment

Choose a reason for hiding this comment

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

Just to verify, the submission token should be "nonce" for a single-use script, hence the issue?

@@ -156,10 +156,6 @@ abstract contract QuarkScript {
bytes32 submissionToken = getActiveSubmissionToken();
uint256 n;

if (submissionToken == QuarkNonceManagerMetadata.EXHAUSTED) {
Copy link
Contributor

Choose a reason for hiding this comment

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

See above line 151:

Note: this may not be accurate after any nested calls from a script

Is that statement still accurate?

Copy link
Collaborator Author

@kevincheng96 kevincheng96 Oct 16, 2024

Choose a reason for hiding this comment

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

Correct, this statement no longer holds. I actually removed this comment in another PR yesterday. See: 5e24a38#diff-a219685a8ac1b6d53f4feb7ad9ab76351cf5f4dd68a30022fc18a4a9ad65467fL151

@kevincheng96
Copy link
Collaborator Author

Just to verify, the submission token should be "nonce" for a single-use script, hence the issue?

Yeah. The submission token can never be EXHAUSTED because that's a reserved sentinel value that the NonceManager will revert on.

@kevincheng96 kevincheng96 merged commit 3540d26 into main Oct 17, 2024
4 checks passed
@kevincheng96 kevincheng96 deleted the kevin/cs-6.7 branch October 17, 2024 04:35
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