Skip to content

Simplify e2e tests #1393

@jubeira

Description

@jubeira

Current e2e tests are becoming complex and there are a few things that we can improve.

Some initial thoughts:

  • We have two layers of fuzzing, one for base params such as balances / swap fees, etc, and one for pool-specific params such as weights, virtual balances, amp factor.
    • This division makes sense, but it's a bit tangled right now. In many cases, pool specific params affect swap sizes and balances, which need to be recomputed again.
    • I would suggest keeping base methods to fuzz balances and swap sizes, but not use them by default. fuzzPoolParams should fuzz balances and compute swap sizes as well, instead of relying on the base layer to do that by default
  • We have redundant extra tests for 'standard' pools. E.g. 50/50 weighted pools have extra tests that focus on fuzzing only base parameters. This is not very effective really. We might want to do extra tests for common configurations, but in any case we should still have more than one option (e.g. 80/20, 50/50, 60/40, etc). We could have a different variant of the function that fuzzes pool params for this purpose (e.g. fuzzCommonPoolParams) and use it in those tests.
  • The current state of the fees is complicated. We use static swap fees in combination with pool creator fees to mock very low pool fees, to check edge cases against the invariant. This is ok-ish: on one hand it's a 'realistic-pessimist' scenario, but on the other one it's complicated and has some weird side effects. We could just have specific tests with 0 swap fees by forcing the swap fee to 0, bypassing minimum swap fee checks instead. Pools should still pass e2e tests even in that condition (or if it doesn't, it's good to know about it).

Other simplifications to untangle these tests are also welcome; this is a starting point and is not meant to be tackled all at once in a single PR, but slowly and in small chunks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions