@aztec-labs/stdlib 7.0.0-nightly.20261109 → 7.0.0-nightly.20261110
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/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +18 -19
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_reexecution_tracker.js +25 -24
- package/dest/interfaces/archiver.d.ts +2 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/checkpoint/checkpoint_reexecution_tracker.ts +31 -28
- package/src/interfaces/archiver.ts +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CheckpointNumber, CheckpointProposalHash, SlotNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
2
|
import type { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import type { TxHash } from '../tx/tx_hash.js';
|
|
3
4
|
/**
|
|
4
5
|
* Outcome of attempting to re-execute a checkpoint proposal locally.
|
|
5
6
|
*
|
|
@@ -44,18 +45,20 @@ export declare class CheckpointReexecutionTracker {
|
|
|
44
45
|
*/
|
|
45
46
|
recordOutcome(slot: SlotNumber, archiveRoot: Fr, outcome: ReexecutionOutcome, checkpointNumber?: CheckpointNumber, details?: ReexecutionDetails): void;
|
|
46
47
|
/**
|
|
47
|
-
* Record
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
48
|
+
* Record that the local node collected every transaction of a block proposal before the deadline. Called from the
|
|
49
|
+
* validator's proposal handler right after tx collection succeeds, before re-execution, so a failed collection
|
|
50
|
+
* records nothing. The data-withholding watcher consults these records as an authoritative signal: tx availability
|
|
51
|
+
* now is too weak (txs may have been evicted from the mempool by the time the watcher runs), but a record that the
|
|
52
|
+
* txs *were* available at proposal time still vouches for the block.
|
|
53
|
+
*
|
|
54
|
+
* The record vouches, per tx, that this node held each listed tx at proposal time for this slot. A vouched tx counts
|
|
55
|
+
* for whichever published block of the slot contains it, regardless of the block's index or the order of its txs,
|
|
56
|
+
* and records from every proposal for the slot accumulate, so a later proposal does not replace an earlier one.
|
|
53
57
|
*
|
|
54
58
|
* @param slot - Slot the block proposal was for.
|
|
55
|
-
* @param
|
|
56
|
-
* @param collected - True if every tx in the proposal was collected locally before deadline.
|
|
59
|
+
* @param txHashes - The proposal's tx hashes.
|
|
57
60
|
*/
|
|
58
|
-
recordTxsCollected(slot: SlotNumber,
|
|
61
|
+
recordTxsCollected(slot: SlotNumber, txHashes: readonly TxHash[]): void;
|
|
59
62
|
/**
|
|
60
63
|
* Record that a proposal equivocation was observed for a slot. The sentinel uses this to skip
|
|
61
64
|
* missed-attestor accounting: with two conflicting proposals in the slot, an honest attestor
|
|
@@ -84,17 +87,13 @@ export declare class CheckpointReexecutionTracker {
|
|
|
84
87
|
*/
|
|
85
88
|
hasValidOutcomeForSlot(slot: SlotNumber, archiveRoot: Fr): boolean;
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* - `true` — we collected every tx for this block proposal before the deadline.
|
|
92
|
-
* - `false` — we tried and failed (missing txs at the deadline).
|
|
93
|
-
* - `undefined` — no record (e.g. we never saw the block proposal). Callers should fall
|
|
94
|
-
* back to a current-state check (e.g. mempool probe) for this case.
|
|
90
|
+
* Whether every given tx was recorded by {@link recordTxsCollected} for this slot, in any order and from any
|
|
91
|
+
* proposals. An empty list is always vouched for. `false` means some tx was not (we never saw a proposal carrying
|
|
92
|
+
* it, or failed to collect that proposal's txs), so callers should fall back to a current-state check such as a
|
|
93
|
+
* mempool probe.
|
|
95
94
|
*/
|
|
96
|
-
|
|
95
|
+
hasCollectedTxs(slot: SlotNumber, txHashes: readonly TxHash[]): boolean;
|
|
97
96
|
/** Drops entries for checkpoints with `number < checkpointNumber`. */
|
|
98
97
|
removeBefore(checkpointNumber: Checkp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C;AAkCF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmD;IAChF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IAEvD;;;;;;;;;OASG;IACI,aAAa,CAClB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,kBAAkB,EAC3B,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,OAAO,GAAE,kBAAuB,GAC/B,IAAI,CA0BN;IAED
|
|
1
|
+
{"version":3,"file":"checkpoint_reexecution_tracker.d.ts","sourceRoot":"","sources":["../../src/checkpoint/checkpoint_reexecution_tracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACjH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;AAErE,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oFAAoF;IACpF,WAAW,CAAC,EAAE,sBAAsB,CAAC;CACtC,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gHAAgH;IAChH,eAAe,CAAC,EAAE,EAAE,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,sBAAsB,CAAC;CACtC,CAAC;AAkCF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmD;IAChF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IAEvD;;;;;;;;;OASG;IACI,aAAa,CAClB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,kBAAkB,EAC3B,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,OAAO,GAAE,kBAAuB,GAC/B,IAAI,CA0BN;IAED;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAkB7E;IAED;;;;OAIG;IACI,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAgBhD;IAED,yEAAyE;IAClE,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEhD;IAED;;;OAGG;IACI,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAEjF;IAED,gGAAgG;IACzF,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CAEzE;IAED,wGAAwG;IACjG,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CAYvE;IAED;;;;;;;;OAQG;IACI,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAGxE;IAED;;;;;OAKG;IACI,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAG7E;IAED,sEAAsE;IAC/D,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CA4B5D;CACF"}
|
|
@@ -12,7 +12,7 @@ export class CheckpointReexecutionTracker {
|
|
|
12
12
|
* a valid proposal that never landed was built on a parent that is on L1, and count only the attestations for it.
|
|
13
13
|
*/ recordOutcome(slot, archiveRoot, outcome, checkpointNumber, details = {}) {
|
|
14
14
|
const archiveRootStr = archiveRoot.toString();
|
|
15
|
-
// Preserve any
|
|
15
|
+
// Preserve any collected txs already accumulated for this slot.
|
|
16
16
|
const existing = this.bySlot.get(slot);
|
|
17
17
|
const entry = {
|
|
18
18
|
checkpointNumber,
|
|
@@ -21,7 +21,7 @@ export class CheckpointReexecutionTracker {
|
|
|
21
21
|
payloadHash: details.payloadHash,
|
|
22
22
|
slot,
|
|
23
23
|
outcome,
|
|
24
|
-
|
|
24
|
+
collectedTxs: existing?.collectedTxs ?? new Set(),
|
|
25
25
|
equivocated: existing?.equivocated ?? false
|
|
26
26
|
};
|
|
27
27
|
if (checkpointNumber !== undefined) {
|
|
@@ -35,17 +35,19 @@ export class CheckpointReexecutionTracker {
|
|
|
35
35
|
this.bySlot.set(slot, entry);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* Record
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
38
|
+
* Record that the local node collected every transaction of a block proposal before the deadline. Called from the
|
|
39
|
+
* validator's proposal handler right after tx collection succeeds, before re-execution, so a failed collection
|
|
40
|
+
* records nothing. The data-withholding watcher consults these records as an authoritative signal: tx availability
|
|
41
|
+
* now is too weak (txs may have been evicted from the mempool by the time the watcher runs), but a record that the
|
|
42
|
+
* txs *were* available at proposal time still vouches for the block.
|
|
43
|
+
*
|
|
44
|
+
* The record vouches, per tx, that this node held each listed tx at proposal time for this slot. A vouched tx counts
|
|
45
|
+
* for whichever published block of the slot contains it, regardless of the block's index or the order of its txs,
|
|
46
|
+
* and records from every proposal for the slot accumulate, so a later proposal does not replace an earlier one.
|
|
44
47
|
*
|
|
45
48
|
* @param slot - Slot the block proposal was for.
|
|
46
|
-
* @param
|
|
47
|
-
|
|
48
|
-
*/ recordTxsCollected(slot, indexWithinCheckpoint, collected) {
|
|
49
|
+
* @param txHashes - The proposal's tx hashes.
|
|
50
|
+
*/ recordTxsCollected(slot, txHashes) {
|
|
49
51
|
let entry = this.bySlot.get(slot);
|
|
50
52
|
if (!entry) {
|
|
51
53
|
entry = {
|
|
@@ -55,12 +57,14 @@ export class CheckpointReexecutionTracker {
|
|
|
55
57
|
payloadHash: undefined,
|
|
56
58
|
slot,
|
|
57
59
|
outcome: undefined,
|
|
58
|
-
|
|
60
|
+
collectedTxs: new Set(),
|
|
59
61
|
equivocated: false
|
|
60
62
|
};
|
|
61
63
|
this.bySlot.set(slot, entry);
|
|
62
64
|
}
|
|
63
|
-
|
|
65
|
+
for (const txHash of txHashes){
|
|
66
|
+
entry.collectedTxs.add(txHash.toString());
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
/**
|
|
66
70
|
* Record that a proposal equivocation was observed for a slot. The sentinel uses this to skip
|
|
@@ -76,7 +80,7 @@ export class CheckpointReexecutionTracker {
|
|
|
76
80
|
payloadHash: undefined,
|
|
77
81
|
slot,
|
|
78
82
|
outcome: undefined,
|
|
79
|
-
|
|
83
|
+
collectedTxs: new Set(),
|
|
80
84
|
equivocated: true
|
|
81
85
|
});
|
|
82
86
|
} else {
|
|
@@ -121,16 +125,13 @@ export class CheckpointReexecutionTracker {
|
|
|
121
125
|
return entry?.outcome === 'valid' && entry.archiveRoot === archiveRoot.toString();
|
|
122
126
|
}
|
|
123
127
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
* back to a current-state check (e.g. mempool probe) for this case.
|
|
132
|
-
*/ getTxsCollectedRecord(slot, indexWithinCheckpoint) {
|
|
133
|
-
return this.bySlot.get(slot)?.txsCollected.get(indexWithinCheckpoint);
|
|
128
|
+
* Whether every given tx was recorded by {@link recordTxsCollected} for this slot, in any order and from any
|
|
129
|
+
* proposals. An empty list is always vouched for. `false` means some tx was not (we never saw a proposal carrying
|
|
130
|
+
* it, or failed to collect that proposal's txs), so callers should fall back to a current-state check such as a
|
|
131
|
+
* mempool probe.
|
|
132
|
+
*/ hasCollectedTxs(slot, txHashes) {
|
|
133
|
+
const collected = this.bySlot.get(slot)?.collectedTxs;
|
|
134
|
+
return txHashes.every((txHash)=>collected?.has(txHash.toString()) ?? false);
|
|
134
135
|
}
|
|
135
136
|
/** Drops entries for checkpoints with `number < checkpointNumber`. */ removeBefore(checkpointNumber) {
|
|
136
137
|
// Track the highest slot among checkpoints we're pruning. Once we know it, any slot
|
|
@@ -20,7 +20,7 @@ export type ArchiverSpecificConfig = {
|
|
|
20
20
|
maxAllowedEthClientDriftSeconds?: number;
|
|
21
21
|
/** Whether to allow starting the archiver without debug/trace method support on Ethereum hosts */
|
|
22
22
|
ethereumAllowNoDebugHosts?: boolean;
|
|
23
|
-
/**
|
|
23
|
+
/** Log a warning instead of failing startup when an L1 RPC returns empty results for logs it should have. */
|
|
24
24
|
archiverSkipHistoricalLogsCheck?: boolean;
|
|
25
25
|
/** Skip validating checkpoint attestations (for testing purposes only) */
|
|
26
26
|
skipValidateCheckpointAttestations?: boolean;
|
|
@@ -53,4 +53,4 @@ export declare const ArchiverSpecificConfigSchema: z.ZodObject<{
|
|
|
53
53
|
}, z.core.$strip>;
|
|
54
54
|
export type ArchiverApi = Omit<L2BlockSource & L2LogsSource & ContractDataSource & L1ToL2MessageSource, 'start' | 'stop' | 'getGenesisBlockHash'>;
|
|
55
55
|
export declare const ArchiverApiSchema: ApiSchemaFor<ArchiverApi>;
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJjaGl2ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2VzL2FyY2hpdmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ25FLE9BQU8sRU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AAa,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,EACvE,OAAO,GAAG,MAAM,GAAG,qBAAqB,CACzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CA6EvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec-labs/stdlib",
|
|
3
|
-
"version": "7.0.0-nightly.
|
|
3
|
+
"version": "7.0.0-nightly.20261110",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
95
95
|
"@aztec-foundation/bb.js": "6.0.0-rc.7",
|
|
96
96
|
"@aztec-foundation/noir-noirc_abi": "6.0.0-rc.7",
|
|
97
|
-
"@aztec-labs/blob-lib": "7.0.0-nightly.
|
|
98
|
-
"@aztec-labs/constants": "7.0.0-nightly.
|
|
99
|
-
"@aztec-labs/ethereum": "7.0.0-nightly.
|
|
100
|
-
"@aztec-labs/foundation": "7.0.0-nightly.
|
|
97
|
+
"@aztec-labs/blob-lib": "7.0.0-nightly.20261110",
|
|
98
|
+
"@aztec-labs/constants": "7.0.0-nightly.20261110",
|
|
99
|
+
"@aztec-labs/ethereum": "7.0.0-nightly.20261110",
|
|
100
|
+
"@aztec-labs/foundation": "7.0.0-nightly.20261110",
|
|
101
101
|
"@google-cloud/storage": "^7.15.0",
|
|
102
102
|
"axios": "^1.15.1",
|
|
103
103
|
"buffer": "^6.0.3",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CheckpointNumber, CheckpointProposalHash, SlotNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
2
|
import type { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
3
|
|
|
4
|
+
import type { TxHash } from '../tx/tx_hash.js';
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Outcome of attempting to re-execute a checkpoint proposal locally.
|
|
6
8
|
*
|
|
@@ -36,8 +38,8 @@ export type ReexecutionDetails = {
|
|
|
36
38
|
/**
|
|
37
39
|
* Tracks two pieces of per-slot state collected during proposal handling:
|
|
38
40
|
*
|
|
39
|
-
* 1.
|
|
40
|
-
* (
|
|
41
|
+
* 1. The txs this node held at proposal time, from block proposals whose txs were all collected
|
|
42
|
+
* locally (per `slot`, by tx hash). Consumed by the data-withholding watcher.
|
|
41
43
|
* 2. The outcome of locally re-executing each checkpoint proposal (keyed by
|
|
42
44
|
* `(checkpointNumber, archiveRoot)` and by `slot`). Consumed by the data-withholding
|
|
43
45
|
* watcher (via `hasReexecuted`) and the sentinel (via `getOutcomeForSlot` and `getRecordForSlot`).
|
|
@@ -56,8 +58,8 @@ interface Entry {
|
|
|
56
58
|
|
|
57
59
|
slot: SlotNumber;
|
|
58
60
|
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
+
// Hashes of the txs of every block proposal at this slot whose txs were all collected.
|
|
62
|
+
collectedTxs: Set<string>;
|
|
61
63
|
|
|
62
64
|
// Set by recordEquivocation when a proposal equivocation is seen for this slot. Consumed by the
|
|
63
65
|
// sentinel: an honest attestor may have seen an invalid version of an equivocated proposal and
|
|
@@ -88,7 +90,7 @@ export class CheckpointReexecutionTracker {
|
|
|
88
90
|
): void {
|
|
89
91
|
const archiveRootStr = archiveRoot.toString();
|
|
90
92
|
|
|
91
|
-
// Preserve any
|
|
93
|
+
// Preserve any collected txs already accumulated for this slot.
|
|
92
94
|
const existing = this.bySlot.get(slot);
|
|
93
95
|
const entry: Entry = {
|
|
94
96
|
checkpointNumber,
|
|
@@ -97,7 +99,7 @@ export class CheckpointReexecutionTracker {
|
|
|
97
99
|
payloadHash: details.payloadHash,
|
|
98
100
|
slot,
|
|
99
101
|
outcome,
|
|
100
|
-
|
|
102
|
+
collectedTxs: existing?.collectedTxs ?? new Set(),
|
|
101
103
|
equivocated: existing?.equivocated ?? false,
|
|
102
104
|
};
|
|
103
105
|
|
|
@@ -114,18 +116,20 @@ export class CheckpointReexecutionTracker {
|
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
/**
|
|
117
|
-
* Record
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
119
|
+
* Record that the local node collected every transaction of a block proposal before the deadline. Called from the
|
|
120
|
+
* validator's proposal handler right after tx collection succeeds, before re-execution, so a failed collection
|
|
121
|
+
* records nothing. The data-withholding watcher consults these records as an authoritative signal: tx availability
|
|
122
|
+
* now is too weak (txs may have been evicted from the mempool by the time the watcher runs), but a record that the
|
|
123
|
+
* txs *were* available at proposal time still vouches for the block.
|
|
124
|
+
*
|
|
125
|
+
* The record vouches, per tx, that this node held each listed tx at proposal time for this slot. A vouched tx counts
|
|
126
|
+
* for whichever published block of the slot contains it, regardless of the block's index or the order of its txs,
|
|
127
|
+
* and records from every proposal for the slot accumulate, so a later proposal does not replace an earlier one.
|
|
123
128
|
*
|
|
124
129
|
* @param slot - Slot the block proposal was for.
|
|
125
|
-
* @param
|
|
126
|
-
* @param collected - True if every tx in the proposal was collected locally before deadline.
|
|
130
|
+
* @param txHashes - The proposal's tx hashes.
|
|
127
131
|
*/
|
|
128
|
-
public recordTxsCollected(slot: SlotNumber,
|
|
132
|
+
public recordTxsCollected(slot: SlotNumber, txHashes: readonly TxHash[]): void {
|
|
129
133
|
let entry = this.bySlot.get(slot);
|
|
130
134
|
if (!entry) {
|
|
131
135
|
entry = {
|
|
@@ -135,12 +139,14 @@ export class CheckpointReexecutionTracker {
|
|
|
135
139
|
payloadHash: undefined,
|
|
136
140
|
slot,
|
|
137
141
|
outcome: undefined,
|
|
138
|
-
|
|
142
|
+
collectedTxs: new Set(),
|
|
139
143
|
equivocated: false,
|
|
140
144
|
};
|
|
141
145
|
this.bySlot.set(slot, entry);
|
|
142
146
|
}
|
|
143
|
-
|
|
147
|
+
for (const txHash of txHashes) {
|
|
148
|
+
entry.collectedTxs.add(txHash.toString());
|
|
149
|
+
}
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
/**
|
|
@@ -158,7 +164,7 @@ export class CheckpointReexecutionTracker {
|
|
|
158
164
|
payloadHash: undefined,
|
|
159
165
|
slot,
|
|
160
166
|
outcome: undefined,
|
|
161
|
-
|
|
167
|
+
collectedTxs: new Set(),
|
|
162
168
|
equivocated: true,
|
|
163
169
|
});
|
|
164
170
|
} else {
|
|
@@ -214,17 +220,14 @@ export class CheckpointReexecutionTracker {
|
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* - `true` — we collected every tx for this block proposal before the deadline.
|
|
222
|
-
* - `false` — we tried and failed (missing txs at the deadline).
|
|
223
|
-
* - `undefined` — no record (e.g. we never saw the block proposal). Callers should fall
|
|
224
|
-
* back to a current-state check (e.g. mempool probe) for this case.
|
|
223
|
+
* Whether every given tx was recorded by {@link recordTxsCollected} for this slot, in any order and from any
|
|
224
|
+
* proposals. An empty list is always vouched for. `false` means some tx was not (we never saw a proposal carrying
|
|
225
|
+
* it, or failed to collect that proposal's txs), so callers should fall back to a current-state check such as a
|
|
226
|
+
* mempool probe.
|
|
225
227
|
*/
|
|
226
|
-
public
|
|
227
|
-
|
|
228
|
+
public hasCollectedTxs(slot: SlotNumber, txHashes: readonly TxHash[]): boolean {
|
|
229
|
+
const collected = this.bySlot.get(slot)?.collectedTxs;
|
|
230
|
+
return txHashes.every(txHash => collected?.has(txHash.toString()) ?? false);
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
/** Drops entries for checkpoints with `number < checkpointNumber`. */
|
|
@@ -61,7 +61,7 @@ export type ArchiverSpecificConfig = {
|
|
|
61
61
|
/** Whether to allow starting the archiver without debug/trace method support on Ethereum hosts */
|
|
62
62
|
ethereumAllowNoDebugHosts?: boolean;
|
|
63
63
|
|
|
64
|
-
/**
|
|
64
|
+
/** Log a warning instead of failing startup when an L1 RPC returns empty results for logs it should have. */
|
|
65
65
|
archiverSkipHistoricalLogsCheck?: boolean;
|
|
66
66
|
|
|
67
67
|
/** Skip validating checkpoint attestations (for testing purposes only) */
|