Repository navigation
feat(sep): add operation-count, event-ordering, network-fingerprint, xdr-roundtrip inspectors - #253
Merged
Conversation
…xdr-roundtrip inspectors Adds four read-only inspection commands: - operation-count-audit (ISSUE-155): reports operation count against documented MAX_OPS_PER_TX (100). Soroban resource budget reported separately, never conflated with op-count. Emits OP_COUNT_PASS_NOT_ACCEPTANCE. - soroban-event-ordering-audit (ISSUE-154): checks ordering within a Soroban event result set and overlap between two sets using only reliable ordering metadata (pagingToken/id). Never falls back to ledger. Does not duplicate soroban-event-decoder (decoding) or soroban-event-retention-audit (pagination). - network-fingerprint (ISSUE-153): produces stable and detailed fingerprints from Horizon + Soroban RPC observations. Stable excludes software versions for cross-upgrade stability; detailed includes them. Emits FINGERPRINT_NOT_EQUIVALENCE_PROOF. Supports --compare against saved profiles. - xdr-roundtrip-audit (ISSUE-152): decodes and re-encodes XDR with @stellar/stellar-sdk, distinguishing byte-level differences (warning) from confirmed semantic drift (error). Never labels a byte difference as corruption alone. All four commands are read-only. network-fingerprint is the only one that performs network calls (Horizon + Soroban RPC). Findings use the severity classification (error | warning | info | inconclusive) established in the previous SEP compliance packs. Closes Dantama022#197 Closes Dantama022#196 Closes Dantama022#195 Closes Dantama022#194
|
@Halisky Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Adds four read-only inspection commands under the Transaction/XDR and Soroban diagnostics epics.
operation-count-auditMAX_OPS_PER_TX = 100. Soroban resource budget reported separately.soroban-event-ordering-auditsoroban-event-decoderorsoroban-event-retention-audit.network-fingerprint--comparemode.xdr-roundtrip-auditCloses #197
Closes #196
Closes #195
Closes #194
Files
New (17):
src/services/operation-count-audit.tssrc/services/soroban-event-ordering-audit.tssrc/services/network-fingerprint.tssrc/services/xdr-roundtrip-audit.tssrc/output/operation-count-audit-report.tssrc/output/soroban-event-ordering-audit-report.tssrc/output/network-fingerprint-report.tssrc/output/xdr-roundtrip-audit-report.tssrc/cli/commands/sep-compliance-4.tstests/operation-count-audit.test.tstests/soroban-event-ordering-audit.test.tstests/network-fingerprint.test.tstests/xdr-roundtrip-audit.test.tsdocs/operation-count-audit.mddocs/soroban-event-ordering-audit.mddocs/network-fingerprint.mddocs/xdr-roundtrip-audit.mdModified (1):
src/cli/index.ts— 2-line addition (import +registerSepCompliance4Commands(program)).Design decisions worth highlighting
1.
operation-count-audit— Soroban resources are separate, alwaysThe audit reads the envelope once. If
invokeHostFunctionoperations exist, aSOROBAN_RESOURCES_PRESENTinfo finding is emitted and asorobanResourcessection is populated. TheMAX_OPS_PER_TX = 100check is applied independently. The test suite asserts that a plain transaction has nosorobanResourcesfield.2.
soroban-event-ordering-audit— explicit non-duplicationTwo existing services already cover adjacent concerns:
soroban-event-decoderdecodes ScVal topics/values (used elsewhere).soroban-event-retention-auditaudits pagination (cursors, missing metadata, duplicateids across pages, page gaps, termination).This new audit focuses only on ordering within a flat set and overlap between two sets.
ORDERING_DELEGATEDis emitted as an inconclusive finding on every run. The audit never falls back toledgerfor ordering — ifpagingToken/idis missing on any record, the check is inconclusive.3.
network-fingerprint— stable vs detailed, equivalence-proof disclaimerThe stable fingerprint excludes software versions so it remains stable across operator upgrades. The detailed fingerprint includes them. The audit never claims fingerprint matching proves complete network equivalence —
FINGERPRINT_NOT_EQUIVALENCE_PROOFis emitted on every result.Comparison mode handles three states distinctly: matching (info), differing stable (warning — real identity change), differing detailed only (info — expected across upgrades). Added / removed / unavailable fields are reported separately from changes.
4.
xdr-roundtrip-audit— no false "corruption" claimsThe audit compares SHA-256 hashes. If they differ, it re-decodes the re-encoded bytes and compares structural JSON. Only a structural difference is reported as
SEMANTIC_DRIFT(error). A byte difference that re-decodes to the same structure is reported asDIFFERS_BUT_SEMANTICALLY_EQUAL(warning) — explicitly not corruption. This is the comparison strategy documented in the ACs.Testing
npm run typecheck npm run lint npm test npm run build