test(light-client): port lightclient tests to test-loop#15971
Conversation
There was a problem hiding this comment.
Pull request overview
Ports the legacy pytest light-client sanity tests to the Rust test-loop framework, consolidating light-client block walking and light-client execution outcome proof verification into test-loop-tests and removing the now-obsolete Python test implementations.
Changes:
- Add
test-loop-tests/src/tests/light_client.rswith test-loop equivalents of the light-client block-walk and execution-outcome-proof tests. - Wire the new module into the test-loop test suite.
- Remove the old pytest tests and helper module, and drop them from the nightly pytest sanity list.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test-loop-tests/src/tests/mod.rs | Registers the new light_client test module in the test-loop test suite. |
| test-loop-tests/src/tests/light_client.rs | Implements light-client tests in Rust test-loop: NEP-25 validation during next_light_client_block walking, epoch-boundary behavior, and light_client_proof verification. |
| pytest/tests/sanity/rpc_light_client_execution_outcome_proof.py | Removes the legacy pytest execution-outcome-proof test after porting to test-loop. |
| pytest/tests/sanity/lightclient_test.py | Removes the legacy pytest light-client block walking test after porting to test-loop. |
| pytest/lib/lightclient.py | Removes the unused pytest light-client helper library. |
| nightly/pytest-sanity.txt | Removes the deleted pytest light-client tests from the nightly pytest sanity run list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #15971 +/- ##
==========================================
+ Coverage 72.49% 72.62% +0.13%
==========================================
Files 946 948 +2
Lines 204277 205021 +744
Branches 204277 205021 +744
==========================================
+ Hits 148094 148904 +810
+ Misses 51215 51143 -72
- Partials 4968 4974 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Ports
lightclient_test.pyandrpc_light_client_execution_outcome_proof.pyfrom pytest to the test-loop framework, and removes the originals along with the now-unusedpytest/lib/lightclient.py.The new
test-loop-tests/src/tests/light_client.rscovers:test_next_light_client_block: walksnext_light_client_blockacross several epochs, validating each returned block per NEP-25 (recomputed block hash matches the canonical chain, approval signatures verify against the epoch's block producers, >2/3 stake threshold, next_bp_hash on epoch change), and asserts the walk advances one epoch per step and climbs all the way to the head's final block.test_next_light_client_block_epoch_boundary: for a fixed last-known block, the light client block lags in the previous epoch until the head's final block crosses the boundary, and the returned block shares the epoch of the block two heights onward.test_light_client_execution_outcome_proof: deploys a contract, runs a succeeding and a failing call, and verifies the light client proof merkle paths for the transaction and each receipt outcome.The execution-outcome-proof test is ignored under
protocol_feature_spice(matching the original's commented-out spice run); the two walk tests run under spice as before.