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

Re-enable or delete the assertion in fetch_sprout_final_treestates() #6389

Closed
Tracked by #6277
teor2345 opened this issue Mar 22, 2023 · 1 comment · Fixed by #6450
Closed
Tracked by #6277

Re-enable or delete the assertion in fetch_sprout_final_treestates() #6389

teor2345 opened this issue Mar 22, 2023 · 1 comment · Fixed by #6450
Assignees
Labels
A-consensus Area: Consensus rule updates A-cryptography Area: Cryptography related C-audit Category: Issues arising from audit findings C-bug Category: This is a bug C-security Category: Security issues

Comments

@teor2345
Copy link
Contributor

Motivation

The auditors have suggested that this commented-out assertion should either be deleted, or enabled but disabled in tests:

/* TODO:
- fix tests that generate incorrect root data
- assert that roots match the fetched tree during tests
- move this CPU-intensive check to sprout_anchors_refer_to_treestates()
assert_eq!(
input_tree.root(),
joinsplit.anchor,
"anchor and fetched input tree root did not match:\n\
anchor: {anchor:?},\n\
input tree root: {input_tree_root:?},\n\
input_tree: {input_tree:?}",
anchor = joinsplit.anchor
);
*/

We can do this using #[cfg(not(test))].

Testing

Our existing integration tests should cover this.

@teor2345 teor2345 added C-bug Category: This is a bug A-consensus Area: Consensus rule updates S-needs-triage Status: A bug report needs triage P-Medium ⚡ C-security Category: Security issues A-cryptography Area: Cryptography related C-audit Category: Issues arising from audit findings labels Mar 22, 2023
@mpguerra mpguerra added this to Zebra Mar 22, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Zebra Mar 22, 2023
@mpguerra mpguerra changed the title Re-enable or delete the assertion in fetch_sprout_final_treestates() Re-enable or delete the assertion in fetch_sprout_final_treestates() Mar 23, 2023
@teor2345 teor2345 self-assigned this Apr 3, 2023
@teor2345
Copy link
Contributor Author

teor2345 commented Apr 3, 2023

In PR #6450 I resolved this issue by deleting the outdated assertion, and updating the TODO so it only applies to tests.

(We can't do this check in production because it could use a lot of CPU.)

@teor2345 teor2345 removed the S-needs-triage Status: A bug report needs triage label Apr 3, 2023
@mergify mergify bot closed this as completed in #6450 Apr 3, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Zebra Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-cryptography Area: Cryptography related C-audit Category: Issues arising from audit findings C-bug Category: This is a bug C-security Category: Security issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant