-
Notifications
You must be signed in to change notification settings - Fork 83
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
base: settle-queue-to-driver
Are you sure you want to change the base?
Conversation
287ccc1
to
5b27c13
Compare
a5ab68a
to
7bcd92f
Compare
impl Default for Arguments { | ||
fn default() -> Self { | ||
Arguments::parse_from([""]) | ||
} | ||
} | ||
|
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 don't think this is needed 🤔
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.
In case only deriving the Default
trait, values from clap
are not used.
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.
but in that case, we could make these Arguments
as optional
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.
In that case, the caller side would need to define default values, no? Didn't get the idea here.
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.
What I meant is something like this: #2924
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.
That didn't really help. Making this config optional would mean that the caller side will be responsible for the values that need to be used by default. While with the current approach, only one struct controls the default values.
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.
.len(); | ||
assert_eq!(unique_solutions_count, solution_ids.len()); | ||
|
||
// `collect_vec` is required to execute futures in the same order. |
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'm pretty sure this is not true. Can you explain why collecting into a vec should make a difference here?
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.
Without collecting, the order of the results will be unpredictable.
de75f95
to
2efbcfe
Compare
Oh, that is cool, didn't know about that. Will try to use this instead. |
464b638
to
3705940
Compare
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
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. To achieve that, I found the easiest way to introduce some delay in the settlement process on the driver's side by using the existing ethrpc batch delay, which is used to wait for a certain amount of time before sending the call to accumulate a batch.It turned out, that this config was hardcoded, so it was required to enable it in the arguments first to use properly in tests.
Changes
Important
ethrpc_max_batch_size = 20
must be added to the Driver's infra config since the default value is100
, which is currently used by other components. And only Driver uses20
. https://github.com/cowprotocol/infrastructure/pull/2301How to test
This is the test.