@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.
- package/dist/src/cluster/cluster-repo.d.ts +58 -9
- package/dist/src/cluster/cluster-repo.d.ts.map +1 -1
- package/dist/src/cluster/cluster-repo.js +113 -21
- package/dist/src/cluster/cluster-repo.js.map +1 -1
- package/dist/src/repo/cluster-coordinator.d.ts +100 -31
- package/dist/src/repo/cluster-coordinator.d.ts.map +1 -1
- package/dist/src/repo/cluster-coordinator.js +288 -192
- package/dist/src/repo/cluster-coordinator.js.map +1 -1
- package/dist/src/repo/coordinator-repo.d.ts +2 -0
- package/dist/src/repo/coordinator-repo.d.ts.map +1 -1
- package/dist/src/repo/coordinator-repo.js +7 -5
- package/dist/src/repo/coordinator-repo.js.map +1 -1
- package/dist/src/storage/storage-repo.d.ts.map +1 -1
- package/dist/src/storage/storage-repo.js +24 -6
- package/dist/src/storage/storage-repo.js.map +1 -1
- package/package.json +2 -2
- package/src/cluster/cluster-repo.ts +116 -21
- package/src/repo/cluster-coordinator.ts +1409 -1296
- package/src/repo/coordinator-repo.ts +9 -5
- package/src/storage/storage-repo.ts +1781 -1762
|
@@ -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
|
|
2512
|
-
// action's LOG TAIL, that matters beyond this block:
|
|
2513
|
-
//
|
|
2514
|
-
//
|
|
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
|