Commit Graph

634 Commits

Author SHA1 Message Date
adrian
9f4ff71b70 refactor: remove skip_balance_check from run_test signature
This field is redundant, as it can be read directly from `config`
2025-09-18 20:00:06 +02:00
adrian
a895d7e1fe fix: add protocol_system key to ekubo test definition 2025-09-18 20:00:06 +02:00
adrian
323063da23 fix: move adapter contract building/finding after filtering components 2025-09-18 20:00:06 +02:00
TAMARA LIPOWSKI
ca7998c5ce fix: Curve SDK tests
- Don't care about token order when comparing. We did not care in the python package. Not sure there is any advantage to caring.
2025-09-18 11:51:38 -04:00
TAMARA LIPOWSKI
8ad709b07a fix: Maverick V2 SDK tests
- substreams.yaml was missing.
- verified both integration tests now pass in Rust and Python test suites
2025-09-18 11:18:41 -04:00
TAMARA LIPOWSKI
0cf444c5f9 fix: Remove failing Balancer V3 tests
- These were also failing in python.
2025-09-18 11:18:25 -04:00
TAMARA LIPOWSKI
0226bda482 fix: Compare lowercase component IDs
- This was failing. Make this more lenient so the user can specify component id in the test file in a non-case-sensitive manner.
- Also switched around a wrong token order which was causing a failure (not sure we care about token order but we may in the future? Python didn't care...)
2025-09-18 11:18:25 -04:00
TAMARA LIPOWSKI
779c690b6d fix: Fix python tests
- These are just used for comparison purposes and will eventually be deleted.
- Also balancer v3 test fix: add protocol_system to yaml, and remove "excludePaths" from protobuf in substreams.yaml (this entry was not supported)
2025-09-18 11:18:25 -04:00
adrian
f00a625182 fix: remove break-lines from "Get changed substreams folders" step output
When multiple changes were detected, each one was written in a separate line, causing an error on github actions
2025-09-18 15:22:00 +02:00
adrian
b1315d1863 test: remove test_composable_stable_pool_creation for balancer-v2 2025-09-17 10:27:44 +02:00
adrian
e1d0c58e64 test: add ci workflow for substreams tests 2025-09-17 10:27:44 +02:00
adrian
183c034204 chore: remove ./substreams/target/wasm32-unknown-unknown/release/*.d files 2025-09-16 11:31:19 +02:00
adrian
b4bf7b770a chore: add missing evm file 2025-09-16 11:31:19 +02:00
adrian
e684a64002 fix: logs handling 2025-09-16 11:31:19 +02:00
adrian
b0f620539b feat: rollback cargo-chef usage 2025-09-16 11:31:19 +02:00
adrian
a3f7a2eac4 feat: improve run.Dockerfile 2025-09-16 11:31:19 +02:00
adrian
3332a88e6f fix: version handling in protocol-testing 2025-09-16 11:31:19 +02:00
adrian
d728440048 feat: add evm and wasm files 2025-09-16 11:31:19 +02:00
adrian
46cfaefbd6 feat: print version and hash when protocol-testing binary is run 2025-09-16 11:31:19 +02:00
dianacarvalho1
89b56e2d42 fix: Pass vm_traces to DecoderContext (#264)
#time 2h 39m
2025-09-12 16:51:19 +01:00
adrian
298bf13e87 refactor: use image field in docker-compose to leverage docker buildx for caching purposes 2025-09-12 10:59:17 +02:00
adrian
92336df9bb feat: skip tests run if the config is invalid 2025-09-12 10:59:17 +02:00
adrian
85080dd6c7 feat: set tycho_logs to false by default 2025-09-12 10:59:17 +02:00
adrian
a84b6518cf chore: remove unused AUTH_API_KEY from docker-compose 2025-09-12 10:59:17 +02:00
adrian
2ea296fb8b fix: pass RUST_LOG down to tycho-indexer 2025-09-12 10:59:17 +02:00
adrian
2a0af6c733 feat: upgrade tycho deps in protocol-testing 2025-09-12 10:59:17 +02:00
adrian
bd532c40b0 feat: bump tycho-indexer to 0.83.3 in docker file 2025-09-12 10:59:17 +02:00
adrian
e6822ae29d fix: run forge build in ./evm directory 2025-09-11 16:27:01 +02:00
adrian
fc56311a81 refactor: add a root-path argument to build the necessary paths ouf of it, instead of passing them separately 2025-09-11 16:27:01 +02:00
adrian
aedab8e8b2 fix: installation of substreams cli 2025-09-11 16:27:01 +02:00
dianacarvalho1
22843cfd3b feat: Add encoding to test suite (#259)
* feat: Add encoding to test suite

Use execution from simulation
Add protocol_system to all test files and pass it to run tycho
Add encoding_utils.rs

#time 5h 0m

#time 1m

#time 7m

* refactor: Move encoding swap to its own method to simplify main code

Rename encoding_utils.rs to encoding.rs

#time 20m


#time 0m

#time 0m
2025-09-11 14:30:49 +01:00
adrian
db5c418e57 feat: test-runner return error if one of the tests failed 2025-09-11 10:59:00 +02:00
adrian
894b169e6f feat: add --evm-path argument to test CLI 2025-09-11 10:59:00 +02:00
adrian
805447f82b feat: install foundry binaries into run.Dockerfile 2025-09-11 10:59:00 +02:00
adrian
0de847740a feat: in the docker-compose, wait until the db is ready before starting the test runner 2025-09-11 10:41:19 +02:00
TAMARA LIPOWSKI
4aaaa0f3e3 test: Improve block header test assertion
Don't be lazy, check the actual number.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
1d8a0069e2 fix: Use permutations to get token directions
- This is needed for pools which have >2 tokens.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
cb3b06bb02 feat: update tycho-simulation version 2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
e121f86ff1 feat: get amount out for both directions
Basically same as before but now in a loop - once per direction - to match the python test suite.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
76c9461eb0 feat: Clear PreCachedDB account storage btw tests
[copied from tycho-simulation commit msg]

Main issue:
- This was causing a big issue in the SDK testing, since accounts were being leaked between test cases. Adding this functionality provides an easy way to clear storage on the rust side, by calling .clear() between subsequent tests.

How this manifested:
- Incorrect pool balances were being loaded in the BalancerV2SwapAdapter if tests were run altogether.
- Pool balances were correct if tests were run in isolation.
- We checked that tycho-indexer returned correct pool balances, and we checked pool balances for that block on-chain to be double-sure
- In the python test suite, which was passing, there was code which dropped the whole database between subsequent tests, which was not being duplicated in the rust suite.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
d75e62ed3d feat: Fetch proper block header for simulation
- Similarly to the way it was done in the python package.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
dc288bcf29 fix: Skip simulation if skip_simulation = True
This is why we weren't getting BAL510 for `test_erc4626_linear_pool_creation` in python - simulation was being skipped, though not skipped in the rust porting. The simulation is skipped here since no liquidity has been added in more than 100k blocks.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
02ed0fe216 feat: Improved error handling
This was previously showing that the test passed even when it failed.

TODO:
- This still fails with "Insufficient balance". Need to debug why.
2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
f5bcd31d66 feat: Rust testing SDK - implement get_amount_out simulation 2025-09-10 11:44:16 -04:00
TAMARA LIPOWSKI
5f8dccb729 feat: Pass adapter contract to decoder
This was the most elegant solution we could come up with at the moment for having the proper adapter in the builder.

Notes:
- The default adapter bytecode in tycho-simulation is still loaded at compile time.
- If the adapter bytecode is passed to the decoder, it will be loaded dynamically at runtime and used instead the bytecodes in tycho-simulation.
- The adapter bytecode is used in the builder to get capabilities and thus spot prices before returning the state, so just overwriting the adapter in the state is way too cumbersome. We went with this solution since it was the lesser evil, even though we know it leaks VM-specific info to non-vm protocols (which was already being done anyway with the balances).
2025-09-10 11:44:16 -04:00
adrian
242a5892da chore: update readme 2025-09-10 16:36:08 +02:00
adrian
62f0cc3060 chore: move separator to print it before anything else at the start 2025-09-10 16:36:08 +02:00
adrian
b1db641c31 fix: docker entrypoint handle correctly passing a single argument as a string 2025-09-10 16:36:08 +02:00
adrian
580a8822a5 feat: add match-test argument to test cli 2025-09-10 16:36:08 +02:00
adrian
24504d0f94 feat: add docker image to build binaries used in tests 2025-09-10 16:36:08 +02:00