Skip to content

test(ltc): three-tier v35/v36 wire-compat RUNTIME harness (ST-2/ST-3 differential)#665

Open
frstrtr wants to merge 1 commit into
masterfrom
ltc-doge/threetier-wirecompat-runtime-harness
Open

test(ltc): three-tier v35/v36 wire-compat RUNTIME harness (ST-2/ST-3 differential)#665
frstrtr wants to merge 1 commit into
masterfrom
ltc-doge/threetier-wirecompat-runtime-harness

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

The c2pool-side runtime mirror of frstrtr/p2pool-merged-v36 p2pool/test/test_getwork_differential.py, folded into the v35<->v36 crossing soak. This is fallback (b) per the integrator ruling: where the differential asserts byte-identical serialization across paths, this harness asserts the same by round-tripping real corpus shares through the production LTC share codec (src/impl/ltc/share.hpp SHARE_FORMATTER) at runtime — not against hand-transcribed oracle bytes like the static KAT (LTC_threetier_wirecompat.ST2_desired_version_vote_byte / ST3_* at bc70ffcf9).

New file src/impl/ltc/test/wirecompat_runtime_test.cpp, suite LTC_threetier_wirecompat_runtime:

  • ROUNDTRIPfrom_hex -> >> RawShare -> ltc::load_share -> re-Serialize; the re-emitted body and full type-tagged wire form are byte-identical to the input hex ("old path == new path"). Corpus is the two real type-tagged shares embedded in share_test.cpp (0x21/type-33, 0x23/type-35).
  • ST2_runtimedesired_version survives a full re-encode/re-parse round trip through the production share codec; its VarInt (== Bitcoin CompactSize) vote slice is present and correct on the wire for boundary vote values 35/36/252/253/300/65536, also pinned via the live HashLinkType.m_length path as the KAT does.
  • ST3_runtime — a v35-lineage share carries ZERO v36 bytes; driven off the loaded share's real hash_link, the v35 HashLinkType wire is exactly one VarStr-length-prefix byte shorter than the v36 V36HashLinkType (which inserts an extra_data VarStr the v35 wire never carries), with no extra_data leak.

Ratchet-state dimension / soak invocation

Every corpus assertion runs under both v35 and v36 tags so the same test body is what the soak invokes at each crossing stage. In CI (no live node) both tags run against the embedded corpus and both are green. The integrator gates each stage on exit code:

# before the ratchet cross:
C2POOL_RATCHET_STATE=v35 ctest -R LTC_threetier_wirecompat_runtime
# after the ratchet cross:
C2POOL_RATCHET_STATE=v36 ctest -R LTC_threetier_wirecompat_runtime

Unset (CI default) runs both.

Verification

share_test builds clean; LTC_threetier_wirecompat* = 5/5 PASS (2 KAT + 3 runtime) for default, =v35, and =v36. Non-hollowness confirmed: a deliberate one-byte CompactSize oracle perturbation fails ST2_runtime; reverting restores green.

Wired into src/impl/ltc/test/CMakeLists.txt share_test target.

…differential)

Runtime mirror of frstrtr/p2pool-merged-v36 test_getwork_differential.py, folded into
the v35<->v36 crossing soak. New src/impl/ltc/test/wirecompat_runtime_test.cpp (suite
LTC_threetier_wirecompat_runtime): ROUNDTRIP + ST2_runtime + ST3_runtime, each under
C2POOL_RATCHET_STATE={unset,v35,v36}; wired into the share_test target.

Test-only: src/impl/ltc/test/{wirecompat_runtime_test.cpp,share_test.cpp,CMakeLists.txt}.
The stratum_server doa_shares_ counter previously bundled here is split out to branch
ltc-doge/stratum-doa-share-accounting.
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.

1 participant