Forked Rebalance Simulation 3d#172
Conversation
d9f1702 to
eef42c2
Compare
eef42c2 to
6369838
Compare
8009611 to
34e65b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
82b2cd4 to
7e17711
Compare
There was a problem hiding this comment.
Any experience locally with inconsistent runs? First run did not trigger rebalance, this happens with scenario 3a and 3b as well. Mainly wondering if these tests could fail in CI.
Output
flow test cadence/tests/forked_rebalance_scenario3d_test.cdc
❗ Version warning: a new version of Flow CLI is available (v2.14.3).
Read the installation guide for upgrade instructions: https://developers.flow.com/tools/flow-cli/install
11:42AM INF Using fork height chainId=flow-mainnet forkBlockID=24806fa16bae3ee6f3852c41ba413319306e2f5620133dd0a0786d228201a712 forkHeight=143292255 host=access.mainnet.nodes.onflow.org:9000
11:42AM INF LOG: "[TEST] Captured Position ID from event: 5"
11:42AM INF LOG: "[TEST] YieldVault ID: 208"
11:42AM INF LOG: "\n=== PRECISION COMPARISON (Initial State) ==="
11:42AM INF LOG: "Expected Yield Tokens: 615.38461539"
11:42AM INF LOG: "Actual Yield Tokens: 615.38461537"
11:42AM INF LOG: "Difference: -0.00000002"
11:42AM INF LOG: ""
11:42AM INF LOG: "Expected Flow Collateral Value: 1000.00000000"
11:42AM INF LOG: "Actual Flow Collateral Value: 1000.00000000"
11:42AM INF LOG: "Difference: -0.00000000"
11:42AM INF LOG: ""
11:42AM INF LOG: "Expected MOET Debt: 615.38461539"
11:42AM INF LOG: "Actual MOET Debt: 615.38461538"
11:42AM INF LOG: "Difference: -0.00000001"
11:42AM INF LOG: "=========================================================\n"
11:42AM INF LOG: "\n=== FLOW PRICE \u{2192} 0.5x ==="
11:42AM INF LOG: "\n=== PRECISION COMPARISON (After Flow Price Decrease) ==="
11:42AM INF LOG: "Expected Yield Tokens: 307.69230769"
11:42AM INF LOG: "Actual Yield Tokens: 615.38461537"
11:42AM INF LOG: "Difference: +307.69230768"
11:42AM INF LOG: ""
11:42AM INF LOG: "Expected Flow Collateral Value: 500.00000000"
11:42AM INF LOG: "Actual Flow Collateral Value: 500.00000000"
11:42AM INF LOG: "Actual Flow Collateral Amount: 1000.00000000 Flow tokens"
11:42AM INF LOG: "Difference: -0.00000000"
11:42AM INF LOG: ""
11:42AM INF LOG: "Expected MOET Debt: 307.69230769"
11:42AM INF LOG: "Actual MOET Debt: 615.38461538"
11:42AM INF LOG: "Difference: +307.69230769"
11:42AM INF LOG: "=========================================================\n"
Test results: "cadence/tests/forked_rebalance_scenario3d_test.cdc"
- FAIL: test_ForkedRebalanceYieldVaultScenario3D
Execution failed:
error: assertion failed: Expected yield tokens after flow price decrease to be 307.69230769 but got 615.38461537
--> cadence/tests/forked_rebalance_scenario3d_test.cdc:281:4
No, I hadn't seen that, but I was able to reproduce.... very strange 🤔, the only things that I can think of that could cause this non-determinism would be randomness or a bug in the testing framework/runtime... EDIT: Thinking about this more, it could be a race condition with timestamps in the testing framework. I.e. the Band Oracle update relies on the current timestamp. If this does not advance between updates, subsequent updates may not be reflected here. |
|
Yeah, Band Oracle was the cause - fixed in 2338365 |
Closes: #163
Description
Converts scenario 3d to a forked simulation.
Failing test is not related to this PR
https://github.com/onflow/FlowYieldVaults/actions/runs/22596031626/job/65466138035#step:9:1299
Test Output
For contributor use:
masterbranchFiles changedin the Github PR explorer