Skip to content

Reject trailing transaction bytes - #2402

Open
a-shannon wants to merge 8 commits into
ergoplatform:masterfrom
a-shannon:fix/strict-transaction-bytes-parser
Open

a-shannon wants to merge 8 commits into
ergoplatform:masterfrom
a-shannon:fix/strict-transaction-bytes-parser

Conversation

@a-shannon

@a-shannon a-shannon commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse hex transaction bodies with an explicit reader and reject unread bytes in /transactions/bytes and /transactions/checkBytes.
  • Preserve canonical requests and the existing validation, check, and broadcast behavior.
  • Keep the correction local to REST parsing; #2405 covers the complementary P2P ingress boundary.

Invariant

Each endpoint accepts exactly one canonical serialized ErgoTransaction. Valid transaction bytes followed by any suffix must not be accepted as the same transaction.

Review and prerequisites

Head 8a74e9a9f946e708cd4e11198f9d3c9f044ed880 preserves both owning files from b2707758f8f8bf8ac27b1d12a37404cb2fb5fb79 unchanged.

The branch reuses convergence helper H 0f9f75c1, selected-header observer U bcfcd611, settled-seed/isolation fixture D 71f33c6e, and synchronizer reader fixture R 76e5ec4b, owned by #2535. Continuation/download correction G d62c945a remains owned by #2511; header/body cache wake-up X a772a5cb remains owned by #2549.

Integrate the required shared/production increments before this REST correction; H precedes U/D and R precedes G. The whole #2535 branch is not a prerequisite of #2511. GitHub's upstream-master diff includes the cumulative prerequisites until they merge. The observer checks each node's selected header instead of combining retained alternatives; existing convergence assertions, mining targets and deadlines remain intact.

Validation

Normal Test and IntegrationTest compilation passed on the final tree, with 82/82 focused cases: 49 synchronization/history/cache cases and 33 convergence/isolation cases.

Historical validation of the unchanged owning correction:

  • RED: TransactionApiRouteSpec passed 24/25; the tailed payload returned 200 instead of 400.
  • GREEN: 25/25; both endpoints accept canonical bytes and return the transaction id, and both reject canonical bytes plus 00 with the exact 400 / bad.request response.
  • Independent review of the exact two-file diff approved the correction; independent replay passed 25/25. git diff --check passed.

Those owner checks are reused; they were not rerun as part of the new 82-case gate. The shared liveness composition passed native CI at pinned #2535 head efbd1e917fe74f0f680a2e3c9e4d93595a59b06a (run 34734047921). This supports the prerequisite composition without proving an exclusive cause for historical integration failures.

The local gate did not run Docker. Exact-head native CI for this updated PR is pending; follow the integration tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants