@ibgib/core-gib 0.1.23 → 0.1.26
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/common/other/graph-helper.d.mts +17 -0
- package/dist/common/other/graph-helper.d.mts.map +1 -1
- package/dist/common/other/graph-helper.mjs +44 -0
- package/dist/common/other/graph-helper.mjs.map +1 -1
- package/dist/common/other/ibgib-helper.d.mts +1 -1
- package/dist/common/other/ibgib-helper.d.mts.map +1 -1
- package/dist/common/other/ibgib-helper.mjs.map +1 -1
- package/dist/sync/graft-info/graft-info-helpers.mjs +2 -2
- package/dist/sync/graft-info/graft-info-helpers.mjs.map +1 -1
- package/dist/sync/sync-conflict.respec.mjs +10 -15
- package/dist/sync/sync-conflict.respec.mjs.map +1 -1
- package/dist/sync/sync-constants.d.mts +1 -0
- package/dist/sync/sync-constants.d.mts.map +1 -1
- package/dist/sync/sync-constants.mjs +1 -0
- package/dist/sync/sync-constants.mjs.map +1 -1
- package/dist/sync/sync-helpers.d.mts +5 -0
- package/dist/sync/sync-helpers.d.mts.map +1 -1
- package/dist/sync/sync-helpers.mjs +37 -1
- package/dist/sync/sync-helpers.mjs.map +1 -1
- package/dist/sync/sync-innerspace-constants.respec.mjs +10 -12
- package/dist/sync/sync-innerspace-constants.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs +10 -12
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs +10 -12
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs +9 -12
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-partial-update.respec.mjs +9 -14
- package/dist/sync/sync-innerspace-partial-update.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace.respec.mjs +9 -12
- package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.d.mts +2 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mjs +4 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts +24 -13
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +176 -76
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts +29 -6
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +38 -55
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +111 -244
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +32 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +96 -7
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +59 -13
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +446 -304
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts +51 -6
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts.map +1 -1
- package/dist/sync/sync-types.d.mts +35 -10
- package/dist/sync/sync-types.d.mts.map +1 -1
- package/dist/sync/sync-types.mjs +1 -2
- package/dist/sync/sync-types.mjs.map +1 -1
- package/package.json +1 -1
- package/src/common/other/graph-helper.mts +53 -0
- package/src/common/other/ibgib-helper.mts +1 -1
- package/src/sync/graft-info/graft-info-helpers.mts +3 -3
- package/src/sync/sync-conflict.respec.mts +10 -17
- package/src/sync/sync-constants.mts +1 -0
- package/src/sync/sync-helpers.mts +47 -7
- package/src/sync/sync-innerspace-constants.respec.mts +10 -12
- package/src/sync/sync-innerspace-deep-updates.respec.mts +10 -12
- package/src/sync/sync-innerspace-dest-ahead.respec.mts +10 -12
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +9 -12
- package/src/sync/sync-innerspace-partial-update.respec.mts +9 -14
- package/src/sync/sync-innerspace.respec.mts +9 -12
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mts +7 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +200 -75
- package/src/sync/sync-peer/sync-peer-types.mts +35 -11
- package/src/sync/sync-peer/sync-peer-v1.mts +154 -257
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +90 -13
- package/src/sync/sync-saga-coordinator.mts +536 -356
- package/src/sync/sync-saga-message/sync-saga-message-types.mts +56 -4
- package/src/sync/sync-types.mts +46 -13
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module SyncPeer_V1 witness class
|
|
2
|
+
* @module SyncPeer_V1 witness class for base class plumbing of sync peers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* NOTE: All push/pulls in this were done to get to compile. These should mostly
|
|
6
|
-
* not be single push/pull calls but should be batched with multiple addresses
|
|
7
|
-
* NOTE: All push/pulls in this were done to get to compile. These should mostly
|
|
8
|
-
* not be single push/pull calls but should be batched with multiple addresses
|
|
9
|
-
* NOTE: All push/pulls in this were done to get to compile. These should mostly
|
|
10
|
-
* not be single push/pull calls but should be batched with multiple addresses
|
|
11
|
-
* NOTE: All push/pulls in this were done to get to compile. These should mostly
|
|
12
|
-
* not be single push/pull calls but should be batched with multiple addresses
|
|
13
|
-
* NOTE: All push/pulls in this were done to get to compile. These should mostly
|
|
14
|
-
* not be single push/pull calls but should be batched with multiple addresses
|
|
4
|
+
* You are expected to implement concrete peer classes for concrete architecture.
|
|
15
5
|
*/
|
|
16
6
|
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
17
|
-
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
18
7
|
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
19
|
-
import { SYNC_MSG_REL8N_NAME, SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN } from '../sync-constants.mjs';
|
|
20
8
|
import { LightWitnessBase_V1 } from '../../witness/light-witness-base-v1.mjs';
|
|
21
9
|
import { newupSubject } from '../../common/pubsub/subject/subject-helper.mjs';
|
|
22
|
-
import {
|
|
10
|
+
import { authenticateContext, authorizeContext, validateContextAndSagaFrame } from '../sync-saga-context/sync-saga-context-helpers.mjs';
|
|
23
11
|
import { getFromSpace } from '../../witness/space/space-helper.mjs';
|
|
24
12
|
const logalot = GLOBAL_LOG_A_LOT || true;
|
|
25
13
|
const logalotControlDomain = true;
|
|
@@ -36,8 +24,7 @@ const lcControlDomain = '[ControlDomain]';
|
|
|
36
24
|
*/
|
|
37
25
|
export class SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
38
26
|
lc = `[${SyncPeer_V1.name}]`;
|
|
39
|
-
|
|
40
|
-
senderTempSpace;
|
|
27
|
+
opts;
|
|
41
28
|
payloadIbGibsDomainReceived$;
|
|
42
29
|
get classname() {
|
|
43
30
|
if (!this.data) {
|
|
@@ -48,80 +35,27 @@ export class SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
|
48
35
|
}
|
|
49
36
|
return this.data.classname;
|
|
50
37
|
}
|
|
51
|
-
constructor(
|
|
38
|
+
constructor(initialData, initialRel8ns) {
|
|
52
39
|
super(initialData, initialRel8ns);
|
|
53
|
-
this.senderSpace = senderSpace;
|
|
54
|
-
this.senderTempSpace = senderTempSpace;
|
|
55
40
|
}
|
|
56
41
|
async initialize() {
|
|
57
42
|
this.payloadIbGibsDomainReceived$ = await newupSubject();
|
|
58
43
|
}
|
|
59
44
|
/**
|
|
60
|
-
*
|
|
45
|
+
* base implementation just sets the opts property.
|
|
61
46
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
47
|
+
* override this in concrete classes for further initialization code
|
|
48
|
+
* specific to the sender.
|
|
64
49
|
*
|
|
65
|
-
* @
|
|
66
|
-
* @returns The INCOMING context (Response), or undefined if failed/empty.
|
|
50
|
+
* @see {@link SyncPeerWitness.opts}
|
|
67
51
|
*/
|
|
68
|
-
async
|
|
69
|
-
const lc = `${this.lc}[${this.
|
|
52
|
+
async initializeSender(opts) {
|
|
53
|
+
const lc = `${this.lc}[${this.initializeSender.name}]`;
|
|
70
54
|
try {
|
|
71
55
|
if (logalot) {
|
|
72
|
-
console.log(`${lc} starting
|
|
73
|
-
}
|
|
74
|
-
if (logalot) {
|
|
75
|
-
console.log(`${lc} starting...`);
|
|
76
|
-
}
|
|
77
|
-
// validate, authenticate, and authorize the context, sagaFrame, and identity(s)
|
|
78
|
-
const validationErrors = await validateContext({ context });
|
|
79
|
-
if (validationErrors.length > 0) {
|
|
80
|
-
throw new Error(`invalid context received. validationErrors: ${validationErrors} (E: 8b34c875c968af29bc433138e57a7826)`);
|
|
81
|
-
}
|
|
82
|
-
const authenticationErrors = await this.authenticateContext({ context });
|
|
83
|
-
if (authenticationErrors.length > 0) {
|
|
84
|
-
throw new Error(`invalid context authentication. authenticationErrors: ${authenticationErrors} (E: da89da5ee1269aeb78952d475d607526)`);
|
|
56
|
+
console.log(`${lc} starting... (I: 31bd5fda37c89fa37fbaf14daf5fe726)`);
|
|
85
57
|
}
|
|
86
|
-
|
|
87
|
-
if (authorizationErrors.length > 0) {
|
|
88
|
-
throw new Error(`invalid context authorization. authorizationErrors: ${authorizationErrors} (E: 8ddc284a758cf10ba829334c1babb826)`);
|
|
89
|
-
}
|
|
90
|
-
// at this point, we have a valid, authenticated, authorized context
|
|
91
|
-
// persist the context, sagaframe, identity(s) ONLY in the receiver's durable space
|
|
92
|
-
// if sending domain ibgibs...
|
|
93
|
-
// verify the domain ibgibs intrinsically.
|
|
94
|
-
// persist the domain ibgibs in the receiver's temp space (push all addrs?)
|
|
95
|
-
// await until all domain ibgibs are in receiver's temp space
|
|
96
|
-
// process the context with the receiver's coordinator to get a new response context
|
|
97
|
-
// analyze the response context
|
|
98
|
-
// validate context intrinsically
|
|
99
|
-
// validate return identity if present
|
|
100
|
-
// persist the response context's dependency graph (context, saga frame and msg(s), identities)
|
|
101
|
-
// if response has payload domain ibgibs,
|
|
102
|
-
// spin off...
|
|
103
|
-
// pull domain ibgibs to local temp space
|
|
104
|
-
// publish domain ibgibs to observable
|
|
105
|
-
// when all domain ibgibs are pulled, publish complete to the observable
|
|
106
|
-
// return resulting context ibgib (which the caller should get BEFORE the domain ibgibs observable completes)
|
|
107
|
-
// 1. PUSH: Ensure Request Data is available on Receiver
|
|
108
|
-
await this.pushContextGraph({ context }); // ???
|
|
109
|
-
// 2. EXECUTE: Trigger Remote Processing
|
|
110
|
-
const response = await this.sendContextRequest(context);
|
|
111
|
-
if (!response) {
|
|
112
|
-
if (logalot) {
|
|
113
|
-
console.log(`${lc} No response from peer.`);
|
|
114
|
-
}
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
// at this point, we have received the response context, sync saga
|
|
118
|
-
// frame/msg stones, and any keystones should be evolved. Depending
|
|
119
|
-
// on the concrete implementation, if there are domain ibgibs to
|
|
120
|
-
// receive, they may already be coming.
|
|
121
|
-
// todo: this pull is a
|
|
122
|
-
// 3. PULL: Ensure Response Data is available on Sender (Local)
|
|
123
|
-
await this.pullContextGraph({ context: response });
|
|
124
|
-
return response;
|
|
58
|
+
this.opts = opts;
|
|
125
59
|
}
|
|
126
60
|
catch (error) {
|
|
127
61
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -133,39 +67,19 @@ export class SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
|
133
67
|
}
|
|
134
68
|
}
|
|
135
69
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
*/
|
|
139
|
-
async authenticateContext({ context }) {
|
|
140
|
-
const lc = `${this.lc}[${this.authenticateContext.name}]`;
|
|
70
|
+
setOptionalOpts(arg) {
|
|
71
|
+
const lc = `${this.lc}[${this.setOptionalOpts.name}]`;
|
|
141
72
|
try {
|
|
142
73
|
if (logalot) {
|
|
143
|
-
console.log(`${lc} starting... (I:
|
|
74
|
+
console.log(`${lc} starting... (I: ae5ddbd3577db267f84743175a736626)`);
|
|
144
75
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
finally {
|
|
153
|
-
if (logalot) {
|
|
154
|
-
console.log(`${lc} complete.`);
|
|
76
|
+
if (!this.opts) {
|
|
77
|
+
throw new Error(`(UNEXPECTED) this.opts falsy? (E: 0dd4d6080a6e2f31d86cf4d86e11b826)`);
|
|
155
78
|
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* move to sync-peer-helpers.mts as a pure function?
|
|
160
|
-
*/
|
|
161
|
-
async authorizeContext({ context }) {
|
|
162
|
-
const lc = `${this.lc}[${this.authorizeContext.name}]`;
|
|
163
|
-
try {
|
|
164
79
|
if (logalot) {
|
|
165
|
-
console.log(`${lc}
|
|
80
|
+
console.log(`${lc} updating opts. arg keys: ${Object.keys(arg)} (I: 452d78a558f8fc3468c8e2e68c70b226)`);
|
|
166
81
|
}
|
|
167
|
-
|
|
168
|
-
return [];
|
|
82
|
+
this.opts = { ...this.opts, ...arg };
|
|
169
83
|
}
|
|
170
84
|
catch (error) {
|
|
171
85
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -178,154 +92,104 @@ export class SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
|
178
92
|
}
|
|
179
93
|
}
|
|
180
94
|
/**
|
|
181
|
-
*
|
|
95
|
+
* Witness the synchronization context (Send/Receive).
|
|
96
|
+
*
|
|
97
|
+
* At this point in code, we are sending the context OUTGOING. The {@link context} should
|
|
98
|
+
* have a fully populated {@link SyncSagaContextIbGib_V1.sagaFrame}
|
|
99
|
+
*
|
|
100
|
+
* @param arg The OUTGOING context (Request).
|
|
101
|
+
* @returns The INCOMING context (Response), or undefined if failed/empty.
|
|
182
102
|
*/
|
|
183
|
-
async
|
|
184
|
-
const lc =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
console.log(`${lc}${lcControlDomain} PUSH Context Envelope -> ${contextAddr} (I: 3f4e5a6b7c8d9e0f)`);
|
|
189
|
-
}
|
|
190
|
-
await this.push([contextAddr]);
|
|
191
|
-
// B. Push Saga Frame & Immediate Deps (Msg, Identity)
|
|
192
|
-
const frameAddr = context.rel8ns?.sagaFrame?.[0];
|
|
193
|
-
if (frameAddr) {
|
|
194
|
-
if (logalotControlDomain) {
|
|
195
|
-
console.log(`${lc}${lcControlDomain} PUSH CONTROL: Saga Frame -> ${frameAddr} (I: 4a5b6c7d8e9f0a1b)`);
|
|
196
|
-
}
|
|
197
|
-
await this.push([frameAddr]);
|
|
198
|
-
// We inspect the local frame to find its immediate deps
|
|
199
|
-
const frame = await this.getLocalIbGib(frameAddr);
|
|
200
|
-
if (frame) {
|
|
201
|
-
// Msg Stone
|
|
202
|
-
const msgAddrs = frame.rel8ns?.[SYNC_MSG_REL8N_NAME];
|
|
203
|
-
if (msgAddrs) {
|
|
204
|
-
for (const addr of msgAddrs) {
|
|
205
|
-
if (logalotControlDomain) {
|
|
206
|
-
console.log(`${lc}${lcControlDomain} PUSH CONTROL: Msg Stone -> ${addr} (I: 5b6c7d8e9f0a1b2c)`);
|
|
207
|
-
}
|
|
208
|
-
await this.push([addr]);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
// Identity
|
|
212
|
-
const idAddrs = frame.rel8ns?.identity;
|
|
213
|
-
if (idAddrs) {
|
|
214
|
-
for (const addr of idAddrs) {
|
|
215
|
-
if (logalotControlDomain) {
|
|
216
|
-
console.log(`${lc}${lcControlDomain} PUSH CONTROL: Identity -> ${addr} (I: 6c7d8e9f0a1b2c3d)`);
|
|
217
|
-
}
|
|
218
|
-
await this.push([addr]);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
103
|
+
async witness(context) {
|
|
104
|
+
const lc = `${this.lc}[${this.witness.name}]`;
|
|
105
|
+
try {
|
|
106
|
+
if (logalot) {
|
|
107
|
+
console.log(`${lc} starting...`);
|
|
221
108
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
109
|
+
if (!this.opts) {
|
|
110
|
+
throw new Error(`(UNEXPECTED) this.opts falsy? Concrete class should have initialized sender opts by now. (E: 0b9e28287318fdf8bf9f5a6886a24826)`);
|
|
111
|
+
}
|
|
112
|
+
// NOTE: There are two basic types of peers:
|
|
113
|
+
// * local-only (peer)
|
|
114
|
+
// * this peer is both sender/receiver peer
|
|
115
|
+
// * for local merges and relatively fast spaces
|
|
116
|
+
// * proxy to remote space
|
|
117
|
+
// * this peer is both sender/receiver peer
|
|
118
|
+
// * works directly with remote/outerspaces
|
|
119
|
+
// * Less efficient over-the-wire xfer due to chatiness
|
|
120
|
+
// * symmetric node sender/receiver peers
|
|
121
|
+
// * separate sender/receiver classes
|
|
122
|
+
// * e.g., SyncPeerClient[Substrate]Sender_V1,
|
|
123
|
+
// SyncPeerClient[Substrate]Receiver_V1
|
|
124
|
+
// * More efficient over-the-wire xfer
|
|
125
|
+
// * Most difficult to mentally model
|
|
126
|
+
// * sender.witness does the pushing out
|
|
127
|
+
// * what the sender/initiator's coordinator has a reference to
|
|
128
|
+
// * receiver.witness does the coming in
|
|
129
|
+
// * lives on a server/remote instance with its own coordinator
|
|
130
|
+
// instance
|
|
131
|
+
// * must do its own validation/authn/authz for possible MITM
|
|
132
|
+
// issues
|
|
133
|
+
// The following is a sketch where some of these may be blurred
|
|
134
|
+
// persist the context, sagaframe, identity(s) ONLY in the receiver's durable space
|
|
135
|
+
// if sending domain ibgibs...
|
|
136
|
+
// verify the domain ibgibs intrinsically.
|
|
137
|
+
// persist the domain ibgibs in the receiver's temp space (push all addrs?)
|
|
138
|
+
// await until all domain ibgibs are in receiver's temp space
|
|
139
|
+
// process the context with the receiver's coordinator to get a new response context
|
|
140
|
+
// analyze the response context
|
|
141
|
+
// validate context intrinsically
|
|
142
|
+
// validate return identity if present
|
|
143
|
+
// persist the response context's dependency graph (context, saga frame and msg(s), identities)
|
|
144
|
+
// if response has payload domain ibgibs,
|
|
145
|
+
// spin off...
|
|
146
|
+
// pull domain ibgibs to local temp space
|
|
147
|
+
// publish domain ibgibs to observable
|
|
148
|
+
// when all domain ibgibs are pulled, publish complete to the observable
|
|
149
|
+
// return resulting context ibgib (which the caller should get BEFORE the domain ibgibs observable completes)
|
|
150
|
+
// validate, authenticate, and authorize the context, sagaFrame, and identity(s)
|
|
151
|
+
const validationErrors = await validateContextAndSagaFrame({ context });
|
|
152
|
+
if (validationErrors.length > 0) {
|
|
153
|
+
throw new Error(`invalid context received. validationErrors: ${validationErrors} (E: 8b34c875c968af29bc433138e57a7826)`);
|
|
228
154
|
}
|
|
229
|
-
await
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
// For payloads, the Peer is just a transport. It doesn't know the structure.
|
|
233
|
-
// It relies on "push" handling the "deep" transfer if needed, or we explicitly iterate if we had a graph.
|
|
234
|
-
// But since we are "Witnessing", we usually assume "push(addr)" acts like "copy(addr, recursive=true)"?
|
|
235
|
-
// Or do we need to be explicit?
|
|
236
|
-
// User said: "payloads should be flat... sync coordinator is the one doing the heavy lifting".
|
|
237
|
-
// So we just push the addrs listed.
|
|
238
|
-
// 1. Control Payloads
|
|
239
|
-
// const controlAddrs = context.data?.[SYNC_SAGA_PAYLOAD_ADDRS_CONTROL];
|
|
240
|
-
// if (controlAddrs && controlAddrs.length > 0) {
|
|
241
|
-
// if (logalotControlDomain) { console.log(`${lc}${lcControlDomain} PUSH CONTROL PAYLOADS (${controlAddrs.length}): ${controlAddrs.join(', ')} (I: 8e9f0a1b2c3d4e5f)`); }
|
|
242
|
-
// for (const addr of controlAddrs) {
|
|
243
|
-
// await this.push(addr);
|
|
244
|
-
// }
|
|
245
|
-
// }
|
|
246
|
-
// 2. Domain Payloads
|
|
247
|
-
const domainAddrs = context.data?.[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN];
|
|
248
|
-
if (domainAddrs && domainAddrs.length > 0) {
|
|
249
|
-
if (logalotControlDomain) {
|
|
250
|
-
console.log(`${lc}${lcControlDomain} PUSH DOMAIN PAYLOADS (${domainAddrs.length}): ${domainAddrs.join(', ')} (I: 9f0a1b2c3d4e5f6a)`);
|
|
155
|
+
const authenticationErrors = await authenticateContext({ context });
|
|
156
|
+
if (authenticationErrors.length > 0) {
|
|
157
|
+
throw new Error(`invalid context authentication. authenticationErrors: ${authenticationErrors} (E: da89da5ee1269aeb78952d475d607526)`);
|
|
251
158
|
}
|
|
252
|
-
|
|
253
|
-
|
|
159
|
+
const authorizationErrors = await authorizeContext({ context });
|
|
160
|
+
if (authorizationErrors.length > 0) {
|
|
161
|
+
throw new Error(`invalid context authorization. authorizationErrors: ${authorizationErrors} (E: 8ddc284a758cf10ba829334c1babb826)`);
|
|
254
162
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (logalotControlDomain) {
|
|
268
|
-
console.log(`${lc}${lcControlDomain} PULL Context Envelope <- ${contextAddr} (I: b1c2d3e4f5a6b7c8)`);
|
|
269
|
-
}
|
|
270
|
-
await this.pull([contextAddr]);
|
|
271
|
-
// B. Pull Saga Frame & Immediate Deps
|
|
272
|
-
const frameAddr = context.rel8ns?.sagaFrame?.[0];
|
|
273
|
-
if (frameAddr) {
|
|
274
|
-
if (logalotControlDomain) {
|
|
275
|
-
console.log(`${lc}${lcControlDomain} PULL CONTROL: Saga Frame <- ${frameAddr} (I: c2d3e4f5a6b7c8d9)`);
|
|
163
|
+
// at this point, we have a valid, authenticated, authorized context
|
|
164
|
+
// execute the transfer of control domain ibgibs & outgoing payload
|
|
165
|
+
// ibgibs...
|
|
166
|
+
const response = await this.sendContextRequest(context);
|
|
167
|
+
if (response) {
|
|
168
|
+
// at this point, all outgoing payload domain ibgibs have been sent.
|
|
169
|
+
// we have received the response context, wherein the sync saga
|
|
170
|
+
// frame/msg stone(s) and any keystones should be evolved. Depending
|
|
171
|
+
// on the concrete implementation, if there are domain ibgibs to
|
|
172
|
+
// receive, they may still be transferring. These will be published
|
|
173
|
+
// to this.payloadIbGibsDomainReceived$
|
|
174
|
+
return response;
|
|
276
175
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const msgAddrs = frame.rel8ns?.[SYNC_MSG_REL8N_NAME];
|
|
282
|
-
if (msgAddrs) {
|
|
283
|
-
for (const addr of msgAddrs) {
|
|
284
|
-
if (logalotControlDomain) {
|
|
285
|
-
console.log(`${lc}${lcControlDomain} PULL CONTROL: Msg Stone <- ${addr} (I: d3e4f5a6b7c8d9e0)`);
|
|
286
|
-
}
|
|
287
|
-
await this.pull([addr]);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
const idAddrs = frame.rel8ns?.identity;
|
|
291
|
-
if (idAddrs) {
|
|
292
|
-
for (const addr of idAddrs) {
|
|
293
|
-
if (logalotControlDomain) {
|
|
294
|
-
console.log(`${lc}${lcControlDomain} PULL CONTROL: Identity <- ${addr} (I: e4f5a6b7c8d9e0f1)`);
|
|
295
|
-
}
|
|
296
|
-
await this.pull([addr]);
|
|
297
|
-
}
|
|
176
|
+
else {
|
|
177
|
+
// response falsy. we could be done, or this could be an error.
|
|
178
|
+
if (logalot) {
|
|
179
|
+
console.log(`${lc} No response from peer. this may be normal if we just sent the very last commit frame. (I: 1855b7728c8898e1f9c001f8170ba826)`);
|
|
298
180
|
}
|
|
181
|
+
return undefined;
|
|
299
182
|
}
|
|
300
183
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
if (logalotControlDomain) {
|
|
305
|
-
console.log(`${lc}${lcControlDomain} PULL CONTROL: Session Keystone <- ${sessionKeystoneAddr} (I: f5a6b7c8d9e0f1a2)`);
|
|
306
|
-
}
|
|
307
|
-
await this.pull([sessionKeystoneAddr]);
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
186
|
+
throw error;
|
|
308
187
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// if (logalotControlDomain) { console.log(`${lc}${lcControlDomain} PULL CONTROL PAYLOADS (${controlAddrs.length}): ${controlAddrs.join(', ')} (I: a6b7c8d9e0f1a2b3)`); }
|
|
313
|
-
// for (const addr of controlAddrs) {
|
|
314
|
-
// await this.pull(addr);
|
|
315
|
-
// }
|
|
316
|
-
// }
|
|
317
|
-
const domainAddrs = context.data?.[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN];
|
|
318
|
-
if (domainAddrs && domainAddrs.length > 0) {
|
|
319
|
-
if (logalotControlDomain) {
|
|
320
|
-
console.log(`${lc}${lcControlDomain} PULL DOMAIN PAYLOADS (${domainAddrs.length}): ${domainAddrs.join(', ')} (I: b7c8d9e0f1a2b3c4)`);
|
|
321
|
-
}
|
|
322
|
-
for (const addr of domainAddrs) {
|
|
323
|
-
await this.pull([addr]);
|
|
188
|
+
finally {
|
|
189
|
+
if (logalot) {
|
|
190
|
+
console.log(`${lc} complete.`);
|
|
324
191
|
}
|
|
325
192
|
}
|
|
326
|
-
if (logalotControlDomain) {
|
|
327
|
-
console.log(`${lc}${lcControlDomain} PULL COMPLETE for context ${contextAddr} (I: c8d9e0f1a2b3c4d5)`);
|
|
328
|
-
}
|
|
329
193
|
}
|
|
330
194
|
/**
|
|
331
195
|
* Abstract accessor to get an IbGib from the Local space/store.
|
|
@@ -340,13 +204,16 @@ export class SyncPeer_V1 extends LightWitnessBase_V1 {
|
|
|
340
204
|
console.log(`${lc} starting... (I: 27b248cb9801eeb2386b71485389a826)`);
|
|
341
205
|
}
|
|
342
206
|
console.warn(`${lc} possibly a bottleneck here, getLocalIbGib only gets a single ibgib... (W: 2fd448a435480e6b128f6b8bcbef4826)`);
|
|
343
|
-
|
|
207
|
+
if (!this.opts) {
|
|
208
|
+
throw new Error(`(UNEXPECTED) this.opts falsy? (E: cfb9431f2fb851f24a6c88e80c3b3326)`);
|
|
209
|
+
}
|
|
210
|
+
const resGet = await getFromSpace({ space: this.opts.senderSpace, addr });
|
|
344
211
|
if (resGet.success && resGet.ibGibs && resGet.ibGibs.length === 1) {
|
|
345
212
|
const ibGib = resGet.ibGibs[0];
|
|
346
213
|
return ibGib;
|
|
347
214
|
}
|
|
348
215
|
else {
|
|
349
|
-
throw new Error(`couldn't get addr (${addr}) from local space ${this.senderSpace}. reason: ${resGet.errorMsg ?? 'unknown error (E: 926ef8bf4fcc299ab89dba34ea691a26)'} (E: d8a89807e471d3f8b938ab21df44cb26)`);
|
|
216
|
+
throw new Error(`couldn't get addr (${addr}) from local space ${this.opts.senderSpace}. reason: ${resGet.errorMsg ?? 'unknown error (E: 926ef8bf4fcc299ab89dba34ea691a26)'} (E: d8a89807e471d3f8b938ab21df44cb26)`);
|
|
350
217
|
}
|
|
351
218
|
}
|
|
352
219
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-peer-v1.mjs","sourceRoot":"","sources":["../../../src/sync/sync-peer/sync-peer-v1.mts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sync-peer-v1.mjs","sourceRoot":"","sources":["../../../src/sync/sync-peer/sync-peer-v1.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAMlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACxI,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,MAAM,OAAO,GAAG,gBAAgB,IAAI,IAAI,CAAC;AACzC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,OAAgB,WAClB,SAAQ,mBAAuD;IAGrD,EAAE,GAAW,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC;IAExC,IAAI,CAA8B;IAClC,4BAA4B,CAA4B;IAE/D,IAAI,SAAS;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QAAC,CAAC;QAC3G,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAAC,CAAC;QAClI,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,YAAY,WAA4B,EAAE,aAAiC;QACvE,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAA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xN,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACjD,MAAM,KAAK,CAAC;QAChB,CAAC;gBAAS,CAAC;YACP,IAAI,OAAO,EAAE,CAAC;gBAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAAC,CAAC;QACpD,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -53,10 +53,41 @@ export declare function parseSyncSagaContextIb({ ib, }: {
|
|
|
53
53
|
* put/registered in {@link localSpace}.
|
|
54
54
|
*/
|
|
55
55
|
export declare function createSyncSagaContext({ sagaFrame, sessionKeystones, payloadIbGibsDomain, localSpace, }: CreateSyncSagaContextOptions): Promise<SyncSagaContextIbGib_V1>;
|
|
56
|
+
/**
|
|
57
|
+
* Validates ONLY the {@link context} ibgib itself and saga frame/msg stone(s)
|
|
58
|
+
* ({@link SyncSagaContextIbGib_V1.sagaFrame}).
|
|
59
|
+
*
|
|
60
|
+
* Does NOT...
|
|
61
|
+
* * validate keystones (authn or authz)
|
|
62
|
+
* * validate domain payload ibgibs...
|
|
63
|
+
* * intrinsically
|
|
64
|
+
* * in relation to this context (addrs match up)
|
|
65
|
+
*
|
|
66
|
+
* @returns empty array if valid, else validation errors
|
|
67
|
+
*/
|
|
68
|
+
export declare function validateContextAndSagaFrame({ context }: {
|
|
69
|
+
context: SyncSagaContextIbGib_V1;
|
|
70
|
+
}): Promise<string[]>;
|
|
71
|
+
/**
|
|
72
|
+
* validates {@link SyncSagaContextIbGib_V1.payloadIbGibsDomain} intrinsically,
|
|
73
|
+
* and ensures that these payloadIbGibs also match the expected addrs in
|
|
74
|
+
* {@link SyncSagaContextData_V1}[{@link SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN}].
|
|
75
|
+
*
|
|
76
|
+
* @returns empty array if valid, else validation errors
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateContextDomainPayloadIbGibs({ context }: {
|
|
79
|
+
context: SyncSagaContextIbGib_V1;
|
|
80
|
+
}): Promise<string[]>;
|
|
81
|
+
/**
|
|
82
|
+
* move to sync-peer-helpers.mts as a pure function?
|
|
83
|
+
*/
|
|
84
|
+
export declare function authenticateContext({ context }: {
|
|
85
|
+
context: SyncSagaContextIbGib_V1;
|
|
86
|
+
}): Promise<string[]>;
|
|
56
87
|
/**
|
|
57
88
|
* move to sync-peer-helpers.mts as a pure function?
|
|
58
89
|
*/
|
|
59
|
-
export declare function
|
|
90
|
+
export declare function authorizeContext({ context }: {
|
|
60
91
|
context: SyncSagaContextIbGib_V1;
|
|
61
92
|
}): Promise<string[]>;
|
|
62
93
|
//# sourceMappingURL=sync-saga-context-helpers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-saga-context-helpers.d.mts","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-helpers.mts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,QAAQ,EAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAC;AAMlD,OAAO,EACH,sBAAsB,EAAE,uBAAuB,EAAE,oBAAoB,EAExE,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-saga-context-helpers.d.mts","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-helpers.mts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,QAAQ,EAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAC;AAMlD,OAAO,EACH,sBAAsB,EAAE,uBAAuB,EAAE,oBAAoB,EAExE,MAAM,+BA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