@kumiai/rpc 0.3.0 → 0.3.1
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/lib/crypto.d.ts +9 -4
- package/lib/peer.js +2 -2
- package/package.json +3 -3
package/lib/crypto.d.ts
CHANGED
|
@@ -78,12 +78,17 @@ export type PendingRecovery = {
|
|
|
78
78
|
*/
|
|
79
79
|
export type GroupMLS = {
|
|
80
80
|
/**
|
|
81
|
-
* Read what a Commit says about itself — epoch and committer — WITHOUT
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
* Read what a Commit says about itself — epoch and committer — WITHOUT advancing state.
|
|
82
|
+
* `null` for bytes that are not a Commit. Lets the lane classify a frame (epoch = this
|
|
83
|
+
* peer's to apply? committer = this peer's own?) before touching it; neither question may
|
|
84
84
|
* be answered by trying and failing.
|
|
85
|
+
*
|
|
86
|
+
* Async and handle-bound: a real host recovers a member commit's committer by decrypting
|
|
87
|
+
* its sender-data with the epoch secret (an open, not an apply) and mapping the sender leaf
|
|
88
|
+
* to a DID against the ratchet tree — both reachable only on the handle the host already
|
|
89
|
+
* holds. The port reaches its own handle internally; the lane awaits.
|
|
85
90
|
*/
|
|
86
|
-
readCommitHeader(commit: Uint8Array): CommitHeader | null
|
|
91
|
+
readCommitHeader(commit: Uint8Array): Promise<CommitHeader | null>;
|
|
87
92
|
/**
|
|
88
93
|
* Apply a received Commit and durably persist the result, returning whether the epoch
|
|
89
94
|
* advanced (the signal to resync the app lane). Must be durable before it resolves.
|
package/lib/peer.js
CHANGED
|
@@ -482,7 +482,7 @@ export function createGroupPeer(params) {
|
|
|
482
482
|
// `message.senderDID` — the hub-authenticated publisher, the hub's word about who handed
|
|
483
483
|
// it over, and the hub is not trusted: a hub that could name the committer could stamp
|
|
484
484
|
// every recipient's own DID onto one poison frame and make the whole group heal at once.
|
|
485
|
-
const disposition = classifyCommit(port.readCommitHeader(commitFrame.commit), position, {
|
|
485
|
+
const disposition = classifyCommit(await port.readCommitHeader(commitFrame.commit), position, {
|
|
486
486
|
localDID,
|
|
487
487
|
epoch: crypto.epoch(),
|
|
488
488
|
appliedByEpoch
|
|
@@ -1075,7 +1075,7 @@ export function createGroupPeer(params) {
|
|
|
1075
1075
|
// the group's epoch, not this peer's, so the own-commit trigger (tests authorship AND
|
|
1076
1076
|
// current epoch) stays quiet; the original heal condition still holds, the peer rejoins
|
|
1077
1077
|
// again, and `resync` collects the leaf the orphan added. Leaves do not accumulate.
|
|
1078
|
-
const rejoinedAtEpoch = port.readCommitHeader(pending.commit)?.epoch;
|
|
1078
|
+
const rejoinedAtEpoch = (await port.readCommitHeader(pending.commit))?.epoch;
|
|
1079
1079
|
await pending.onAccepted();
|
|
1080
1080
|
const accepted = asLogPosition(sequenceID);
|
|
1081
1081
|
reconciledHead = accepted;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/rpc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "High-level MLS-aware group RPC for Enkaku: bus broadcast/anycast/gather plus directed RPC over the pub/sub hub",
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@enkaku/transport": "^0.19.1",
|
|
34
34
|
"@noble/hashes": "^2.0.0",
|
|
35
35
|
"@kumiai/broadcast": "^0.3.0",
|
|
36
|
-
"@kumiai/hub-
|
|
37
|
-
"@kumiai/hub-
|
|
36
|
+
"@kumiai/hub-protocol": "^0.3.0",
|
|
37
|
+
"@kumiai/hub-tunnel": "^0.3.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@noble/curves": "^2.0.1",
|