test(saya-tee): settle blocks carrying cross-chain messages - #581
Conversation
The persistent-TEE e2e only settled plain transfer blocks, so it never built a `messages_commitment` over a real message — the exact path that broke when saya hashed L1->L2 messages with the Ethereum keccak formula instead of the Poseidon hash Katana commits to (piltover rejects such a block with 'tee: invalid messages', stalling settlement). Add a phase after the plain-block loop that drives a message in each direction through a settled block: - deploy the `contract_msg_starknet` l1-handler on the appchain; - L1->L2: `send_message_to_appchain` on the L2 piltover core, relayed by the appchain messaging collector into an l1-handler tx, then assert the block settles; - L2->L1: emit `send_message_to_l1` from the appchain, then assert the block settles. Enables the messaging collector on the L3 node and raises the L2 node's `max_event_page_size` to fit the collector's query. Verified red against a keccak-hashing saya-tee (stalls at the L1->L2 block) and green against the Poseidon fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7a40a7a to
684dab2
Compare
|
Ran |
The `test` workflow (and its `saya-tee-e2e` job) is path-filtered to `crates/**`/`bin/**`, so PRs that only touch integration-test crates under `tests/**` (e.g. the saya-tee e2e) never trigger it — every workflow shows as skipped. Add `tests/**/*.rs`, `tests/**/Cargo.toml`, and `Cargo.lock` to both the workflow `paths` filter and the `detect-changes` `broader-rust` filter so those changes run the workspace jobs. Bump the saya pin the `saya-tee-e2e` job builds from `17c0ee0` to `v0.4.1`, which includes the L1->L2 Poseidon message-hash fix (dojoengine/saya#77) the new messaging regression test depends on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #581 +/- ##
==========================================
- Coverage 73.32% 68.62% -4.70%
==========================================
Files 209 321 +112
Lines 23132 45352 +22220
==========================================
+ Hits 16961 31125 +14164
- Misses 6171 14227 +8056 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What
Adds a regression phase to the persistent-TEE e2e (
tests/saya-tee) that settles blocks which actually carry cross-chain messages — in both directions.The existing harness only drives plain transfer blocks, so its
messages_commitmentis always over an empty message set. That's why a real bug went uncaught: saya hashed L1→L2 messages with the Ethereumkeccak256formula instead of the Poseidon hash Katana commits to, so any settled block that consumes an L1→L2 message is rejected by piltover with'tee: invalid messages'and settlement stalls.How
After the existing plain-block loop, the test:
contract_msg_starknetl1-handler on the appchain;send_message_to_appchainon the L2 piltover core, lets the appchain messaging collector relay it into an l1-handler tx, then asserts the block settles;send_message_to_l1from the appchain, then asserts the block settles.Supporting harness changes: enable the messaging collector on the L3 node (
config.messaging), and raise the L2 node'smax_event_page_size(the collector queries withchunk_size = 200;test_configcapped it at 100).Verification
saya-tee: both message blocks settle, test passes.saya-tee: the L1→L2 message block fails'tee: invalid messages', piltover stalls, the settlement assertion times out.Note
This guards the fix in saya (dojoengine/saya#77). Until that lands, building
saya-teefrom sayamain(pre-fix) makes this test correctly fail — so this should merge after the saya fix is available to CI.