Commit Graph

649 Commits

Author SHA1 Message Date
dianacarvalho1
9a7e6a1cf7 feat: Remove python suite (deprecated) (#284)
Update readme

#time 10m
2025-09-26 16:47:21 +01:00
TAMARA LIPOWSKI
e00063053d fix: Pass proper native address when encoding router call
- We were using the wrapped address here instead of the proper native address, so the value was being set to the in amount when it should have been zero.
2025-09-26 10:31:31 -04:00
TAMARA LIPOWSKI
e1bc6c1e55 chore: expose actual debug_traceCall error
Without this it was being hidden, somehow.
2025-09-26 10:31:31 -04:00
TAMARA LIPOWSKI
6cc1dcc505 fix: UniswapV3 proto definition
This fixes the error:
test-runner-1  | 2025-09-20T00:59:08.199125Z ERROR Substreams pack command failed: Error: validation failed: module "map_balance_changes" has invalid proto output type "proto:tycho.evm.uniswap.v3.BalanceDeltas": proto message type "tycho.evm.uniswap.v3.BalanceDeltas" not found in package proto definitions

And now it matches how it's done in UniswapV2
2025-09-26 10:31:31 -04:00
TAMARA LIPOWSKI
2ae5c4bcc7 feat: Add UniswapV3 test 2025-09-26 10:31:31 -04:00
dianacarvalho1
b577e7d6b2 refactor: Misc improvements to code (#277)
* refactor: Misc improvements to code

- Decouple validating logic from TychoRunner
- Move all data fetching and decoding the tycho message into the same method
- Split validate_state into validate_state, validate_token_balances and simulate_and_execute
- Make rpc_provider and runtime attributes of TestRunner
- Add references where possible to avoid clones
- Remove unnecessary code
- Make clippy happy

#time 2h 36m

#time 0m


#time 3m

* chore: Use tycho deps and foundry from tycho_simulation

This is to try to decrease the risk of using conflicting versions in the different repositories

#time 32m


#time 0m

* chore: Read RPC_URL in main.rs

#time 10m

* fix: Support eth trades (skip balance and allowance overwrites) and set balance overwrite to amount in

For tokens like USDC setting the balance super high was making us getting blacklisted

#time 1h 12m

* fix: Fix curve tests and filter components_by_id with the expected_component_ids

#time 1h 30m


#time 0m

* fix: Don't use all the possible executor addresses. Hardcode just one for the test

Refactor overwrites logic:
- renamed functions
- moved logic around that fits together
- don't use StateOverrides and then convert to alloy overrides. Use alloy's directly

#time 1h 21m

* fix: Assume that the executors mapping starts at storage value 1

Move setup_router_overwrites away from the rpc and into the execution file
Delete unnecessary get_storage_at

#time 33m
2025-09-25 17:27:05 +01:00
Zizou
12369c3981 fix: update get_block_storage_changes to correctly emit previous value (#280)
Before this commit we were using the latest `ContractSlot` for both previous and new value. This is not correct because if the value changed twice we would have the middle value emitted as "previous". For example if a value was changed like this in a single transaction 1 -> 10 -> 2 we would have `new_value=2` and `previous_values=10` while the previous value was actually 1.

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-09-25 17:41:07 +02:00
zach
486bd0c9e9 fix: build cmd 2025-09-25 21:00:04 +08:00
Tamara
eaca47479b feat: Simulate txs against RPC (#261)
* feat: (WIP) Simulate txs against RPC

* fix: include test_executor_addresses.json

We should probably fetch this from execution instead. Will do later

* feat: (WIP) Attempt to use TokenProxyOverwriteFactory

* feat: (WIP) Attempt to use TokenProxyOverwriteFactory

* feat: Add simulating execution using debug_traceCall

Decoded amount out from execution and compared with the one from simulation
Allow for printing the execution traces
Moved all execution methods into execution.rs
Created traces.rs (heavily clauded) that prints the traces nicely and gets the function selectors frm 4byte (I decided not to use EtherscanIdentifier from foundry because adding foundry as a dependency is really heavy and I expect problems because of it)

Temporary: hardcoded storage slots for test_weighted_pool_v4 to pass

#time 1h 55m

* feat: Use BalanceSlotDetector and AllowanceSlotDetector from tycho_ethereum

#time 1h 14m

* fix: Improve traces.rs

#time 2m

* feat: Add skip_execution

Also get tycho router bytecode at compile time

#time 22m

* test: Skip tests that are before the Shanghai upgrade

Remove unnecessary TODOs

#time 35m

* feat: Point tycho dependencies to specific commits

#time 9m

* fix: Set historical_trade to true in TychoRouterEncoderBuilder

#time 41m


#time 0m

* feat: Improve traces.rs (use foundry instead of 4bytes)

Improved the format of the printed trace as well

#time 1h 7m

* fix: After merge fixes

#time 3m

* feat: Use new executors_addresses in tycho-execution and read it at startup

#time 1h 25m

* feat: Create a new flag to enable execution_traces

#time 9m

* fix: Small code, log and trace improvements

Add trying to decode method's calldatas in tracing

#time 1m

* fix: Simplify simulate_transactions_with_tracing by introducing a new method: bytes_to_fixed_32

#time 13m

* fix: After merge fixes

#time 1m

* fix: Include executor's bytecode at compile time

#time 11m

---------

Co-authored-by: TAMARA LIPOWSKI <data.lipowski@extaccount.com>
Co-authored-by: Diana Carvalho <diana@propellerheads.xyz>
2025-09-23 15:57:43 +01:00
TAMARA LIPOWSKI
dbabda84f2 chore: improved logging and comment 2025-09-23 00:42:23 -04:00
TAMARA LIPOWSKI
69352511e7 chore: Make CI happy
Errors such as...
error: struct `Pools` is never constructed
2025-09-23 00:42:23 -04:00
TAMARA LIPOWSKI
2c0c4d97fb refactor: Move module_name to integration test yaml
It's not good to keep this in the test_runner because then we have multiple points that we need to edit the test config, which can be hard to find.

We need this because the module name for uniswap_v2 is so far different from the rest of the protocols.
2025-09-23 00:42:23 -04:00
TAMARA LIPOWSKI
99c8a32d23 feat: Add test for PancakeswapV2
- There are some ugly hardcodings here that I hope to improve.
2025-09-23 00:42:23 -04:00
TAMARA LIPOWSKI
1c5cf42d00 feat: Add test for UniswapV2
- Used a random post-Shanghai-created USV2 pool state with enough liquidity for the test

Necessary fixes:
- Don't hardcode to EVMPoolState
- Don't expect adapter to always be set.
- UniswapV2 names its module differently for some reason... this seems like a special case so instead of updating all integration test yamls, I'm just hardcoding it in test_runner.rs. Perhaps not the best decision?
- Log the static attributes if not found.
- Get the substreams yaml path from config instead of hardcoding it.
2025-09-23 00:42:23 -04:00
TAMARA LIPOWSKI
12e6e48a78 feat: Add test for UniswapV2
- Used a random post-Shanghai-created USV2 pool state with enough liquidity for the test

Necessary fixes:
- Don't hardcode to EVMPoolState
- Don't expect adapter to always be set.
- UniswapV2 names its module differently for some reason... this seems like a special case so instead of updating all integration test yamls, I'm just hardcoding it in test_runner.rs. Perhaps not the best decision?
- Log the static attributes if not found.
- Get the substreams yaml path from config instead of hardcoding it.
2025-09-23 00:42:23 -04:00
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