keri-ts 2.2.5 → 2.2.6
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/esm/keri/npm/src/acdc/dhking.js +29 -2
- package/esm/keri/npm/src/acdc/observing.js +10 -3
- package/esm/keri/npm/src/acdc/query-resend.js +74 -0
- package/esm/keri/npm/src/acdc/regengine.js +39 -9
- package/esm/keri/npm/src/acdc/regeventing.js +5 -3
- package/esm/keri/npm/src/acdc/unblinding.js +38 -3
- package/esm/keri/npm/src/app/delivery/forwarding.js +28 -1
- package/esm/keri/npm/src/app/ipex/group-issuance.js +28 -14
- package/esm/keri/npm/src/app/ipex/ipex-discloser.js +58 -9
- package/esm/keri/npm/src/app/ipex/issuance.js +16 -9
- package/esm/keri/npm/src/app/ipex/unblinding-workflow.js +23 -8
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +1 -1
- package/esm/keri/npm/src/app/runtime/ipex-auxiliaries.js +8 -1
- package/esm/keri/npm/src/core/mailbox/kram-policy.js +8 -0
- package/esm/keri/npm/src/core/missing-anchor-query.js +20 -0
- package/esm/keri/npm/src/vdr/eventing.js +43 -9
- package/esm/keri/npm/src/version.js +2 -2
- package/package.json +1 -1
- package/types/acdc/dhking.d.ts +8 -0
- package/types/acdc/dhking.d.ts.map +1 -1
- package/types/acdc/observing.d.ts +5 -1
- package/types/acdc/observing.d.ts.map +1 -1
- package/types/acdc/query-resend.d.ts +24 -0
- package/types/acdc/query-resend.d.ts.map +1 -0
- package/types/acdc/regengine.d.ts +19 -1
- package/types/acdc/regengine.d.ts.map +1 -1
- package/types/acdc/regeventing.d.ts.map +1 -1
- package/types/acdc/unblinding.d.ts +13 -1
- package/types/acdc/unblinding.d.ts.map +1 -1
- package/types/app/delivery/forwarding.d.ts +21 -0
- package/types/app/delivery/forwarding.d.ts.map +1 -1
- package/types/app/ipex/group-issuance.d.ts +6 -2
- package/types/app/ipex/group-issuance.d.ts.map +1 -1
- package/types/app/ipex/ipex-discloser.d.ts +25 -0
- package/types/app/ipex/ipex-discloser.d.ts.map +1 -1
- package/types/app/ipex/issuance.d.ts +11 -5
- package/types/app/ipex/issuance.d.ts.map +1 -1
- package/types/app/ipex/unblinding-workflow.d.ts +9 -1
- package/types/app/ipex/unblinding-workflow.d.ts.map +1 -1
- package/types/app/runtime/ipex-auxiliaries.d.ts.map +1 -1
- package/types/core/mailbox/kram-policy.d.ts +6 -0
- package/types/core/mailbox/kram-policy.d.ts.map +1 -1
- package/types/core/missing-anchor-query.d.ts +34 -0
- package/types/core/missing-anchor-query.d.ts.map +1 -0
- package/types/vdr/eventing.d.ts +32 -1
- package/types/vdr/eventing.d.ts.map +1 -1
- package/types/version.d.ts +2 -2
|
@@ -69,6 +69,7 @@ import { call, race } from "effection";
|
|
|
69
69
|
import { RegistryAuthor } from "../../acdc/authoring.js";
|
|
70
70
|
import { RegistryCustody } from "../../acdc/custody.js";
|
|
71
71
|
import { grantTransactionId, registryUncommitted, resumableExchange } from "../../acdc/dhking.js";
|
|
72
|
+
import { QUERY_RESEND_MS } from "../../acdc/query-resend.js";
|
|
72
73
|
import { KramRefusedError, ValidationError } from "../../core/errors.js";
|
|
73
74
|
import { CREDENTIAL_MAILBOX_TOPIC } from "../../core/mailbox/mailbox-topics.js";
|
|
74
75
|
import { timestampMicros } from "../../time/mod.js";
|
|
@@ -78,14 +79,15 @@ import { DeliveryOutbox, } from "../runtime/delivery-outbox.js";
|
|
|
78
79
|
import { observeUntil, waitOnClock } from "../runtime/workflow-contract.js";
|
|
79
80
|
import { awaitsGroupProof, beginGroupProofFollow, deriveGroupCustody, GroupIssuance, GroupParty, registerGroupRoutes, stepGroup, storedGroupProof, } from "./group-issuance.js";
|
|
80
81
|
import { IpexAdmitter } from "./ipex-admitting.js";
|
|
81
|
-
import { exchangeWire, IpexDiscloser, storedExchangeWire } from "./ipex-discloser.js";
|
|
82
|
+
import { exchangeWire, IpexDiscloser, storedExchangeWire, } from "./ipex-discloser.js";
|
|
82
83
|
/**
|
|
83
|
-
* Milliseconds between resends of the issuer query
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
84
|
+
* Milliseconds between the first resends of the issuer query, which the holder may have lost before consenting (a
|
|
85
|
+
* process that ended, or a retained query that outlived its window). A single-signer issuer re-dates every resend
|
|
86
|
+
* (new date, SAID and signatures): the peer's KRAM caches every query it accepts, so an identical resend would be
|
|
87
|
+
* a replay it drops. A group cannot re-date (re-signing needs the members), so it resends the same bytes, doubling
|
|
88
|
+
* this interval up to a cap and stopping once the query is older than the multi-key acceptance window.
|
|
87
89
|
*/
|
|
88
|
-
export const ISSUANCE_QUERY_RESEND_MS =
|
|
90
|
+
export const ISSUANCE_QUERY_RESEND_MS = QUERY_RESEND_MS;
|
|
89
91
|
/**
|
|
90
92
|
* Milliseconds between scans of the pending exchange escrow for Grants a restarted process can finish and group
|
|
91
93
|
* Grants whose final proof a member follows. The scan repeats because what makes a Grant resumable can arrive after
|
|
@@ -384,7 +386,7 @@ export class IssuanceOperations {
|
|
|
384
386
|
peer: wires ? retained.serder.sad.ri : retained.serder.pre,
|
|
385
387
|
registry: credential.regid,
|
|
386
388
|
expires,
|
|
387
|
-
issuer: wires ? { credential, ...wires, query: null, sent: true, nextQuery: 0 } : undefined,
|
|
389
|
+
issuer: wires ? { credential, ...wires, query: null, sent: true, supportMark: null, nextQuery: 0 } : undefined,
|
|
388
390
|
phase: "rootRetained",
|
|
389
391
|
outbox: new DeliveryOutbox(this.deps.retry),
|
|
390
392
|
finished: false,
|
|
@@ -522,6 +524,7 @@ export class IssuanceOperations {
|
|
|
522
524
|
dest: op.peer,
|
|
523
525
|
msg: concatBytes(this.discloser.proofSupport(issuer.raw, op.hab), issuer.grantWire),
|
|
524
526
|
});
|
|
527
|
+
issuer.supportMark = this.discloser.proofSupportMark(issuer.raw, op.hab);
|
|
525
528
|
issuer.sent = true;
|
|
526
529
|
}
|
|
527
530
|
while (op.dh.outgoing.length) {
|
|
@@ -591,7 +594,11 @@ export class IssuanceOperations {
|
|
|
591
594
|
yield* op.dh.finish(op.xid);
|
|
592
595
|
if (!this.deps.exc.complete(op.grant))
|
|
593
596
|
throw new ValidationError("Issued Grant remains unaccepted");
|
|
594
|
-
|
|
597
|
+
// The Grant send already carried the support; proving added the anchoring event and the registry update.
|
|
598
|
+
const support = issuer.supportMark
|
|
599
|
+
? this.discloser.proofSupportSince(issuer.raw, op.hab, issuer.supportMark)
|
|
600
|
+
: this.discloser.proofSupport(issuer.raw, op.hab);
|
|
601
|
+
this.enqueue(op, { src: op.hab.pre, dest: op.peer, msg: support });
|
|
595
602
|
op.finished = true;
|
|
596
603
|
}
|
|
597
604
|
}
|
|
@@ -787,7 +794,7 @@ export function* beginIssuance(ops, grant, auths) {
|
|
|
787
794
|
peer: retained.serder.sad.ri,
|
|
788
795
|
registry: credential.regid,
|
|
789
796
|
expires,
|
|
790
|
-
issuer: { credential, raw, grantWire, query, auths, sent: false, nextQuery: 0 },
|
|
797
|
+
issuer: { credential, raw, grantWire, query, auths, sent: false, supportMark: null, nextQuery: 0 },
|
|
791
798
|
phase: "exchangingKeys",
|
|
792
799
|
outbox: new DeliveryOutbox(ops.deps.retry),
|
|
793
800
|
finished: false,
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { bytesEqual, collectPayload, framePayload, parseBytes, SerderKERI, Vrsn_2_0 } from "cesr-ts";
|
|
30
30
|
import { call, race } from "effection";
|
|
31
|
+
import { QUERY_RESEND_MS, ThresholdQueryResend } from "../../acdc/query-resend.js";
|
|
31
32
|
import { Unblind } from "../../acdc/unblinding.js";
|
|
32
33
|
import { ValidationError } from "../../core/errors.js";
|
|
33
|
-
import { singleKeyQueryWindow } from "../../core/mailbox/kram-policy.js";
|
|
34
|
+
import { multiKeyQueryWindow, singleKeyQueryWindow } from "../../core/mailbox/kram-policy.js";
|
|
34
35
|
import { timestampMicros } from "../../time/mod.js";
|
|
35
36
|
import { groupSigningMembers, isLocalGroupHab, localGroupMember } from "../multisig/group-members.js";
|
|
36
37
|
import { MULTISIG_QRY_ROUTE, MULTISIG_RPY_ROUTE, multisigExnBody } from "../multisig/grouping.js";
|
|
@@ -38,8 +39,13 @@ import { remoteGroupMembers } from "../multisig/multisig-messaging.js";
|
|
|
38
39
|
import { envelopeFromFrame } from "../protocol/parsering.js";
|
|
39
40
|
import { DeliveryOutbox } from "../runtime/delivery-outbox.js";
|
|
40
41
|
import { observeUntil, waitOnClock } from "../runtime/workflow-contract.js";
|
|
41
|
-
/**
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Milliseconds between the first resends of the disclosee query, as `tufa ipex unblind` does. A single-signer
|
|
44
|
+
* requester sends the signed bytes unchanged while they are timely and re-dates them once older than the
|
|
45
|
+
* single-key window. A group requester cannot re-date (re-signing needs the members), so it resends the same
|
|
46
|
+
* bytes, doubling this interval up to a cap and stopping once the query is older than the multi-key window.
|
|
47
|
+
*/
|
|
48
|
+
export const UNBLIND_QUERY_RESEND_MS = QUERY_RESEND_MS;
|
|
43
49
|
/** The key of one party's operation on a Grant. */
|
|
44
50
|
export function unblindingKey(grant, role) {
|
|
45
51
|
return `${role}:${grant}`;
|
|
@@ -96,6 +102,13 @@ class GroupUnblind {
|
|
|
96
102
|
writable: true,
|
|
97
103
|
value: false
|
|
98
104
|
});
|
|
105
|
+
/** The frozen threshold query a requester resends unchanged, with its backoff schedule. */
|
|
106
|
+
Object.defineProperty(this, "resend", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
configurable: true,
|
|
109
|
+
writable: true,
|
|
110
|
+
value: new ThresholdQueryResend()
|
|
111
|
+
});
|
|
99
112
|
}
|
|
100
113
|
}
|
|
101
114
|
const EXPIRED = "The presentation reached its original exchange deadline";
|
|
@@ -409,7 +422,7 @@ export class UnblindingOperations {
|
|
|
409
422
|
yield* broadcast(message.msg);
|
|
410
423
|
}
|
|
411
424
|
else if (message.kin === "query")
|
|
412
|
-
|
|
425
|
+
g.resend.set(message.msg);
|
|
413
426
|
else if (!g.finished) {
|
|
414
427
|
yield* owner.finish(xid); // Validate exact evidence; no issuer-state admission policy here.
|
|
415
428
|
g.finished = true;
|
|
@@ -428,10 +441,12 @@ export class UnblindingOperations {
|
|
|
428
441
|
yield* owner.finish(xid);
|
|
429
442
|
return this.finishedStep(op);
|
|
430
443
|
}
|
|
431
|
-
// A threshold query cannot be re-dated by one member: it is resent unchanged
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
444
|
+
// A threshold query cannot be re-dated by one member: it is resent unchanged, with backoff, while the
|
|
445
|
+
// discloser can still accept it. The operation keeps waiting past that, to its own deadline.
|
|
446
|
+
const now = deps.clock.now();
|
|
447
|
+
if (g.resend.ready(now) && g.resend.fresh(now, multiKeyQueryWindow(deps.hby.db, Unblind.Route))) {
|
|
448
|
+
yield* send(op.peer, g.resend.query);
|
|
449
|
+
g.resend.sent(now, UNBLIND_QUERY_RESEND_MS);
|
|
435
450
|
}
|
|
436
451
|
return "stepped";
|
|
437
452
|
}
|
|
@@ -135,7 +135,7 @@ export function* createAgentRuntime(hby, http, clock, options = {}) {
|
|
|
135
135
|
const kramer = options.kram ? new Kramer(hby.db, { config: options.kram, cues: protocolCues, now }) : undefined;
|
|
136
136
|
const kvy = new Kevery(hby.db, { cues: protocolCues, rvy: revery, messagePolicy: options.messagePolicy, kramer });
|
|
137
137
|
const exc = new Exchanger(hby, { cues: protocolCues, now });
|
|
138
|
-
const registry = acdc ? new RegistryObserver(hby.db, acdc.store) : null;
|
|
138
|
+
const registry = acdc ? new RegistryObserver(hby.db, acdc.store, protocolCues) : null;
|
|
139
139
|
// Every runtime with a v2 registry store owns the per-identifier DH and Unblind owners: one dispatch path.
|
|
140
140
|
const ipex = registry
|
|
141
141
|
? yield* resource(function* (provide) {
|
|
@@ -122,7 +122,14 @@ export class IpexAuxiliaries {
|
|
|
122
122
|
const current = this.unblinds.get(hab.pre);
|
|
123
123
|
if (current?.hab === hab)
|
|
124
124
|
return current;
|
|
125
|
-
const owner = new Unblind({
|
|
125
|
+
const owner = new Unblind({
|
|
126
|
+
hab,
|
|
127
|
+
exc: this.exc,
|
|
128
|
+
registry: this.registry,
|
|
129
|
+
rvy: this.rvy,
|
|
130
|
+
now: this.now,
|
|
131
|
+
kram: this.kram,
|
|
132
|
+
});
|
|
126
133
|
current?.close();
|
|
127
134
|
this.unblinds.set(hab.pre, owner);
|
|
128
135
|
return owner;
|
|
@@ -29,6 +29,14 @@ function storedCacheType(db, ilk, route) {
|
|
|
29
29
|
export function singleKeyQueryWindow(db, route) {
|
|
30
30
|
return storedCacheType(db, "qry", route)?.sl ?? null;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* How long a multi-key (group threshold) query on `route` stays timely under the windows this store was configured
|
|
34
|
+
* with, in milliseconds: the multi-key lag. A group sender uses its own windows as the estimate of its peer's, as
|
|
35
|
+
* {@link singleKeyQueryWindow} does. Null when this store has no KRAM cache types (KRAM never ran on it).
|
|
36
|
+
*/
|
|
37
|
+
export function multiKeyQueryWindow(db, route) {
|
|
38
|
+
return storedCacheType(db, "qry", route)?.ll ?? null;
|
|
39
|
+
}
|
|
32
40
|
/**
|
|
33
41
|
* How long an exchange of a message of `ilk` on `route` stays open after its opener under the windows this store
|
|
34
42
|
* is configured with now, in milliseconds: the exchange lag `xl`. Null when this store has no KRAM cache types
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name the issuer KEL events still missing for a pending event, or null when more KEL cannot supply the anchor.
|
|
3
|
+
*
|
|
4
|
+
* @param pre Issuer whose KEL holds the anchoring seal.
|
|
5
|
+
* @param accepted Sequence number of the issuer's accepted KEL here, or null when the issuer is unknown.
|
|
6
|
+
* @param anchor Sequence number of the anchoring event when a source seal names it, otherwise null.
|
|
7
|
+
* @returns The query, or null when the accepted KEL already reaches a known anchor sequence number: the anchor was
|
|
8
|
+
* found wanting rather than missing, and replay cannot change that.
|
|
9
|
+
*/
|
|
10
|
+
export function missingAnchorQuery(pre, accepted, anchor) {
|
|
11
|
+
if (accepted !== null && anchor !== null && accepted >= anchor)
|
|
12
|
+
return null;
|
|
13
|
+
const fn = (accepted === null ? 0n : accepted + 1n).toString(16);
|
|
14
|
+
return anchor === null ? { pre, fn } : { pre, fn, s: anchor.toString(16) };
|
|
15
|
+
}
|
|
16
|
+
/** The routed query cue that asks for `query`; the existing query path sends it. */
|
|
17
|
+
export function missingAnchorCue(query) {
|
|
18
|
+
const { pre, fn, s } = query;
|
|
19
|
+
return { kin: "query", pre, route: "logs", q: s === undefined ? { fn } : { fn, s } };
|
|
20
|
+
}
|
|
@@ -529,8 +529,7 @@ export class Tever {
|
|
|
529
529
|
return reject("Simple issue registry prefix mismatch.", serder, this.regk);
|
|
530
530
|
}
|
|
531
531
|
if (!this.verifyAnchor(serder, args.seqner ?? null, args.saider ?? null)) {
|
|
532
|
-
this.
|
|
533
|
-
return escrow("anchorless", "Missing KEL anchor for TEL issue.", serder, this.regk);
|
|
532
|
+
return this.escrowAnchorless("Missing KEL anchor for TEL issue.", serder, args.seqner ?? null, args.saider ?? null);
|
|
534
533
|
}
|
|
535
534
|
this.logEvent({
|
|
536
535
|
pre: okPre(serder),
|
|
@@ -588,8 +587,7 @@ export class Tever {
|
|
|
588
587
|
return reject("Simple revoke is invalid against backer-based registry.", serder, this.regk);
|
|
589
588
|
}
|
|
590
589
|
if (!this.verifyAnchor(serder, args.seqner ?? null, args.saider ?? null)) {
|
|
591
|
-
this.
|
|
592
|
-
return escrow("anchorless", "Missing KEL anchor for TEL revoke.", serder, this.regk);
|
|
590
|
+
return this.escrowAnchorless("Missing KEL anchor for TEL revoke.", serder, args.seqner ?? null, args.saider ?? null);
|
|
593
591
|
}
|
|
594
592
|
this.logRevoked(serder, sn, args, undefined, recordPublicationFailure);
|
|
595
593
|
return accept(serder, this.regk);
|
|
@@ -640,8 +638,7 @@ export class Tever {
|
|
|
640
638
|
// Every arrival and retry verifies the union against this exact historical cohort.
|
|
641
639
|
[...this.reger.tibs.get(dgKey(okPre(args.serder), okSaid(args.serder))), ...args.bigers], verfers).sigers;
|
|
642
640
|
if (!this.verifyAnchor(args.serder, args.seqner, args.saider)) {
|
|
643
|
-
this.
|
|
644
|
-
const decision = escrow("anchorless", "Missing KEL anchor for TEL event.", args.serder, this.regk);
|
|
641
|
+
const decision = this.escrowAnchorless("Missing KEL anchor for TEL event.", args.serder, args.seqner, args.saider, verified, [...args.baks]);
|
|
645
642
|
return { kind: "escrow", decision, reason: decision.reason };
|
|
646
643
|
}
|
|
647
644
|
if (!args.local && args.baks.length > 0) {
|
|
@@ -671,7 +668,38 @@ export class Tever {
|
|
|
671
668
|
this.reger.tvts.put(key, serder.raw);
|
|
672
669
|
this.reger.twes.put(pre, okSn(serder), said);
|
|
673
670
|
}
|
|
674
|
-
/**
|
|
671
|
+
/**
|
|
672
|
+
* Retain an event whose anchoring issuer KEL event is not accepted yet and decide whether to ask for it.
|
|
673
|
+
*
|
|
674
|
+
* The decision names the missing KEL only when this call put the event into the anchorless escrow. Escrow
|
|
675
|
+
* retries and repeat arrivals find the row present, so they never ask again.
|
|
676
|
+
*/
|
|
677
|
+
escrowAnchorless(reason, serder, seqner, saider, bigers = [], baks = []) {
|
|
678
|
+
const added = this.escrowALEvent(serder, seqner, saider, bigers, baks);
|
|
679
|
+
const decision = escrow("anchorless", reason, serder, this.regk);
|
|
680
|
+
const query = added ? this.missingAnchorQuery(seqner, saider) : null;
|
|
681
|
+
return query ? { ...decision, query } : decision;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Name the issuer KEL events still missing for a source seal, or null when more KEL cannot supply the anchor.
|
|
685
|
+
*
|
|
686
|
+
* Without a complete source seal there is no coordinate to ask for. When the issuer's accepted KEL already
|
|
687
|
+
* reaches the seal's sequence number, the anchor was found wanting rather than missing, and replay cannot
|
|
688
|
+
* change that.
|
|
689
|
+
*/
|
|
690
|
+
missingAnchorQuery(seqner, saider) {
|
|
691
|
+
if (!seqner || !saider)
|
|
692
|
+
return null;
|
|
693
|
+
const known = this.db.getKever(this.pre, { refresh: true })?.sner.num ?? null;
|
|
694
|
+
if (known !== null && known >= seqner.num)
|
|
695
|
+
return null;
|
|
696
|
+
return {
|
|
697
|
+
pre: this.pre,
|
|
698
|
+
fn: (known === null ? 0n : known + 1n).toString(16),
|
|
699
|
+
s: seqner.num.toString(16),
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
/** Retain anchorless evidence without changing the source seal representation. Returns whether the escrow row is new. */
|
|
675
703
|
escrowALEvent(serder, seqner, saider, bigers = [], baks = []) {
|
|
676
704
|
const pre = okPre(serder);
|
|
677
705
|
const said = okSaid(serder);
|
|
@@ -685,7 +713,7 @@ export class Tever {
|
|
|
685
713
|
this.reger.baks.put(key, [...baks]);
|
|
686
714
|
}
|
|
687
715
|
this.reger.tvts.put(key, serder.raw);
|
|
688
|
-
this.reger.taes.put(pre, okSn(serder), said);
|
|
716
|
+
return this.reger.taes.put(pre, okSn(serder), said);
|
|
689
717
|
}
|
|
690
718
|
/** Persist accepted TEL evidence and the exact qualified source seal. */
|
|
691
719
|
logEvent(args) {
|
|
@@ -867,6 +895,11 @@ export class Tevery {
|
|
|
867
895
|
}
|
|
868
896
|
if (accepted)
|
|
869
897
|
this.tevers.set(accepted.regk, accepted);
|
|
898
|
+
if (decision.kind === "escrow" && decision.query) {
|
|
899
|
+
// The event is now escrowed; ask the issuer's KEL holders for what its anchor needs through the ordinary cue path.
|
|
900
|
+
const { pre, fn, s } = decision.query;
|
|
901
|
+
this.cues.push({ kin: "query", pre, route: "logs", q: { fn, s } });
|
|
902
|
+
}
|
|
870
903
|
if (decision.kind === "accept" && (decision.ilk === Ilks.rev || decision.ilk === Ilks.brv)) {
|
|
871
904
|
// Keep publication outside semantic error conversion and after the writer has committed.
|
|
872
905
|
this.cues.push({ kin: "revoked", serder: args.serder });
|
|
@@ -1201,7 +1234,8 @@ export class Tevery {
|
|
|
1201
1234
|
if (Tevery.registryKey(event) !== regk)
|
|
1202
1235
|
return reject("Credential belongs to a different registry.");
|
|
1203
1236
|
const fields = ["vn", "i", "s", "d", "ri", "dt", "et"];
|
|
1204
|
-
if (accepted.qb64 !== record.d
|
|
1237
|
+
if (accepted.qb64 !== record.d
|
|
1238
|
+
|| fields.some((key) => JSON.stringify(record[key]) !== JSON.stringify(current[key]))
|
|
1205
1239
|
|| ["s", "d"].some((key) => record.a[key] !== current.a[key])
|
|
1206
1240
|
|| ["i", "s", "d"].some((key) => record.ra[key] !== current.ra[key]))
|
|
1207
1241
|
return reject("Credential state does not match current accepted TEL and anchors.");
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* `src/version.ts` files by hand; edit this template instead.
|
|
7
7
|
*/
|
|
8
8
|
/** Package semantic version copied from the owning package manifest. */
|
|
9
|
-
export const PACKAGE_VERSION = "2.2.
|
|
9
|
+
export const PACKAGE_VERSION = "2.2.6";
|
|
10
10
|
/** Optional build metadata stamp injected by release/CI workflows. */
|
|
11
|
-
export const BUILD_METADATA = "build.
|
|
11
|
+
export const BUILD_METADATA = "build.47.76cb6d73290faa83236723b397d8ae90436a001a";
|
|
12
12
|
/** User-facing version string with build metadata appended when present. */
|
|
13
13
|
export const DISPLAY_VERSION = BUILD_METADATA
|
|
14
14
|
? `${PACKAGE_VERSION}+${BUILD_METADATA}`
|
package/package.json
CHANGED
package/types/acdc/dhking.d.ts
CHANGED
|
@@ -170,6 +170,14 @@ export declare class Dhke implements AuxiliaryQueryProcessor {
|
|
|
170
170
|
processQuery(envelope: KeriDispatchEnvelope): {
|
|
171
171
|
kind: "accept";
|
|
172
172
|
} | MessageDropDecision;
|
|
173
|
+
/**
|
|
174
|
+
* A copy of the accepted query: nothing is verified, derived or contributed again, so a member round that
|
|
175
|
+
* already holds its `sign` contribution is not asked for another. If the reply exists it is queued again for a
|
|
176
|
+
* peer that lost it, at most once per {@link QUERY_RESEND_MS}.
|
|
177
|
+
*/
|
|
178
|
+
private duplicateQuery;
|
|
179
|
+
/** Queue the stored reply for the issuer and note when. */
|
|
180
|
+
private emitReply;
|
|
173
181
|
/** Revery decides reply threshold acceptance before any issuer derivation or retention. */
|
|
174
182
|
processReply({ serder, diger, route, cigars, tsgs }: {
|
|
175
183
|
serder: SerderKERI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dhking.d.ts","sourceRoot":"","sources":["../../src/acdc/dhking.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,KAAK,KAAK,EAGV,KAAK,KAAK,EAUV,MAAM,EAEN,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,uBAAuB,EAI5B,KAAK,mBAAmB,EAEzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMlF,OAAO,EAAmB,KAAK,oBAAoB,EAAE,KAAK,MAAM,EAA2B,MAAM,oBAAoB,CAAC;AACtH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"dhking.d.ts","sourceRoot":"","sources":["../../src/acdc/dhking.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,KAAK,KAAK,EAGV,KAAK,KAAK,EAUV,MAAM,EAEN,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,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O,CAAC,WAAW;IAmBnB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,KAAK;IAcb,kGAAkG;IAClG,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,SAAS;IAsBjB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,MAAM;IAgBd,OAAO,CAAC,YAAY;IAKpB,oGAAoG;IACpG,OAAO,CAAC,OAAO;CAqBhB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Public v2 registry intake with event-local opening preflight and durable retention. */
|
|
2
2
|
import { type BlindState, type BoundState, type SerderACDC } from "cesr-ts";
|
|
3
|
+
import type { AgentCue } from "../core/cues.js";
|
|
4
|
+
import type { Deck } from "../core/deck.js";
|
|
3
5
|
import type { Baser } from "../db/basing.js";
|
|
4
6
|
import { type RegistryEventDecision } from "./regengine.js";
|
|
5
7
|
import { type RegistryEvent, type RegistrySourceLocators } from "./regeventing.js";
|
|
@@ -22,11 +24,13 @@ export type RegistryObserverDecision = RegistryEventDecision | {
|
|
|
22
24
|
* event commits independently; a later failure preserves the already accepted prefix.
|
|
23
25
|
* Parsed evidence stays borrowed. Composition supplies this owner to v2 protocol dispatch;
|
|
24
26
|
* no local habitat, alias or application disclosure custody is created by public intake.
|
|
27
|
+
* `cues` receives the issuer KEL `logs` query of each event that first waits for its anchoring KEL event.
|
|
25
28
|
*/
|
|
26
29
|
export declare class RegistryObserver {
|
|
27
30
|
readonly db: Baser;
|
|
28
31
|
readonly store: RegistryStore;
|
|
29
|
-
|
|
32
|
+
readonly cues: Deck<AgentCue> | null;
|
|
33
|
+
constructor(db: Baser, store: RegistryStore, cues?: Deck<AgentCue> | null);
|
|
30
34
|
/** Stage parsed events before inception, otherwise delegate ordinary validation and acceptance. */
|
|
31
35
|
processEvent(serder: SerderACDC, locators?: RegistryIntakeEvidence): RegistryObserverDecision;
|
|
32
36
|
/** Retry one registry after inception/KEL dependencies arrive; never scan every registry implicitly. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observing.d.ts","sourceRoot":"","sources":["../../src/acdc/observing.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAwC,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"observing.d.ts","sourceRoot":"","sources":["../../src/acdc/observing.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAwC,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAClH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAK5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E,+EAA+E;AAC/E,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAC9B;AAED,uFAAuF;AACvF,MAAM,MAAM,wBAAwB,GAChC,qBAAqB,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAElE;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IACf,QAAQ,CAAC,EAAE,EAAE,KAAK;IAAE,QAAQ,CAAC,KAAK,EAAE,aAAa;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI;gBAA9E,EAAE,EAAE,KAAK,EAAW,KAAK,EAAE,aAAa,EAAW,IAAI,GAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAW;IAE1G,mGAAmG;IACnG,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAE,sBAA2B,GAAG,wBAAwB;IA6CjG,wGAAwG;IACxG,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMnC;;;OAGG;IACH,iBAAiB,IAAI,IAAI;IAQzB,+FAA+F;IAC/F,OAAO,CAAC,MAAM;CAkBf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Milliseconds between the first resends of a query, and the shortest gap a receiver re-sends a stored reply. */
|
|
2
|
+
export declare const QUERY_RESEND_MS = 1000;
|
|
3
|
+
/** The longest gap the backoff reaches, in milliseconds. */
|
|
4
|
+
export declare const QUERY_RESEND_CAP_MS = 8000;
|
|
5
|
+
/** One group operation's frozen threshold query and when it may next be sent; memory only. */
|
|
6
|
+
export declare class ThresholdQueryResend {
|
|
7
|
+
/** The frozen signed query, unchanged on every resend; absent until the members' contributions complete it. */
|
|
8
|
+
query?: Uint8Array;
|
|
9
|
+
private queryAt;
|
|
10
|
+
private next;
|
|
11
|
+
private wait;
|
|
12
|
+
/** Take the frozen query and restart the schedule; its own `dt` is what the acceptance window is measured from. */
|
|
13
|
+
set(query: Uint8Array): void;
|
|
14
|
+
/** Whether a query is frozen and the running gap has elapsed at `now` (epoch ms). */
|
|
15
|
+
ready(now: number): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the query is still younger than `windowMs` at `now`; past it a receiver can no longer accept the
|
|
18
|
+
* unchanged query, so it is not sent again. A null window (this store never ran KRAM) never closes.
|
|
19
|
+
*/
|
|
20
|
+
fresh(now: number, windowMs: number | null): boolean;
|
|
21
|
+
/** Record a send at `now`: the next gap doubles from `baseMs` up to {@link QUERY_RESEND_CAP_MS}. */
|
|
22
|
+
sent(now: number, baseMs: number): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=query-resend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-resend.d.ts","sourceRoot":"","sources":["../../src/acdc/query-resend.ts"],"names":[],"mappings":"AAcA,kHAAkH;AAClH,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,8FAA8F;AAC9F,qBAAa,oBAAoB;IAC/B,+GAA+G;IAC/G,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,IAAI,CAAK;IAEjB,mHAAmH;IACnH,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAU5B,qFAAqF;IACrF,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI3B;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAIpD,oGAAoG;IACpG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAIxC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** Shared TEL validation, accepted-state publication, anchoring and retry for local and foreign registries. */
|
|
2
2
|
import { Diger, NumberPrimitive, type Saider, SerderACDC } from "cesr-ts";
|
|
3
|
+
import type { AgentCue } from "../core/cues.js";
|
|
4
|
+
import type { Deck } from "../core/deck.js";
|
|
5
|
+
import { type MissingAnchorQuery } from "../core/missing-anchor-query.js";
|
|
3
6
|
import type { Baser } from "../db/basing.js";
|
|
4
7
|
import { type RegistryEvent, type RegistryEventValidation, type RegistrySourceLocators } from "./regeventing.js";
|
|
5
8
|
import type { RegistryStore } from "./registering.js";
|
|
@@ -11,6 +14,8 @@ export type RegistryEventDecision = {
|
|
|
11
14
|
kind: "escrow";
|
|
12
15
|
reason: "anchor" | "order";
|
|
13
16
|
event: RegistryEvent;
|
|
17
|
+
/** Present only when this decision first placed the event in the anchor escrow and issuer KEL events are missing. */
|
|
18
|
+
query?: MissingAnchorQuery;
|
|
14
19
|
} | {
|
|
15
20
|
kind: "reject";
|
|
16
21
|
reason: "ordinalRange";
|
|
@@ -21,13 +26,18 @@ export type RegistryEventDecision = {
|
|
|
21
26
|
* Borrow the issuer's accepted KEL and registry store; no keys or handles are acquired.
|
|
22
27
|
* The local facade and foreign observer share this accepted-state engine.
|
|
23
28
|
* Publication is atomic; binding this instance happens only after successful commit.
|
|
29
|
+
* An event that first enters the anchor escrow publishes one issuer KEL `logs` query to `cues` after that write.
|
|
24
30
|
*/
|
|
25
31
|
export declare class RegistryEventer {
|
|
26
32
|
readonly db: Baser;
|
|
27
33
|
readonly issuer: string;
|
|
28
34
|
readonly store: RegistryStore;
|
|
29
35
|
regk: string | null;
|
|
30
|
-
|
|
36
|
+
/** Application cue flow for missing-anchor queries; null for a local issuer, whose own KEL holds every anchor. */
|
|
37
|
+
readonly cues: Deck<AgentCue> | null;
|
|
38
|
+
constructor(db: Baser, issuer: string, store: RegistryStore, regk?: string | null,
|
|
39
|
+
/** Application cue flow for missing-anchor queries; null for a local issuer, whose own KEL holds every anchor. */
|
|
40
|
+
cues?: Deck<AgentCue> | null);
|
|
31
41
|
/** Validated accepted head metadata; local construction may inspect it without duplicating acceptance checks. */
|
|
32
42
|
get acceptedHeadEvent(): RegistryEvent | null;
|
|
33
43
|
/** Read the accepted head only after validating its body and ordinal marker. */
|
|
@@ -59,6 +69,14 @@ export declare class RegistryEventer {
|
|
|
59
69
|
private processOne;
|
|
60
70
|
/** Validate, anchor and accept one inception, or retain its body in anchor escrow. */
|
|
61
71
|
private processInception;
|
|
72
|
+
/**
|
|
73
|
+
* Retain an event whose anchoring issuer KEL event is not accepted yet and decide whether to ask for it.
|
|
74
|
+
*
|
|
75
|
+
* The decision names the missing KEL only when this call put the event into the anchor escrow; retries and repeat
|
|
76
|
+
* arrivals find the row present. A source seal naming this issuer supplies the anchor's sequence number, and the
|
|
77
|
+
* highest one bounds the replay; without one the query names only where the recipient's KEL ends.
|
|
78
|
+
*/
|
|
79
|
+
private escrowAnchorless;
|
|
62
80
|
/** Replay is read-only; first acceptance repeats this check under its write transaction. */
|
|
63
81
|
private acceptedEvent;
|
|
64
82
|
/** Accepted markers require a matching body at the exact ordinal, unlike mere staged bodies. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regengine.d.ts","sourceRoot":"","sources":["../../src/acdc/regengine.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,OAAO,EACL,KAAK,EAEL,eAAe,EACf,KAAK,MAAM,EACX,UAAU,EACX,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"regengine.d.ts","sourceRoot":"","sources":["../../src/acdc/regengine.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,OAAO,EACL,KAAK,EAEL,eAAe,EACf,KAAK,MAAM,EACX,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAoB,KAAK,kBAAkB,EAAsB,MAAM,iCAAiC,CAAC;AAChH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAK5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,QAAQ,GAA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BAAkB,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAYpH;AAmDD,uFAAuF;AACvF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAY3E;AAED,+FAA+F;AAC/F,wBAAgB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,EAAE,EAAE,KAAK,GAAG,eAAe,GAAG,IAAI,CAerH;AASD;;;;GAIG;AACH,wBAAgB,GAAG,CACjB,EAAE,GAAG,EAAE,OAAY,EAAE,EAAE,EAAE,OAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,gBAAgB,GAC9E,oBAAoB,CAyDtB;AAED,wEAAwE;AACxE,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAChF,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,EAAE,GAAG,EAAE,OAAY,EAAE,EAAE,EAAE,OAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,aAAqB,EAAE,EACnH,uBAAuB,GACxB,oBAAoB,CAuDtB"}
|
|
@@ -54,12 +54,15 @@ export declare class Unblind implements AuxiliaryQueryProcessor {
|
|
|
54
54
|
readonly registry: RegistryObserver;
|
|
55
55
|
readonly group: boolean;
|
|
56
56
|
private readonly kram;
|
|
57
|
+
private readonly now;
|
|
57
58
|
/** Bind the exact Grant verifier's store; the state vocabulary is chosen per approved operation. */
|
|
58
|
-
constructor({ hab, exc, registry, rvy, kram }: {
|
|
59
|
+
constructor({ hab, exc, registry, rvy, now, kram }: {
|
|
59
60
|
hab: Hab;
|
|
60
61
|
exc: Exchanger;
|
|
61
62
|
registry: RegistryObserver;
|
|
62
63
|
rvy?: Revery;
|
|
64
|
+
/** Epoch-millisecond clock that paces reply re-emission for duplicate queries. */
|
|
65
|
+
now?: () => number;
|
|
63
66
|
/** False when the runtime has KRAM off: its `tmsc`/`msgc` rows never exist, so `approve` refuses. */
|
|
64
67
|
kram?: boolean;
|
|
65
68
|
});
|
|
@@ -113,6 +116,15 @@ export declare class Unblind implements AuxiliaryQueryProcessor {
|
|
|
113
116
|
hasPeerQuery(xid: string): boolean;
|
|
114
117
|
/** Retry a previously authenticated request locally when held proofs become available. */
|
|
115
118
|
respond(xid: string): Uint8Array;
|
|
119
|
+
/** The query as held and compared: its frame, every attachment group, the public evidence and KRAM's normalized proof. */
|
|
120
|
+
private queryWire;
|
|
121
|
+
/**
|
|
122
|
+
* A copy of the accepted query: nothing is verified or derived again. If the reply exists it is queued again for
|
|
123
|
+
* a peer that lost it, at most once per {@link QUERY_RESEND_MS}.
|
|
124
|
+
*/
|
|
125
|
+
private duplicateQuery;
|
|
126
|
+
/** Queue the stored reply for the recipient and note when. */
|
|
127
|
+
private emitReply;
|
|
116
128
|
/** Independently vet openings before caching them; Revery owns signature threshold and BADA. */
|
|
117
129
|
processReply({ serder, diger, route, cigars, tsgs, attachments }: {
|
|
118
130
|
serder: SerderKERI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unblinding.d.ts","sourceRoot":"","sources":["../../src/acdc/unblinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAGL,KAAK,KAAK,EAGV,KAAK,EAQL,KAAK,UAAU,EAGhB,MAAM,SAAS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G,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,SAAS;IAUjB,iGAAiG;IACjG,OAAO,CAAC,MAAM;IAcd,kGAAkG;IAClG,OAAO,CAAC,YAAY;IAapB,kGAAkG;IAClG,OAAO,CAAC,aAAa;IAWrB,gGAAgG;IAChG,OAAO,CAAC,YAAY;IA4BpB,iFAAiF;IACjF,OAAO,CAAC,WAAW;IA0CnB,OAAO,CAAC,MAAM;IAYd,4FAA4F;IAC5F,OAAO,CAAC,cAAc;IAyDtB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,IAAI;IAkCZ,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,aAAa;CA4BtB"}
|
|
@@ -294,6 +294,27 @@ export declare class Poster {
|
|
|
294
294
|
* @throws UnsendableMessageError when a forwarded ordinary message is not exactly one message.
|
|
295
295
|
*/
|
|
296
296
|
private prepareBytesTarget;
|
|
297
|
+
/**
|
|
298
|
+
* Whether the configured relay is already known to hold what it needs to verify `signer`'s `/fwd` wrappers, so
|
|
299
|
+
* the whole-KEL introduction can be left out.
|
|
300
|
+
*
|
|
301
|
+
* The relay verifies a wrapper against the signer's current key state, which the signer's latest establishment
|
|
302
|
+
* event fixes; interaction events do not change it. The evidence is `Baser.kpub`, the record the KEL publisher
|
|
303
|
+
* keeps per (identifier, mailbox) of the establishment event whose KEL (delegation chain included, and only once a
|
|
304
|
+
* delegated establishment is anchored) the mailbox was last given. The relay is the signer's mailbox, so the
|
|
305
|
+
* publisher and the mailbox admin request keep that record. Any other endpoint, and any mismatch or missing
|
|
306
|
+
* record, keeps today's full introduction.
|
|
307
|
+
*
|
|
308
|
+
* Known limit: a 2xx is not acceptance, and a relay that lost its store answers a `/fwd` from a sender it no
|
|
309
|
+
* longer knows with the same 204 acknowledgement and drops it. Nothing in the `/fwd` path signals that today; the
|
|
310
|
+
* sender's next mailbox poll gets the relay's 403, which makes `KelPublisher` clear the record and repost the KEL.
|
|
311
|
+
* Wrappers sent in between are lost until then.
|
|
312
|
+
*
|
|
313
|
+
* @param signer Local habitat that signs the wrapper (a group's local member).
|
|
314
|
+
* @param eid Endpoint AID the prepared wire goes to.
|
|
315
|
+
* @returns True only when `eid` is the relay and the record holds `signer`'s current establishment heads.
|
|
316
|
+
*/
|
|
317
|
+
private relayHoldsKel;
|
|
297
318
|
/**
|
|
298
319
|
* Prepare complete signed wire and its introduction before opening transport.
|
|
299
320
|
*
|