Repository navigation
feat: apply uniform event schema versioning and named decoding (#496) - #532
Merged
Cedarich merged 8 commits intoAug 29, 2026
Merged
Conversation
…fix silent event rejections
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
This PR implements a uniform event-versioning policy across all Soroban contract events. It migrates the TypeScript client away from fragile positional decoding toward strict, name-based schema validation, ensuring that reordered or malformed payloads are explicitly rejected rather than silently misparsed.
Related Issue(s)
Closes #496
Type of Change
Description
1. Smart Contract (Rust)
schema_version: u32to all previously unversioned events (e.g.,AssetAllowlisted,ContractPaused,AdminTransferProposed, etc.).EVENT_SCHEMA_VERSIONconstant into everyemit_*function.test.rsto account for the new payload shape.events.rsalongside the ABI stability notes.2. TypeScript Client & Decoder
payload[0]). The client now requires namedScMappayloads resolved by Soroban symbols.decodeSorobanEventand the codec now enforceschemaVersionagainst the expected constant. Unsupported versions or missing fields trigger a structured rejection ({ type: 'unknown', name: '...' }).3. CI & Tooling
schema.jsonand tightened the generator template to makeschema_versionmandatory.check-client-drift.mjs) to strictly compare ordered Rust fields, schema properties, and client declarations.Testing Evidence
cargo test. All 202 tests passed successfully.events.test.tscovering 3 scenarios (success, unsupported version, and malformed/reordered payload) for all 14 contract events. Executednpm testlocally, with all 105 tests passing.node soroban/scripts/check-client-drift.mjswithout errors, ensuring ABI schema matches the Rust source and TS client definitions.Screenshots
Not applicable (Smart contract, client library, and CI tooling changes only).
Checklist