Skip to content

Commit 34f3591

Browse files
V45 Gate 14: Refresh settlement proof readbacks
Recognize the stronger parameterized BTC pre-finality tests in prior settlement proof catalogs, add the BTC settlement readback surface to source-safe proof coverage, and regenerate affected Bitcode proof artifacts.
1 parent a86cd90 commit 34f3591

6 files changed

Lines changed: 55 additions & 10 deletions

.bitcode/v39-settlement-rights-delivery.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
"sourceSafetyVerdict": "source-safe-settlement-rights-delivery",
465465
"runtimeType": "AssetPackSettlementRightsDeliveryBoundary",
466466
"paymentType": "AssetPackSettlementPaymentObservation",
467+
"btcSettlementReadbackType": "AssetPackBtcSettlementReadback",
467468
"finalityType": "AssetPackSettlementFinalityReceipt",
468469
"rightsTransferType": "BtdRightsTransferReceipt",
469470
"readReceiptType": "BtdReadReceipt",
@@ -473,6 +474,7 @@
473474
"replayType": "AssetPackSettlementRightsDeliveryReplayReceipt",
474475
"storageRecordKinds": [
475476
"btc_payment_observation",
477+
"btc_settlement_readback",
476478
"settlement_finality",
477479
"source_to_shares_compensation",
478480
"btd_read_receipt",
@@ -506,5 +508,5 @@
506508
"failedPredicateIds": []
507509
},
508510
"passed": true,
509-
"artifactRoot": "v39-settlement-rights-delivery:ef0207da866bfb8375772f46"
511+
"artifactRoot": "v39-settlement-rights-delivery:ac368ea9dcc45bda1c5ef73d"
510512
}

.bitcode/v40-ledger-storage-sync.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"rowCount": 10,
1212
"synchronizationSurfaceCount": 6,
1313
"failClosedStateCount": 4,
14-
"storageRecordKindCount": 9,
14+
"storageRecordKindCount": 10,
1515
"requiredReadbackCount": 5,
1616
"walletAuthorityBoundaryCount": 4,
1717
"deliveryUnlockConditionCount": 5
@@ -595,7 +595,7 @@
595595
"rowCount": 10,
596596
"synchronizationSurfaceCount": 6,
597597
"failClosedStateCount": 4,
598-
"storageRecordKindCount": 9,
598+
"storageRecordKindCount": 10,
599599
"requiredReadbackCount": 5,
600600
"walletAuthorityBoundaryCount": 4,
601601
"deliveryUnlockConditionCount": 5
@@ -619,8 +619,8 @@
619619
"proofRoots": {
620620
"rowSetRoot": "sha256:bb6d02003baa62525f760c53",
621621
"predicateRoot": "sha256:f4ca6728fac60849d7140424",
622-
"coverageRoot": "sha256:3b6c32dec61478478438ef74",
623-
"artifactRoot": "sha256:84e6aae8d9795dcb9dd757a1"
622+
"coverageRoot": "sha256:a15ad35380e94dcf91814adc",
623+
"artifactRoot": "sha256:a68d8a8ea5ff7c19827537d5"
624624
},
625625
"sourceSafety": {
626626
"sourceSafeMetadataOnly": true,

.bitcode/v42-settlement-rights-delivery.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@
551551
"sourceSafetyVerdict": "source-safe-v42-settlement-rights-delivery-metadata",
552552
"runtimeType": "AssetPackSettlementRightsDeliveryBoundary",
553553
"paymentType": "AssetPackSettlementPaymentObservation",
554+
"btcSettlementReadbackType": "AssetPackBtcSettlementReadback",
554555
"finalityType": "AssetPackSettlementFinalityReceipt",
555556
"rightsTransferType": "BtdRightsTransferReceipt",
556557
"readReceiptType": "BtdReadReceipt",
@@ -583,5 +584,5 @@
583584
"failedPredicateIds": []
584585
},
585586
"passed": true,
586-
"artifactRoot": "v42-settlement-rights-delivery:6866f71624c147178c383189"
587+
"artifactRoot": "v42-settlement-rights-delivery:03357cba132e98e24c3c6b23"
587588
}

packages/protocol/src/canonical/v39-settlement-rights-delivery.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ function predicateResult(id, sourcePath, passed) {
8383
return { id, sourcePath, passed: Boolean(passed) };
8484
}
8585

86+
function settlementFinalityTestsCovered(boundaryTest) {
87+
return (
88+
boundaryTest.includes('fails closed until BTC finality is confirmed') ||
89+
(
90+
boundaryTest.includes('fails closed for %s BTC state before finality') &&
91+
boundaryTest.includes("'prepared'") &&
92+
boundaryTest.includes("'signed'") &&
93+
boundaryTest.includes("'broadcast'") &&
94+
boundaryTest.includes("'observed'")
95+
)
96+
) && boundaryTest.includes('blocked_until_payment_finality');
97+
}
98+
8699
function row(input) {
87100
return {
88101
...input,
@@ -214,7 +227,7 @@ function buildPredicateResults(repoRoot) {
214227
predicateResult('postprocess-optionally-emits-settlement', SOURCE_ROOTS.postprocess, postprocess.includes('ensureAssetPackSettlementRightsDeliveryBoundary') && postprocess.includes('assetPackSettlementRightsDeliveryBoundary')),
215228
predicateResult('tests-cover-confirmed-delivery', SOURCE_ROOTS.boundaryTest, boundaryTest.includes('unlocks BTD rights') && boundaryTest.includes('settlement_delivered')),
216229
predicateResult('tests-cover-underpayment', SOURCE_ROOTS.boundaryTest, boundaryTest.includes('fails closed when BTC payment is underpaid') && boundaryTest.includes('blocked_until_compensation_conservation')),
217-
predicateResult('tests-cover-finality', SOURCE_ROOTS.boundaryTest, boundaryTest.includes('fails closed until BTC finality is confirmed') && boundaryTest.includes('blocked_until_payment_finality')),
230+
predicateResult('tests-cover-finality', SOURCE_ROOTS.boundaryTest, settlementFinalityTestsCovered(boundaryTest)),
218231
predicateResult('tests-cover-reconciliation-drift', SOURCE_ROOTS.boundaryTest, boundaryTest.includes('ledger, database, or object storage projections drift') && boundaryTest.includes('blocked_until_projection_repair')),
219232
predicateResult('spec-gate7-expanded', SOURCE_ROOTS.v39Spec, spec.includes('AssetPackSettlementRightsDeliveryBoundary') && spec.includes('v39-settlement-rights-delivery')),
220233
predicateResult('delta-gate7-expanded', SOURCE_ROOTS.v39Delta, delta.includes('Gate 7') && delta.includes('AssetPackSettlementRightsDeliveryBoundary')),
@@ -240,6 +253,7 @@ function buildCoverage(rows, predicateResults) {
240253
sourceSafetyVerdict: V39_SETTLEMENT_RIGHTS_DELIVERY_SOURCE_SAFETY_VERDICT,
241254
runtimeType: 'AssetPackSettlementRightsDeliveryBoundary',
242255
paymentType: 'AssetPackSettlementPaymentObservation',
256+
btcSettlementReadbackType: 'AssetPackBtcSettlementReadback',
243257
finalityType: 'AssetPackSettlementFinalityReceipt',
244258
rightsTransferType: 'BtdRightsTransferReceipt',
245259
readReceiptType: 'BtdReadReceipt',
@@ -249,6 +263,7 @@ function buildCoverage(rows, predicateResults) {
249263
replayType: 'AssetPackSettlementRightsDeliveryReplayReceipt',
250264
storageRecordKinds: [
251265
'btc_payment_observation',
266+
'btc_settlement_readback',
252267
'settlement_finality',
253268
'source_to_shares_compensation',
254269
'btd_read_receipt',

packages/protocol/src/canonical/v40-ledger-storage-sync.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const V40_LEDGER_STORAGE_SYNC_EXPECTED_TOTALS = Object.freeze({
4242
rowCount: 10,
4343
synchronizationSurfaceCount: 6,
4444
failClosedStateCount: 4,
45-
storageRecordKindCount: 9,
45+
storageRecordKindCount: 10,
4646
requiredReadbackCount: 5,
4747
walletAuthorityBoundaryCount: 4,
4848
deliveryUnlockConditionCount: 5,
@@ -116,6 +116,19 @@ function predicateResult(id, sourcePath, passed) {
116116
return { id, sourcePath, passed: Boolean(passed) };
117117
}
118118

119+
function settlementFinalityTestsCovered(boundaryTest) {
120+
return (
121+
boundaryTest.includes('fails closed until BTC finality is confirmed') ||
122+
(
123+
boundaryTest.includes('fails closed for %s BTC state before finality') &&
124+
boundaryTest.includes("'prepared'") &&
125+
boundaryTest.includes("'signed'") &&
126+
boundaryTest.includes("'broadcast'") &&
127+
boundaryTest.includes("'observed'")
128+
)
129+
) && boundaryTest.includes('blocked_until_payment_finality');
130+
}
131+
119132
function sourceContainsExactHttpsUrl(source, expectedUrl) {
120133
return Array.from(source.matchAll(HTTPS_URL_LITERAL_PATTERN)).some((match) => {
121134
try {
@@ -343,7 +356,7 @@ function buildPredicateResults(repoRoot) {
343356
'settlement-fail-closed-tests-covered',
344357
SOURCE_ROOTS.settlementBoundaryTest,
345358
sources.settlementBoundaryTest.includes('fails closed when BTC payment is underpaid') &&
346-
sources.settlementBoundaryTest.includes('fails closed until BTC finality is confirmed') &&
359+
settlementFinalityTestsCovered(sources.settlementBoundaryTest) &&
347360
sources.settlementBoundaryTest.includes('withholds delivery when ledger, database, or object storage projections drift'),
348361
),
349362
predicateResult(

packages/protocol/src/canonical/v42-settlement-rights-delivery.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ function predicateResult(id, sourcePath, passed) {
9292
return { id, sourcePath, passed: Boolean(passed) };
9393
}
9494

95+
function settlementFinalityTestsCovered(boundaryTest) {
96+
return (
97+
boundaryTest.includes('fails closed until BTC finality is confirmed') ||
98+
(
99+
boundaryTest.includes('fails closed for %s BTC state before finality') &&
100+
boundaryTest.includes("'prepared'") &&
101+
boundaryTest.includes("'signed'") &&
102+
boundaryTest.includes("'broadcast'") &&
103+
boundaryTest.includes("'observed'")
104+
)
105+
) && boundaryTest.includes('blocked_until_payment_finality');
106+
}
107+
95108
function row(input) {
96109
return {
97110
...input,
@@ -213,7 +226,7 @@ function buildPredicateResults(repoRoot) {
213226
predicateResult('boundary-source-safety', SOURCE_ROOTS.boundary, sources.boundary.includes('source_safe_settlement_rights_delivery_boundary') && sources.boundary.includes('walletPrivateMaterialVisible: false')),
214227
predicateResult('tests-cover-confirmed-delivery', SOURCE_ROOTS.boundaryTest, sources.boundaryTest.includes('unlocks BTD rights') && sources.boundaryTest.includes('settlement_delivered')),
215228
predicateResult('tests-cover-underpayment', SOURCE_ROOTS.boundaryTest, sources.boundaryTest.includes('fails closed when BTC payment is underpaid') && sources.boundaryTest.includes('blocked_until_compensation_conservation')),
216-
predicateResult('tests-cover-finality', SOURCE_ROOTS.boundaryTest, sources.boundaryTest.includes('fails closed until BTC finality is confirmed') && sources.boundaryTest.includes('blocked_until_payment_finality')),
229+
predicateResult('tests-cover-finality', SOURCE_ROOTS.boundaryTest, settlementFinalityTestsCovered(sources.boundaryTest)),
217230
predicateResult('tests-cover-reconciliation-drift', SOURCE_ROOTS.boundaryTest, sources.boundaryTest.includes('ledger, database, or object storage projections drift') && sources.boundaryTest.includes('blocked_until_projection_repair')),
218231
predicateResult('host-materializes-boundary', SOURCE_ROOTS.pipelineHostHarness, sources.pipelineHostHarness.includes('buildAssetPackSettlementRightsDeliveryBoundary') && sources.pipelineHostHarness.includes('assetPackSettlementRightsDeliveryBoundary')),
219232
predicateResult('host-test-covers-boundary', SOURCE_ROOTS.pipelineHostHarnessTest, sources.pipelineHostHarnessTest.includes('buildAssetPackSettlementRightsDeliveryBoundary') && sources.pipelineHostHarnessTest.includes('assetPackSettlementRightsDeliveryBoundary')),
@@ -241,6 +254,7 @@ function buildCoverage(rows, predicateResults) {
241254
sourceSafetyVerdict: V42_SETTLEMENT_RIGHTS_DELIVERY_SOURCE_SAFETY_VERDICT,
242255
runtimeType: 'AssetPackSettlementRightsDeliveryBoundary',
243256
paymentType: 'AssetPackSettlementPaymentObservation',
257+
btcSettlementReadbackType: 'AssetPackBtcSettlementReadback',
244258
finalityType: 'AssetPackSettlementFinalityReceipt',
245259
rightsTransferType: 'BtdRightsTransferReceipt',
246260
readReceiptType: 'BtdReadReceipt',

0 commit comments

Comments
 (0)