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>
* 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>
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.
- 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.
- 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.
- 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...)
- 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)
* 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
[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.