@optimystic/db-p2p 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -337,6 +337,8 @@ interface LocalClusterWithExecutionTracking extends ICluster {
337
337
  getExecutedPendResult?(messageHash: string): PendResult | undefined;
338
338
  /** Local storage's verdict for a commit applied during consensus; see ClusterMember.getExecutedCommitResult. */
339
339
  getExecutedCommitResult?(messageHash: string): CommitResult | undefined;
340
+ /** One more reconcile for a behind-refused commit, once remote members hold it; see ClusterMember.reconcileRefusedCommit. */
341
+ reconcileRefusedCommit?(record: ClusterRecord): Promise<void>;
340
342
  /** Self-sign a one-peer commit proof for the solo-cohort commit path; see ClusterMember.mintSoloCommitProof.
341
343
  * Optional like its siblings: absent on a bare ICluster double, and then the solo path simply
342
344
  * commits proof-less — exactly the pre-mint behavior. */
@@ -600,7 +602,8 @@ export class CoordinatorRepo implements IRepo {
600
602
  peerId: localPeerId,
601
603
  wasTransactionExecuted: localCluster.wasTransactionExecuted?.bind(localCluster),
602
604
  getExecutedPendResult: localCluster.getExecutedPendResult?.bind(localCluster),
603
- getExecutedCommitResult: localCluster.getExecutedCommitResult?.bind(localCluster)
605
+ getExecutedCommitResult: localCluster.getExecutedCommitResult?.bind(localCluster),
606
+ reconcileRefusedCommit: localCluster.reconcileRefusedCommit?.bind(localCluster)
604
607
  } : undefined;
605
608
  this.coordinator = new ClusterCoordinator(keyNetwork, createClusterClient, policy, localClusterRef, fretService, reputation, stateStore);
606
609
  }
@@ -2508,10 +2511,11 @@ export class CoordinatorRepo implements IRepo {
2508
2511
  // fresh revision, which is what the `conflict: true` shape makes `Collection.syncAttempts`
2509
2512
  // and the multi-collection `pendPhase` do. But a member reached only by
2510
2513
  // `scheduleCommitRetry` can still land the refused revision later, and this node's own
2511
- // member (or its fallback commit) may hold it already. When the refused block is the
2512
- // action's LOG TAIL, that matters beyond this block: `NetworkTransactor.commit` stops at a
2513
- // refused tail and never sweeps the action's other blocks, so the writer can then read
2514
- // its own log entry back while none of the data it describes was committed anywhere.
2514
+ // member (or its fallback commit) may hold it already. When the refused commit carries the
2515
+ // action's LOG TAIL, that matters beyond this block: the writer can then read its own log
2516
+ // entry back while the data it describes is on a minority at best when the tail travelled
2517
+ // with the other blocks, the members holding it may hold them too; when it travelled alone,
2518
+ // `NetworkTransactor.commit` stops at the refused tail and never sweeps the rest.
2515
2519
  // The writer's retry with the SAME action id is what converges that, and only because it
2516
2520
  // does two things: `isOwnRevision` in `StorageRepo.pend` and `commit` treats an
2517
2521
  // already-landed own revision as satisfied, and `Collection.completeOwnEntry` — on