-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: Handle invalid (zero) capacity of changelog and roots reliably #930
Conversation
e99dfdb
to
427caa8
Compare
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.
Tests are too long we need to reduce the test iterations.
previous time was 23 not its 35 min
test-programs/account-compression-test/tests/address_merkle_tree_tests.rs
Outdated
Show resolved
Hide resolved
for changelog_size in (1..=5000).step_by(1000) { | ||
for roots_size in (changelog_size..=5000).step_by(1000) { | ||
for queue_capacity in [5003, 6857, 7901] { | ||
test_init_and_insert_into_nullifier_queue( |
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.
I think this one makes sense to iterate over multiple capacities.
I don't know how the underlying test works but it's probably enough to just do a couple inserts and empty the queue no need to do a lot of transactions here, imo.
canopy_depth: ADDRESS_MERKLE_TREE_CANOPY_DEPTH, | ||
address_changelog_size, | ||
network_fee: Some(5000), | ||
rollover_threshold: Some(95), |
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.
Iterations make sense!
We can just put the rollover threshold to zero to test this one, that should be faster.
Imo we should still keep one test that advances the slot and modifies the account (idk whether these replaced that original test which did that.)
48a5090
to
2df375c
Compare
* Validate changelog and roots size not only in `new()` method, but also in `init()` and all wrapper types (zero-copy and copy). * Add SBF tests which initialize trees with zero capacities and expect an error. * Add SBF tests with changelog and root capacity 1. They are expected to succeed.
Having them everywhere makes test runs on CI too long.
Not defining it violates asserts.
new()
method, but also ininit()
and all wrapper types (zero-copy and copy).