Repository navigation
Fix oracle batch game_id, WebSocket subscription validation/broadcast, and deploy version check - #1870
Merged
yahia008 merged 4 commits intoOct 22, 2026
Conversation
…y drops the game_id Closes StellarCheckMate#1772
…bscription `match_i Closes StellarCheckMate#1773
…es not verify the d Closes StellarCheckMate#1774
… payload to all sub Closes StellarCheckMate#1775
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix oracle batch game_id, WebSocket subscription validation/broadcast, and deploy version check
What was solved
#1772 — Fix: oracle
submit_batch_resultssilently drops the game_id from the oracle recordFix the oracle contract's
submit_batch_resultsso thegame_idsupplied in each batch entry is threaded through the internal settlement path and persisted on the on-chain oracle record, plus a test asserting the stored record contains the supplied game_id.Addressed:
game_idfrom each batch entry through to the oracle record write insubmit_batch_results#1773 — Fix: websocket server does not validate subscription
match_idis a valid u64Fix the WebSocket subscription handler so it parses and validates the incoming
match_idas a positive u64 before registering an event filter, sends a typed error frame to the client on invalid input instead of letting an unhandled exception close the connection, and adds a test covering the invalid-input path.Addressed:
match_idfrom the raw subscription string into a u64 before passing it to the event filtermatch_idis a positive integer (reject zero and non-numeric input)match_idis invalid rather than allowing an unhandled exception to close the connection#1774 — Deployment:
scripts/deploy_testnet.shdoes not verify the deployed contract version matches the built WASMUpdate
scripts/deploy_testnet.shso that after deploying the escrow contract it invokesget_contract_versionon-chain and compares the result to the built package version (CARGO_PKG_VERSION), failing the script on mismatch to catch stale deployments.Addressed:
stellar contract invoke ... -- get_contract_versionagainst the deployed contract IDCARGO_PKG_VERSIONof the built WASM#1775 — Fix: websocket server sends the full event payload to all subscribers, not just those watching that match
Fix the WebSocket server broadcast loop so events are dispatched only to clients subscribed to the event's match_id, using a match_id → Set subscription map, and add a test with two clients subscribed to different matches.
Addressed:
Changes
contracts/escrow/src/tests/batch_submit.rs(modify)README.md(modify)server/src/websocket.rs(create)server/src/ws/subscriptions.rs(create)scripts/deploy_testnet.sh(modify)server/src/ws/mod.rs(create)Approach
submit_batch_resultssilently drops the game_id from the oracle record #1772 — Fix: oraclesubmit_batch_resultssilently drops the game_id from the oracle record (Changed: contracts/escrow/src/tests/batch_submit.rs)match_idis a valid u64 #1773 — Fix: websocket server does not validate subscriptionmatch_idis a valid u64 (Changed: README.md)scripts/deploy_testnet.shdoes not verify the deployed contract version matches the built WASM #1774 — Deployment:scripts/deploy_testnet.shdoes not verify the deployed contract version matches the built WASM (Changed: scripts/deploy_testnet.sh)Issues
Closes #1772
Closes #1773
Closes #1774
Closes #1775