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

Driver settle queue tests #3133

Open
wants to merge 5 commits into
base: settle-queue-to-driver
Choose a base branch
from

Conversation

squadgazzz
Copy link
Contributor

@squadgazzz squadgazzz commented Nov 22, 2024

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

  • A driver's test that validates the settlement queue limit works as expected.
  • Start using ethrpc arguments in the Driver's config.
  • Since a delay is incorporated into all RPC calls, the solve deadline has to be increased in the tests.

Important

ethrpc_max_batch_size = 20 must be added to the Driver's infra config since the default value is 100, which is currently used by other components. And only Driver uses 20. https://github.com/cowprotocol/infrastructure/pull/2301

How to test

This is the test.

@squadgazzz squadgazzz changed the base branch from main to settle-queue-to-driver November 22, 2024 15:12
@squadgazzz squadgazzz marked this pull request as ready for review November 22, 2024 18:11
@squadgazzz squadgazzz requested a review from a team as a code owner November 22, 2024 18:11
Comment on lines +132 to +135
let id1 = test.solve().await.ok().id();
let id2 = test.solve().await.ok().id();
let id3 = test.solve().await.ok().id();
let id4 = test.solve().await.ok().id();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to the framework limitations, this has to be executed sequentially. Otherwise, each solution will most likely receive the same ID, which is critical for this test, where at least 4 distinct settlement requests must be sent.

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.

1 participant