|
3 | 3 | #include <string> |
4 | 4 |
|
5 | 5 | #include <impl/btc/config_pool.hpp> |
| 6 | +#include <core/version_gate.hpp> // SSOT: V36_ACTIVATION_VERSION / is_v36_active |
6 | 7 |
|
7 | 8 | // G0/G1 — BTC share-format byte-parity against the BAKED p2pool baseline. |
8 | 9 | // |
@@ -60,3 +61,33 @@ TEST(BTC_g01_share_format, ProtocolFloorIsForwardCompatibleRaise) |
60 | 61 | EXPECT_GE(btc::PoolConfig::MINIMUM_PROTOCOL_VERSION, GOLDEN_MINIMUM_PROTOCOL_VERSION) |
61 | 62 | << "c2pool floor must not drop below the p2pool baseline"; |
62 | 63 | } |
| 64 | + |
| 65 | + |
| 66 | +// Share-version additive discipline (G1 bucket-2): the c2pool sharechain extends |
| 67 | +// the p2pool baseline version set by EXACTLY ONE sanctioned version -- 36 -- the |
| 68 | +// V36 share-format / consensus-revision boundary owned by the core::version_gate |
| 69 | +// SSOT. c2pool has no p2pool-style share-version array to compare element-wise, |
| 70 | +// so the additive is locked against the SSOT instead. The baseline set is |
| 71 | +// transcribed from the golden fixture (constants.share_versions @ ece15b03fc23). |
| 72 | +// This catches two drift modes the byte-parity TESTs above do not: |
| 73 | +// 1. boundary drift -- V36_ACTIVATION_VERSION moving off 36 (an unsanctioned / |
| 74 | +// shifted version) fails here; |
| 75 | +// 2. baseline-composition drift -- no baseline version may be treated as V36. |
| 76 | +TEST(BTC_g01_share_format, ShareVersionAdditiveIsExactlyV36) |
| 77 | +{ |
| 78 | + // Transcribed from btc.g01.golden.json -> constants.share_versions. |
| 79 | + constexpr uint64_t GOLDEN_BASELINE_VERSIONS[] = {0, 17, 32, 33, 34, 35}; |
| 80 | + |
| 81 | + // The SINGLE sanctioned additive over the p2pool baseline is the V36 boundary. |
| 82 | + EXPECT_EQ(core::version_gate::V36_ACTIVATION_VERSION, 36u) |
| 83 | + << "only sanctioned c2pool version added over the baseline is 36"; |
| 84 | + |
| 85 | + // No baseline version is on the V36 side of the gate -- all pre-revision. |
| 86 | + for (uint64_t v : GOLDEN_BASELINE_VERSIONS) |
| 87 | + EXPECT_FALSE(core::version_gate::is_v36_active(v)) |
| 88 | + << "baseline version " << v << " must remain pre-V36"; |
| 89 | + |
| 90 | + // Boundary is exact: 36 activates, 35 (max baseline) does not. |
| 91 | + EXPECT_TRUE (core::version_gate::is_v36_active(36)); |
| 92 | + EXPECT_FALSE(core::version_gate::is_v36_active(35)); |
| 93 | +} |
0 commit comments