@optimystic/db-core 1.17.0 → 1.19.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/README.md +2 -1
- package/dist/src/blocks/helpers.d.ts +7 -0
- package/dist/src/blocks/helpers.d.ts.map +1 -1
- package/dist/src/blocks/helpers.js +7 -1
- package/dist/src/blocks/helpers.js.map +1 -1
- package/dist/src/btree/btree.d.ts +100 -4
- package/dist/src/btree/btree.d.ts.map +1 -1
- package/dist/src/btree/btree.js +252 -90
- package/dist/src/btree/btree.js.map +1 -1
- package/dist/src/btree/node-division.d.ts +37 -0
- package/dist/src/btree/node-division.d.ts.map +1 -0
- package/dist/src/btree/node-division.js +133 -0
- package/dist/src/btree/node-division.js.map +1 -0
- package/dist/src/chain/chain.d.ts +23 -0
- package/dist/src/chain/chain.d.ts.map +1 -1
- package/dist/src/chain/chain.js +43 -6
- package/dist/src/chain/chain.js.map +1 -1
- package/dist/src/collection/collection.d.ts +38 -5
- package/dist/src/collection/collection.d.ts.map +1 -1
- package/dist/src/collection/collection.js +126 -11
- package/dist/src/collection/collection.js.map +1 -1
- package/dist/src/collection/struct.d.ts +20 -0
- package/dist/src/collection/struct.d.ts.map +1 -1
- package/dist/src/collection/struct.js.map +1 -1
- package/dist/src/collections/tree/tree.d.ts.map +1 -1
- package/dist/src/collections/tree/tree.js +5 -3
- package/dist/src/collections/tree/tree.js.map +1 -1
- package/dist/src/log/log.d.ts +5 -1
- package/dist/src/log/log.d.ts.map +1 -1
- package/dist/src/log/log.js +7 -1
- package/dist/src/log/log.js.map +1 -1
- package/dist/src/network/block-size.d.ts +67 -0
- package/dist/src/network/block-size.d.ts.map +1 -0
- package/dist/src/network/block-size.js +82 -0
- package/dist/src/network/block-size.js.map +1 -0
- package/dist/src/network/index.d.ts +2 -0
- package/dist/src/network/index.d.ts.map +1 -1
- package/dist/src/network/index.js +2 -0
- package/dist/src/network/index.js.map +1 -1
- package/dist/src/network/struct.d.ts +13 -11
- package/dist/src/network/struct.d.ts.map +1 -1
- package/dist/src/network/struct.js.map +1 -1
- package/dist/src/network/transaction-size.d.ts +59 -0
- package/dist/src/network/transaction-size.d.ts.map +1 -0
- package/dist/src/network/transaction-size.js +74 -0
- package/dist/src/network/transaction-size.js.map +1 -0
- package/dist/src/reactivity/config.d.ts +8 -4
- package/dist/src/reactivity/config.d.ts.map +1 -1
- package/dist/src/reactivity/config.js +7 -3
- package/dist/src/reactivity/config.js.map +1 -1
- package/dist/src/reactivity/rotation.d.ts +9 -3
- package/dist/src/reactivity/rotation.d.ts.map +1 -1
- package/dist/src/reactivity/rotation.js +8 -2
- package/dist/src/reactivity/rotation.js.map +1 -1
- package/dist/src/testing/test-transactor.d.ts +2 -0
- package/dist/src/testing/test-transactor.d.ts.map +1 -1
- package/dist/src/testing/test-transactor.js +10 -0
- package/dist/src/testing/test-transactor.js.map +1 -1
- package/dist/src/transaction/coordinator.d.ts +72 -3
- package/dist/src/transaction/coordinator.d.ts.map +1 -1
- package/dist/src/transaction/coordinator.js +320 -146
- package/dist/src/transaction/coordinator.js.map +1 -1
- package/dist/src/transactor/change-notifier.d.ts +19 -8
- package/dist/src/transactor/change-notifier.d.ts.map +1 -1
- package/dist/src/transactor/change-notifier.js.map +1 -1
- package/dist/src/transactor/network-transactor.d.ts +57 -8
- package/dist/src/transactor/network-transactor.d.ts.map +1 -1
- package/dist/src/transactor/network-transactor.js +185 -24
- package/dist/src/transactor/network-transactor.js.map +1 -1
- package/dist/src/transactor/transactor.d.ts +14 -0
- package/dist/src/transactor/transactor.d.ts.map +1 -1
- package/dist/src/transform/digest.d.ts +20 -0
- package/dist/src/transform/digest.d.ts.map +1 -1
- package/dist/src/transform/digest.js +23 -3
- package/dist/src/transform/digest.js.map +1 -1
- package/package.json +1 -1
- package/src/blocks/helpers.ts +8 -1
- package/src/btree/btree.ts +266 -88
- package/src/btree/node-division.ts +155 -0
- package/src/chain/chain.ts +55 -6
- package/src/collection/collection.ts +135 -13
- package/src/collection/struct.ts +18 -0
- package/src/collections/tree/tree.ts +4 -2
- package/src/log/log.ts +7 -1
- package/src/network/block-size.ts +81 -0
- package/src/network/index.ts +2 -0
- package/src/network/struct.ts +15 -13
- package/src/network/transaction-size.ts +73 -0
- package/src/reactivity/config.ts +8 -4
- package/src/reactivity/rotation.ts +9 -3
- package/src/testing/test-transactor.ts +12 -0
- package/src/transaction/coordinator.ts +383 -154
- package/src/transactor/change-notifier.ts +19 -8
- package/src/transactor/network-transactor.ts +192 -29
- package/src/transactor/transactor.ts +16 -0
- package/src/transform/digest.ts +36 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAW,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9J,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAe,sBAAsB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGlH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAW,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9J,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAy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,OAAO,UAAO;IAMrE,6GAA6G;YAC/F,cAAc;IAc5B,+EAA+E;YACjE,WAAW;IAWzB;;;;;oGAKgG;IAChG,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,EAAE,MAAM,OAAO,GAanF,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;CAGzC"}
|
package/dist/src/log/log.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Chain, entryAt } from "../chain/chain.js";
|
|
|
3
3
|
import { nameof } from "../utility/nameof.js";
|
|
4
4
|
import { LogDataBlockType, LogHeaderBlockType } from "./struct.js";
|
|
5
5
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
6
|
+
import { BLOCK_TARGET_BYTES } from '../network/block-size.js';
|
|
6
7
|
export const priorHash$ = nameof("priorHash");
|
|
7
8
|
/**
|
|
8
9
|
* Canonical byte payload covered by {@link LogBlock.priorHash}: every field of a log block EXCEPT
|
|
@@ -219,10 +220,15 @@ export class Log {
|
|
|
219
220
|
}
|
|
220
221
|
return pendings;
|
|
221
222
|
}
|
|
222
|
-
/** Chain options used by every log: block type factories
|
|
223
|
+
/** Chain options used by every log: block type factories, the priorHash `newBlock` hook, and the
|
|
224
|
+
* byte target a log block rolls over at. Every entry carries its action's data, so a count alone
|
|
225
|
+
* would let a log of large entries build a block too large to copy between machines; with
|
|
226
|
+
* {@link BLOCK_TARGET_BYTES} a log block either holds one entry (and is then no larger than the
|
|
227
|
+
* transaction that wrote it) or stays near the target.
|
|
223
228
|
* Exposed (not private) so tests can drive a raw {@link Chain} through the exact same hook. */
|
|
224
229
|
static getChainOptions(store, newDataBlockId) {
|
|
225
230
|
return {
|
|
231
|
+
blockTargetBytes: BLOCK_TARGET_BYTES,
|
|
226
232
|
createDataBlock: () => ({ header: store.createBlockHeader(LogDataBlockType, newDataBlockId?.()) }),
|
|
227
233
|
createHeaderBlock: (id) => ({ header: store.createBlockHeader(LogHeaderBlockType, id) }),
|
|
228
234
|
newBlock: async (newTail, oldTail) => {
|
package/dist/src/log/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAgB,WAAW,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CAAU,KAAwB;IACpE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,OAAO,CAAC;AAChB,CAAC;AAiCD,MAAM,OAAO,GAAG;IAEG;IADlB,YACkB,KAA+B;QAA/B,UAAK,GAAL,KAA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IAAI,KAAK,EAAE,MAAM,EAAE,CAAC;gBACnB,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;YACpE,CAAC;QACF,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED;;;;;oGAKgG;IAChG,MAAM,CAAC,eAAe,CAAU,KAAyB,EAAE,cAA8B;QACxF,OAAO;YACN,gBAAgB,EAAE,kBAAkB;YACpC,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,cAAc,EAAE,EAAE,CAAC,EAAE,CAAC;YAClG,iBAAiB,EAAE,CAAC,EAAY,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,CAAC;YAClG,QAAQ,EAAE,KAAK,EAAE,OAA0B,EAAE,OAAsC,EAAE,EAAE;gBACtF,IAAI,OAAO,EAAE,CAAC;oBACb,gFAAgF;oBAChF,8EAA8E;oBAC9E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;oBACzG,OAAO,CAAC,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;gBAClE,CAAC;YACF,CAAC;SACsC,CAAC;IAE1C,CAAC;CACD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BlockId } from "../blocks/structs.js";
|
|
2
|
+
/**
|
|
3
|
+
* The most bytes one block may encode to, measured by `jsonEncodedBytes` (the UTF-8 length of its
|
|
4
|
+
* `JSON.stringify`): 7.5 MiB, the same as {@link MAX_TRANSACTION_BYTES}.
|
|
5
|
+
*
|
|
6
|
+
* Every path that copies a whole block to another machine sends it in one message under db-p2p's
|
|
7
|
+
* `MAX_BLOCK_MESSAGE_BYTES` frame cap — a replication push, a sync archive answer, a remote `get` reply —
|
|
8
|
+
* so a block larger than one frame can never be replicated, repaired or read remotely. Two things pin the
|
|
9
|
+
* value:
|
|
10
|
+
*
|
|
11
|
+
* - **It fits the frame with its wrapping.** A block at this size, plus what it travels in (a `get`
|
|
12
|
+
* reply entry's state, an archive revision entry, a push's metadata and commit proof), fits the
|
|
13
|
+
* 8 MiB frame inside the same envelope reserve a transaction gets (`TRANSACTION_ENVELOPE_RESERVE_BYTES`).
|
|
14
|
+
* - **No single transaction can exceed it on its own.** A block holding one entry or child is never
|
|
15
|
+
* larger than the transaction that wrote it, since that entry is inside the transaction's pend (as the
|
|
16
|
+
* new block's insert, or as the update operation that appends it), and the pend is held to
|
|
17
|
+
* {@link MAX_TRANSACTION_BYTES}.
|
|
18
|
+
*
|
|
19
|
+
* Structures that hold many entries per block (the log, tree nodes) keep each block that holds more than
|
|
20
|
+
* one entry near {@link BLOCK_TARGET_BYTES}, far under this limit; this is the bound itself.
|
|
21
|
+
*/
|
|
22
|
+
export declare const MAX_BLOCK_BYTES: number;
|
|
23
|
+
/**
|
|
24
|
+
* The size past which a block holding more than one entry starts a new block: 1 MiB, by the same
|
|
25
|
+
* `jsonEncodedBytes` measure as {@link MAX_BLOCK_BYTES}. The log rolls over to a new tail block at it
|
|
26
|
+
* (`ChainInitOptions.blockTargetBytes`); an entry larger than it sits alone in its own block.
|
|
27
|
+
*
|
|
28
|
+
* Why 1 MiB:
|
|
29
|
+
*
|
|
30
|
+
* - One block's copy stays far under the 8 MiB frame, so a remote `get` reply carrying a few blocks
|
|
31
|
+
* still fits one message in the ordinary case, and a single replication push stays short on a slow
|
|
32
|
+
* relayed link.
|
|
33
|
+
* - It is 32 entries of 32 KiB, so a log of ordinary small entries keeps rolling over by count
|
|
34
|
+
* (`EntriesPerBlock`) exactly as it did before the size rule.
|
|
35
|
+
*
|
|
36
|
+
* The cost: a structure of large entries spreads over more blocks, so walking it reads more blocks.
|
|
37
|
+
*/
|
|
38
|
+
export declare const BLOCK_TARGET_BYTES: number;
|
|
39
|
+
/**
|
|
40
|
+
* A write that would leave a block larger than {@link MAX_BLOCK_BYTES}: once committed, the block could
|
|
41
|
+
* never be copied to another machine in one message. Raised by the writer before anything is sent
|
|
42
|
+
* ({@link oversizedBlock}), so nothing was reserved and nothing needs cancelling. Not a `StaleFailure`
|
|
43
|
+
* and never retried — the same write leaves the same block on every attempt. The structures that hold
|
|
44
|
+
* many entries per block split by size (the log rolls over, a tree node divides), so this names a block
|
|
45
|
+
* that outgrew the limit some other way; the change has to be written in a form that does not.
|
|
46
|
+
*/
|
|
47
|
+
export declare class BlockTooLargeError extends Error {
|
|
48
|
+
readonly blockId: BlockId;
|
|
49
|
+
/** What the block's post-write content encodes to, by `jsonEncodedBytes`. */
|
|
50
|
+
readonly bytes: number;
|
|
51
|
+
/** The limit it exceeded: {@link MAX_BLOCK_BYTES}. */
|
|
52
|
+
readonly limit: number;
|
|
53
|
+
constructor(blockId: BlockId,
|
|
54
|
+
/** What the block's post-write content encodes to, by `jsonEncodedBytes`. */
|
|
55
|
+
bytes: number,
|
|
56
|
+
/** The limit it exceeded: {@link MAX_BLOCK_BYTES}. */
|
|
57
|
+
limit?: number);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The refusal for the first block in `bytes` — per block, what a write would leave its content encoding
|
|
61
|
+
* to — that is over {@link MAX_BLOCK_BYTES}, or `undefined` when every one fits. The one rule both write
|
|
62
|
+
* paths apply before anything is sent. It judges only the blocks it is given: a writer measures what it
|
|
63
|
+
* can materialize locally (`describeTouchedBlocks`), which leaves out a deleted block and an updated
|
|
64
|
+
* block whose base it cannot materialize.
|
|
65
|
+
*/
|
|
66
|
+
export declare function oversizedBlock(bytes: Readonly<Record<BlockId, number>>): BlockTooLargeError | undefined;
|
|
67
|
+
//# sourceMappingURL=block-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-size.d.ts","sourceRoot":"","sources":["../../../src/network/block-size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe,QAAwB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,QAAc,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAE3C,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAJb,OAAO,EAAE,OAAO;IACzB,6EAA6E;IACpE,KAAK,EAAE,MAAM;IACtB,sDAAsD;IAC7C,KAAK,GAAE,MAAwB;CAKzC;AAED;;;;;;GAMG;AAMH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,kBAAkB,GAAG,SAAS,CAKvG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { MAX_TRANSACTION_BYTES } from "./transaction-size.js";
|
|
2
|
+
/**
|
|
3
|
+
* The most bytes one block may encode to, measured by `jsonEncodedBytes` (the UTF-8 length of its
|
|
4
|
+
* `JSON.stringify`): 7.5 MiB, the same as {@link MAX_TRANSACTION_BYTES}.
|
|
5
|
+
*
|
|
6
|
+
* Every path that copies a whole block to another machine sends it in one message under db-p2p's
|
|
7
|
+
* `MAX_BLOCK_MESSAGE_BYTES` frame cap — a replication push, a sync archive answer, a remote `get` reply —
|
|
8
|
+
* so a block larger than one frame can never be replicated, repaired or read remotely. Two things pin the
|
|
9
|
+
* value:
|
|
10
|
+
*
|
|
11
|
+
* - **It fits the frame with its wrapping.** A block at this size, plus what it travels in (a `get`
|
|
12
|
+
* reply entry's state, an archive revision entry, a push's metadata and commit proof), fits the
|
|
13
|
+
* 8 MiB frame inside the same envelope reserve a transaction gets (`TRANSACTION_ENVELOPE_RESERVE_BYTES`).
|
|
14
|
+
* - **No single transaction can exceed it on its own.** A block holding one entry or child is never
|
|
15
|
+
* larger than the transaction that wrote it, since that entry is inside the transaction's pend (as the
|
|
16
|
+
* new block's insert, or as the update operation that appends it), and the pend is held to
|
|
17
|
+
* {@link MAX_TRANSACTION_BYTES}.
|
|
18
|
+
*
|
|
19
|
+
* Structures that hold many entries per block (the log, tree nodes) keep each block that holds more than
|
|
20
|
+
* one entry near {@link BLOCK_TARGET_BYTES}, far under this limit; this is the bound itself.
|
|
21
|
+
*/
|
|
22
|
+
export const MAX_BLOCK_BYTES = MAX_TRANSACTION_BYTES;
|
|
23
|
+
/**
|
|
24
|
+
* The size past which a block holding more than one entry starts a new block: 1 MiB, by the same
|
|
25
|
+
* `jsonEncodedBytes` measure as {@link MAX_BLOCK_BYTES}. The log rolls over to a new tail block at it
|
|
26
|
+
* (`ChainInitOptions.blockTargetBytes`); an entry larger than it sits alone in its own block.
|
|
27
|
+
*
|
|
28
|
+
* Why 1 MiB:
|
|
29
|
+
*
|
|
30
|
+
* - One block's copy stays far under the 8 MiB frame, so a remote `get` reply carrying a few blocks
|
|
31
|
+
* still fits one message in the ordinary case, and a single replication push stays short on a slow
|
|
32
|
+
* relayed link.
|
|
33
|
+
* - It is 32 entries of 32 KiB, so a log of ordinary small entries keeps rolling over by count
|
|
34
|
+
* (`EntriesPerBlock`) exactly as it did before the size rule.
|
|
35
|
+
*
|
|
36
|
+
* The cost: a structure of large entries spreads over more blocks, so walking it reads more blocks.
|
|
37
|
+
*/
|
|
38
|
+
export const BLOCK_TARGET_BYTES = 1024 * 1024;
|
|
39
|
+
/**
|
|
40
|
+
* A write that would leave a block larger than {@link MAX_BLOCK_BYTES}: once committed, the block could
|
|
41
|
+
* never be copied to another machine in one message. Raised by the writer before anything is sent
|
|
42
|
+
* ({@link oversizedBlock}), so nothing was reserved and nothing needs cancelling. Not a `StaleFailure`
|
|
43
|
+
* and never retried — the same write leaves the same block on every attempt. The structures that hold
|
|
44
|
+
* many entries per block split by size (the log rolls over, a tree node divides), so this names a block
|
|
45
|
+
* that outgrew the limit some other way; the change has to be written in a form that does not.
|
|
46
|
+
*/
|
|
47
|
+
export class BlockTooLargeError extends Error {
|
|
48
|
+
blockId;
|
|
49
|
+
bytes;
|
|
50
|
+
limit;
|
|
51
|
+
constructor(blockId,
|
|
52
|
+
/** What the block's post-write content encodes to, by `jsonEncodedBytes`. */
|
|
53
|
+
bytes,
|
|
54
|
+
/** The limit it exceeded: {@link MAX_BLOCK_BYTES}. */
|
|
55
|
+
limit = MAX_BLOCK_BYTES) {
|
|
56
|
+
super(`block ${blockId} would encode to ${bytes} bytes once written, over the per-block limit MAX_BLOCK_BYTES (${limit} bytes); a block that large could never be copied to another machine`);
|
|
57
|
+
this.blockId = blockId;
|
|
58
|
+
this.bytes = bytes;
|
|
59
|
+
this.limit = limit;
|
|
60
|
+
this.name = 'BlockTooLargeError';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The refusal for the first block in `bytes` — per block, what a write would leave its content encoding
|
|
65
|
+
* to — that is over {@link MAX_BLOCK_BYTES}, or `undefined` when every one fits. The one rule both write
|
|
66
|
+
* paths apply before anything is sent. It judges only the blocks it is given: a writer measures what it
|
|
67
|
+
* can materialize locally (`describeTouchedBlocks`), which leaves out a deleted block and an updated
|
|
68
|
+
* block whose base it cannot materialize.
|
|
69
|
+
*/
|
|
70
|
+
// NOTE: accepted tradeoff (no backwards compatibility yet, AGENTS.md) — a block a build without the split
|
|
71
|
+
// rules already grew past the limit refuses every write that leaves it over, including ones that do not
|
|
72
|
+
// grow it: a log tail's roll-over (which rewrites its `nextId`) wedges every later write to that
|
|
73
|
+
// collection, and a delete from an oversized leaf is refused. If a deployment must keep writing over such
|
|
74
|
+
// data, refuse only a block that grows past its base's size here, rather than every block over the limit.
|
|
75
|
+
export function oversizedBlock(bytes) {
|
|
76
|
+
for (const [blockId, size] of Object.entries(bytes)) {
|
|
77
|
+
if (size > MAX_BLOCK_BYTES)
|
|
78
|
+
return new BlockTooLargeError(blockId, size);
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=block-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-size.js","sourceRoot":"","sources":["../../../src/network/block-size.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAElC;IAEA;IAEA;IALV,YACU,OAAgB;IACzB,6EAA6E;IACpE,KAAa;IACtB,sDAAsD;IAC7C,QAAgB,eAAe;QAExC,KAAK,CAAC,SAAS,OAAO,oBAAoB,KAAK,kEAAkE,KAAK,sEAAsE,CAAC,CAAC;QANrL,YAAO,GAAP,OAAO,CAAS;QAEhB,UAAK,GAAL,KAAK,CAAQ;QAEb,UAAK,GAAL,KAAK,CAA0B;QAGxC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IAClC,CAAC;CACD;AAED;;;;;;GAMG;AACH,0GAA0G;AAC1G,wGAAwG;AACxG,iGAAiG;AACjG,0GAA0G;AAC1G,0GAA0G;AAC1G,MAAM,UAAU,cAAc,CAAC,KAAwC;IACtE,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,IAAI,IAAI,GAAG,eAAe;YAAE,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./i-key-network.js";
|
|
2
2
|
export * from "./i-peer-network.js";
|
|
3
|
+
export * from "./block-size.js";
|
|
3
4
|
export * from "./durability.js";
|
|
4
5
|
export * from "./i-repo.js";
|
|
5
6
|
export * from "./lineage.js";
|
|
@@ -8,5 +9,6 @@ export * from "./routing-key.js";
|
|
|
8
9
|
export * from "./stale-failure.js";
|
|
9
10
|
export * from "./struct.js";
|
|
10
11
|
export * from "./transaction-expired-error.js";
|
|
12
|
+
export * from "./transaction-size.js";
|
|
11
13
|
export * from "./types.js";
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/network/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/network/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./i-key-network.js";
|
|
2
2
|
export * from "./i-peer-network.js";
|
|
3
|
+
export * from "./block-size.js";
|
|
3
4
|
export * from "./durability.js";
|
|
4
5
|
export * from "./i-repo.js";
|
|
5
6
|
export * from "./lineage.js";
|
|
@@ -8,5 +9,6 @@ export * from "./routing-key.js";
|
|
|
8
9
|
export * from "./stale-failure.js";
|
|
9
10
|
export * from "./struct.js";
|
|
10
11
|
export * from "./transaction-expired-error.js";
|
|
12
|
+
export * from "./transaction-size.js";
|
|
11
13
|
export * from "./types.js";
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/network/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/network/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
|
@@ -78,18 +78,20 @@ export type PendRequest = ActionTransforms & {
|
|
|
78
78
|
*/
|
|
79
79
|
baseRevs?: BlockBaseRevs;
|
|
80
80
|
/**
|
|
81
|
-
* The writer's word that this pend
|
|
82
|
-
* is
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
81
|
+
* The writer's word that this pend, together with the other pends sent with it in one request
|
|
82
|
+
* (`IRepo.pendMany`), is the action's whole reservation — every block the action will commit is in
|
|
83
|
+
* that one request — and that the action's commit goes as one request to the coordinator this pend
|
|
84
|
+
* goes to. Only then may a coordinator hold back the pend record's final delivery to the other
|
|
85
|
+
* members and send it inside the commit's first request (`ClusterCoordinator.mayDeferPendDelivery`
|
|
86
|
+
* in db-p2p): a member that refuses any of the record's pends late refuses that one commit record,
|
|
87
|
+
* before anything of the action is durable. A send that pends in several requests before committing
|
|
88
|
+
* any — several collections one request each under one action id, or one collection split across
|
|
89
|
+
* coordinators — must never carry it: one request's late refusal would surface while another
|
|
90
|
+
* request's commit may already have landed, tearing the action.
|
|
90
91
|
*
|
|
91
|
-
* Set by `TransactorSource.transact
|
|
92
|
-
* one collection
|
|
92
|
+
* Set by `TransactorSource.transact`, and by `TransactionCoordinator` for a transaction of exactly
|
|
93
|
+
* one collection or for every request of a `pendMany` (whose commit goes through `commitMany`);
|
|
94
|
+
* `NetworkTransactor.pend` keeps it only on a request carrying the whole pend.
|
|
93
95
|
* `Collection.completeOwnEntry` re-sends one participant of a half-landed multi-collection action
|
|
94
96
|
* through `transact`, and carries it too: that re-send pends and commits its one collection on its
|
|
95
97
|
* own, so its late refusal stops only its own commit, as an on-time refusal would.
|
|
@@ -1 +1 @@
|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AC,CAAC;AAGnC,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC;AACrC,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAC7C,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;AAC3C,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/network/struct.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/network/struct.ts"],"names":[],"mappings":"AAyhBA;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC1B;IAA2B;IAAhD,YAAqB,OAAgB,EAAW,MAA8B;QAC7E,KAAK,CAAC,SAAS,OAAO,oBAAoB,MAAM,mDAAmD,CAAC,CAAC;QADjF,YAAO,GAAP,OAAO,CAAS;QAAW,WAAM,GAAN,MAAM,CAAwB;QAE7E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACrC,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC5B;IAA2B;IAAhD,YAAqB,OAAgB,EAAW,UAAkB;QACjE,KAAK,CAAC,SAAS,OAAO,4CAA4C,UAAU,wDAAwD,CAAC,CAAC;QADlH,YAAO,GAAP,OAAO,CAAS;QAAW,eAAU,GAAV,UAAU,CAAQ;QAEjE,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACvC,CAAC;CACD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ActionId } from "../collection/action.js";
|
|
2
|
+
import type { PendRequest } from "./struct.js";
|
|
3
|
+
/**
|
|
4
|
+
* The most bytes one transaction's pend may encode to: 7.5 MiB, measured by {@link jsonEncodedBytes}
|
|
5
|
+
* over the {@link PendRequest}s that travel together in one consensus record — transforms, validation
|
|
6
|
+
* payload and all. That is the sum of the batch when a transaction's collections travel together
|
|
7
|
+
* (`IRepo.pendMany`), and one collection's pend when they cannot and each is pended on its own.
|
|
8
|
+
*
|
|
9
|
+
* A pend's payload travels whole in one frame on every hop it takes: writer → coordinator on the repo
|
|
10
|
+
* protocol, then coordinator → each other cohort member on the cluster protocol, and back as the
|
|
11
|
+
* member's echoed answer. Both protocols decode under one frame cap (db-p2p's
|
|
12
|
+
* `MAX_BLOCK_MESSAGE_BYTES`), which is this limit plus a reserve for the envelope around the pend, so a
|
|
13
|
+
* transaction under this limit fits every frame it rides in. The limit is the same at every group
|
|
14
|
+
* size: a solo cohort takes no cluster hop, but is held to it all the same, so a write that commits
|
|
15
|
+
* on one machine does not start failing when a second joins.
|
|
16
|
+
*
|
|
17
|
+
* A writer with more to save than this splits it into several transactions.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MAX_TRANSACTION_BYTES: number;
|
|
20
|
+
/**
|
|
21
|
+
* The bytes `value` encodes to on the wire: the UTF-8 length of its `JSON.stringify`. JSON is the
|
|
22
|
+
* encoding every request and response frame of the repo and cluster protocols carries, so this is the
|
|
23
|
+
* measure a frame cap is judged by.
|
|
24
|
+
*/
|
|
25
|
+
export declare function jsonEncodedBytes(value: unknown): number;
|
|
26
|
+
/**
|
|
27
|
+
* A transaction too large to send: its pend encodes to more than {@link MAX_TRANSACTION_BYTES}.
|
|
28
|
+
* Raised before anything is sent, so nothing was reserved and nothing needs cancelling. Not a
|
|
29
|
+
* `StaleFailure` and never retried — the same transaction is the same size on every attempt. The
|
|
30
|
+
* writer has to split the change into smaller transactions.
|
|
31
|
+
*/
|
|
32
|
+
export declare class TransactionTooLargeError extends Error {
|
|
33
|
+
readonly actionId: ActionId;
|
|
34
|
+
/** What the transaction's pend encodes to, by {@link jsonEncodedBytes}. */
|
|
35
|
+
readonly bytes: number;
|
|
36
|
+
/** The limit it exceeded: {@link MAX_TRANSACTION_BYTES}. */
|
|
37
|
+
readonly limit: number;
|
|
38
|
+
constructor(actionId: ActionId,
|
|
39
|
+
/** What the transaction's pend encodes to, by {@link jsonEncodedBytes}. */
|
|
40
|
+
bytes: number,
|
|
41
|
+
/** The limit it exceeded: {@link MAX_TRANSACTION_BYTES}. */
|
|
42
|
+
limit?: number);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What `requests` — one transaction's pends that ride in one consensus record — encode to together,
|
|
46
|
+
* the measure {@link MAX_TRANSACTION_BYTES} is judged by.
|
|
47
|
+
*
|
|
48
|
+
* NOTE: encodes every request once more than sending it does, on the writer and again on the
|
|
49
|
+
* coordinator. Negligible for an ordinary write; if pend encoding ever shows in a profile of large
|
|
50
|
+
* writes, measure once on the writer and hand the size along instead.
|
|
51
|
+
*/
|
|
52
|
+
export declare function transactionBytes(requests: readonly PendRequest[]): number;
|
|
53
|
+
/**
|
|
54
|
+
* Throws {@link TransactionTooLargeError} when `requests` together encode to more than
|
|
55
|
+
* {@link MAX_TRANSACTION_BYTES} ({@link transactionBytes}). The one rule both the writer (before
|
|
56
|
+
* sending) and the coordinator (on receipt) apply.
|
|
57
|
+
*/
|
|
58
|
+
export declare function assertTransactionFits(requests: readonly PendRequest[]): void;
|
|
59
|
+
//# sourceMappingURL=transaction-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-size.d.ts","sourceRoot":"","sources":["../../../src/network/transaction-size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,QAAoB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAEjD,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAJb,QAAQ,EAAE,QAAQ;IAC3B,2EAA2E;IAClE,KAAK,EAAE,MAAM;IACtB,4DAA4D;IACnD,KAAK,GAAE,MAA8B;CAK/C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAIzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAI5E"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The most bytes one transaction's pend may encode to: 7.5 MiB, measured by {@link jsonEncodedBytes}
|
|
3
|
+
* over the {@link PendRequest}s that travel together in one consensus record — transforms, validation
|
|
4
|
+
* payload and all. That is the sum of the batch when a transaction's collections travel together
|
|
5
|
+
* (`IRepo.pendMany`), and one collection's pend when they cannot and each is pended on its own.
|
|
6
|
+
*
|
|
7
|
+
* A pend's payload travels whole in one frame on every hop it takes: writer → coordinator on the repo
|
|
8
|
+
* protocol, then coordinator → each other cohort member on the cluster protocol, and back as the
|
|
9
|
+
* member's echoed answer. Both protocols decode under one frame cap (db-p2p's
|
|
10
|
+
* `MAX_BLOCK_MESSAGE_BYTES`), which is this limit plus a reserve for the envelope around the pend, so a
|
|
11
|
+
* transaction under this limit fits every frame it rides in. The limit is the same at every group
|
|
12
|
+
* size: a solo cohort takes no cluster hop, but is held to it all the same, so a write that commits
|
|
13
|
+
* on one machine does not start failing when a second joins.
|
|
14
|
+
*
|
|
15
|
+
* A writer with more to save than this splits it into several transactions.
|
|
16
|
+
*/
|
|
17
|
+
export const MAX_TRANSACTION_BYTES = 7.5 * 1024 * 1024;
|
|
18
|
+
/**
|
|
19
|
+
* The bytes `value` encodes to on the wire: the UTF-8 length of its `JSON.stringify`. JSON is the
|
|
20
|
+
* encoding every request and response frame of the repo and cluster protocols carries, so this is the
|
|
21
|
+
* measure a frame cap is judged by.
|
|
22
|
+
*/
|
|
23
|
+
export function jsonEncodedBytes(value) {
|
|
24
|
+
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A transaction too large to send: its pend encodes to more than {@link MAX_TRANSACTION_BYTES}.
|
|
28
|
+
* Raised before anything is sent, so nothing was reserved and nothing needs cancelling. Not a
|
|
29
|
+
* `StaleFailure` and never retried — the same transaction is the same size on every attempt. The
|
|
30
|
+
* writer has to split the change into smaller transactions.
|
|
31
|
+
*/
|
|
32
|
+
export class TransactionTooLargeError extends Error {
|
|
33
|
+
actionId;
|
|
34
|
+
bytes;
|
|
35
|
+
limit;
|
|
36
|
+
constructor(actionId,
|
|
37
|
+
/** What the transaction's pend encodes to, by {@link jsonEncodedBytes}. */
|
|
38
|
+
bytes,
|
|
39
|
+
/** The limit it exceeded: {@link MAX_TRANSACTION_BYTES}. */
|
|
40
|
+
limit = MAX_TRANSACTION_BYTES) {
|
|
41
|
+
super(`transaction ${actionId} encodes to ${bytes} bytes, over the per-transaction limit MAX_TRANSACTION_BYTES (${limit} bytes); split it into smaller transactions`);
|
|
42
|
+
this.actionId = actionId;
|
|
43
|
+
this.bytes = bytes;
|
|
44
|
+
this.limit = limit;
|
|
45
|
+
this.name = 'TransactionTooLargeError';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What `requests` — one transaction's pends that ride in one consensus record — encode to together,
|
|
50
|
+
* the measure {@link MAX_TRANSACTION_BYTES} is judged by.
|
|
51
|
+
*
|
|
52
|
+
* NOTE: encodes every request once more than sending it does, on the writer and again on the
|
|
53
|
+
* coordinator. Negligible for an ordinary write; if pend encoding ever shows in a profile of large
|
|
54
|
+
* writes, measure once on the writer and hand the size along instead.
|
|
55
|
+
*/
|
|
56
|
+
export function transactionBytes(requests) {
|
|
57
|
+
let bytes = 0;
|
|
58
|
+
for (const request of requests)
|
|
59
|
+
bytes += jsonEncodedBytes(request);
|
|
60
|
+
return bytes;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Throws {@link TransactionTooLargeError} when `requests` together encode to more than
|
|
64
|
+
* {@link MAX_TRANSACTION_BYTES} ({@link transactionBytes}). The one rule both the writer (before
|
|
65
|
+
* sending) and the coordinator (on receipt) apply.
|
|
66
|
+
*/
|
|
67
|
+
export function assertTransactionFits(requests) {
|
|
68
|
+
if (requests.length === 0)
|
|
69
|
+
return;
|
|
70
|
+
const bytes = transactionBytes(requests);
|
|
71
|
+
if (bytes > MAX_TRANSACTION_BYTES)
|
|
72
|
+
throw new TransactionTooLargeError(requests[0].actionId, bytes);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=transaction-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-size.js","sourceRoot":"","sources":["../../../src/network/transaction-size.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC9C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAExC;IAEA;IAEA;IALV,YACU,QAAkB;IAC3B,2EAA2E;IAClE,KAAa;IACtB,4DAA4D;IACnD,QAAgB,qBAAqB;QAE9C,KAAK,CAAC,eAAe,QAAQ,eAAe,KAAK,iEAAiE,KAAK,6CAA6C,CAAC,CAAC;QAN7J,aAAQ,GAAR,QAAQ,CAAU;QAElB,UAAK,GAAL,KAAK,CAAQ;QAEb,UAAK,GAAL,KAAK,CAAgC;QAG9C,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgC;IAChE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,OAAO,IAAI,QAAQ;QAAE,KAAK,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgC;IACrE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,KAAK,GAAG,qBAAqB;QAAE,MAAM,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACrG,CAAC"}
|
|
@@ -39,9 +39,13 @@ export declare const SUBSCRIBER_TTL_CORE_MS = 90000;
|
|
|
39
39
|
/** Subscriber registration TTL on an Edge node (ms), inherited from cohort-topic. */
|
|
40
40
|
export declare const SUBSCRIBER_TTL_EDGE_MS = 60000;
|
|
41
41
|
/**
|
|
42
|
-
* Entries per log block —
|
|
43
|
-
* `EntriesPerBlock` entries (`chain/chain.ts`),
|
|
44
|
-
*
|
|
42
|
+
* Entries per log block — the most commits a tail block takes before the log rotates. The collection log
|
|
43
|
+
* starts a new tail block after `EntriesPerBlock` entries (`chain/chain.ts`), or sooner once the block
|
|
44
|
+
* reaches `BLOCK_TARGET_BYTES` (`network/block-size.ts`), so this is an upper bound, not a tunable of its
|
|
45
|
+
* own: a log of small entries rotates exactly here, while a log of large entries rotates earlier and its
|
|
46
|
+
* fill tracker's warm-up fires late or not at all. Nothing depends on the count being exact — the warm-up
|
|
47
|
+
* and filling signals are logged only, and live rotation is detected from observed tail changes
|
|
48
|
+
* (`ReactivityOriginationManager.observeTailCommit` in db-p2p).
|
|
45
49
|
*/
|
|
46
50
|
export declare const BLOCK_FILL_SIZE_DEFAULT = 32;
|
|
47
51
|
/** Old-tail drain time after rotation (ms). Simulator-validated-pending. */
|
|
@@ -68,7 +72,7 @@ export interface ReactivityConfig {
|
|
|
68
72
|
readonly subscriberTtlCoreMs: number;
|
|
69
73
|
/** Subscriber TTL on an Edge node (ms). */
|
|
70
74
|
readonly subscriberTtlEdgeMs: number;
|
|
71
|
-
/**
|
|
75
|
+
/** Most entries per log block before the tail rotates — the log's `EntriesPerBlock`, an upper bound (see {@link BLOCK_FILL_SIZE_DEFAULT}). */
|
|
72
76
|
readonly blockFillSize: number;
|
|
73
77
|
/** Old-tail drain time after rotation (ms). Simulator-validated-pending. */
|
|
74
78
|
readonly tDrainMs: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/reactivity/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,+FAA+F;AAC/F,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,oFAAoF;AACpF,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,qFAAqF;AACrF,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/reactivity/config.ts"],"names":[],"mappings":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CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAO,GAAG,MAAM,CAYvJ"}
|
|
@@ -40,9 +40,13 @@ export const SUBSCRIBER_TTL_CORE_MS = 90_000;
|
|
|
40
40
|
/** Subscriber registration TTL on an Edge node (ms), inherited from cohort-topic. */
|
|
41
41
|
export const SUBSCRIBER_TTL_EDGE_MS = 60_000;
|
|
42
42
|
/**
|
|
43
|
-
* Entries per log block —
|
|
44
|
-
* `EntriesPerBlock` entries (`chain/chain.ts`),
|
|
45
|
-
*
|
|
43
|
+
* Entries per log block — the most commits a tail block takes before the log rotates. The collection log
|
|
44
|
+
* starts a new tail block after `EntriesPerBlock` entries (`chain/chain.ts`), or sooner once the block
|
|
45
|
+
* reaches `BLOCK_TARGET_BYTES` (`network/block-size.ts`), so this is an upper bound, not a tunable of its
|
|
46
|
+
* own: a log of small entries rotates exactly here, while a log of large entries rotates earlier and its
|
|
47
|
+
* fill tracker's warm-up fires late or not at all. Nothing depends on the count being exact — the warm-up
|
|
48
|
+
* and filling signals are logged only, and live rotation is detected from observed tail changes
|
|
49
|
+
* (`ReactivityOriginationManager.observeTailCommit` in db-p2p).
|
|
46
50
|
*/
|
|
47
51
|
export const BLOCK_FILL_SIZE_DEFAULT = EntriesPerBlock;
|
|
48
52
|
/** Old-tail drain time after rotation (ms). Simulator-validated-pending. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/reactivity/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAC7B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,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