-
Notifications
You must be signed in to change notification settings - Fork 91
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
Driver settle queue tests #3133
Conversation
287ccc1
to
5b27c13
Compare
a5ab68a
to
7bcd92f
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.
Using the ethrpc configurations seems weird to make this test work.
Did you consider using anvil's helper methods instead?
You could first disable auto mining and manually clear the mempool to make sure that transactions actually do not get mined so that the submission futures don't return.
de75f95
to
2efbcfe
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.
LG.
I think it's good to have these tests to make sure no regression bugs are introduced in the future.
However, since this is a bit risky change, I would prefer to have a live testing on staging:
- Enable only one solver - baseline
- Organize testing session (maybe backend team only) and spam staging with multiple orders.
# Conflicts: # crates/driver/src/domain/competition/mod.rs
# Conflicts: # crates/driver/src/domain/competition/mod.rs
# Conflicts: # crates/driver/src/tests/cases/buy_eth.rs # crates/driver/src/tests/cases/merge_settlements.rs # crates/driver/src/tests/cases/parallel_auctions.rs # crates/driver/src/tests/cases/settle.rs # crates/driver/src/tests/setup/mod.rs
# Conflicts: # crates/driver/src/domain/competition/mod.rs # crates/driver/src/infra/api/mod.rs # crates/driver/src/infra/api/routes/solve/mod.rs # crates/driver/src/infra/config/file/load.rs # crates/driver/src/infra/config/file/mod.rs # crates/driver/src/infra/solver/mod.rs
# Conflicts: # crates/driver/src/infra/config/file/mod.rs
# Conflicts: # crates/driver/src/domain/competition/mod.rs # crates/driver/src/infra/api/error.rs # crates/driver/src/infra/observe/mod.rs
Description
An attempt to properly test #3129. The idea is to send multiple
/settle
requests to the same driver to check that some will be discarded due to the settlement queue limit.Changes
anvil
with disabled auto-mining is used to accumulate/settle
requests in the queue.TooManyPendingSettlements
API error to properly identify the cause. I couldn't find a better way to ensure the logic is correct. Also, it might be helpful for all the parties to understand why a specific solution/settlement was discarded.default_settle_queue_size
is reduced to2
, since 1 ongoing settlement(dequeued) + 2 more in the queue make it3
pending in total, which is high enough IMO.Settle
struct, which stores the/settle
endpoint response data in order to fix a compilation issue. More details: Driver settle queue tests #3133 (comment)How to test
This is the test.