@avow-finance/spec 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +119 -2
- package/dist/agent-connect.d.ts +82 -0
- package/dist/agent-connect.d.ts.map +1 -0
- package/dist/agent-connect.js +91 -0
- package/dist/agent-connect.js.map +1 -0
- package/dist/agent-session.d.ts +791 -0
- package/dist/agent-session.d.ts.map +1 -0
- package/dist/agent-session.js +176 -0
- package/dist/agent-session.js.map +1 -0
- package/dist/ap2.d.ts +79 -0
- package/dist/ap2.d.ts.map +1 -0
- package/dist/ap2.js +151 -0
- package/dist/ap2.js.map +1 -0
- package/dist/api-request.d.ts +144 -0
- package/dist/api-request.d.ts.map +1 -0
- package/dist/api-request.js +246 -0
- package/dist/api-request.js.map +1 -0
- package/dist/api.d.ts +288 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +332 -0
- package/dist/api.js.map +1 -0
- package/dist/canonical.d.ts +22 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +66 -0
- package/dist/canonical.js.map +1 -0
- package/dist/commitment-card.d.ts +78 -0
- package/dist/commitment-card.d.ts.map +1 -0
- package/dist/commitment-card.js +224 -0
- package/dist/commitment-card.js.map +1 -0
- package/dist/commitment.d.ts +185 -0
- package/dist/commitment.d.ts.map +1 -0
- package/dist/commitment.js +148 -0
- package/dist/commitment.js.map +1 -0
- package/dist/compute-offers.d.ts +128 -0
- package/dist/compute-offers.d.ts.map +1 -0
- package/dist/compute-offers.js +111 -0
- package/dist/compute-offers.js.map +1 -0
- package/dist/contest.d.ts +88 -0
- package/dist/contest.d.ts.map +1 -0
- package/dist/contest.js +131 -0
- package/dist/contest.js.map +1 -0
- package/dist/demo.d.ts +69 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/demo.js +152 -0
- package/dist/demo.js.map +1 -0
- package/dist/dependencies.d.ts +308 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +133 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/eip712.d.ts +1569 -0
- package/dist/eip712.d.ts.map +1 -0
- package/dist/eip712.js +550 -0
- package/dist/eip712.js.map +1 -0
- package/dist/elided-terms.d.ts +37 -0
- package/dist/elided-terms.d.ts.map +1 -0
- package/dist/elided-terms.js +48 -0
- package/dist/elided-terms.js.map +1 -0
- package/dist/erc8183.d.ts +78 -0
- package/dist/erc8183.d.ts.map +1 -0
- package/dist/erc8183.js +88 -0
- package/dist/erc8183.js.map +1 -0
- package/dist/facts.d.ts +70 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +33 -0
- package/dist/facts.js.map +1 -0
- package/dist/gpu-reservation.d.ts +79 -0
- package/dist/gpu-reservation.d.ts.map +1 -0
- package/dist/gpu-reservation.js +135 -0
- package/dist/gpu-reservation.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/job-session.d.ts +981 -0
- package/dist/job-session.d.ts.map +1 -0
- package/dist/job-session.js +170 -0
- package/dist/job-session.js.map +1 -0
- package/dist/job-verification.d.ts +244 -0
- package/dist/job-verification.d.ts.map +1 -0
- package/dist/job-verification.js +89 -0
- package/dist/job-verification.js.map +1 -0
- package/dist/job-wording.d.ts +48 -0
- package/dist/job-wording.d.ts.map +1 -0
- package/dist/job-wording.js +134 -0
- package/dist/job-wording.js.map +1 -0
- package/dist/job.d.ts +117 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +166 -0
- package/dist/job.js.map +1 -0
- package/dist/json-fields.d.ts +13 -0
- package/dist/json-fields.d.ts.map +1 -0
- package/dist/json-fields.js +30 -0
- package/dist/json-fields.js.map +1 -0
- package/dist/keychain.d.ts +51 -0
- package/dist/keychain.d.ts.map +1 -0
- package/dist/keychain.js +133 -0
- package/dist/keychain.js.map +1 -0
- package/dist/mailbox.d.ts +1650 -0
- package/dist/mailbox.d.ts.map +1 -0
- package/dist/mailbox.js +87 -0
- package/dist/mailbox.js.map +1 -0
- package/dist/mandate.d.ts +53 -0
- package/dist/mandate.d.ts.map +1 -0
- package/dist/mandate.js +97 -0
- package/dist/mandate.js.map +1 -0
- package/dist/networks.d.ts +18 -0
- package/dist/networks.d.ts.map +1 -0
- package/dist/networks.js +24 -0
- package/dist/networks.js.map +1 -0
- package/dist/profiles.d.ts +31 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +33 -0
- package/dist/profiles.js.map +1 -0
- package/dist/rail.d.ts +48 -0
- package/dist/rail.d.ts.map +1 -0
- package/dist/rail.js +28 -0
- package/dist/rail.js.map +1 -0
- package/dist/reasons.d.ts +173 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +174 -0
- package/dist/reasons.js.map +1 -0
- package/dist/reference-link.d.ts +23 -0
- package/dist/reference-link.d.ts.map +1 -0
- package/dist/reference-link.js +56 -0
- package/dist/reference-link.js.map +1 -0
- package/dist/references.d.ts +125 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +108 -0
- package/dist/references.js.map +1 -0
- package/dist/replay.d.ts +30 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +27 -0
- package/dist/replay.js.map +1 -0
- package/dist/sandbox-registration.d.ts +200 -0
- package/dist/sandbox-registration.d.ts.map +1 -0
- package/dist/sandbox-registration.js +172 -0
- package/dist/sandbox-registration.js.map +1 -0
- package/dist/sandbox.d.ts +3478 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +316 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/session-fields.d.ts +203 -0
- package/dist/session-fields.d.ts.map +1 -0
- package/dist/session-fields.js +43 -0
- package/dist/session-fields.js.map +1 -0
- package/dist/supplier-adapter.d.ts +65 -0
- package/dist/supplier-adapter.d.ts.map +1 -0
- package/dist/supplier-adapter.js +91 -0
- package/dist/supplier-adapter.js.map +1 -0
- package/dist/terms-v1.d.ts +74 -0
- package/dist/terms-v1.d.ts.map +1 -0
- package/dist/terms-v1.js +156 -0
- package/dist/terms-v1.js.map +1 -0
- package/dist/terms.d.ts +341 -0
- package/dist/terms.d.ts.map +1 -0
- package/dist/terms.js +715 -0
- package/dist/terms.js.map +1 -0
- package/dist/test-customer.d.ts +1525 -0
- package/dist/test-customer.d.ts.map +1 -0
- package/dist/test-customer.js +260 -0
- package/dist/test-customer.js.map +1 -0
- package/dist/types.d.ts +272 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +51 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +66 -0
- package/dist/version.js.map +1 -0
- package/dist/wire.d.ts +2698 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +678 -0
- package/dist/wire.js.map +1 -0
- package/package.json +37 -3
- package/vectors/api-request-v1.json +53 -0
- package/vectors/contest-statement-v1.json +42 -0
- package/vectors/terms-v2.json +398 -0
- package/vectors/terms-v3.json +2103 -0
package/dist/demo.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { gpuReservationTerms } from './gpu-reservation.js';
|
|
2
|
+
import { jobTerms } from './job.js';
|
|
3
|
+
/** Whole dollars in micros. */
|
|
4
|
+
export function dollars(n) {
|
|
5
|
+
if (!Number.isInteger(n))
|
|
6
|
+
throw new RangeError('Use whole dollars, or write the micros out');
|
|
7
|
+
return BigInt(n) * 1000000n;
|
|
8
|
+
}
|
|
9
|
+
const MINUTE = 60n;
|
|
10
|
+
const HOUR = 60n * MINUTE;
|
|
11
|
+
/**
|
|
12
|
+
* Demo terms for 8 H100s under the GPU reservation template: a $500 reserve, free cancellation
|
|
13
|
+
* until 24 hours before the start, $250 for a late cancellation, $500 for a no-show after 30
|
|
14
|
+
* minutes' grace and a 72-hour contest window. Usage is $3 per GPU-hour, paid separately. A
|
|
15
|
+
* dispute nobody rules on by day 90 splits a confirmed charge evenly, and the caller names the
|
|
16
|
+
* arbiter.
|
|
17
|
+
*/
|
|
18
|
+
export function demoTerms(windowStart, arbiter) {
|
|
19
|
+
const windowEnd = windowStart + 24n * HOUR;
|
|
20
|
+
return gpuReservationTerms({
|
|
21
|
+
resource: { gpu: 'H100', count: 8, region: 'demo', sku: 'demo-h100x8' },
|
|
22
|
+
currency: 'USD',
|
|
23
|
+
windowStart,
|
|
24
|
+
windowDuration: 24n * HOUR,
|
|
25
|
+
pricePerGpuHour: dollars(3),
|
|
26
|
+
freeCancelBy: windowStart - 24n * HOUR,
|
|
27
|
+
lateCancellation: dollars(250),
|
|
28
|
+
noShow: dollars(500),
|
|
29
|
+
gracePeriod: 30n * MINUTE,
|
|
30
|
+
chargeDeadline: windowEnd,
|
|
31
|
+
contestWindow: 72n * HOUR,
|
|
32
|
+
releaseDate: windowEnd,
|
|
33
|
+
arbiter,
|
|
34
|
+
day90SupplierShareBps: 5000,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The same terms run in minutes for testnet: a 30-minute window, free cancellation until 10
|
|
39
|
+
* minutes before, 2 minutes' grace and a 10-minute contest window, which only the testnet demo
|
|
40
|
+
* profile accepts.
|
|
41
|
+
*/
|
|
42
|
+
export function testnetDemoTerms(windowStart, arbiter) {
|
|
43
|
+
const windowEnd = windowStart + 30n * MINUTE;
|
|
44
|
+
return gpuReservationTerms({
|
|
45
|
+
resource: { gpu: 'H100', count: 8, region: 'demo', sku: 'demo-h100x8' },
|
|
46
|
+
currency: 'USD',
|
|
47
|
+
windowStart,
|
|
48
|
+
windowDuration: 30n * MINUTE,
|
|
49
|
+
pricePerGpuHour: dollars(3),
|
|
50
|
+
freeCancelBy: windowStart - 10n * MINUTE,
|
|
51
|
+
lateCancellation: dollars(250),
|
|
52
|
+
noShow: dollars(500),
|
|
53
|
+
gracePeriod: 2n * MINUTE,
|
|
54
|
+
chargeDeadline: windowEnd,
|
|
55
|
+
contestWindow: 10n * MINUTE,
|
|
56
|
+
releaseDate: windowEnd,
|
|
57
|
+
arbiter,
|
|
58
|
+
day90SupplierShareBps: 5000,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A job on testnet as Avow's test customer proposes one: a ten-minute fine-tuning run on one H100
|
|
63
|
+
* in the demo region, starting at `startsAt`, for $40 paid on delivery. Its reserve backs a late
|
|
64
|
+
* cancellation after work has started, up to $10, and a no-show, up to $6, two minutes after the
|
|
65
|
+
* start. Charges can be reported until ten minutes after the deadline, and the reserve comes back
|
|
66
|
+
* then.
|
|
67
|
+
*/
|
|
68
|
+
export function testnetDemoJobTerms(startsAt, arbiter) {
|
|
69
|
+
const deliverBy = startsAt + 10n * MINUTE;
|
|
70
|
+
return jobTerms({
|
|
71
|
+
work: { kind: 'fine-tuning', summary: 'Fine-tune a small model on the demo dataset' },
|
|
72
|
+
compute: { gpu: 'H100', count: 1, region: 'demo' },
|
|
73
|
+
currency: 'USD',
|
|
74
|
+
startsAt,
|
|
75
|
+
deliverBy,
|
|
76
|
+
price: dollars(40),
|
|
77
|
+
lateCancellation: dollars(10),
|
|
78
|
+
noShow: dollars(6),
|
|
79
|
+
gracePeriod: 2n * MINUTE,
|
|
80
|
+
chargeDeadline: deliverBy + 10n * MINUTE,
|
|
81
|
+
contestWindow: 10n * MINUTE,
|
|
82
|
+
releaseDate: deliverBy + 10n * MINUTE,
|
|
83
|
+
arbiter,
|
|
84
|
+
day90SupplierShareBps: 5000,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* How the demo job's clock runs from its offer, in seconds. Avow's test customer keeps an offer
|
|
89
|
+
* open for `quote` seconds by default, which leaves the developer's agent time to compare compute,
|
|
90
|
+
* book it and quote. Work starts `accept` seconds after the offer lapses, which leaves the customer
|
|
91
|
+
* time to verify the quote and fund its reserve, and the developer time to accept before the start.
|
|
92
|
+
* A scripted agent quotes in about ten seconds and the rest takes about fifteen, so both leave room
|
|
93
|
+
* for a slower model and a slow block.
|
|
94
|
+
*/
|
|
95
|
+
export const DEMO_JOB_TIMING = { quote: 60n, accept: 60n };
|
|
96
|
+
/** The demo GPU supplier's business id on testnet. */
|
|
97
|
+
export const DEMO_GPU_SUPPLIER = 'avow-demo-gpu';
|
|
98
|
+
/**
|
|
99
|
+
* The four offers Avow's demo GPU supplier lists for a job's window, each reserving $40 a GPU, so
|
|
100
|
+
* the agent has a real choice. Under the starter's defaults, a $3.00 budget per GPU-hour and $500
|
|
101
|
+
* of authority for a job on one H100, one is clearly best and each other fails a check that names
|
|
102
|
+
* why.
|
|
103
|
+
*
|
|
104
|
+
* - `h100-firm` takes 1 to 16 GPUs at $2.40, firm, over the job's whole run. It's the one that fits.
|
|
105
|
+
* - `h100-flex` is cheaper at $1.60 and flexible. Its window and its free cancellation both start
|
|
106
|
+
* and end at the job's start, so it can never pass the customer's check before the job starts,
|
|
107
|
+
* and the customer refuses it as still cancellable (`dependency.cancellable`).
|
|
108
|
+
* - `h100-later` starts after the job's deadline, so it doesn't hold the job's run
|
|
109
|
+
* (`dependency.does_not_fit`).
|
|
110
|
+
* - `h100-x16` takes exactly 16 GPUs at $2.00, which reserves $640, more than the mandate allows for
|
|
111
|
+
* one commitment (`mandate.over_commitment_cap`). Sixteen GPUs of `h100-firm` reserve the same.
|
|
112
|
+
*
|
|
113
|
+
* Each window but the later one starts when the job does, and each ends five minutes after its
|
|
114
|
+
* deadline. An offer lapses ten minutes after it's listed, or the test customer's acceptance window
|
|
115
|
+
* before the job starts if that comes first. That's when the job's own offer lapses, so the agent
|
|
116
|
+
* books compute by the time it has to quote, and the supplier has that window to accept before its
|
|
117
|
+
* booking starts. The supplier itself signs any GPU terms within its limits, whatever it listed.
|
|
118
|
+
*/
|
|
119
|
+
export function demoComputeOffers(job) {
|
|
120
|
+
const end = job.deliverBy + 5n * MINUTE;
|
|
121
|
+
const later = job.deliverBy + 10n * MINUTE;
|
|
122
|
+
const minutesFrom = (start) => Number((end - start + MINUTE - 1n) / MINUTE);
|
|
123
|
+
const offer = (o) => {
|
|
124
|
+
const startsAt = o.startsAt ?? job.startsAt;
|
|
125
|
+
const lapses = job.listedAt + 10n * MINUTE;
|
|
126
|
+
const booksBy = job.startsAt - DEMO_JOB_TIMING.accept;
|
|
127
|
+
return {
|
|
128
|
+
supplier: DEMO_GPU_SUPPLIER,
|
|
129
|
+
gpu: 'H100',
|
|
130
|
+
region: 'demo',
|
|
131
|
+
sku: 'demo-h100',
|
|
132
|
+
gpus: { min: 1, max: 16 },
|
|
133
|
+
minutes: minutesFrom(startsAt),
|
|
134
|
+
freeCancelBy: job.listedAt,
|
|
135
|
+
reservePerGpu: dollars(40),
|
|
136
|
+
...o,
|
|
137
|
+
startsAt,
|
|
138
|
+
expiry: lapses < booksBy ? lapses : booksBy,
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
supplier: DEMO_GPU_SUPPLIER,
|
|
143
|
+
listedAt: job.listedAt,
|
|
144
|
+
offers: [
|
|
145
|
+
offer({ id: 'h100-firm', pricePerGpuHour: 2400000n }),
|
|
146
|
+
offer({ id: 'h100-flex', pricePerGpuHour: 1600000n, freeCancelBy: job.startsAt }),
|
|
147
|
+
offer({ id: 'h100-later', pricePerGpuHour: 2200000n, startsAt: later, minutes: 30 }),
|
|
148
|
+
offer({ id: 'h100-x16', pricePerGpuHour: 2000000n, gpus: { min: 16, max: 16 } }),
|
|
149
|
+
],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=demo.js.map
|
package/dist/demo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.js","sourceRoot":"","sources":["../src/demo.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AACpF,OAAO,EAAiB,QAAQ,EAAE,MAAM,UAAU,CAAA;AAElD,+BAA+B;AAC/B,MAAM,UAAU,OAAO,CAAC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ACH,CAAC,CAAA;IACD,OAAO;QACL,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,MAAM,EAAE;YACN,KAAK,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAU,EAAE,CAAC;YACvD,KAAK,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAU,EAAE,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;YACnF,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,QAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;YACtF,KAAK,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,QAAU,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC;SACnF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ReasonCode } from './reasons.js';
|
|
4
|
+
import { type CommitmentReference } from './references.js';
|
|
5
|
+
import { type ChainedTerms, type ChainedTermsOf, type TemplateId, type TermsOf } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* The `dependencies` section of version 3 terms. Each entry names one booking this one relies on,
|
|
8
|
+
* the state that booking has to be in whenever it's checked, and the section of it the seller
|
|
9
|
+
* shows whoever checks it. Nothing on the chain reads this section, and neither lock knows about
|
|
10
|
+
* the other. The parties that rely on it check it at set moments by reading the lock that holds
|
|
11
|
+
* the booking relied on.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Who checks the bookings a version 3 booking relies on for its buyer, one setting for the whole
|
|
15
|
+
* dependencies section, held in the header. With `buyer`, the default, the buyer sees every entry
|
|
16
|
+
* and the subject the seller shows, and reads each booking from the chain itself. With `avow`, the
|
|
17
|
+
* buyer sees the dependencies section only as its label and digest and relies on Avow, whose API
|
|
18
|
+
* is planned to check each booking before it approves and doesn't do so yet. The seller and Avow
|
|
19
|
+
* see every entry in both.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEPENDENCY_CHECKS: readonly ['buyer', 'avow'];
|
|
22
|
+
export type DependencyCheck = (typeof DEPENDENCY_CHECKS)[number];
|
|
23
|
+
/**
|
|
24
|
+
* The states a booking relied on can be required to be in. `accepted` means its lock holds it as
|
|
25
|
+
* accepted with no report filed.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEPENDENCY_CONDITIONS: readonly ['accepted'];
|
|
28
|
+
export type DependencyCondition = (typeof DEPENDENCY_CONDITIONS)[number];
|
|
29
|
+
/**
|
|
30
|
+
* The sections of a booking relied on that its seller can show whoever checks it. `subject` shows
|
|
31
|
+
* the resource and the window, and no price.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEPENDENCY_DISCLOSURES: readonly ['subject'];
|
|
34
|
+
export type DependencyDisclosure = (typeof DEPENDENCY_DISCLOSURES)[number];
|
|
35
|
+
/** The most bookings one booking can rely on, the longest list `Dependencies` allows. */
|
|
36
|
+
export declare const MAX_DEPENDENCIES: Dependencies['length'];
|
|
37
|
+
/** A commitment reference to the buyer side of a lock, the only side a booking can rely on. */
|
|
38
|
+
export type BuyerSideReference = Omit<CommitmentReference, 'side'> & {
|
|
39
|
+
side: 'buyer';
|
|
40
|
+
};
|
|
41
|
+
/** One booking this one relies on. */
|
|
42
|
+
export interface Dependency {
|
|
43
|
+
/**
|
|
44
|
+
* The booking relied on, by chain, lock, commitment id, side and terms hash. It's on the buyer
|
|
45
|
+
* side of the seller's own lock, and a check reads that lock to confirm it.
|
|
46
|
+
*/
|
|
47
|
+
on: BuyerSideReference;
|
|
48
|
+
condition: DependencyCondition;
|
|
49
|
+
disclosed: DependencyDisclosure;
|
|
50
|
+
}
|
|
51
|
+
/** One to four entries, each naming a different booking. */
|
|
52
|
+
export type Dependencies = readonly [Dependency] | readonly [Dependency, Dependency] | readonly [Dependency, Dependency, Dependency] | readonly [Dependency, Dependency, Dependency, Dependency];
|
|
53
|
+
declare const dependenciesChecked: unique symbol;
|
|
54
|
+
/**
|
|
55
|
+
* Version 3 terms every booking of which passed a check that read its lock. Short of a deliberate
|
|
56
|
+
* cast, only the verifier's `verifyDependencies` produces one, so code that takes these in place of
|
|
57
|
+
* `ChainedTerms`, such as `checkMandate`, can't be handed unchecked terms by mistake. The brand
|
|
58
|
+
* exists only in the types, and nothing checks it at run time.
|
|
59
|
+
*/
|
|
60
|
+
export type CheckedChainedTerms = ChainedTerms & {
|
|
61
|
+
readonly [dependenciesChecked]: true;
|
|
62
|
+
};
|
|
63
|
+
/** Whether terms are version 3, the version that names the bookings it relies on. */
|
|
64
|
+
export declare function isChainedTerms(terms: unknown): terms is ChainedTerms;
|
|
65
|
+
/**
|
|
66
|
+
* Version 3 terms that say what version 2 terms say and rely on the bookings given, which the
|
|
67
|
+
* buyer checks unless the setting says Avow does.
|
|
68
|
+
*/
|
|
69
|
+
export declare function chainedTerms<Subject, Template extends TemplateId>(terms: TermsOf<Subject, Template>, dependencies: Dependencies, dependencyCheck?: DependencyCheck): ChainedTermsOf<Subject, Template>;
|
|
70
|
+
/** One booking a version 3 booking relies on, as JSON. */
|
|
71
|
+
export declare const dependencyJson: z.ZodObject<{
|
|
72
|
+
on: z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"commitment">;
|
|
74
|
+
chainId: z.ZodNumber;
|
|
75
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
76
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
77
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
78
|
+
side: z.ZodLiteral<"buyer">;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
condition: z.ZodEnum<{
|
|
81
|
+
accepted: "accepted";
|
|
82
|
+
}>;
|
|
83
|
+
disclosed: z.ZodEnum<{
|
|
84
|
+
subject: "subject";
|
|
85
|
+
}>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
/**
|
|
88
|
+
* The dependencies section as JSON, one to four entries, no two naming the same booking, whatever
|
|
89
|
+
* terms hash each gives.
|
|
90
|
+
*/
|
|
91
|
+
export declare const dependenciesJson: z.ZodUnion<readonly [z.ZodTuple<[z.ZodObject<{
|
|
92
|
+
on: z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"commitment">;
|
|
94
|
+
chainId: z.ZodNumber;
|
|
95
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
96
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
97
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
98
|
+
side: z.ZodLiteral<"buyer">;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
condition: z.ZodEnum<{
|
|
101
|
+
accepted: "accepted";
|
|
102
|
+
}>;
|
|
103
|
+
disclosed: z.ZodEnum<{
|
|
104
|
+
subject: "subject";
|
|
105
|
+
}>;
|
|
106
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodObject<{
|
|
107
|
+
on: z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"commitment">;
|
|
109
|
+
chainId: z.ZodNumber;
|
|
110
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
111
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
112
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
113
|
+
side: z.ZodLiteral<"buyer">;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
condition: z.ZodEnum<{
|
|
116
|
+
accepted: "accepted";
|
|
117
|
+
}>;
|
|
118
|
+
disclosed: z.ZodEnum<{
|
|
119
|
+
subject: "subject";
|
|
120
|
+
}>;
|
|
121
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
122
|
+
on: z.ZodObject<{
|
|
123
|
+
kind: z.ZodLiteral<"commitment">;
|
|
124
|
+
chainId: z.ZodNumber;
|
|
125
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
126
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
127
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
128
|
+
side: z.ZodLiteral<"buyer">;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
condition: z.ZodEnum<{
|
|
131
|
+
accepted: "accepted";
|
|
132
|
+
}>;
|
|
133
|
+
disclosed: z.ZodEnum<{
|
|
134
|
+
subject: "subject";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodObject<{
|
|
137
|
+
on: z.ZodObject<{
|
|
138
|
+
kind: z.ZodLiteral<"commitment">;
|
|
139
|
+
chainId: z.ZodNumber;
|
|
140
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
141
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
142
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
143
|
+
side: z.ZodLiteral<"buyer">;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
condition: z.ZodEnum<{
|
|
146
|
+
accepted: "accepted";
|
|
147
|
+
}>;
|
|
148
|
+
disclosed: z.ZodEnum<{
|
|
149
|
+
subject: "subject";
|
|
150
|
+
}>;
|
|
151
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
152
|
+
on: z.ZodObject<{
|
|
153
|
+
kind: z.ZodLiteral<"commitment">;
|
|
154
|
+
chainId: z.ZodNumber;
|
|
155
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
156
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
157
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
158
|
+
side: z.ZodLiteral<"buyer">;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
condition: z.ZodEnum<{
|
|
161
|
+
accepted: "accepted";
|
|
162
|
+
}>;
|
|
163
|
+
disclosed: z.ZodEnum<{
|
|
164
|
+
subject: "subject";
|
|
165
|
+
}>;
|
|
166
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
167
|
+
on: z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"commitment">;
|
|
169
|
+
chainId: z.ZodNumber;
|
|
170
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
171
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
172
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
173
|
+
side: z.ZodLiteral<"buyer">;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
condition: z.ZodEnum<{
|
|
176
|
+
accepted: "accepted";
|
|
177
|
+
}>;
|
|
178
|
+
disclosed: z.ZodEnum<{
|
|
179
|
+
subject: "subject";
|
|
180
|
+
}>;
|
|
181
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodObject<{
|
|
182
|
+
on: z.ZodObject<{
|
|
183
|
+
kind: z.ZodLiteral<"commitment">;
|
|
184
|
+
chainId: z.ZodNumber;
|
|
185
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
186
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
187
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
188
|
+
side: z.ZodLiteral<"buyer">;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
condition: z.ZodEnum<{
|
|
191
|
+
accepted: "accepted";
|
|
192
|
+
}>;
|
|
193
|
+
disclosed: z.ZodEnum<{
|
|
194
|
+
subject: "subject";
|
|
195
|
+
}>;
|
|
196
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
197
|
+
on: z.ZodObject<{
|
|
198
|
+
kind: z.ZodLiteral<"commitment">;
|
|
199
|
+
chainId: z.ZodNumber;
|
|
200
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
201
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
202
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
203
|
+
side: z.ZodLiteral<"buyer">;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
condition: z.ZodEnum<{
|
|
206
|
+
accepted: "accepted";
|
|
207
|
+
}>;
|
|
208
|
+
disclosed: z.ZodEnum<{
|
|
209
|
+
subject: "subject";
|
|
210
|
+
}>;
|
|
211
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
212
|
+
on: z.ZodObject<{
|
|
213
|
+
kind: z.ZodLiteral<"commitment">;
|
|
214
|
+
chainId: z.ZodNumber;
|
|
215
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
216
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
217
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
218
|
+
side: z.ZodLiteral<"buyer">;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
condition: z.ZodEnum<{
|
|
221
|
+
accepted: "accepted";
|
|
222
|
+
}>;
|
|
223
|
+
disclosed: z.ZodEnum<{
|
|
224
|
+
subject: "subject";
|
|
225
|
+
}>;
|
|
226
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
227
|
+
on: z.ZodObject<{
|
|
228
|
+
kind: z.ZodLiteral<"commitment">;
|
|
229
|
+
chainId: z.ZodNumber;
|
|
230
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
231
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
232
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
233
|
+
side: z.ZodLiteral<"buyer">;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
condition: z.ZodEnum<{
|
|
236
|
+
accepted: "accepted";
|
|
237
|
+
}>;
|
|
238
|
+
disclosed: z.ZodEnum<{
|
|
239
|
+
subject: "subject";
|
|
240
|
+
}>;
|
|
241
|
+
}, z.core.$strict>], null>]>;
|
|
242
|
+
/**
|
|
243
|
+
* Checks the dependencies section on its own and returns null when it's sound, or `terms.invalid`.
|
|
244
|
+
* It has the form `dependenciesJson` reads, one to four entries, each with exactly a buyer-side
|
|
245
|
+
* commitment reference, a condition this version knows and a section it lets a seller show, and no
|
|
246
|
+
* two entries name the same booking, whatever terms hash each gives.
|
|
247
|
+
*
|
|
248
|
+
* Two bookings can never rely on each other. An entry names a terms hash that already exists, and
|
|
249
|
+
* this booking's terms hash covers the entry, so no booking it names can name it back.
|
|
250
|
+
*/
|
|
251
|
+
export declare function dependenciesProblem(dependencies: unknown): ReasonCode | null;
|
|
252
|
+
/** A booking's subject with the template that reads it. */
|
|
253
|
+
export interface TemplatedSubject {
|
|
254
|
+
template: string;
|
|
255
|
+
subject: unknown;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* What's wrong with a booking's subject on its own, by its template's rules, or null when nothing
|
|
259
|
+
* is. A template this code doesn't know is `terms.template_unknown`.
|
|
260
|
+
*/
|
|
261
|
+
export declare function subjectProblem(t: TemplatedSubject): ReasonCode | null;
|
|
262
|
+
/**
|
|
263
|
+
* Whether a booking's subject fits inside the subject of a booking it relies on, by the rules of
|
|
264
|
+
* the inner booking's template. A pair of templates those rules don't name never fits, a template
|
|
265
|
+
* this code doesn't know never fits, and neither does a subject its template's rules refuse.
|
|
266
|
+
*/
|
|
267
|
+
export declare function subjectFits(inner: TemplatedSubject, outer: TemplatedSubject): boolean;
|
|
268
|
+
/** A block a check read at, by number, with the hash and timestamp it had then. */
|
|
269
|
+
export interface PinnedBlock {
|
|
270
|
+
number: bigint;
|
|
271
|
+
hash: Hex;
|
|
272
|
+
/** The block's timestamp in seconds, which the lock's deadlines are held against. */
|
|
273
|
+
timestamp: bigint;
|
|
274
|
+
}
|
|
275
|
+
/** A pinned block's JSON form, with numbers as decimal strings and the hash in lower case. */
|
|
276
|
+
export declare const pinnedBlockJson: z.ZodObject<{
|
|
277
|
+
number: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
278
|
+
hash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
279
|
+
timestamp: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
/** A booking relied on that passed a check, with the block every read of it was pinned to. */
|
|
282
|
+
export interface CheckedDependency {
|
|
283
|
+
on: CommitmentReference;
|
|
284
|
+
block: PinnedBlock;
|
|
285
|
+
}
|
|
286
|
+
/** A booking relied on by its place in the terms, or null when no single one is meant. */
|
|
287
|
+
export declare const dependencyIndexJson: z.ZodNullable<z.ZodNumber>;
|
|
288
|
+
/** A checked booking's JSON form. */
|
|
289
|
+
export declare const checkedDependencyJson: z.ZodObject<{
|
|
290
|
+
on: z.ZodObject<{
|
|
291
|
+
kind: z.ZodLiteral<"commitment">;
|
|
292
|
+
chainId: z.ZodNumber;
|
|
293
|
+
lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
294
|
+
commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
295
|
+
side: z.ZodEnum<{
|
|
296
|
+
buyer: "buyer";
|
|
297
|
+
supplier: "supplier";
|
|
298
|
+
}>;
|
|
299
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
block: z.ZodObject<{
|
|
302
|
+
number: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
303
|
+
hash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
304
|
+
timestamp: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
305
|
+
}, z.core.$strict>;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
export {};
|
|
308
|
+
//# sourceMappingURL=dependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,OAAO,EACb,MAAM,YAAY,CAAA;AAEnB;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,YAAI,OAAO,EAAE,MAAM,CAAU,CAAA;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAI,UAAU,CAAU,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AAM,qBAAqB;;;;;;;;;;;;;;;;;kBAGhC,CAAA"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GPU_RESERVATION, gpuSubjectFits, gpuSubjectProblem, } from './gpu-reservation.js';
|
|
3
|
+
import { jobFitsReservation, jobSubjectProblem } from './job.js';
|
|
4
|
+
import { bytes32, u64 } from './json-fields.js';
|
|
5
|
+
import { commitmentReferenceJson } from './references.js';
|
|
6
|
+
import { CHAINED_TERMS_VERSION, } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* The `dependencies` section of version 3 terms. Each entry names one booking this one relies on,
|
|
9
|
+
* the state that booking has to be in whenever it's checked, and the section of it the seller
|
|
10
|
+
* shows whoever checks it. Nothing on the chain reads this section, and neither lock knows about
|
|
11
|
+
* the other. The parties that rely on it check it at set moments by reading the lock that holds
|
|
12
|
+
* the booking relied on.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Who checks the bookings a version 3 booking relies on for its buyer, one setting for the whole
|
|
16
|
+
* dependencies section, held in the header. With `buyer`, the default, the buyer sees every entry
|
|
17
|
+
* and the subject the seller shows, and reads each booking from the chain itself. With `avow`, the
|
|
18
|
+
* buyer sees the dependencies section only as its label and digest and relies on Avow, whose API
|
|
19
|
+
* is planned to check each booking before it approves and doesn't do so yet. The seller and Avow
|
|
20
|
+
* see every entry in both.
|
|
21
|
+
*/
|
|
22
|
+
export const DEPENDENCY_CHECKS = ['buyer', 'avow'];
|
|
23
|
+
/**
|
|
24
|
+
* The states a booking relied on can be required to be in. `accepted` means its lock holds it as
|
|
25
|
+
* accepted with no report filed.
|
|
26
|
+
*/
|
|
27
|
+
export const DEPENDENCY_CONDITIONS = ['accepted'];
|
|
28
|
+
/**
|
|
29
|
+
* The sections of a booking relied on that its seller can show whoever checks it. `subject` shows
|
|
30
|
+
* the resource and the window, and no price.
|
|
31
|
+
*/
|
|
32
|
+
export const DEPENDENCY_DISCLOSURES = ['subject'];
|
|
33
|
+
/** The most bookings one booking can rely on, the longest list `Dependencies` allows. */
|
|
34
|
+
export const MAX_DEPENDENCIES = 4;
|
|
35
|
+
/** Whether terms are version 3, the version that names the bookings it relies on. */
|
|
36
|
+
export function isChainedTerms(terms) {
|
|
37
|
+
return (typeof terms === 'object' &&
|
|
38
|
+
terms !== null &&
|
|
39
|
+
'version' in terms &&
|
|
40
|
+
terms.version === CHAINED_TERMS_VERSION);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Version 3 terms that say what version 2 terms say and rely on the bookings given, which the
|
|
44
|
+
* buyer checks unless the setting says Avow does.
|
|
45
|
+
*/
|
|
46
|
+
export function chainedTerms(terms, dependencies, dependencyCheck = 'buyer') {
|
|
47
|
+
return { ...terms, version: CHAINED_TERMS_VERSION, dependencyCheck, dependencies };
|
|
48
|
+
}
|
|
49
|
+
/** One booking a version 3 booking relies on, as JSON. */
|
|
50
|
+
export const dependencyJson = z.strictObject({
|
|
51
|
+
on: commitmentReferenceJson.extend({ side: z.literal('buyer') }),
|
|
52
|
+
condition: z.enum(DEPENDENCY_CONDITIONS),
|
|
53
|
+
disclosed: z.enum(DEPENDENCY_DISCLOSURES),
|
|
54
|
+
});
|
|
55
|
+
/** Where an entry's booking sits. The schema reads hex in lower case, so letter case can't change it. */
|
|
56
|
+
const placeOf = ({ on }) => `${on.chainId}:${on.lock}:${on.commitmentId}:${on.side}`;
|
|
57
|
+
/**
|
|
58
|
+
* The dependencies section as JSON, one to four entries, no two naming the same booking, whatever
|
|
59
|
+
* terms hash each gives.
|
|
60
|
+
*/
|
|
61
|
+
export const dependenciesJson = z
|
|
62
|
+
.union([
|
|
63
|
+
z.tuple([dependencyJson]),
|
|
64
|
+
z.tuple([dependencyJson, dependencyJson]),
|
|
65
|
+
z.tuple([dependencyJson, dependencyJson, dependencyJson]),
|
|
66
|
+
z.tuple([dependencyJson, dependencyJson, dependencyJson, dependencyJson]),
|
|
67
|
+
])
|
|
68
|
+
.refine((entries) => new Set(entries.map(placeOf)).size === entries.length, {
|
|
69
|
+
message: 'Two entries name the same booking',
|
|
70
|
+
});
|
|
71
|
+
const _sameLengths = true;
|
|
72
|
+
void _sameLengths;
|
|
73
|
+
/**
|
|
74
|
+
* Checks the dependencies section on its own and returns null when it's sound, or `terms.invalid`.
|
|
75
|
+
* It has the form `dependenciesJson` reads, one to four entries, each with exactly a buyer-side
|
|
76
|
+
* commitment reference, a condition this version knows and a section it lets a seller show, and no
|
|
77
|
+
* two entries name the same booking, whatever terms hash each gives.
|
|
78
|
+
*
|
|
79
|
+
* Two bookings can never rely on each other. An entry names a terms hash that already exists, and
|
|
80
|
+
* this booking's terms hash covers the entry, so no booking it names can name it back.
|
|
81
|
+
*/
|
|
82
|
+
export function dependenciesProblem(dependencies) {
|
|
83
|
+
return dependenciesJson.safeParse(dependencies).success ? null : 'terms.invalid';
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Each template's rules for a booking's subject, on its own and inside the subject of a booking it
|
|
87
|
+
* relies on. A GPU reservation fits only inside a GPU reservation, and a job only inside the GPU
|
|
88
|
+
* reservation of the compute it runs on. The build fails when a template has no rules here.
|
|
89
|
+
*/
|
|
90
|
+
const SUBJECT_RULES = {
|
|
91
|
+
'gpu-reservation/1': {
|
|
92
|
+
problem: (subject) => gpuSubjectProblem(subject),
|
|
93
|
+
fits: (inner, outer) => outer.template === GPU_RESERVATION &&
|
|
94
|
+
gpuSubjectFits(inner, outer.subject),
|
|
95
|
+
},
|
|
96
|
+
'job/1': {
|
|
97
|
+
problem: (subject) => jobSubjectProblem(subject),
|
|
98
|
+
fits: (inner, outer) => outer.template === GPU_RESERVATION &&
|
|
99
|
+
jobFitsReservation(inner, outer.subject),
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
const rulesOf = (template) => Object.hasOwn(SUBJECT_RULES, template) ? SUBJECT_RULES[template] : null;
|
|
103
|
+
/**
|
|
104
|
+
* What's wrong with a booking's subject on its own, by its template's rules, or null when nothing
|
|
105
|
+
* is. A template this code doesn't know is `terms.template_unknown`.
|
|
106
|
+
*/
|
|
107
|
+
export function subjectProblem(t) {
|
|
108
|
+
const rules = rulesOf(t.template);
|
|
109
|
+
return rules ? rules.problem(t.subject) : 'terms.template_unknown';
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Whether a booking's subject fits inside the subject of a booking it relies on, by the rules of
|
|
113
|
+
* the inner booking's template. A pair of templates those rules don't name never fits, a template
|
|
114
|
+
* this code doesn't know never fits, and neither does a subject its template's rules refuse.
|
|
115
|
+
*/
|
|
116
|
+
export function subjectFits(inner, outer) {
|
|
117
|
+
return rulesOf(inner.template)?.fits(inner.subject, outer) ?? false;
|
|
118
|
+
}
|
|
119
|
+
/** A pinned block's JSON form, with numbers as decimal strings and the hash in lower case. */
|
|
120
|
+
export const pinnedBlockJson = z.strictObject({ number: u64, hash: bytes32, timestamp: u64 });
|
|
121
|
+
/** A booking relied on by its place in the terms, or null when no single one is meant. */
|
|
122
|
+
export const dependencyIndexJson = z
|
|
123
|
+
.number()
|
|
124
|
+
.int()
|
|
125
|
+
.min(0)
|
|
126
|
+
.max(MAX_DEPENDENCIES - 1)
|
|
127
|
+
.nullable();
|
|
128
|
+
/** A checked booking's JSON form. */
|
|
129
|
+
export const checkedDependencyJson = z.strictObject({
|
|
130
|
+
on: commitmentReferenceJson,
|
|
131
|
+
block: pinnedBlockJson,
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,eAAe,EAEf,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAmB,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE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