@origintrail-official/dkg-agent 10.0.20 → 10.0.21
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/approved-private-replica.d.ts +54 -0
- package/dist/approved-private-replica.d.ts.map +1 -0
- package/dist/approved-private-replica.js +148 -0
- package/dist/approved-private-replica.js.map +1 -0
- package/dist/bounded-operation.d.ts +2 -0
- package/dist/bounded-operation.d.ts.map +1 -1
- package/dist/bounded-operation.js +5 -0
- package/dist/bounded-operation.js.map +1 -1
- package/dist/chain-finality-confirmations-v1.d.ts +7 -0
- package/dist/chain-finality-confirmations-v1.d.ts.map +1 -0
- package/dist/chain-finality-confirmations-v1.js +9 -0
- package/dist/chain-finality-confirmations-v1.js.map +1 -0
- package/dist/chain-reconciler.d.ts +23 -0
- package/dist/chain-reconciler.d.ts.map +1 -1
- package/dist/chain-reconciler.js +35 -0
- package/dist/chain-reconciler.js.map +1 -1
- package/dist/context-graph-member-proof.d.ts +13 -0
- package/dist/context-graph-member-proof.d.ts.map +1 -1
- package/dist/context-graph-member-proof.js +36 -0
- package/dist/context-graph-member-proof.js.map +1 -1
- package/dist/context-graph-membership-persist-scheduler.d.ts +7 -23
- package/dist/context-graph-membership-persist-scheduler.d.ts.map +1 -1
- package/dist/context-graph-membership-persist-scheduler.js +12 -88
- package/dist/context-graph-membership-persist-scheduler.js.map +1 -1
- package/dist/context-graph-meta-projection.d.ts +13 -2
- package/dist/context-graph-meta-projection.d.ts.map +1 -1
- package/dist/context-graph-meta-projection.js +61 -24
- package/dist/context-graph-meta-projection.js.map +1 -1
- package/dist/context-graph-private-meta-proof.d.ts +5 -0
- package/dist/context-graph-private-meta-proof.d.ts.map +1 -1
- package/dist/context-graph-private-meta-proof.js +23 -0
- package/dist/context-graph-private-meta-proof.js.map +1 -1
- package/dist/context-graph-read-authority.d.ts +13 -0
- package/dist/context-graph-read-authority.d.ts.map +1 -1
- package/dist/context-graph-read-authority.js +23 -3
- package/dist/context-graph-read-authority.js.map +1 -1
- package/dist/context-graph-storage-discovery.d.ts +11 -2
- package/dist/context-graph-storage-discovery.d.ts.map +1 -1
- package/dist/context-graph-storage-discovery.js +11 -2
- package/dist/context-graph-storage-discovery.js.map +1 -1
- package/dist/context-graph-subscription-persist-scheduler.d.ts +52 -0
- package/dist/context-graph-subscription-persist-scheduler.d.ts.map +1 -0
- package/dist/context-graph-subscription-persist-scheduler.js +78 -0
- package/dist/context-graph-subscription-persist-scheduler.js.map +1 -0
- package/dist/curator-dial-address.d.ts +16 -0
- package/dist/curator-dial-address.d.ts.map +1 -0
- package/dist/curator-dial-address.js +58 -0
- package/dist/curator-dial-address.js.map +1 -0
- package/dist/curator-meta-refresh.d.ts +2 -0
- package/dist/curator-meta-refresh.d.ts.map +1 -1
- package/dist/curator-meta-refresh.js +2 -44
- package/dist/curator-meta-refresh.js.map +1 -1
- package/dist/curator-peer-connection.d.ts +21 -0
- package/dist/curator-peer-connection.d.ts.map +1 -0
- package/dist/curator-peer-connection.js +41 -0
- package/dist/curator-peer-connection.js.map +1 -0
- package/dist/dkg-agent-base.d.ts +94 -22
- package/dist/dkg-agent-base.d.ts.map +1 -1
- package/dist/dkg-agent-base.js +97 -144
- package/dist/dkg-agent-base.js.map +1 -1
- package/dist/dkg-agent-cg-registry.d.ts +10 -0
- package/dist/dkg-agent-cg-registry.d.ts.map +1 -1
- package/dist/dkg-agent-cg-registry.js +176 -115
- package/dist/dkg-agent-cg-registry.js.map +1 -1
- package/dist/dkg-agent-cg-resolve.d.ts +6 -4
- package/dist/dkg-agent-cg-resolve.d.ts.map +1 -1
- package/dist/dkg-agent-cg-resolve.js +22 -16
- package/dist/dkg-agent-cg-resolve.js.map +1 -1
- package/dist/dkg-agent-constants.d.ts +4 -2
- package/dist/dkg-agent-constants.d.ts.map +1 -1
- package/dist/dkg-agent-constants.js +4 -2
- package/dist/dkg-agent-constants.js.map +1 -1
- package/dist/dkg-agent-crypto.d.ts +101 -21
- package/dist/dkg-agent-crypto.d.ts.map +1 -1
- package/dist/dkg-agent-crypto.js +670 -152
- package/dist/dkg-agent-crypto.js.map +1 -1
- package/dist/dkg-agent-helpers.d.ts +2 -2
- package/dist/dkg-agent-helpers.d.ts.map +1 -1
- package/dist/dkg-agent-helpers.js +3 -3
- package/dist/dkg-agent-helpers.js.map +1 -1
- package/dist/dkg-agent-join.d.ts +12 -1
- package/dist/dkg-agent-join.d.ts.map +1 -1
- package/dist/dkg-agent-join.js +80 -92
- package/dist/dkg-agent-join.js.map +1 -1
- package/dist/dkg-agent-lifecycle.d.ts +58 -15
- package/dist/dkg-agent-lifecycle.d.ts.map +1 -1
- package/dist/dkg-agent-lifecycle.js +295 -114
- package/dist/dkg-agent-lifecycle.js.map +1 -1
- package/dist/dkg-agent-publish.d.ts +33 -40
- package/dist/dkg-agent-publish.d.ts.map +1 -1
- package/dist/dkg-agent-publish.js +190 -256
- package/dist/dkg-agent-publish.js.map +1 -1
- package/dist/dkg-agent-query.d.ts +7 -0
- package/dist/dkg-agent-query.d.ts.map +1 -1
- package/dist/dkg-agent-query.js +75 -63
- package/dist/dkg-agent-query.js.map +1 -1
- package/dist/dkg-agent-registered-private-empty-vm.d.ts +70 -0
- package/dist/dkg-agent-registered-private-empty-vm.d.ts.map +1 -0
- package/dist/dkg-agent-registered-private-empty-vm.js +133 -0
- package/dist/dkg-agent-registered-private-empty-vm.js.map +1 -0
- package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts +8 -3
- package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-catalog-auto-publish.js +45 -51
- package/dist/dkg-agent-rfc64-catalog-auto-publish.js.map +1 -1
- package/dist/dkg-agent-rfc64-catalog.d.ts +63 -87
- package/dist/dkg-agent-rfc64-catalog.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-catalog.js +595 -551
- package/dist/dkg-agent-rfc64-catalog.js.map +1 -1
- package/dist/dkg-agent-swm-host.d.ts +43 -52
- package/dist/dkg-agent-swm-host.d.ts.map +1 -1
- package/dist/dkg-agent-swm-host.js +629 -812
- package/dist/dkg-agent-swm-host.js.map +1 -1
- package/dist/dkg-agent-swm-state.d.ts +15 -0
- package/dist/dkg-agent-swm-state.d.ts.map +1 -1
- package/dist/dkg-agent-swm-state.js +43 -0
- package/dist/dkg-agent-swm-state.js.map +1 -1
- package/dist/dkg-agent-swm-substrate.d.ts +2 -0
- package/dist/dkg-agent-swm-substrate.d.ts.map +1 -1
- package/dist/dkg-agent-swm-substrate.js +110 -53
- package/dist/dkg-agent-swm-substrate.js.map +1 -1
- package/dist/dkg-agent-types.d.ts +62 -26
- package/dist/dkg-agent-types.d.ts.map +1 -1
- package/dist/dkg-agent-types.js.map +1 -1
- package/dist/dkg-agent-vm-promotion.d.ts +2 -0
- package/dist/dkg-agent-vm-promotion.d.ts.map +1 -1
- package/dist/dkg-agent-vm-promotion.js +39 -5
- package/dist/dkg-agent-vm-promotion.js.map +1 -1
- package/dist/dkg-agent.d.ts +8 -1
- package/dist/dkg-agent.d.ts.map +1 -1
- package/dist/dkg-agent.js +75 -45
- package/dist/dkg-agent.js.map +1 -1
- package/dist/exact-graph-content-verifier.d.ts.map +1 -1
- package/dist/exact-graph-content-verifier.js +3 -2
- package/dist/exact-graph-content-verifier.js.map +1 -1
- package/dist/finalization-handler.d.ts +19 -207
- package/dist/finalization-handler.d.ts.map +1 -1
- package/dist/finalization-handler.js +79 -1646
- package/dist/finalization-handler.js.map +1 -1
- package/dist/finalization-recovery-worker.js +1 -1
- package/dist/finalization-recovery-worker.js.map +1 -1
- package/dist/finalized-authority-cold-resolution.d.ts +6 -1
- package/dist/finalized-authority-cold-resolution.d.ts.map +1 -1
- package/dist/finalized-authority-cold-resolution.js +22 -3
- package/dist/finalized-authority-cold-resolution.js.map +1 -1
- package/dist/gossip-session.d.ts +29 -0
- package/dist/gossip-session.d.ts.map +1 -0
- package/dist/gossip-session.js +48 -0
- package/dist/gossip-session.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts +5 -5
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts.map +1 -1
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js +59 -49
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js.map +1 -1
- package/dist/internal/context-graph-authority/finalized-target-projection.d.ts +17 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.d.ts.map +1 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.js +36 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.js.map +1 -0
- package/dist/internal/context-graph-authority/swm-transport-authority.d.ts +43 -7
- package/dist/internal/context-graph-authority/swm-transport-authority.d.ts.map +1 -1
- package/dist/internal/context-graph-authority/swm-transport-authority.js +135 -18
- package/dist/internal/context-graph-authority/swm-transport-authority.js.map +1 -1
- package/dist/internal/context-graph-binding-abort.d.ts +3 -0
- package/dist/internal/context-graph-binding-abort.d.ts.map +1 -0
- package/dist/internal/context-graph-binding-abort.js +32 -0
- package/dist/internal/context-graph-binding-abort.js.map +1 -0
- package/dist/internal/context-graph-cache-invalidating-store.d.ts +3 -0
- package/dist/internal/context-graph-cache-invalidating-store.d.ts.map +1 -0
- package/dist/internal/context-graph-cache-invalidating-store.js +167 -0
- package/dist/internal/context-graph-cache-invalidating-store.js.map +1 -0
- package/dist/internal/context-graph-meta-record-copy.d.ts +3 -0
- package/dist/internal/context-graph-meta-record-copy.d.ts.map +1 -0
- package/dist/internal/context-graph-meta-record-copy.js +21 -0
- package/dist/internal/context-graph-meta-record-copy.js.map +1 -0
- package/dist/internal/gossip/host-mode-handler.d.ts +11 -0
- package/dist/internal/gossip/host-mode-handler.d.ts.map +1 -0
- package/dist/internal/gossip/host-mode-handler.js +41 -0
- package/dist/internal/gossip/host-mode-handler.js.map +1 -0
- package/dist/internal/join-encryption-key-bundle.d.ts +10 -0
- package/dist/internal/join-encryption-key-bundle.d.ts.map +1 -0
- package/dist/internal/join-encryption-key-bundle.js +72 -0
- package/dist/internal/join-encryption-key-bundle.js.map +1 -0
- package/dist/internal/knowledge-asset-vm-publish-request.d.ts +31 -0
- package/dist/internal/knowledge-asset-vm-publish-request.d.ts.map +1 -0
- package/dist/internal/knowledge-asset-vm-publish-request.js +91 -0
- package/dist/internal/knowledge-asset-vm-publish-request.js.map +1 -0
- package/dist/internal/lifecycle-sync-policy.d.ts +5 -0
- package/dist/internal/lifecycle-sync-policy.d.ts.map +1 -0
- package/dist/internal/lifecycle-sync-policy.js +12 -0
- package/dist/internal/lifecycle-sync-policy.js.map +1 -0
- package/dist/internal/local-private-member.d.ts +14 -0
- package/dist/internal/local-private-member.d.ts.map +1 -0
- package/dist/internal/local-private-member.js +21 -0
- package/dist/internal/local-private-member.js.map +1 -0
- package/dist/internal/promote/assertion-promote-precommit.d.ts +41 -1
- package/dist/internal/promote/assertion-promote-precommit.d.ts.map +1 -1
- package/dist/internal/promote/assertion-promote-precommit.js +74 -5
- package/dist/internal/promote/assertion-promote-precommit.js.map +1 -1
- package/dist/internal/storage-ack-owned-request.d.ts +16 -0
- package/dist/internal/storage-ack-owned-request.d.ts.map +1 -0
- package/dist/internal/storage-ack-owned-request.js +16 -0
- package/dist/internal/storage-ack-owned-request.js.map +1 -0
- package/dist/internal/vm-reconcile-local-admission-wait.d.ts +96 -0
- package/dist/internal/vm-reconcile-local-admission-wait.d.ts.map +1 -0
- package/dist/internal/vm-reconcile-local-admission-wait.js +226 -0
- package/dist/internal/vm-reconcile-local-admission-wait.js.map +1 -0
- package/dist/internal/vm-reconcile-read-authority.d.ts +27 -0
- package/dist/internal/vm-reconcile-read-authority.d.ts.map +1 -0
- package/dist/internal/vm-reconcile-read-authority.js +33 -0
- package/dist/internal/vm-reconcile-read-authority.js.map +1 -0
- package/dist/internal/vm-reconcile-sweep-admission.d.ts +2 -0
- package/dist/internal/vm-reconcile-sweep-admission.d.ts.map +1 -1
- package/dist/internal/vm-reconcile-sweep.d.ts +16 -4
- package/dist/internal/vm-reconcile-sweep.d.ts.map +1 -1
- package/dist/internal/vm-reconcile-sweep.js +91 -50
- package/dist/internal/vm-reconcile-sweep.js.map +1 -1
- package/dist/internal/workspace-projected-delegatees.d.ts +3 -0
- package/dist/internal/workspace-projected-delegatees.d.ts.map +1 -0
- package/dist/internal/workspace-projected-delegatees.js +34 -0
- package/dist/internal/workspace-projected-delegatees.js.map +1 -0
- package/dist/join-approval-restart-projection.d.ts +14 -0
- package/dist/join-approval-restart-projection.d.ts.map +1 -0
- package/dist/join-approval-restart-projection.js +32 -0
- package/dist/join-approval-restart-projection.js.map +1 -0
- package/dist/keyed-persist-scheduler.d.ts +72 -0
- package/dist/keyed-persist-scheduler.d.ts.map +1 -0
- package/dist/keyed-persist-scheduler.js +140 -0
- package/dist/keyed-persist-scheduler.js.map +1 -0
- package/dist/map-with-concurrency.d.ts +7 -0
- package/dist/map-with-concurrency.d.ts.map +1 -1
- package/dist/map-with-concurrency.js +36 -0
- package/dist/map-with-concurrency.js.map +1 -1
- package/dist/p2p/network-admission-coordinator.d.ts +15 -0
- package/dist/p2p/network-admission-coordinator.d.ts.map +1 -1
- package/dist/p2p/network-admission-coordinator.js +20 -2
- package/dist/p2p/network-admission-coordinator.js.map +1 -1
- package/dist/prepare-unscoped-context-graph-read-checks.d.ts.map +1 -1
- package/dist/prepare-unscoped-context-graph-read-checks.js +12 -0
- package/dist/prepare-unscoped-context-graph-read-checks.js.map +1 -1
- package/dist/registered-context-graph-authority.d.ts +7 -0
- package/dist/registered-context-graph-authority.d.ts.map +1 -1
- package/dist/registered-private-empty-vm-attempt-v1.d.ts +34 -0
- package/dist/registered-private-empty-vm-attempt-v1.d.ts.map +1 -0
- package/dist/registered-private-empty-vm-attempt-v1.js +120 -0
- package/dist/registered-private-empty-vm-attempt-v1.js.map +1 -0
- package/dist/reserved-ka-id-allocation.d.ts +12 -0
- package/dist/reserved-ka-id-allocation.d.ts.map +1 -0
- package/dist/reserved-ka-id-allocation.js +25 -0
- package/dist/reserved-ka-id-allocation.js.map +1 -0
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts +5 -3
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts.map +1 -1
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.js +9 -0
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.js.map +1 -1
- package/dist/rfc64/catalog-completion-evidence-v1.d.ts +38 -0
- package/dist/rfc64/catalog-completion-evidence-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-completion-evidence-v1.js +49 -0
- package/dist/rfc64/catalog-completion-evidence-v1.js.map +1 -0
- package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts +6 -3
- package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-operational-applied-heads-v1.js +6 -3
- package/dist/rfc64/catalog-operational-applied-heads-v1.js.map +1 -1
- package/dist/rfc64/catalog-operational-reads-v1.d.ts +13 -0
- package/dist/rfc64/catalog-operational-reads-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-operational-reads-v1.js +56 -0
- package/dist/rfc64/catalog-operational-reads-v1.js.map +1 -0
- package/dist/rfc64/catalog-operational-targets-v1.d.ts +55 -0
- package/dist/rfc64/catalog-operational-targets-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-operational-targets-v1.js +379 -0
- package/dist/rfc64/catalog-operational-targets-v1.js.map +1 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts +2 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js +18 -25
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js.map +1 -1
- package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts +25 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts.map +1 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.js +127 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.js.map +1 -0
- package/dist/rfc64/legacy-swm-boundary-v1.d.ts +12 -0
- package/dist/rfc64/legacy-swm-boundary-v1.d.ts.map +1 -1
- package/dist/rfc64/legacy-swm-boundary-v1.js +83 -144
- package/dist/rfc64/legacy-swm-boundary-v1.js.map +1 -1
- package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts +33 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts.map +1 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.js +97 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.js.map +1 -0
- package/dist/rfc64/private-read-roster-v1.d.ts +14 -0
- package/dist/rfc64/private-read-roster-v1.d.ts.map +1 -0
- package/dist/rfc64/private-read-roster-v1.js +57 -0
- package/dist/rfc64/private-read-roster-v1.js.map +1 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts +20 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts.map +1 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.js +26 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.js.map +1 -0
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts +3 -1
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.js +34 -0
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.js.map +1 -1
- package/dist/sync/auth/pipe-request-tail.d.ts +5 -1
- package/dist/sync/auth/pipe-request-tail.d.ts.map +1 -1
- package/dist/sync/auth/pipe-request-tail.js +13 -3
- package/dist/sync/auth/pipe-request-tail.js.map +1 -1
- package/dist/sync/auth/request-build.d.ts +3 -0
- package/dist/sync/auth/request-build.d.ts.map +1 -1
- package/dist/sync/auth/request-build.js +11 -2
- package/dist/sync/auth/request-build.js.map +1 -1
- package/dist/sync/backpressure.d.ts +27 -16
- package/dist/sync/backpressure.d.ts.map +1 -1
- package/dist/sync/backpressure.js +66 -40
- package/dist/sync/backpressure.js.map +1 -1
- package/dist/sync/catchup-policy.d.ts +2 -0
- package/dist/sync/catchup-policy.d.ts.map +1 -1
- package/dist/sync/catchup-policy.js +2 -0
- package/dist/sync/catchup-policy.js.map +1 -1
- package/dist/sync/exact-assets.d.ts +7 -5
- package/dist/sync/exact-assets.d.ts.map +1 -1
- package/dist/sync/exact-assets.js +13 -8
- package/dist/sync/exact-assets.js.map +1 -1
- package/dist/sync/exact-batch-observation.d.ts +3 -0
- package/dist/sync/exact-batch-observation.d.ts.map +1 -0
- package/dist/sync/exact-batch-observation.js +13 -0
- package/dist/sync/exact-batch-observation.js.map +1 -0
- package/dist/sync/exact-batch-stream-capability.d.ts +24 -0
- package/dist/sync/exact-batch-stream-capability.d.ts.map +1 -0
- package/dist/sync/exact-batch-stream-capability.js +88 -0
- package/dist/sync/exact-batch-stream-capability.js.map +1 -0
- package/dist/sync/exact-batch-stream-contract.d.ts +78 -0
- package/dist/sync/exact-batch-stream-contract.d.ts.map +1 -0
- package/dist/sync/exact-batch-stream-contract.js +206 -0
- package/dist/sync/exact-batch-stream-contract.js.map +1 -0
- package/dist/sync/peer-connection.d.ts.map +1 -1
- package/dist/sync/peer-connection.js +11 -2
- package/dist/sync/peer-connection.js.map +1 -1
- package/dist/sync/priority-admission-queue.d.ts +17 -0
- package/dist/sync/priority-admission-queue.d.ts.map +1 -1
- package/dist/sync/priority-admission-queue.js +58 -37
- package/dist/sync/priority-admission-queue.js.map +1 -1
- package/dist/sync/requester/admission-boundary.d.ts +12 -0
- package/dist/sync/requester/admission-boundary.d.ts.map +1 -0
- package/dist/sync/requester/admission-boundary.js +22 -0
- package/dist/sync/requester/admission-boundary.js.map +1 -0
- package/dist/sync/requester/durable-sync.d.ts +2 -1
- package/dist/sync/requester/durable-sync.d.ts.map +1 -1
- package/dist/sync/requester/durable-sync.js +3 -188
- package/dist/sync/requester/durable-sync.js.map +1 -1
- package/dist/sync/requester/exact-batch-stream-driver.d.ts +83 -0
- package/dist/sync/requester/exact-batch-stream-driver.d.ts.map +1 -0
- package/dist/sync/requester/exact-batch-stream-driver.js +299 -0
- package/dist/sync/requester/exact-batch-stream-driver.js.map +1 -0
- package/dist/sync/requester/exact-batch-stream.d.ts +72 -0
- package/dist/sync/requester/exact-batch-stream.d.ts.map +1 -0
- package/dist/sync/requester/exact-batch-stream.js +267 -0
- package/dist/sync/requester/exact-batch-stream.js.map +1 -0
- package/dist/sync/requester/exact-recovery-transport.d.ts +19 -0
- package/dist/sync/requester/exact-recovery-transport.d.ts.map +1 -0
- package/dist/sync/requester/exact-recovery-transport.js +3 -0
- package/dist/sync/requester/exact-recovery-transport.js.map +1 -0
- package/dist/sync/requester/finalized-swm-twin-reconciliation.js +12 -3
- package/dist/sync/requester/finalized-swm-twin-reconciliation.js.map +1 -1
- package/dist/sync/requester/graph-scoped-materialization.d.ts.map +1 -1
- package/dist/sync/requester/graph-scoped-materialization.js +58 -24
- package/dist/sync/requester/graph-scoped-materialization.js.map +1 -1
- package/dist/sync/requester/page-fetch.d.ts +7 -0
- package/dist/sync/requester/page-fetch.d.ts.map +1 -1
- package/dist/sync/requester/page-fetch.js +103 -49
- package/dist/sync/requester/page-fetch.js.map +1 -1
- package/dist/sync/requester/shared-memory-sync.d.ts +10 -5
- package/dist/sync/requester/shared-memory-sync.d.ts.map +1 -1
- package/dist/sync/requester/shared-memory-sync.js +149 -150
- package/dist/sync/requester/shared-memory-sync.js.map +1 -1
- package/dist/sync/requester/swm-materialization-memo.d.ts +12 -0
- package/dist/sync/requester/swm-materialization-memo.d.ts.map +1 -0
- package/dist/sync/requester/swm-materialization-memo.js +54 -0
- package/dist/sync/requester/swm-materialization-memo.js.map +1 -0
- package/dist/sync/requester/swm-recovery.d.ts +3 -29
- package/dist/sync/requester/swm-recovery.d.ts.map +1 -1
- package/dist/sync/requester/swm-recovery.js +11 -10
- package/dist/sync/requester/swm-recovery.js.map +1 -1
- package/dist/sync/requester/swm-snapshot-materializer.d.ts.map +1 -1
- package/dist/sync/requester/swm-snapshot-materializer.js +18 -0
- package/dist/sync/requester/swm-snapshot-materializer.js.map +1 -1
- package/dist/sync/requester/swm-target-executor.d.ts +6 -0
- package/dist/sync/requester/swm-target-executor.d.ts.map +1 -1
- package/dist/sync/requester/swm-target-executor.js +24 -3
- package/dist/sync/requester/swm-target-executor.js.map +1 -1
- package/dist/sync/requester/verified-asset-preparation.d.ts +9 -0
- package/dist/sync/requester/verified-asset-preparation.d.ts.map +1 -0
- package/dist/sync/requester/verified-asset-preparation.js +190 -0
- package/dist/sync/requester/verified-asset-preparation.js.map +1 -0
- package/dist/sync/responder/asset-metadata.d.ts +18 -0
- package/dist/sync/responder/asset-metadata.d.ts.map +1 -0
- package/dist/sync/responder/asset-metadata.js +27 -0
- package/dist/sync/responder/asset-metadata.js.map +1 -0
- package/dist/sync/responder/durable-data-request-policy.d.ts +2 -16
- package/dist/sync/responder/durable-data-request-policy.d.ts.map +1 -1
- package/dist/sync/responder/durable-data-request-policy.js +1 -31
- package/dist/sync/responder/durable-data-request-policy.js.map +1 -1
- package/dist/sync/responder/exact-asset-export-cache.d.ts +89 -0
- package/dist/sync/responder/exact-asset-export-cache.d.ts.map +1 -0
- package/dist/sync/responder/exact-asset-export-cache.js +550 -0
- package/dist/sync/responder/exact-asset-export-cache.js.map +1 -0
- package/dist/sync/responder/exact-batch-stream.d.ts +47 -0
- package/dist/sync/responder/exact-batch-stream.d.ts.map +1 -0
- package/dist/sync/responder/exact-batch-stream.js +151 -0
- package/dist/sync/responder/exact-batch-stream.js.map +1 -0
- package/dist/sync/responder/exact-data-session.d.ts +67 -0
- package/dist/sync/responder/exact-data-session.d.ts.map +1 -0
- package/dist/sync/responder/exact-data-session.js +130 -0
- package/dist/sync/responder/exact-data-session.js.map +1 -0
- package/dist/sync/responder/exact-graph-cursor-filter.d.ts +9 -0
- package/dist/sync/responder/exact-graph-cursor-filter.d.ts.map +1 -0
- package/dist/sync/responder/exact-graph-cursor-filter.js +101 -0
- package/dist/sync/responder/exact-graph-cursor-filter.js.map +1 -0
- package/dist/sync/responder/exact-graph-reader.d.ts +95 -0
- package/dist/sync/responder/exact-graph-reader.d.ts.map +1 -0
- package/dist/sync/responder/exact-graph-reader.js +623 -0
- package/dist/sync/responder/exact-graph-reader.js.map +1 -0
- package/dist/sync/responder/exact-page-reader.d.ts +37 -0
- package/dist/sync/responder/exact-page-reader.d.ts.map +1 -0
- package/dist/sync/responder/exact-page-reader.js +130 -0
- package/dist/sync/responder/exact-page-reader.js.map +1 -0
- package/dist/sync/responder/graph-plan.d.ts +19 -85
- package/dist/sync/responder/graph-plan.d.ts.map +1 -1
- package/dist/sync/responder/graph-plan.js +51 -988
- package/dist/sync/responder/graph-plan.js.map +1 -1
- package/dist/sync/responder/page-framing-policy.d.ts +31 -0
- package/dist/sync/responder/page-framing-policy.d.ts.map +1 -0
- package/dist/sync/responder/page-framing-policy.js +41 -0
- package/dist/sync/responder/page-framing-policy.js.map +1 -0
- package/dist/sync/responder/responder-row-page.d.ts +85 -0
- package/dist/sync/responder/responder-row-page.d.ts.map +1 -0
- package/dist/sync/responder/responder-row-page.js +181 -0
- package/dist/sync/responder/responder-row-page.js.map +1 -0
- package/dist/sync/responder/row-serialization.d.ts +34 -0
- package/dist/sync/responder/row-serialization.d.ts.map +1 -0
- package/dist/sync/responder/row-serialization.js +69 -0
- package/dist/sync/responder/row-serialization.js.map +1 -0
- package/dist/sync/responder/session-plan-memo.d.ts +20 -0
- package/dist/sync/responder/session-plan-memo.d.ts.map +1 -0
- package/dist/sync/responder/session-plan-memo.js +135 -0
- package/dist/sync/responder/session-plan-memo.js.map +1 -0
- package/dist/sync/responder/sync-handler.d.ts +18 -1
- package/dist/sync/responder/sync-handler.d.ts.map +1 -1
- package/dist/sync/responder/sync-handler.js +101 -57
- package/dist/sync/responder/sync-handler.js.map +1 -1
- package/dist/sync/shared-memory-completion.d.ts +30 -0
- package/dist/sync/shared-memory-completion.d.ts.map +1 -1
- package/dist/sync/shared-memory-completion.js +13 -0
- package/dist/sync/shared-memory-completion.js.map +1 -1
- package/dist/sync/wire-compression.d.ts +47 -0
- package/dist/sync/wire-compression.d.ts.map +1 -0
- package/dist/sync/wire-compression.js +111 -0
- package/dist/sync/wire-compression.js.map +1 -0
- package/dist/unscoped-query-consistency.d.ts +12 -0
- package/dist/unscoped-query-consistency.d.ts.map +1 -1
- package/dist/unscoped-query-consistency.js +17 -1
- package/dist/unscoped-query-consistency.js.map +1 -1
- package/dist/vm-promotion-audit.d.ts +2 -2
- package/dist/vm-promotion-audit.d.ts.map +1 -1
- package/dist/vm-promotion-audit.js +26 -9
- package/dist/vm-promotion-audit.js.map +1 -1
- package/dist/vm-reconcile-dispatcher.d.ts +42 -1
- package/dist/vm-reconcile-dispatcher.d.ts.map +1 -1
- package/dist/vm-reconcile-dispatcher.js +103 -4
- package/dist/vm-reconcile-dispatcher.js.map +1 -1
- package/dist/vm-reconcile-peer-topology.d.ts +7 -9
- package/dist/vm-reconcile-peer-topology.d.ts.map +1 -1
- package/dist/vm-reconcile-peer-topology.js +1 -37
- package/dist/vm-reconcile-peer-topology.js.map +1 -1
- package/dist/vm-recovery-candidate-order.d.ts +16 -0
- package/dist/vm-recovery-candidate-order.d.ts.map +1 -0
- package/dist/vm-recovery-candidate-order.js +24 -0
- package/dist/vm-recovery-candidate-order.js.map +1 -0
- package/dist/vm-recovery-core-transport-preference.d.ts +69 -0
- package/dist/vm-recovery-core-transport-preference.d.ts.map +1 -0
- package/dist/vm-recovery-core-transport-preference.js +131 -0
- package/dist/vm-recovery-core-transport-preference.js.map +1 -0
- package/dist/vm-recovery-experiment-policy.d.ts +24 -0
- package/dist/vm-recovery-experiment-policy.d.ts.map +1 -0
- package/dist/vm-recovery-experiment-policy.js +18 -0
- package/dist/vm-recovery-experiment-policy.js.map +1 -0
- package/dist/vm-recovery-footprint.d.ts +54 -0
- package/dist/vm-recovery-footprint.d.ts.map +1 -1
- package/dist/vm-recovery-footprint.js +88 -24
- package/dist/vm-recovery-footprint.js.map +1 -1
- package/dist/vm-recovery-microbatch.d.ts +2 -0
- package/dist/vm-recovery-microbatch.d.ts.map +1 -1
- package/dist/vm-recovery-microbatch.js +7 -3
- package/dist/vm-recovery-microbatch.js.map +1 -1
- package/dist/vm-recovery-pass-authority.d.ts +84 -0
- package/dist/vm-recovery-pass-authority.d.ts.map +1 -0
- package/dist/vm-recovery-pass-authority.js +126 -0
- package/dist/vm-recovery-pass-authority.js.map +1 -0
- package/dist/vm-recovery-phase-timing.d.ts +75 -0
- package/dist/vm-recovery-phase-timing.d.ts.map +1 -0
- package/dist/vm-recovery-phase-timing.js +236 -0
- package/dist/vm-recovery-phase-timing.js.map +1 -0
- package/dist/vm-recovery-preparation.d.ts +143 -0
- package/dist/vm-recovery-preparation.d.ts.map +1 -0
- package/dist/vm-recovery-preparation.js +433 -0
- package/dist/vm-recovery-preparation.js.map +1 -0
- package/dist/vm-recovery-provider-policy.d.ts +13 -1
- package/dist/vm-recovery-provider-policy.d.ts.map +1 -1
- package/dist/vm-recovery-provider-policy.js +37 -5
- package/dist/vm-recovery-provider-policy.js.map +1 -1
- package/dist/vm-recovery-stream-profile.d.ts +15 -0
- package/dist/vm-recovery-stream-profile.d.ts.map +1 -0
- package/dist/vm-recovery-stream-profile.js +53 -0
- package/dist/vm-recovery-stream-profile.js.map +1 -0
- package/dist/vm-recovery-stream-setback-policy.d.ts +54 -0
- package/dist/vm-recovery-stream-setback-policy.d.ts.map +1 -0
- package/dist/vm-recovery-stream-setback-policy.js +85 -0
- package/dist/vm-recovery-stream-setback-policy.js.map +1 -0
- package/dist/vm-recovery-timing-observer.d.ts +27 -0
- package/dist/vm-recovery-timing-observer.d.ts.map +1 -0
- package/dist/vm-recovery-timing-observer.js +49 -0
- package/dist/vm-recovery-timing-observer.js.map +1 -0
- package/dist/vm-recovery-transport-budget-policy.d.ts +32 -0
- package/dist/vm-recovery-transport-budget-policy.d.ts.map +1 -0
- package/dist/vm-recovery-transport-budget-policy.js +55 -0
- package/dist/vm-recovery-transport-budget-policy.js.map +1 -0
- package/dist/vm-recovery-transport-plan.d.ts +83 -0
- package/dist/vm-recovery-transport-plan.d.ts.map +1 -0
- package/dist/vm-recovery-transport-plan.js +117 -0
- package/dist/vm-recovery-transport-plan.js.map +1 -0
- package/package.json +17 -9
- package/dist/finalization-annotations.d.ts +0 -5
- package/dist/finalization-annotations.d.ts.map +0 -1
- package/dist/finalization-annotations.js +0 -6
- package/dist/finalization-annotations.js.map +0 -1
- package/dist/swm-ka-bound.d.ts +0 -21
- package/dist/swm-ka-bound.d.ts.map +0 -1
- package/dist/swm-ka-bound.js +0 -36
- package/dist/swm-ka-bound.js.map +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { syncReconcilerEnabled, syncOnConnectEnabled, durableSyncEnabled } from './internal/lifecycle-sync-policy.js';
|
|
2
|
+
import { emptySwmRecoveryResult } from './sync/shared-memory-completion.js';
|
|
3
|
+
import { DurableSyncAdmissionBoundary } from './sync/requester/admission-boundary.js';
|
|
1
4
|
import { createRandomSamplingEligibilityResolver } from './random-sampling-eligibility.js';
|
|
2
5
|
import { RandomSamplingRuntime } from './random-sampling-runtime.js';
|
|
3
6
|
import { startAuthorityIndexSnapshotRuntime } from './authority-index-snapshot-runtime.js';
|
|
@@ -12,10 +15,11 @@ import { startAuthorityIndexSnapshotRuntime } from './authority-index-snapshot-r
|
|
|
12
15
|
import { traverseBoundedCuratorRoster, curatorRosterResolution, } from './bounded-curator-roster-traversal.js';
|
|
13
16
|
import { setTimeout as waitForPeerEventTurn } from 'node:timers/promises';
|
|
14
17
|
import { PeerSyncSession } from './sync/peer-sync-session.js';
|
|
18
|
+
import { captureExactBatchStreamRefusalScope } from './sync/exact-batch-stream-capability.js';
|
|
15
19
|
import { createStorageACKRegistrationPlan } from './p2p/storage-ack-registrar.js';
|
|
16
20
|
import { syncOpenedPeerConnection } from './sync/peer-connection.js';
|
|
17
21
|
import { isLegacySyncGraphCandidateV1 } from './sync/legacy-sync-graph-candidate.js';
|
|
18
|
-
import { ProtocolRouter, GossipSubManager, DKGEvent, LibP2PNetwork, PeerResolver, StubNetworkStateRegistry, PROTOCOL_ACCESS, PROTOCOL_PUBLISH, PROTOCOL_SYNC, PROTOCOL_SYNC_POOLED, PROTOCOL_SYNC_CHANGELOG, PROTOCOL_QUERY_REMOTE, PROTOCOL_GET_CIPHERTEXT_CHUNK, PROTOCOL_VERIFY_PROPOSAL, PROTOCOL_JOIN_REQUEST, PROTOCOL_NETWORK_IDENTITY, advertisesSyncProtocol, PROTOCOL_SWM_SENDER_KEY, PROTOCOL_SWM_UPDATE, PROTOCOL_SWM_SHARE_ACK, PROTOCOL_SWM_HOST_CATCHUP, PROTOCOL_MESSAGE, contextGraphDataGraphUri, contextGraphMetaGraphUri, contextGraphWorkspaceMetaGraphUri, contextGraphMetaUri, deriveCuratorDidFromCgId, SYSTEM_CONTEXT_GRAPHS, DKG_ONTOLOGY, GRAPH_KA_CONTENT_SCOPE_VERSION, validateSubGraphName, createOperationContext, isSafeIri, QuietRetryableHandlerError, InMemoryMessageIdempotencyStore, InMemoryProtocolOutboxStore, assertBoundedProtocolOutboxStore, tripleContentV10, withRetry, } from '@origintrail-official/dkg-core';
|
|
22
|
+
import { ProtocolRouter, GossipSubManager, DKGEvent, registerExperimentalExactBatchResponder, LibP2PNetwork, PeerResolver, StubNetworkStateRegistry, PROTOCOL_ACCESS, PROTOCOL_PUBLISH, PROTOCOL_SYNC, PROTOCOL_SYNC_POOLED, PROTOCOL_SYNC_CHANGELOG, PROTOCOL_QUERY_REMOTE, PROTOCOL_GET_CIPHERTEXT_CHUNK, PROTOCOL_VERIFY_PROPOSAL, PROTOCOL_JOIN_REQUEST, PROTOCOL_NETWORK_IDENTITY, advertisesSyncProtocol, PROTOCOL_SWM_SENDER_KEY, PROTOCOL_SWM_UPDATE, PROTOCOL_SWM_SHARE_ACK, PROTOCOL_SWM_HOST_CATCHUP, PROTOCOL_MESSAGE, contextGraphDataGraphUri, contextGraphMetaGraphUri, contextGraphWorkspaceMetaGraphUri, contextGraphMetaUri, deriveCuratorDidFromCgId, SYSTEM_CONTEXT_GRAPHS, DKG_ONTOLOGY, GRAPH_KA_CONTENT_SCOPE_VERSION, validateSubGraphName, createOperationContext, isSafeIri, QuietRetryableHandlerError, InMemoryMessageIdempotencyStore, InMemoryProtocolOutboxStore, assertBoundedProtocolOutboxStore, tripleContentV10, withRetry, } from '@origintrail-official/dkg-core';
|
|
19
23
|
import { GraphManager, asChangelogReader } from '@origintrail-official/dkg-storage';
|
|
20
24
|
import { readChangelogDeltaPage } from './sync/responder/graph-plan.js';
|
|
21
25
|
import { decodeChangelogRequest, encodeChangelogResponse } from './sync/changelog/wire.js';
|
|
@@ -54,6 +58,7 @@ import { deleteSyncPageCheckpoint, fetchSyncPages, SyncPageSizeProfileCache, } f
|
|
|
54
58
|
import { composeSyncWorkAdmission, createSyncFetchSharingIdentity, } from './sync/work-admission.js';
|
|
55
59
|
import { createChallengePinnedExactAssetSelection, createUalOnlyExactAssetSelection, exactAssetUalsForSelection, exactAssetFilterKey, exactSyncPhaseAccumulationLimits, requireExactAssetSelection, } from './sync/exact-assets.js';
|
|
56
60
|
import { runOversizeSweep } from './sync/oversize-sweep.js';
|
|
61
|
+
import { EXACT_SYNC_GZIP_ENCODING, resolveExactSyncGzipProfile } from './sync/wire-compression.js';
|
|
57
62
|
import { MemorySyncCheckpointStore, } from './sync/checkpoint/state.js';
|
|
58
63
|
import { DurableRecoveryRunner, } from './sync/durable-recovery-runner.js';
|
|
59
64
|
import { createDurableSyncBudget, createDurableSyncFetchTimeoutMs, DURABLE_SYNC_SETTLEMENT_HEADROOM_MS, EXACT_RECOVERY_DURABLE_TRANSFER_TIMEOUT_MS, normalizeDurableSyncTimeoutMs, } from './sync/requester/durable-sync-budget.js';
|
|
@@ -63,23 +68,26 @@ import { mergeExactAssetResponderCapability, mergeExactDurableFetchDisposition,
|
|
|
63
68
|
import { resolveSyncAgentsMeta, shouldWithholdAgentsDurableMeta } from './sync/agents-meta-policy.js';
|
|
64
69
|
import { createSelectedSwmMetaRetentionBudget, } from './sync/selected-swm-meta-budget.js';
|
|
65
70
|
import { sharedMemoryOwnershipKeyFromGraph, } from './sync/requester/shared-memory-sync.js';
|
|
66
|
-
import { emptySharedMemorySyncResult
|
|
71
|
+
import { emptySharedMemorySyncResult, mergeSamePeerSharedMemoryDiagnostics, mergeFleetSharedMemoryDiagnostics, recordSharedMemoryPhaseFailure, } from './sync/shared-memory-diagnostics.js';
|
|
67
72
|
import { createSelectedSwmMetaFetcher, } from './sync/selected-swm-meta-fetcher.js';
|
|
68
73
|
import { runOrderedContextGraphSyncs, } from './sync/requester/ordered-sync.js';
|
|
69
74
|
import { registerSyncHandler, resolveSyncResponderSnapshotPolicy, } from './sync/responder/sync-handler.js';
|
|
75
|
+
import { createExactBatchResponderBinding } from './sync/responder/exact-batch-stream.js';
|
|
76
|
+
import { exactBatchTransportOptions } from './sync/requester/exact-batch-stream.js';
|
|
77
|
+
import { runExactBatchStreamDriver } from './sync/requester/exact-batch-stream-driver.js';
|
|
70
78
|
import { runSelectedSharedMemoryRetry, runRegistrySyncOnConnect, SyncOnConnectPostSyncError, } from './sync/on-connect/sync-on-connect.js';
|
|
71
79
|
import { captureSyncOnConnectAttempt, } from './sync/on-connect/attempt-accounting.js';
|
|
72
80
|
import { ReconciledSyncOnConnectPeerJobRunner } from './sync/on-connect/peer-job-runner.js';
|
|
73
81
|
import { formatPrivateRecoverySkip, planPrivateRecoverySource, } from './sync/private-recovery-source-planner.js';
|
|
74
82
|
import { mapWithConcurrency } from './map-with-concurrency.js';
|
|
75
83
|
import { CATCHUP_MAX_CONCURRENT_PEER_SYNCS } from './sync/catchup-concurrency.js';
|
|
76
|
-
import { FOREGROUND_CATCHUP_SYNC_PRIORITY, catchupAdmissionSource, runCatchupPlaneWithPolicy, runCatchupPlanesWithPolicy, } from './sync/catchup-policy.js';
|
|
84
|
+
import { FOREGROUND_CATCHUP_SYNC_PRIORITY, VM_RECOVERY_SYNC_PRIORITY, catchupAdmissionSource, runCatchupPlaneWithPolicy, runCatchupPlanesWithPolicy, } from './sync/catchup-policy.js';
|
|
77
85
|
import { SwmCatchupPassTracker, catchupPassNowMs, resolveSwmCatchupPassConfig, runSwmCatchupContinuations, } from './sync/catchup-pass-policy.js';
|
|
78
86
|
import { runSelectedSwmContinuations, } from './sync/selected-swm-continuation.js';
|
|
79
87
|
import { projectRfc64SelectedSwmGraphSyncStatus, } from './sync/selected-swm-graph-sync-status.js';
|
|
80
88
|
import { applySelectedSwmFreshnessResolution, } from './sync/shared-memory-freshness.js';
|
|
81
89
|
import { classifyDurableProgress, createDurableSyncAccumulator, createFailedPeerDurableSyncResult, createIncompleteDurableSyncResult, durableSyncAccumulatorHasPeerTransportFailure, durableSyncAccumulatorHasTerminalBoundary, durableSyncAccumulatorFromResult, finalizeDurableSyncCompletion, markDurableTerminalBoundary, mergeDurableSyncAccumulatorInto, mergeDurableSyncResultIntoAccumulator, recordDurableSyncDiagnostics, } from './sync/durable-progress.js';
|
|
82
|
-
import { getSyncBackpressureSnapshot, getSyncBackpressureBusyError,
|
|
90
|
+
import { getSyncBackpressureSnapshot, getSyncBackpressureBusyError, resolveExactBatchStreamEnabled, resolveSyncGlobalBackpressure, syncAdmissionWouldBeRefused, withGlobalSyncBackpressure, } from './sync/backpressure.js';
|
|
83
91
|
import { contextGraphPriority, countSyncPriorityClasses, normalizeSyncAdmissionSource, orderContextGraphIdsByPriority, syncPriorityClass, } from './sync/policy.js';
|
|
84
92
|
import { automaticDurableSyncContextGraphs, systemContextGraphSyncOptionsOf, } from './sync/system-context-graph-policy.js';
|
|
85
93
|
import { activeSyncAdmissionSource, monotonicNowMs, recordSyncAttempt, recordSyncAttemptRequestBytes, recordSyncAttemptResponseBytes, recordSyncOperationDuration, recordSyncOperationRejected, recordSyncSingleFlightJoin, syncAttemptAttributes, syncOperationRejectionReason, withSyncAdmissionSource, } from './sync/attempt-telemetry.js';
|
|
@@ -189,6 +197,7 @@ import { normalizeAgentDid, inferAdapterPublisherAddress, } from './dkg-agent-he
|
|
|
189
197
|
import { DKGAgentBase } from './dkg-agent-base.js';
|
|
190
198
|
import { VmReconcileShutdownTimeoutError } from './vm-reconcile-service.js';
|
|
191
199
|
import { ContextGraphMembershipPersistShutdownTimeoutError } from './context-graph-membership-persist-scheduler.js';
|
|
200
|
+
import { ContextGraphSubscriptionPersistShutdownTimeoutError } from './context-graph-subscription-persist-scheduler.js';
|
|
192
201
|
import { createLocalContextGraphOriginMembershipRecord, } from './local-context-graph-provenance.js';
|
|
193
202
|
import { contextGraphReadAuthorityDependencyOf, unavailableContextGraphReadAuthorityDecision, } from './context-graph-read-authority.js';
|
|
194
203
|
import { deterministicStartupJitterMs, scheduleAfterStartupJitter } from './startup-jitter.js';
|
|
@@ -199,34 +208,11 @@ import { isRfc64PrivateRecoveryOwnerV1, resolveRfc64PrivateRecoveryContextGraphI
|
|
|
199
208
|
import { CONTEXT_GRAPH_AUTHORITY_RPC_SITES as CG_AUTH_RPC_SITES, withRpcUsageSite, } from '@origintrail-official/dkg-chain';
|
|
200
209
|
import { rfc64ExecutionPlanAllowsLegacySyncV1, resolveRfc64RuntimeCatalogBootstrapConfigV1, } from './rfc64/public-catalog-activation-config-v1.js';
|
|
201
210
|
import { reconcileRfc64CatalogAuthorityPlanV1 } from './rfc64/catalog-rollout-authority-reconciliation-v1.js';
|
|
202
|
-
import { initializeRfc64LegacySwmBoundaryV1, prepareRfc64LateLegacySwmBoundaryV1, } from './rfc64/legacy-swm-boundary-v1.js';
|
|
211
|
+
import { initializeRfc64LegacySwmBoundaryV1, prepareRfc64LateLegacySwmBoundaryV1, retireRfc64LegacySwmAfterFinalizedVmV1, } from './rfc64/legacy-swm-boundary-v1.js';
|
|
212
|
+
import { projectPersistedJoinApprovals, } from './join-approval-restart-projection.js';
|
|
213
|
+
import { verifiedCuratorDialAddress } from './curator-dial-address.js';
|
|
203
214
|
const DEFAULT_HOST_MODE_RECONCILE_JITTER_RATIO = 0.15;
|
|
204
215
|
const RFC64_SELECTED_SWM_ADMISSION_PRIORITY = 2_000;
|
|
205
|
-
function projectPersistedJoinApprovals(persistedMembershipRows, persistedContextGraphIds, localAgentAddresses) {
|
|
206
|
-
const newestApprovalByContextGraph = new Map();
|
|
207
|
-
for (const membership of persistedMembershipRows) {
|
|
208
|
-
const principalId = membership.principalId.toLowerCase();
|
|
209
|
-
if (membership.principalType !== 'agent' ||
|
|
210
|
-
membership.status !== 'active' ||
|
|
211
|
-
membership.source !== 'join-approved' ||
|
|
212
|
-
!persistedContextGraphIds.has(membership.contextGraphId) ||
|
|
213
|
-
!localAgentAddresses.has(principalId)) {
|
|
214
|
-
continue;
|
|
215
|
-
}
|
|
216
|
-
const existing = newestApprovalByContextGraph.get(membership.contextGraphId);
|
|
217
|
-
if (!existing || membership.updatedAt > existing.updatedAt) {
|
|
218
|
-
newestApprovalByContextGraph.set(membership.contextGraphId, {
|
|
219
|
-
principalId,
|
|
220
|
-
updatedAt: membership.updatedAt,
|
|
221
|
-
curatorPeerId: typeof membership.metadata?.['curatorPeerId'] === 'string' &&
|
|
222
|
-
membership.metadata['curatorPeerId'].trim()
|
|
223
|
-
? membership.metadata['curatorPeerId'].trim()
|
|
224
|
-
: undefined,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return newestApprovalByContextGraph;
|
|
229
|
-
}
|
|
230
216
|
function resolveAgentSyncGlobalBackpressure(config) {
|
|
231
217
|
// `trackSyncContextGraph()` mutates this list when an Edge explicitly
|
|
232
218
|
// subscribes or starts a foreground catch-up. Those operator-selected graphs
|
|
@@ -427,6 +413,8 @@ function syncPageFetchCoalescingKey(params) {
|
|
|
427
413
|
params.assetUals === undefined ? null : exactAssetFilterKey(params.assetUals),
|
|
428
414
|
params.returnAcceptedPrefixOnRetryableTransportFailure === true,
|
|
429
415
|
params.requesterScope ?? null,
|
|
416
|
+
params.responseEncoding ?? null,
|
|
417
|
+
params.maxAcceptedBytes ?? null,
|
|
430
418
|
params.maxAcceptedQuads ?? null,
|
|
431
419
|
params.maxAcceptedHeapBytesEstimate ?? null,
|
|
432
420
|
]);
|
|
@@ -514,12 +502,14 @@ function contextGraphCatchupSingleFlightKey(params) {
|
|
|
514
502
|
function durableSyncSingleFlightKey(params) {
|
|
515
503
|
if (params.hasPhaseCallback
|
|
516
504
|
|| params.hasAtomicCommitCallback
|
|
505
|
+
|| params.hasWorkStartedCallback
|
|
517
506
|
|| params.hasAccessDeniedCallback
|
|
518
507
|
|| params.hasSinceBatchIdResolver
|
|
519
508
|
|| params.hasSignal
|
|
520
509
|
|| params.hasCurrentFence
|
|
521
510
|
|| params.hasChallengePinnedSelection
|
|
522
|
-
|| params.hasForcedFreshExactSession
|
|
511
|
+
|| params.hasForcedFreshExactSession
|
|
512
|
+
|| params.hasRegisteredPublicEvidence) {
|
|
523
513
|
return null;
|
|
524
514
|
}
|
|
525
515
|
return syncSingleFlightKey('durable-sync', {
|
|
@@ -531,6 +521,7 @@ function durableSyncSingleFlightKey(params) {
|
|
|
531
521
|
syncAgentsMeta: params.syncAgentsMeta,
|
|
532
522
|
exactAssetUals: params.exactAssetUals ?? null,
|
|
533
523
|
settlementSliceTimeoutMs: params.settlementSliceTimeoutMs ?? null,
|
|
524
|
+
exactRecoveryTransportMode: params.exactRecoveryTransportMode ?? 'stream-preferred',
|
|
534
525
|
priority: params.priority ?? null,
|
|
535
526
|
});
|
|
536
527
|
}
|
|
@@ -831,42 +822,16 @@ async function authenticateDurableGraphScopedAsset(params) {
|
|
|
831
822
|
signal?.removeEventListener('abort', abortFromOperation);
|
|
832
823
|
}
|
|
833
824
|
}
|
|
834
|
-
function sameStringArray(a, b) {
|
|
835
|
-
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
836
|
-
}
|
|
837
|
-
function syncReconcilerEnabled(config) {
|
|
838
|
-
return resolveSyncReconcilerEnabled(config.syncReconcilerEnabled);
|
|
839
|
-
}
|
|
840
|
-
function syncOnConnectEnabled(config) {
|
|
841
|
-
return resolveBooleanSwitch(config.syncOnConnectEnabled, 'DKG_SYNC_ON_CONNECT_ENABLED', true);
|
|
842
|
-
}
|
|
843
|
-
function durableSyncEnabled(config) {
|
|
844
|
-
return resolveBooleanSwitch(config.durableSyncEnabled, 'DKG_DURABLE_SYNC_ENABLED', true);
|
|
845
|
-
}
|
|
846
825
|
/** OT-RFC-59 responder cap on the peer-controlled raw-scan limit (DoS bound). Honest
|
|
847
826
|
* requesters send SYNC_PAGE_SIZE (500); the headroom tolerates larger legitimate pages. */
|
|
848
827
|
const CHANGELOG_MAX_SCAN_LIMIT = 2000;
|
|
849
|
-
function
|
|
850
|
-
return
|
|
851
|
-
}
|
|
852
|
-
function mergeSharedMemorySyncResults(a, b) {
|
|
853
|
-
return {
|
|
854
|
-
...mergeSamePeerSharedMemoryDiagnostics(a, b),
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
function emptySwmRecoveryResult() {
|
|
858
|
-
return {
|
|
859
|
-
replacedRoots: 0,
|
|
860
|
-
replacedGraphs: 0,
|
|
861
|
-
insertedDataQuads: 0,
|
|
862
|
-
insertedMetaQuads: 0,
|
|
863
|
-
droppedDataTriples: 0,
|
|
864
|
-
readySnapshots: 0,
|
|
865
|
-
totalSnapshots: 0,
|
|
866
|
-
completed: true,
|
|
867
|
-
};
|
|
828
|
+
function sameStringArray(a, b) {
|
|
829
|
+
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
868
830
|
}
|
|
869
831
|
export class LifecycleSyncMethods extends DKGAgentBase {
|
|
832
|
+
async retireLegacySwmAfterVerifiedVmTwin(input) {
|
|
833
|
+
await retireRfc64LegacySwmAfterFinalizedVmV1(this, input.contextGraphId, input.kaUal, String(input.assertionVersion), input.subGraphName);
|
|
834
|
+
}
|
|
870
835
|
async retireFinalizedSwmTwinCandidate(candidate, ctx) {
|
|
871
836
|
await this.publisher.clearPublishedKnowledgeAssetSwm(candidate.contextGraphId, {
|
|
872
837
|
kind: 'named-lifecycle',
|
|
@@ -949,6 +914,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
949
914
|
// lanes, and the changelog lane's legacy `runResync` fallback) reports
|
|
950
915
|
// its attempts and bytes under this label without carrying it as a
|
|
951
916
|
// parameter, so it can never reach a coalescing key.
|
|
917
|
+
admission.onWorkStarted?.();
|
|
952
918
|
return await withSyncAdmissionSource(source, work);
|
|
953
919
|
}
|
|
954
920
|
catch (error) {
|
|
@@ -1017,6 +983,20 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1017
983
|
admissionBoundary.dispose();
|
|
1018
984
|
}
|
|
1019
985
|
}
|
|
986
|
+
/**
|
|
987
|
+
* Whether this node's sync admission would take an exact VM recovery fetch
|
|
988
|
+
* for the graph right now. A read of the limiter: nothing is claimed or
|
|
989
|
+
* queued, and the fetch must still handle a refusal.
|
|
990
|
+
*/
|
|
991
|
+
vmRecoverySyncAdmissionAvailable(contextGraphId) {
|
|
992
|
+
return !syncAdmissionWouldBeRefused(resolveAgentSyncGlobalBackpressure(this.config), {
|
|
993
|
+
contextGraphId,
|
|
994
|
+
lane: 'durable',
|
|
995
|
+
priority: VM_RECOVERY_SYNC_PRIORITY,
|
|
996
|
+
priorityClass: syncPriorityClass(VM_RECOVERY_SYNC_PRIORITY),
|
|
997
|
+
source: 'vm-recovery',
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1020
1000
|
async start() {
|
|
1021
1001
|
if (this.vmReconcileShutdownBlocked) {
|
|
1022
1002
|
throw new VmReconcileShutdownTimeoutError(DKGAgentBase.VM_RECONCILE_SHUTDOWN_TIMEOUT_MS);
|
|
@@ -1024,6 +1004,9 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1024
1004
|
if (this.contextGraphMembershipPersistenceShutdownBlocked) {
|
|
1025
1005
|
throw new ContextGraphMembershipPersistShutdownTimeoutError(DKGAgentBase.CONTEXT_GRAPH_MEMBERSHIP_PERSIST_SHUTDOWN_TIMEOUT_MS);
|
|
1026
1006
|
}
|
|
1007
|
+
if (this.contextGraphSubscriptionPersistenceShutdownBlocked) {
|
|
1008
|
+
throw new ContextGraphSubscriptionPersistShutdownTimeoutError(DKGAgentBase.CONTEXT_GRAPH_SUBSCRIPTION_PERSIST_SHUTDOWN_TIMEOUT_MS);
|
|
1009
|
+
}
|
|
1027
1010
|
if (this.started)
|
|
1028
1011
|
return;
|
|
1029
1012
|
this.storageACKRegistrationRuntime.retireCurrentGeneration();
|
|
@@ -1042,6 +1025,9 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1042
1025
|
await this.contextGraphSubscriptionRehydrationPromotionRuntime?.close();
|
|
1043
1026
|
this.rfc64BackgroundWorkDispatcherV1.reopen();
|
|
1044
1027
|
this.contextGraphMembershipPersistence.reopen();
|
|
1028
|
+
// stop() drained and closed subscription writes; a restarted agent admits
|
|
1029
|
+
// them again. Writes issued before the first start() left it open.
|
|
1030
|
+
this.contextGraphSubscriptionPersistence.reopenIfClosed();
|
|
1045
1031
|
// stop() aborts detached cold authority flights; a restarted agent admits
|
|
1046
1032
|
// new ones (the runtime is created lazily on first use otherwise).
|
|
1047
1033
|
peekFinalizedAuthorityColdResolution(this)?.reopen();
|
|
@@ -1348,11 +1334,17 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1348
1334
|
this.messenger.setOutboxResponseHandler(PROTOCOL_JOIN_REQUEST, async (result) => {
|
|
1349
1335
|
await this.handleJoinRequestOutboxResponse(result);
|
|
1350
1336
|
});
|
|
1337
|
+
// Snapshot live intent before any durable read or detached persistence
|
|
1338
|
+
// completion. Durable rows claim their part of this startup plan below.
|
|
1339
|
+
const liveIntents = [...this.subscribedContextGraphs].filter(([, subscription]) => subscription.subscribed && !subscription.pendingMeta);
|
|
1351
1340
|
this.gossip = new GossipSubManager(this.node, this.eventBus, {
|
|
1352
1341
|
networkId: this.config.networkIdentity?.networkId,
|
|
1353
1342
|
chainId: this.config.networkIdentity?.chainId,
|
|
1354
1343
|
isPeerAccepted: (peerId) => this.networkAdmissionCoordinator.isAcceptedPeer(peerId),
|
|
1355
1344
|
});
|
|
1345
|
+
for (const [id, subscription] of liveIntents) {
|
|
1346
|
+
this.gossipSession.startupLiveIntents.set(id, { syncMode: subscription.syncMode });
|
|
1347
|
+
}
|
|
1356
1348
|
await this.loadSwmSenderKeyState();
|
|
1357
1349
|
await this.initializeSwmHostModeStore();
|
|
1358
1350
|
await this.rehydrateContextGraphsFromDurableState();
|
|
@@ -1956,6 +1948,28 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1956
1948
|
peerId: this.peerId,
|
|
1957
1949
|
parseSyncRequest: this.parseSyncRequest.bind(this),
|
|
1958
1950
|
authorizeSyncRequest: this.authorizeSyncRequest.bind(this),
|
|
1951
|
+
onExperimentalExactBatchResources: resolveExactBatchStreamEnabled()
|
|
1952
|
+
&& this.config.nodeRole === 'core'
|
|
1953
|
+
? (resources) => {
|
|
1954
|
+
const binding = createExactBatchResponderBinding({
|
|
1955
|
+
localPeerId: this.peerId,
|
|
1956
|
+
store: this.store,
|
|
1957
|
+
exportCache: resources.exportCache,
|
|
1958
|
+
admission: resources,
|
|
1959
|
+
parseSyncRequest: this.parseSyncRequest.bind(this),
|
|
1960
|
+
authorizeSyncRequest: this.authorizeSyncRequest.bind(this),
|
|
1961
|
+
isPublicContextGraph: async (cg, signal) => (await this.resolveRegisteredContextGraphAuthority(cg, {
|
|
1962
|
+
authorityReadMode: 'finalized-index-or-live', signal,
|
|
1963
|
+
})).kind === 'public',
|
|
1964
|
+
servingWithheld: (cg) => this.contextGraphServingWithheld(cg),
|
|
1965
|
+
onExport: (assetIndex, wholePayloadExports, operationContext) => this.log.info(operationContext, `Exact batch responder export asset=${assetIndex} wholePayloadExports=${wholePayloadExports}`),
|
|
1966
|
+
onPayload: (assetIndex, plainBytes, encodedBytes, operationContext) => this.log.info(operationContext, `Exact batch responder payload asset=${assetIndex} plainBytes=${plainBytes} encodedBytes=${encodedBytes}`),
|
|
1967
|
+
onFallback: (reason, assetIndex, operationContext, budgetReason) => this.log.info(operationContext, `Exact batch responder refusal asset=${assetIndex} reason=${reason}${budgetReason ? ` budgetReason=${budgetReason}` : ''}`),
|
|
1968
|
+
onStage: (stage, assetIndex, durationMs, operationContext) => this.log.info(operationContext, `Exact batch responder stage=${stage} asset=${assetIndex} durationMs=${durationMs.toFixed(3)}`),
|
|
1969
|
+
});
|
|
1970
|
+
registerExperimentalExactBatchResponder(this.router, exactBatchTransportOptions(120_000), binding.authorizeRequest, binding.respond);
|
|
1971
|
+
}
|
|
1972
|
+
: undefined,
|
|
1959
1973
|
// Serve-skip policy (#1233): withhold the no-consumer agents/_meta snapshot
|
|
1960
1974
|
// unless the operator opts in. This is the env boundary — the pure
|
|
1961
1975
|
// `shouldWithholdAgentsDurableMeta` resolver is called directly with a FRESH
|
|
@@ -1964,6 +1978,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
1964
1978
|
shouldWithholdDurableMeta: (contextGraphId) => shouldWithholdAgentsDurableMeta(contextGraphId, process.env.DKG_SERVE_AGENTS_META),
|
|
1965
1979
|
servingWithheld: (contextGraphId) => this.contextGraphServingWithheld(contextGraphId),
|
|
1966
1980
|
logWarn: (ctx, message) => this.log.warn(ctx, message),
|
|
1981
|
+
logInfo: (ctx, message) => this.log.info(ctx, message),
|
|
1967
1982
|
logDebug: (ctx, message) => this.log.debug(ctx, message),
|
|
1968
1983
|
snapshotBudget: snapshotPolicy.budget,
|
|
1969
1984
|
contextGraphPriorities: this.config.syncContextGraphPriorities,
|
|
@@ -2069,7 +2084,16 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
2069
2084
|
role: 'participant',
|
|
2070
2085
|
status: 'active',
|
|
2071
2086
|
source: 'join-approved',
|
|
2072
|
-
metadata: {
|
|
2087
|
+
metadata: {
|
|
2088
|
+
curatorPeerId: peerId.toString(),
|
|
2089
|
+
// The approved sender's own listener address is a durable
|
|
2090
|
+
// transport hint. An inbound remoteAddr can be an ephemeral
|
|
2091
|
+
// source port, so it is never persisted for restart dialing.
|
|
2092
|
+
...(() => {
|
|
2093
|
+
const address = verifiedCuratorDialAddress(payload.curatorDialAddress, peerId.toString());
|
|
2094
|
+
return address ? { curatorDialAddress: address } : {};
|
|
2095
|
+
})(),
|
|
2096
|
+
},
|
|
2073
2097
|
};
|
|
2074
2098
|
// Commit the restart contract before changing live subscription
|
|
2075
2099
|
// state. The two stores do not expose a shared transaction, so the
|
|
@@ -2333,6 +2357,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
2333
2357
|
for (const systemContextGraph of [SYSTEM_CONTEXT_GRAPHS.AGENTS, SYSTEM_CONTEXT_GRAPHS.ONTOLOGY]) {
|
|
2334
2358
|
this.subscribeToContextGraph(systemContextGraph, { syncMode: 'always-on' });
|
|
2335
2359
|
}
|
|
2360
|
+
this.applyStartupContextGraphGossipPlan();
|
|
2336
2361
|
// Connect to bootstrap peers
|
|
2337
2362
|
if (this.config.bootstrapPeers) {
|
|
2338
2363
|
for (const addr of this.config.bootstrapPeers) {
|
|
@@ -2549,6 +2574,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
2549
2574
|
// this is now the only outbox tick — chat (PR-3) and every
|
|
2550
2575
|
// future migrated protocol drain on the same cadence so
|
|
2551
2576
|
// operators see a single "outbox tick" beat.
|
|
2577
|
+
let senderKeyRetryInFlight = false;
|
|
2552
2578
|
this.messengerOutboxTimer = setInterval(() => {
|
|
2553
2579
|
const now = Date.now();
|
|
2554
2580
|
this.messenger.processOutboxTick(now)
|
|
@@ -2564,6 +2590,25 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
2564
2590
|
`msgId=${entry.messageId.slice(0, 8)} lastError="${entry.lastError}"`);
|
|
2565
2591
|
}
|
|
2566
2592
|
});
|
|
2593
|
+
// A retryable ACK is a delivered Messenger response, so it has no
|
|
2594
|
+
// outbox obligation. The sender-key queue owns that retry and must
|
|
2595
|
+
// progress even if both peers stay connected and no further share is
|
|
2596
|
+
// published. Keep one pass in flight and reuse its current-authority
|
|
2597
|
+
// recipient check before every resend.
|
|
2598
|
+
if (!senderKeyRetryInFlight && this.pendingSenderKeyByAgent.size > 0) {
|
|
2599
|
+
senderKeyRetryInFlight = true;
|
|
2600
|
+
void this.drainPendingSenderKeysForConnectedPeers()
|
|
2601
|
+
.then((drained) => {
|
|
2602
|
+
if (drained > 0) {
|
|
2603
|
+
this.log.info(ctx, `Sender-key retry delivered ${drained} pending package(s)`);
|
|
2604
|
+
}
|
|
2605
|
+
})
|
|
2606
|
+
.catch((err) => {
|
|
2607
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2608
|
+
this.log.warn(ctx, `Sender-key retry tick failed: ${message}`);
|
|
2609
|
+
})
|
|
2610
|
+
.finally(() => { senderKeyRetryInFlight = false; });
|
|
2611
|
+
}
|
|
2567
2612
|
}, MESSAGE_OUTBOX_TICK_MS);
|
|
2568
2613
|
if (this.messengerOutboxTimer.unref)
|
|
2569
2614
|
this.messengerOutboxTimer.unref();
|
|
@@ -2817,6 +2862,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
2817
2862
|
this.warmedCores.delete(remotePeer);
|
|
2818
2863
|
this.warmCoreFailedUnpins.delete(remotePeer);
|
|
2819
2864
|
this.vmReconcileExactPeerCapabilities?.delete(remotePeer);
|
|
2865
|
+
this.vmReconcilePublicCoreTransportPreferencePolicy?.forgetPeer(remotePeer);
|
|
2820
2866
|
}
|
|
2821
2867
|
queueSelectedSwmFromPeerOnConnect(remotePeer, handleSyncError, delayMs = 3000) {
|
|
2822
2868
|
const selectedContextGraphIds = this.selectedSwmBootstrapContextGraphIdsForPeer(remotePeer);
|
|
@@ -3776,8 +3822,10 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3776
3822
|
return result.insertedTriples;
|
|
3777
3823
|
}
|
|
3778
3824
|
/** One agent-owned admission decision for the legacy shared-memory lane. */
|
|
3779
|
-
canUseLegacySharedMemorySyncForContextGraphV1(contextGraphId) {
|
|
3780
|
-
|
|
3825
|
+
async canUseLegacySharedMemorySyncForContextGraphV1(contextGraphId) {
|
|
3826
|
+
// The private predicate verifies local membership and current lane authority.
|
|
3827
|
+
return this.rfc64LegacySwmGossipAllowedForContextGraph(contextGraphId)
|
|
3828
|
+
|| await this.rfc64PrivateRootSwmOnLegacyLaneV1(contextGraphId) === true;
|
|
3781
3829
|
}
|
|
3782
3830
|
/** One agent-owned admission decision for the legacy durable VM lane. */
|
|
3783
3831
|
async canUseLegacyDurableSyncForContextGraphV1(contextGraphId) {
|
|
@@ -3861,6 +3909,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3861
3909
|
return (await LifecycleSyncMethods.prototype.runLegacyDurableSyncDetailed.call(this, ctx, remotePeerId, contextGraphIds, onPhase, onAccessDenied, sinceBatchIdFor, options)).result;
|
|
3862
3910
|
}
|
|
3863
3911
|
async runLegacyDurableSyncDetailed(ctx, remotePeerId, contextGraphIds, onPhase, onAccessDenied, sinceBatchIdFor, options) {
|
|
3912
|
+
const admissionBoundary = new DurableSyncAdmissionBoundary(options?.onWorkStarted);
|
|
3864
3913
|
const syncAgentsMeta = resolveSyncAgentsMeta(this.config.syncAgentsMeta, process.env.DKG_SYNC_AGENTS_META);
|
|
3865
3914
|
const stopOnBackoffWorthyFailure = options?.stopOnBackoffWorthyFailure;
|
|
3866
3915
|
const exactAssetSelection = options?.exactAssetSelection;
|
|
@@ -3886,6 +3935,10 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3886
3935
|
let exactFetchDisposition;
|
|
3887
3936
|
let exactResponderCapability;
|
|
3888
3937
|
const authenticatedExactAssets = [];
|
|
3938
|
+
const committedExactAssetUals = [];
|
|
3939
|
+
// What the stream established about this peer for one graph. A run over
|
|
3940
|
+
// several graphs has no single answer, so it reports none.
|
|
3941
|
+
let exactStreamOutcome;
|
|
3889
3942
|
const markExactFetchIncomplete = () => {
|
|
3890
3943
|
if (exactAssetUals === undefined)
|
|
3891
3944
|
return;
|
|
@@ -3907,6 +3960,8 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3907
3960
|
fetchTimeoutMs,
|
|
3908
3961
|
exactAssetSelection,
|
|
3909
3962
|
forceFreshExactSession: options?.forceFreshExactSession,
|
|
3963
|
+
exactRecoveryTransportMode: options?.exactRecoveryTransportMode,
|
|
3964
|
+
registeredPublicEvidence: options?.registeredPublicEvidence,
|
|
3910
3965
|
authenticationTimeoutMs,
|
|
3911
3966
|
operationFetchDeadline: operationBoundary.fetchDeadline,
|
|
3912
3967
|
operationDeadline: operationBoundary.deadline,
|
|
@@ -3922,6 +3977,11 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3922
3977
|
if (detailed.authenticatedExactAssets !== undefined) {
|
|
3923
3978
|
authenticatedExactAssets.push(...detailed.authenticatedExactAssets);
|
|
3924
3979
|
}
|
|
3980
|
+
if (detailed.committedExactAssetUals !== undefined) {
|
|
3981
|
+
committedExactAssetUals.push(...detailed.committedExactAssetUals);
|
|
3982
|
+
}
|
|
3983
|
+
if (orderedContextGraphIds.length === 1)
|
|
3984
|
+
exactStreamOutcome = detailed.exactStreamOutcome;
|
|
3925
3985
|
return durableSyncAccumulatorFromResult(detailed.result);
|
|
3926
3986
|
},
|
|
3927
3987
|
})),
|
|
@@ -3933,6 +3993,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3933
3993
|
priorityOverride: options?.priority,
|
|
3934
3994
|
operationSignal: operationBoundary.signal,
|
|
3935
3995
|
source: options?.source,
|
|
3996
|
+
onWorkStarted: admissionBoundary.startWork,
|
|
3936
3997
|
}), operationBoundary.signal);
|
|
3937
3998
|
}
|
|
3938
3999
|
catch (error) {
|
|
@@ -3944,6 +4005,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3944
4005
|
},
|
|
3945
4006
|
merge: mergeDurableSyncAccumulatorInto,
|
|
3946
4007
|
markDeferred: (summary) => {
|
|
4008
|
+
admissionBoundary.defer();
|
|
3947
4009
|
markExactFetchIncomplete();
|
|
3948
4010
|
recordDurableSyncDiagnostics(summary, { deferredBackpressure: 1 });
|
|
3949
4011
|
return markDurableTerminalBoundary(summary, false);
|
|
@@ -3966,12 +4028,17 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3966
4028
|
onDeferred: (item, error) => this.log.info(ctx, `Deferring durable sync at CG ${item.contextGraphId} due to local backpressure: ${error.message}`),
|
|
3967
4029
|
});
|
|
3968
4030
|
return {
|
|
4031
|
+
admission: admissionBoundary.snapshot(),
|
|
3969
4032
|
result: finalizeDurableSyncCompletion(accumulator),
|
|
3970
4033
|
...(exactFetchDisposition ? { exactFetchDisposition } : {}),
|
|
3971
4034
|
...(exactResponderCapability ? { exactResponderCapability } : {}),
|
|
3972
4035
|
...(authenticatedExactAssets.length === 0
|
|
3973
4036
|
? {}
|
|
3974
4037
|
: { authenticatedExactAssets: Object.freeze([...authenticatedExactAssets]) }),
|
|
4038
|
+
...(committedExactAssetUals.length === 0
|
|
4039
|
+
? {}
|
|
4040
|
+
: { committedExactAssetUals: Object.freeze([...committedExactAssetUals]) }),
|
|
4041
|
+
...(exactStreamOutcome === undefined ? {} : { exactStreamOutcome }),
|
|
3975
4042
|
};
|
|
3976
4043
|
};
|
|
3977
4044
|
const singleFlightKey = durableSyncSingleFlightKey({
|
|
@@ -3983,14 +4050,17 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
3983
4050
|
syncAgentsMeta,
|
|
3984
4051
|
hasPhaseCallback: Boolean(onPhase),
|
|
3985
4052
|
hasAtomicCommitCallback: Boolean(options?.onAtomicCommitStarted),
|
|
4053
|
+
hasWorkStartedCallback: Boolean(options?.onWorkStarted),
|
|
3986
4054
|
hasAccessDeniedCallback: Boolean(onAccessDenied),
|
|
3987
4055
|
hasSinceBatchIdResolver: Boolean(sinceBatchIdFor),
|
|
3988
4056
|
hasSignal: Boolean(operationBoundary.signal),
|
|
3989
4057
|
hasCurrentFence: Boolean(options?.isCurrent),
|
|
3990
4058
|
hasChallengePinnedSelection: exactAssetSelection?.kind === 'challenge-pinned',
|
|
3991
4059
|
hasForcedFreshExactSession: options?.forceFreshExactSession === true,
|
|
4060
|
+
hasRegisteredPublicEvidence: options?.registeredPublicEvidence !== undefined,
|
|
3992
4061
|
exactAssetUals,
|
|
3993
4062
|
settlementSliceTimeoutMs: options?.settlementSliceTimeoutMs,
|
|
4063
|
+
exactRecoveryTransportMode: options?.exactRecoveryTransportMode,
|
|
3994
4064
|
priority: options?.priority,
|
|
3995
4065
|
});
|
|
3996
4066
|
const runWithinBoundary = async () => {
|
|
@@ -4022,13 +4092,18 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4022
4092
|
const detailed = await this.runLegacyDurableSyncDetailed(ctx, remotePeerId, [contextGraphId], undefined, undefined, undefined, {
|
|
4023
4093
|
exactAssetSelection: selection,
|
|
4024
4094
|
forceFreshExactSession: options.forceFreshExactSession,
|
|
4095
|
+
exactRecoveryTransportMode: options.exactRecoveryTransportMode,
|
|
4096
|
+
registeredPublicEvidence: options.registeredPublicEvidence,
|
|
4097
|
+
...(options.totalTimeoutMs === undefined ? {} : { totalTimeoutMs: options.totalTimeoutMs }),
|
|
4025
4098
|
stopOnBackoffWorthyFailure: true,
|
|
4026
|
-
priority:
|
|
4099
|
+
priority: VM_RECOVERY_SYNC_PRIORITY,
|
|
4027
4100
|
source: 'vm-recovery',
|
|
4101
|
+
onWorkStarted: options.onWorkStarted,
|
|
4028
4102
|
signal: options.signal,
|
|
4029
4103
|
isCurrent: options.isCurrent,
|
|
4030
4104
|
});
|
|
4031
4105
|
return {
|
|
4106
|
+
admission: detailed.admission,
|
|
4032
4107
|
result: detailed.result,
|
|
4033
4108
|
disposition: detailed.exactFetchDisposition ?? 'incomplete',
|
|
4034
4109
|
...(detailed.exactResponderCapability === undefined
|
|
@@ -4037,14 +4112,30 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4037
4112
|
...(detailed.authenticatedExactAssets === undefined
|
|
4038
4113
|
? {}
|
|
4039
4114
|
: { authenticatedAssets: detailed.authenticatedExactAssets }),
|
|
4115
|
+
...(detailed.committedExactAssetUals === undefined
|
|
4116
|
+
? {}
|
|
4117
|
+
: { committedExactAssetUals: detailed.committedExactAssetUals }),
|
|
4118
|
+
...(detailed.exactStreamOutcome === undefined
|
|
4119
|
+
? {}
|
|
4120
|
+
: { streamOutcome: detailed.exactStreamOutcome }),
|
|
4040
4121
|
};
|
|
4041
4122
|
}
|
|
4042
4123
|
/** Execute one legacy durable Context Graph after its caller owns admission. */
|
|
4043
4124
|
async runLegacyDurableSyncForContextGraph(ctx, remotePeerId, contextGraphId, remainingContextGraphs, options = {}) {
|
|
4044
4125
|
return (await LifecycleSyncMethods.prototype.runLegacyDurableSyncForContextGraphDetailed.call(this, ctx, remotePeerId, contextGraphId, remainingContextGraphs, options)).result;
|
|
4045
4126
|
}
|
|
4127
|
+
/** Capture transport refusal scope without performing authority or store IO. */
|
|
4128
|
+
captureExperimentalExactBatchRefusalScope(contextGraphId) {
|
|
4129
|
+
return captureExactBatchStreamRefusalScope({
|
|
4130
|
+
contextGraphId, deploymentId: this.chain.deploymentId,
|
|
4131
|
+
binding: this.contextGraphBindingState.currentBindingFor(contextGraphId, this.subscribedContextGraphs.get(contextGraphId)),
|
|
4132
|
+
bindingGeneration: this.contextGraphBindingState.capture(contextGraphId),
|
|
4133
|
+
selectedBindingGeneration: this.selectedVmReconcileCursors?.get(contextGraphId)?.bindingGeneration,
|
|
4134
|
+
lifecycleGeneration: this.vmReconcileLifecycleGeneration,
|
|
4135
|
+
});
|
|
4136
|
+
}
|
|
4046
4137
|
async runLegacyDurableSyncForContextGraphDetailed(ctx, remotePeerId, contextGraphId, remainingContextGraphs, options = {}) {
|
|
4047
|
-
const { onPhase, onAtomicCommitStarted, onAccessDenied, sinceBatchIdFor, stopOnBackoffWorthyFailure, onVerifiedFullSnapshot, fetchTimeoutMs = SYNC_TOTAL_TIMEOUT_MS, exactAssetSelection, forceFreshExactSession, authenticationTimeoutMs = fetchTimeoutMs, operationFetchDeadline, operationDeadline, settlementSliceTimeoutMs, signal, isCurrent, durableMetaContinuation, } = options;
|
|
4138
|
+
const { onPhase, onAtomicCommitStarted, onAccessDenied, sinceBatchIdFor, stopOnBackoffWorthyFailure, onVerifiedFullSnapshot, fetchTimeoutMs = SYNC_TOTAL_TIMEOUT_MS, exactAssetSelection, forceFreshExactSession, exactRecoveryTransportMode = 'stream-preferred', registeredPublicEvidence, authenticationTimeoutMs = fetchTimeoutMs, operationFetchDeadline, operationDeadline, settlementSliceTimeoutMs, signal, isCurrent, durableMetaContinuation, } = options;
|
|
4048
4139
|
const assertLifecycleCurrent = () => {
|
|
4049
4140
|
if (isCurrent?.() === false) {
|
|
4050
4141
|
throw asSyncFetchAbortError(new Error(`Exact VM recovery lifecycle for ${contextGraphId} is no longer current`));
|
|
@@ -4239,13 +4330,26 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4239
4330
|
this.invalidateListContextGraphsCache();
|
|
4240
4331
|
this.contextGraphMetaProjection.markDirtyFromQuads(authentication.asset.metadataQuads);
|
|
4241
4332
|
try {
|
|
4333
|
+
let retiredTwin;
|
|
4242
4334
|
const retirement = await reconcileFinalizedSwmTwin({
|
|
4243
4335
|
store: this.store,
|
|
4244
4336
|
writeLocks: this.writeLocks,
|
|
4245
4337
|
asset: authentication.asset,
|
|
4246
|
-
retire: (candidate) =>
|
|
4338
|
+
retire: async (candidate) => {
|
|
4339
|
+
await this.retireFinalizedSwmTwinCandidate(candidate, ctx);
|
|
4340
|
+
retiredTwin = candidate;
|
|
4341
|
+
},
|
|
4247
4342
|
});
|
|
4248
4343
|
if (retirement === 'retired') {
|
|
4344
|
+
await this.retireLegacySwmAfterVerifiedVmTwin({
|
|
4345
|
+
contextGraphId: asset.contextGraphId,
|
|
4346
|
+
kaUal: asset.ual,
|
|
4347
|
+
assertionVersion: asset.assertionVersion,
|
|
4348
|
+
// The marker of the namespace whose twin was verified and
|
|
4349
|
+
// retired. Without it a twin in a named subgraph would
|
|
4350
|
+
// retire the root marker of the same asset.
|
|
4351
|
+
subGraphName: retiredTwin?.subGraphName,
|
|
4352
|
+
});
|
|
4249
4353
|
this.invalidateListContextGraphsCache();
|
|
4250
4354
|
this.log.info(ctx, `Retired byte-identical SWM twin after durable VM materialization for ${asset.ual}`);
|
|
4251
4355
|
}
|
|
@@ -4293,7 +4397,54 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4293
4397
|
};
|
|
4294
4398
|
}
|
|
4295
4399
|
if (exactAssetSelection !== undefined) {
|
|
4296
|
-
|
|
4400
|
+
const outcome = await runExactBatchStreamDriver({
|
|
4401
|
+
contextGraphId, remotePeerId,
|
|
4402
|
+
selection: exactAssetSelection, transportMode: exactRecoveryTransportMode,
|
|
4403
|
+
streamEnabled: resolveExactBatchStreamEnabled(),
|
|
4404
|
+
fetchDeadline: contextGraphBudget.fetchDeadline, signal, isCurrent,
|
|
4405
|
+
}, {
|
|
4406
|
+
router: this.router, capabilityOwner: this,
|
|
4407
|
+
captureConnectionKey: () => this.getSyncReconcilerConnectionKey(remotePeerId),
|
|
4408
|
+
captureRefusalScope: () => this.captureExperimentalExactBatchRefusalScope(contextGraphId),
|
|
4409
|
+
isChainEnabled: () => this.chain.chainId !== 'none',
|
|
4410
|
+
getPeerProtocols: () => this.getPeerProtocols(remotePeerId),
|
|
4411
|
+
// The recovery pass that owns this exchange may have handed it its own fresh positive
|
|
4412
|
+
// answer; every other fetch, and any doubt about that answer, reads the authority itself.
|
|
4413
|
+
isRegisteredPublic: async () => registeredPublicEvidence?.usableFor(contextGraphId, signal) === true
|
|
4414
|
+
|| (await this.resolveRegisteredContextGraphAuthority(contextGraphId, {
|
|
4415
|
+
authorityReadMode: 'finalized-index-or-live', signal,
|
|
4416
|
+
})).kind === 'public',
|
|
4417
|
+
requestIdentity: () => ({
|
|
4418
|
+
requesterPeerId: this.peerId,
|
|
4419
|
+
computeSyncDigest: (...args) => this.computeSyncDigest(...args),
|
|
4420
|
+
getIdentityId: () => this.chain.getIdentityId(),
|
|
4421
|
+
signMessage: typeof this.chain.signMessage === 'function' ? this.chain.signMessage.bind(this.chain) : undefined,
|
|
4422
|
+
}),
|
|
4423
|
+
verification: {
|
|
4424
|
+
ctx,
|
|
4425
|
+
parseAndFilter: (text, graph, cg) => this.getOrCreateSyncVerifyWorker().parseAndFilter(text, graph, cg),
|
|
4426
|
+
processDurableBatchInWorker: durableContext.processDurableBatchInWorker,
|
|
4427
|
+
authenticationDeadline: contextGraphBudget.createGraphScopedAuthenticationDeadline,
|
|
4428
|
+
storeGraphScopedAsset: durableContext.storeGraphScopedAsset,
|
|
4429
|
+
},
|
|
4430
|
+
reconnect: async (reconnectSignal) => {
|
|
4431
|
+
try {
|
|
4432
|
+
await this.ensurePeerConnected(remotePeerId, { signal: reconnectSignal });
|
|
4433
|
+
}
|
|
4434
|
+
catch {
|
|
4435
|
+
// Unreachable for now, or connected but no longer admitted.
|
|
4436
|
+
return false;
|
|
4437
|
+
}
|
|
4438
|
+
return this.node.libp2p.getConnections()
|
|
4439
|
+
.some((connection) => connection.remotePeer.toString() === remotePeerId);
|
|
4440
|
+
},
|
|
4441
|
+
logInfo: message => this.log.info(ctx, message),
|
|
4442
|
+
});
|
|
4443
|
+
switch (outcome.kind) {
|
|
4444
|
+
case 'settled': return outcome.detailed;
|
|
4445
|
+
case 'not-selected':
|
|
4446
|
+
case 'unsupported-before-start': return runDurableSyncDetailed(durableContext);
|
|
4447
|
+
}
|
|
4297
4448
|
}
|
|
4298
4449
|
return { result: await runDurableSync(durableContext) };
|
|
4299
4450
|
}
|
|
@@ -4642,9 +4793,25 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4642
4793
|
deadline,
|
|
4643
4794
|
fetchSharingIdentity: defaultPageFetchSharingIdentity,
|
|
4644
4795
|
});
|
|
4796
|
+
// Match the additive builder negotiation. Authorization is still evaluated
|
|
4797
|
+
// by buildSyncRequest and by the responder before any export is admitted.
|
|
4798
|
+
const responseEncoding = resolveExactSyncGzipProfile({
|
|
4799
|
+
includeSharedMemory, phase, assetUals, responseEncoding: EXACT_SYNC_GZIP_ENCODING,
|
|
4800
|
+
})?.responseEncoding;
|
|
4645
4801
|
const exactAccumulationLimits = assetUals === undefined
|
|
4646
4802
|
? undefined
|
|
4647
|
-
: exactSyncPhaseAccumulationLimits(assetUals);
|
|
4803
|
+
: exactSyncPhaseAccumulationLimits(assetUals, responseEncoding);
|
|
4804
|
+
const effectiveMaxAcceptedQuads = exactAccumulationLimits?.maxQuads === undefined
|
|
4805
|
+
? maxAcceptedQuads
|
|
4806
|
+
: maxAcceptedQuads === undefined
|
|
4807
|
+
? exactAccumulationLimits.maxQuads
|
|
4808
|
+
: Math.min(exactAccumulationLimits.maxQuads, maxAcceptedQuads);
|
|
4809
|
+
const exactHeapLimit = exactAccumulationLimits?.maxHeapBytesEstimate;
|
|
4810
|
+
const effectiveMaxAcceptedHeapBytesEstimate = exactHeapLimit === undefined
|
|
4811
|
+
? maxAcceptedHeapBytesEstimate
|
|
4812
|
+
: maxAcceptedHeapBytesEstimate === undefined
|
|
4813
|
+
? exactHeapLimit
|
|
4814
|
+
: Math.min(exactHeapLimit, maxAcceptedHeapBytesEstimate);
|
|
4648
4815
|
// Coalescing is declared by the capability, never inferred from singleton
|
|
4649
4816
|
// identity. Exclusive private rounds cannot inherit another job's clock.
|
|
4650
4817
|
const fetchSharingIdentity = effectiveWorkAdmission.fetchSharingIdentity;
|
|
@@ -4664,8 +4831,10 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4664
4831
|
assetUals,
|
|
4665
4832
|
returnAcceptedPrefixOnRetryableTransportFailure,
|
|
4666
4833
|
requesterScope,
|
|
4667
|
-
|
|
4668
|
-
|
|
4834
|
+
responseEncoding,
|
|
4835
|
+
maxAcceptedBytes: exactAccumulationLimits?.maxBytes,
|
|
4836
|
+
maxAcceptedQuads: effectiveMaxAcceptedQuads,
|
|
4837
|
+
maxAcceptedHeapBytesEstimate: effectiveMaxAcceptedHeapBytesEstimate,
|
|
4669
4838
|
});
|
|
4670
4839
|
const inFlight = inFlightSyncPageFetchesFor(this);
|
|
4671
4840
|
// Read once, here: this fetch runs inside the admitted operation, so the
|
|
@@ -4722,15 +4891,12 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
4722
4891
|
snapshotRef,
|
|
4723
4892
|
sinceBatchId,
|
|
4724
4893
|
assetUals,
|
|
4894
|
+
responseEncoding,
|
|
4725
4895
|
returnAcceptedPrefixOnRetryableTransportFailure,
|
|
4726
4896
|
requesterScope,
|
|
4727
4897
|
maxAcceptedBytes: exactAccumulationLimits?.maxBytes,
|
|
4728
|
-
maxAcceptedQuads:
|
|
4729
|
-
|
|
4730
|
-
: maxAcceptedQuads === undefined
|
|
4731
|
-
? exactAccumulationLimits.maxQuads
|
|
4732
|
-
: Math.min(exactAccumulationLimits.maxQuads, maxAcceptedQuads),
|
|
4733
|
-
maxAcceptedHeapBytesEstimate,
|
|
4898
|
+
maxAcceptedQuads: effectiveMaxAcceptedQuads,
|
|
4899
|
+
maxAcceptedHeapBytesEstimate: effectiveMaxAcceptedHeapBytesEstimate,
|
|
4734
4900
|
pageSizeProfileCache: syncPageSizeProfileCacheFor(this),
|
|
4735
4901
|
deadline,
|
|
4736
4902
|
recovery,
|
|
@@ -5180,7 +5346,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
5180
5346
|
selectedSwmPriority: selectedPublicWork,
|
|
5181
5347
|
});
|
|
5182
5348
|
},
|
|
5183
|
-
merge:
|
|
5349
|
+
merge: mergeSamePeerSharedMemoryDiagnostics,
|
|
5184
5350
|
onResult: (item, result) => {
|
|
5185
5351
|
if (selectedSwmEnabled
|
|
5186
5352
|
&& item.lane === 'shared_memory'
|
|
@@ -5234,7 +5400,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
5234
5400
|
source: options?.source,
|
|
5235
5401
|
selectedSwmPriority: true,
|
|
5236
5402
|
}),
|
|
5237
|
-
merge:
|
|
5403
|
+
merge: mergeSamePeerSharedMemoryDiagnostics,
|
|
5238
5404
|
markDeferred: (summary) => ({
|
|
5239
5405
|
...summary,
|
|
5240
5406
|
deferredBackpressure: (summary.deferredBackpressure ?? 0) + 1,
|
|
@@ -5257,7 +5423,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
5257
5423
|
},
|
|
5258
5424
|
});
|
|
5259
5425
|
const { summary: continuationSummary } = continuationExecution;
|
|
5260
|
-
const finalSummary =
|
|
5426
|
+
const finalSummary = mergeSamePeerSharedMemoryDiagnostics(initialSummary, continuationSummary);
|
|
5261
5427
|
const incompleteSelectedContextGraphs = new Set(continuationExecution.incompleteContextGraphIds);
|
|
5262
5428
|
const continuedSelectedContextGraphs = new Set(selectedContinuationUnits.map(({ work: unitWork }) => unitWork.contextGraphId));
|
|
5263
5429
|
for (const target of selectedPublicTargets) {
|
|
@@ -5436,16 +5602,6 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
5436
5602
|
});
|
|
5437
5603
|
}
|
|
5438
5604
|
/** Focused VM-recovery operation that returns clean per-peer miss evidence. */
|
|
5439
|
-
async syncVmRecoveryFromConnectedPeers(contextGraphId, options) {
|
|
5440
|
-
const catchup = await this.syncContextGraphFromConnectedPeers(contextGraphId, options);
|
|
5441
|
-
return {
|
|
5442
|
-
catchup,
|
|
5443
|
-
// Embedders may still override the catch-up method with the pre-evidence
|
|
5444
|
-
// result shape. Treat that legacy shape as no proof; production results
|
|
5445
|
-
// always carry the immutable field below.
|
|
5446
|
-
cleanMissPeerIds: [...(catchup.cleanSharedMemoryPeerIds ?? [])],
|
|
5447
|
-
};
|
|
5448
|
-
}
|
|
5449
5605
|
selectCatchupPeerWindow(peers, options) {
|
|
5450
5606
|
const maxPeers = options?.maxPeers;
|
|
5451
5607
|
if (maxPeers === undefined || !Number.isInteger(maxPeers) || maxPeers <= 0) {
|
|
@@ -5606,7 +5762,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
5606
5762
|
// into HEAD's `accessDeniedPeers` counter so the existing daemon
|
|
5607
5763
|
// catchup-status endpoint and UI keep working — see
|
|
5608
5764
|
// `cli/src/daemon.ts` subscribe job and `catchup-runner.ts`.
|
|
5609
|
-
const emptyShared = () =>
|
|
5765
|
+
const emptyShared = () => emptySharedMemorySyncResult(1);
|
|
5610
5766
|
// Bounded fan-out: at most CATCHUP_MAX_CONCURRENT_PEER_SYNCS peer syncs run
|
|
5611
5767
|
// at once. The pre-cap unbounded `Promise.all` over every sync-capable peer
|
|
5612
5768
|
// was the top amplifier of the 2026-07-07 mainnet sync storm — one
|
|
@@ -6046,13 +6202,14 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
6046
6202
|
* snapshot that does not prove this member yet, or unavailable authority is
|
|
6047
6203
|
* `retry`; no approval binding or denied authority is `stop`.
|
|
6048
6204
|
*/
|
|
6049
|
-
async resumePendingJoinApprovalMetadata(contextGraphId, curatorPeerId) {
|
|
6205
|
+
async resumePendingJoinApprovalMetadata(contextGraphId, curatorPeerId, curatorDialAddress) {
|
|
6050
6206
|
const ctx = createOperationContext('sync');
|
|
6051
6207
|
const acceptance = await this.resolveApprovedMemberAcceptance(contextGraphId);
|
|
6052
6208
|
if (!acceptance)
|
|
6053
6209
|
return 'stop';
|
|
6054
6210
|
const refreshed = await this.refreshMetaFromCurator(contextGraphId, {
|
|
6055
6211
|
trustedCuratorPeerId: curatorPeerId,
|
|
6212
|
+
curatorDialAddressHint: curatorDialAddress,
|
|
6056
6213
|
force: true,
|
|
6057
6214
|
approvedMember: acceptance,
|
|
6058
6215
|
}).catch((error) => {
|
|
@@ -6100,12 +6257,12 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
6100
6257
|
* throws, is tried again with backoff while the row is still a subscribed,
|
|
6101
6258
|
* join-approved, pending-metadata row; the node stopping ends the loop.
|
|
6102
6259
|
*/
|
|
6103
|
-
async recoverPendingJoinApprovalMetadata(contextGraphId, curatorPeerId) {
|
|
6260
|
+
async recoverPendingJoinApprovalMetadata(contextGraphId, curatorPeerId, curatorDialAddress) {
|
|
6104
6261
|
const stopSignal = this.node.stopSignal;
|
|
6105
6262
|
for (let attempt = 0;; attempt += 1) {
|
|
6106
6263
|
let outcome;
|
|
6107
6264
|
try {
|
|
6108
|
-
outcome = await this.resumePendingJoinApprovalMetadata(contextGraphId, curatorPeerId);
|
|
6265
|
+
outcome = await this.resumePendingJoinApprovalMetadata(contextGraphId, curatorPeerId, curatorDialAddress);
|
|
6109
6266
|
}
|
|
6110
6267
|
catch (error) {
|
|
6111
6268
|
// A store or network fault that escapes an attempt is as transient as
|
|
@@ -6122,7 +6279,10 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
6122
6279
|
const current = this.subscribedContextGraphs.get(contextGraphId);
|
|
6123
6280
|
if (!this.localApprovedAgentByCG.has(contextGraphId)
|
|
6124
6281
|
|| current?.subscribed !== true
|
|
6125
|
-
|
|
6282
|
+
// A concurrent data catch-up can set `synced` while authoritative
|
|
6283
|
+
// join metadata is still pending or unknown. Only its explicit
|
|
6284
|
+
// confirmation ends this join-specific retry.
|
|
6285
|
+
|| (current.synced === true && current.metaSynced === true && current.pendingMeta !== true))
|
|
6126
6286
|
return;
|
|
6127
6287
|
}
|
|
6128
6288
|
}
|
|
@@ -6500,14 +6660,16 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
6500
6660
|
pending.add(revision);
|
|
6501
6661
|
}
|
|
6502
6662
|
enqueueContextGraphSubscriptionPersistWrite(contextGraphId, write) {
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6663
|
+
// The scheduler owns per-context-graph ordering, strict non-coalescing,
|
|
6664
|
+
// write-start timing (a microtask after admission), shutdown drain and
|
|
6665
|
+
// bounds; the revision maps below stay the cancel/supersede layer on top of
|
|
6666
|
+
// it. The returned promise rejects when the write (or admission) fails, so
|
|
6667
|
+
// an awaiting caller sees the failure. The lane keeps draining, so a failed
|
|
6668
|
+
// write does not stall the next one for this context graph.
|
|
6669
|
+
const run = this.contextGraphSubscriptionPersistence.enqueue(contextGraphId, write);
|
|
6670
|
+
// Idle cleanup runs after the caller's own handlers and marks a failure as
|
|
6671
|
+
// handled for a caller that drops the promise, as the chain tail did.
|
|
6672
|
+
void run.catch(() => undefined).finally(() => {
|
|
6511
6673
|
this.clearContextGraphSubscriptionPersistRevisionStateIfIdle(contextGraphId);
|
|
6512
6674
|
});
|
|
6513
6675
|
return run;
|
|
@@ -6528,7 +6690,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
6528
6690
|
clearContextGraphSubscriptionPersistRevisionStateIfIdle(contextGraphId) {
|
|
6529
6691
|
if ((this.contextGraphSubscriptionPersistPendingRevisions.get(contextGraphId)?.size ?? 0) > 0)
|
|
6530
6692
|
return;
|
|
6531
|
-
if (this.
|
|
6693
|
+
if (this.contextGraphSubscriptionPersistence.hasLane(contextGraphId))
|
|
6532
6694
|
return;
|
|
6533
6695
|
const sub = this.subscribedContextGraphs.get(contextGraphId);
|
|
6534
6696
|
if (sub?.subscribed === true || sub?.coreHosted === true)
|
|
@@ -7495,6 +7657,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7495
7657
|
return;
|
|
7496
7658
|
const ctx = createOperationContext('init');
|
|
7497
7659
|
let authorityBudget;
|
|
7660
|
+
const startupPlan = this.gossipSession.beginDurableStartupPlan(this.contextGraphSubscriptionRehydrationAccountedIds);
|
|
7498
7661
|
try {
|
|
7499
7662
|
// System context graphs (AGENTS/ONTOLOGY) are auto-subscribed separately
|
|
7500
7663
|
// by start(); their persisted rows must NOT be rehydrated here too. Re-
|
|
@@ -7503,6 +7666,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7503
7666
|
// dormant. Exclude them from the rehydration set entirely.
|
|
7504
7667
|
const systemContextGraphs = new Set(Object.values(SYSTEM_CONTEXT_GRAPHS));
|
|
7505
7668
|
const persistedRows = await store.loadAll();
|
|
7669
|
+
startupPlan.claimDurableRows(persistedRows);
|
|
7506
7670
|
// A name-hash placeholder whose verified cleartext row is also durable
|
|
7507
7671
|
// was adopted earlier; the crash window between the two writes can
|
|
7508
7672
|
// leave both. Never reactivate the placeholder. Record the adoption as
|
|
@@ -7578,10 +7742,10 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7578
7742
|
// snapshot already read by the provenance phase. Load every persisted
|
|
7579
7743
|
// row (not just rows under the activation cap) so a dormant subscription
|
|
7580
7744
|
// still has the right signer when an operator activates it explicitly.
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7745
|
+
const newestApprovalByContextGraph = persistedMembershipRows === null
|
|
7746
|
+
? null
|
|
7747
|
+
: projectPersistedJoinApprovals(persistedMembershipRows, new Set(rows.map((row) => row.id)), new Set([...this.localAgents.keys()].map((address) => address.toLowerCase())));
|
|
7748
|
+
if (newestApprovalByContextGraph) {
|
|
7585
7749
|
for (const [contextGraphId, approval] of newestApprovalByContextGraph) {
|
|
7586
7750
|
this.localApprovedAgentByCG.set(contextGraphId, approval.principalId);
|
|
7587
7751
|
if (approval.curatorPeerId) {
|
|
@@ -7668,7 +7832,22 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7668
7832
|
const approvedAgentAddress = row.subscribed
|
|
7669
7833
|
? this.localApprovedAgentByCG.get(row.id)
|
|
7670
7834
|
: undefined;
|
|
7671
|
-
|
|
7835
|
+
let hasJoinApproval = approvedAgentAddress !== undefined;
|
|
7836
|
+
// The membership row is the restart hint, not the current requester
|
|
7837
|
+
// decision. A later explicit pending/rejected decision must retire a
|
|
7838
|
+
// stale join-approved hint instead of resurrecting its subscription in
|
|
7839
|
+
// restricted pending-metadata mode. Missing decision state remains the
|
|
7840
|
+
// compatibility shape for legacy persisted membership rows.
|
|
7841
|
+
if (approvedAgentAddress !== undefined) {
|
|
7842
|
+
try {
|
|
7843
|
+
const requesterState = await this.readRequesterJoinRequestState(row.id, approvedAgentAddress);
|
|
7844
|
+
hasJoinApproval = requesterState === null
|
|
7845
|
+
|| requesterState.status === 'approved';
|
|
7846
|
+
}
|
|
7847
|
+
catch {
|
|
7848
|
+
hasJoinApproval = false;
|
|
7849
|
+
}
|
|
7850
|
+
}
|
|
7672
7851
|
// A join-approved row keeps the synchronous path: only it can restore
|
|
7673
7852
|
// the restricted pending-metadata bootstrap, which background
|
|
7674
7853
|
// authority recovery does not offer.
|
|
@@ -7764,7 +7943,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7764
7943
|
const curatorPeerId = this.preferredSyncPeers.get(row.id);
|
|
7765
7944
|
this.log.info(ctx, `Restored persisted context-graph subscription "${row.id}" in restricted pending-metadata mode; VM, payload recovery, and SWM remain closed`);
|
|
7766
7945
|
if (curatorPeerId) {
|
|
7767
|
-
void this.recoverPendingJoinApprovalMetadata(row.id, curatorPeerId).catch((error) => {
|
|
7946
|
+
void this.recoverPendingJoinApprovalMetadata(row.id, curatorPeerId, newestApprovalByContextGraph?.get(row.id)?.curatorDialAddress).catch((error) => {
|
|
7768
7947
|
this.log.warn(ctx, `Pending join-approval recovery for "${row.id}" stopped safely: ${error instanceof Error ? error.message : String(error)}`);
|
|
7769
7948
|
});
|
|
7770
7949
|
}
|
|
@@ -7839,6 +8018,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7839
8018
|
}
|
|
7840
8019
|
finally {
|
|
7841
8020
|
authorityBudget?.dispose();
|
|
8021
|
+
startupPlan.finish();
|
|
7842
8022
|
}
|
|
7843
8023
|
}
|
|
7844
8024
|
/**
|
|
@@ -7896,7 +8076,7 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
7896
8076
|
}
|
|
7897
8077
|
}
|
|
7898
8078
|
const activeUserIdsWithPendingStoreWrite = store
|
|
7899
|
-
? activeUserIds.filter((id) => this.
|
|
8079
|
+
? activeUserIds.filter((id) => this.contextGraphSubscriptionPersistence.hasLane(id))
|
|
7900
8080
|
: [];
|
|
7901
8081
|
const storeDeleteIds = [...new Set([...persistedUserIds, ...activeUserIdsWithPendingStoreWrite])];
|
|
7902
8082
|
const total = storeDeleteIds.length;
|
|
@@ -8009,8 +8189,9 @@ export class LifecycleSyncMethods extends DKGAgentBase {
|
|
|
8009
8189
|
* plaintext: registered public, or unregistered under an active accepted
|
|
8010
8190
|
* owner-signed public policy (see classifySwmTransportAuthority). A retained
|
|
8011
8191
|
* snapshot therefore never outvotes a registration the index shows. Private,
|
|
8012
|
-
* legacy-unregistered or unavailable authority, or
|
|
8013
|
-
* `unproven`, which admits only the complete private
|
|
8192
|
+
* approved-private-replica, legacy-unregistered or unavailable authority, or
|
|
8193
|
+
* an unreadable chain, is `unproven`, which admits only the complete private
|
|
8194
|
+
* definition.
|
|
8014
8195
|
*/
|
|
8015
8196
|
async resolveApprovedMemberAcceptance(contextGraphId) {
|
|
8016
8197
|
const approvedAgentAddress = this.localApprovedAgentByCG.get(contextGraphId);
|