@aztec/archiver 0.0.0-test.1 → 0.0.1-commit.023c3e5

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.
Files changed (225) hide show
  1. package/README.md +164 -9
  2. package/dest/archiver.d.ts +136 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +781 -0
  5. package/dest/config.d.ts +30 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/config.js +71 -0
  8. package/dest/errors.d.ts +41 -0
  9. package/dest/errors.d.ts.map +1 -0
  10. package/dest/errors.js +62 -0
  11. package/dest/factory.d.ts +13 -16
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +103 -55
  14. package/dest/index.d.ts +10 -4
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +8 -3
  17. package/dest/interfaces.d.ts +9 -0
  18. package/dest/interfaces.d.ts.map +1 -0
  19. package/dest/interfaces.js +3 -0
  20. package/dest/l1/bin/retrieve-calldata.d.ts +3 -0
  21. package/dest/l1/bin/retrieve-calldata.d.ts.map +1 -0
  22. package/dest/l1/bin/retrieve-calldata.js +149 -0
  23. package/dest/l1/calldata_retriever.d.ts +112 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +471 -0
  26. package/dest/l1/data_retrieval.d.ts +88 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/l1/data_retrieval.js +312 -0
  29. package/dest/l1/debug_tx.d.ts +19 -0
  30. package/dest/l1/debug_tx.d.ts.map +1 -0
  31. package/dest/l1/debug_tx.js +73 -0
  32. package/dest/l1/spire_proposer.d.ts +70 -0
  33. package/dest/l1/spire_proposer.d.ts.map +1 -0
  34. package/dest/l1/spire_proposer.js +157 -0
  35. package/dest/l1/trace_tx.d.ts +97 -0
  36. package/dest/l1/trace_tx.d.ts.map +1 -0
  37. package/dest/l1/trace_tx.js +91 -0
  38. package/dest/l1/types.d.ts +12 -0
  39. package/dest/l1/types.d.ts.map +1 -0
  40. package/dest/l1/types.js +3 -0
  41. package/dest/l1/validate_trace.d.ts +32 -0
  42. package/dest/l1/validate_trace.d.ts.map +1 -0
  43. package/dest/l1/validate_trace.js +154 -0
  44. package/dest/modules/data_source_base.d.ts +84 -0
  45. package/dest/modules/data_source_base.d.ts.map +1 -0
  46. package/dest/modules/data_source_base.js +260 -0
  47. package/dest/modules/data_store_updater.d.ts +73 -0
  48. package/dest/modules/data_store_updater.d.ts.map +1 -0
  49. package/dest/modules/data_store_updater.js +302 -0
  50. package/dest/modules/instrumentation.d.ts +37 -0
  51. package/dest/modules/instrumentation.d.ts.map +1 -0
  52. package/dest/modules/instrumentation.js +110 -0
  53. package/dest/modules/l1_synchronizer.d.ts +75 -0
  54. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  55. package/dest/modules/l1_synchronizer.js +1112 -0
  56. package/dest/modules/validation.d.ts +17 -0
  57. package/dest/modules/validation.d.ts.map +1 -0
  58. package/dest/modules/validation.js +104 -0
  59. package/dest/store/block_store.d.ts +192 -0
  60. package/dest/store/block_store.d.ts.map +1 -0
  61. package/dest/store/block_store.js +721 -0
  62. package/dest/store/contract_class_store.d.ts +18 -0
  63. package/dest/store/contract_class_store.d.ts.map +1 -0
  64. package/dest/{archiver/kv_archiver_store → store}/contract_class_store.js +25 -27
  65. package/dest/store/contract_instance_store.d.ts +24 -0
  66. package/dest/store/contract_instance_store.d.ts.map +1 -0
  67. package/dest/store/contract_instance_store.js +77 -0
  68. package/dest/store/kv_archiver_store.d.ts +340 -0
  69. package/dest/store/kv_archiver_store.d.ts.map +1 -0
  70. package/dest/store/kv_archiver_store.js +446 -0
  71. package/dest/store/log_store.d.ts +54 -0
  72. package/dest/store/log_store.d.ts.map +1 -0
  73. package/dest/store/log_store.js +436 -0
  74. package/dest/store/message_store.d.ts +40 -0
  75. package/dest/store/message_store.d.ts.map +1 -0
  76. package/dest/store/message_store.js +188 -0
  77. package/dest/structs/data_retrieval.d.ts +27 -0
  78. package/dest/structs/data_retrieval.d.ts.map +1 -0
  79. package/dest/structs/inbox_message.d.ts +15 -0
  80. package/dest/structs/inbox_message.d.ts.map +1 -0
  81. package/dest/structs/inbox_message.js +39 -0
  82. package/dest/structs/published.d.ts +2 -0
  83. package/dest/structs/published.d.ts.map +1 -0
  84. package/dest/structs/published.js +1 -0
  85. package/dest/test/fake_l1_state.d.ts +190 -0
  86. package/dest/test/fake_l1_state.d.ts.map +1 -0
  87. package/dest/test/fake_l1_state.js +383 -0
  88. package/dest/test/index.d.ts +2 -1
  89. package/dest/test/index.d.ts.map +1 -1
  90. package/dest/test/index.js +4 -1
  91. package/dest/test/mock_archiver.d.ts +16 -8
  92. package/dest/test/mock_archiver.d.ts.map +1 -1
  93. package/dest/test/mock_archiver.js +18 -14
  94. package/dest/test/mock_l1_to_l2_message_source.d.ts +9 -6
  95. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  96. package/dest/test/mock_l1_to_l2_message_source.js +30 -7
  97. package/dest/test/mock_l2_block_source.d.ts +62 -16
  98. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  99. package/dest/test/mock_l2_block_source.js +263 -32
  100. package/dest/test/mock_structs.d.ts +85 -0
  101. package/dest/test/mock_structs.d.ts.map +1 -0
  102. package/dest/test/mock_structs.js +171 -0
  103. package/dest/test/noop_l1_archiver.d.ts +23 -0
  104. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  105. package/dest/test/noop_l1_archiver.js +68 -0
  106. package/package.json +31 -33
  107. package/src/archiver.ts +543 -0
  108. package/src/config.ts +95 -0
  109. package/src/errors.ts +102 -0
  110. package/src/factory.ts +144 -71
  111. package/src/index.ts +10 -3
  112. package/src/interfaces.ts +9 -0
  113. package/src/l1/README.md +98 -0
  114. package/src/l1/bin/retrieve-calldata.ts +187 -0
  115. package/src/l1/calldata_retriever.ts +641 -0
  116. package/src/l1/data_retrieval.ts +495 -0
  117. package/src/l1/debug_tx.ts +99 -0
  118. package/src/l1/spire_proposer.ts +160 -0
  119. package/src/l1/trace_tx.ts +128 -0
  120. package/src/l1/types.ts +13 -0
  121. package/src/l1/validate_trace.ts +229 -0
  122. package/src/modules/data_source_base.ts +367 -0
  123. package/src/modules/data_store_updater.ts +423 -0
  124. package/src/modules/instrumentation.ts +157 -0
  125. package/src/modules/l1_synchronizer.ts +930 -0
  126. package/src/modules/validation.ts +129 -0
  127. package/src/store/block_store.ts +966 -0
  128. package/src/{archiver/kv_archiver_store → store}/contract_class_store.ts +26 -32
  129. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +37 -29
  130. package/src/store/kv_archiver_store.ts +639 -0
  131. package/src/store/log_store.ts +575 -0
  132. package/src/store/message_store.ts +261 -0
  133. package/src/structs/inbox_message.ts +41 -0
  134. package/src/structs/published.ts +1 -0
  135. package/src/test/fake_l1_state.ts +599 -0
  136. package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
  137. package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
  138. package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
  139. package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
  140. package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
  141. package/src/test/fixtures/trace_transaction-proxied.json +128 -0
  142. package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
  143. package/src/test/index.ts +4 -0
  144. package/src/test/mock_archiver.ts +22 -16
  145. package/src/test/mock_l1_to_l2_message_source.ts +26 -8
  146. package/src/test/mock_l2_block_source.ts +313 -42
  147. package/src/test/mock_structs.ts +311 -0
  148. package/src/test/noop_l1_archiver.ts +109 -0
  149. package/dest/archiver/archiver.d.ts +0 -197
  150. package/dest/archiver/archiver.d.ts.map +0 -1
  151. package/dest/archiver/archiver.js +0 -900
  152. package/dest/archiver/archiver_store.d.ts +0 -220
  153. package/dest/archiver/archiver_store.d.ts.map +0 -1
  154. package/dest/archiver/archiver_store.js +0 -4
  155. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  156. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  157. package/dest/archiver/archiver_store_test_suite.js +0 -794
  158. package/dest/archiver/config.d.ts +0 -37
  159. package/dest/archiver/config.d.ts.map +0 -1
  160. package/dest/archiver/config.js +0 -46
  161. package/dest/archiver/data_retrieval.d.ts +0 -74
  162. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  163. package/dest/archiver/data_retrieval.js +0 -283
  164. package/dest/archiver/errors.d.ts +0 -4
  165. package/dest/archiver/errors.d.ts.map +0 -1
  166. package/dest/archiver/errors.js +0 -5
  167. package/dest/archiver/index.d.ts +0 -8
  168. package/dest/archiver/index.d.ts.map +0 -1
  169. package/dest/archiver/index.js +0 -5
  170. package/dest/archiver/instrumentation.d.ts +0 -29
  171. package/dest/archiver/instrumentation.d.ts.map +0 -1
  172. package/dest/archiver/instrumentation.js +0 -99
  173. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -87
  174. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  175. package/dest/archiver/kv_archiver_store/block_store.js +0 -217
  176. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  177. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  178. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -21
  179. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  180. package/dest/archiver/kv_archiver_store/contract_instance_store.js +0 -63
  181. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -153
  182. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  183. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -254
  184. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
  185. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  186. package/dest/archiver/kv_archiver_store/log_store.js +0 -364
  187. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -33
  188. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  189. package/dest/archiver/kv_archiver_store/message_store.js +0 -85
  190. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +0 -12
  191. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +0 -1
  192. package/dest/archiver/kv_archiver_store/nullifier_store.js +0 -73
  193. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +0 -23
  194. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +0 -1
  195. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +0 -49
  196. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +0 -175
  197. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +0 -1
  198. package/dest/archiver/memory_archiver_store/memory_archiver_store.js +0 -636
  199. package/dest/archiver/structs/data_retrieval.d.ts +0 -27
  200. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  201. package/dest/archiver/structs/published.d.ts +0 -11
  202. package/dest/archiver/structs/published.d.ts.map +0 -1
  203. package/dest/archiver/structs/published.js +0 -1
  204. package/dest/rpc/index.d.ts +0 -10
  205. package/dest/rpc/index.d.ts.map +0 -1
  206. package/dest/rpc/index.js +0 -18
  207. package/src/archiver/archiver.ts +0 -1181
  208. package/src/archiver/archiver_store.ts +0 -263
  209. package/src/archiver/archiver_store_test_suite.ts +0 -810
  210. package/src/archiver/config.ts +0 -92
  211. package/src/archiver/data_retrieval.ts +0 -422
  212. package/src/archiver/errors.ts +0 -5
  213. package/src/archiver/index.ts +0 -7
  214. package/src/archiver/instrumentation.ts +0 -132
  215. package/src/archiver/kv_archiver_store/block_store.ts +0 -283
  216. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -358
  217. package/src/archiver/kv_archiver_store/log_store.ts +0 -444
  218. package/src/archiver/kv_archiver_store/message_store.ts +0 -102
  219. package/src/archiver/kv_archiver_store/nullifier_store.ts +0 -97
  220. package/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +0 -61
  221. package/src/archiver/memory_archiver_store/memory_archiver_store.ts +0 -801
  222. package/src/archiver/structs/published.ts +0 -11
  223. package/src/rpc/index.ts +0 -20
  224. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  225. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
@@ -0,0 +1,311 @@
1
+ import {
2
+ MAX_NOTE_HASHES_PER_TX,
3
+ NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
4
+ PRIVATE_LOG_SIZE_IN_FIELDS,
5
+ } from '@aztec/constants';
6
+ import { makeTuple } from '@aztec/foundation/array';
7
+ import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
8
+ import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
9
+ import { times, timesParallel } from '@aztec/foundation/collection';
10
+ import { randomBigInt, randomInt } from '@aztec/foundation/crypto/random';
11
+ import type { Secp256k1Signer } from '@aztec/foundation/crypto/secp256k1-signer';
12
+ import { Fr } from '@aztec/foundation/curves/bn254';
13
+ import { EthAddress } from '@aztec/foundation/eth-address';
14
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
15
+ import { CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
16
+ import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
17
+ import { PrivateLog, PublicLog, SiloedTag, Tag } from '@aztec/stdlib/logs';
18
+ import { InboxLeaf } from '@aztec/stdlib/messaging';
19
+ import { orderAttestations } from '@aztec/stdlib/p2p';
20
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
21
+ import { makeCheckpointAttestationFromCheckpoint } from '@aztec/stdlib/testing';
22
+ import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
23
+ import { PartialStateReference, StateReference, TxEffect } from '@aztec/stdlib/tx';
24
+
25
+ import { type InboxMessage, updateRollingHash } from '../structs/inbox_message.js';
26
+
27
+ export function makeInboxMessage(
28
+ previousRollingHash = Buffer16.ZERO,
29
+ overrides: Partial<InboxMessage> = {},
30
+ ): InboxMessage {
31
+ const { checkpointNumber = CheckpointNumber(randomInt(100) + 1) } = overrides;
32
+ const { l1BlockNumber = randomBigInt(100n) + 1n } = overrides;
33
+ const { l1BlockHash = Buffer32.random() } = overrides;
34
+ const { leaf = Fr.random() } = overrides;
35
+ const { rollingHash = updateRollingHash(previousRollingHash, leaf) } = overrides;
36
+ const { index = InboxLeaf.smallestIndexForCheckpoint(checkpointNumber) } = overrides;
37
+
38
+ return {
39
+ index,
40
+ leaf,
41
+ checkpointNumber,
42
+ l1BlockNumber,
43
+ l1BlockHash,
44
+ rollingHash,
45
+ };
46
+ }
47
+
48
+ export function makeInboxMessages(
49
+ totalCount: number,
50
+ opts: {
51
+ initialHash?: Buffer16;
52
+ initialCheckpointNumber?: CheckpointNumber;
53
+ messagesPerCheckpoint?: number;
54
+ overrideFn?: (msg: InboxMessage, index: number) => InboxMessage;
55
+ } = {},
56
+ ): InboxMessage[] {
57
+ const {
58
+ initialHash = Buffer16.ZERO,
59
+ overrideFn = msg => msg,
60
+ initialCheckpointNumber = CheckpointNumber(1),
61
+ messagesPerCheckpoint = 1,
62
+ } = opts;
63
+
64
+ const messages: InboxMessage[] = [];
65
+ let rollingHash = initialHash;
66
+ for (let i = 0; i < totalCount; i++) {
67
+ const msgIndex = i % messagesPerCheckpoint;
68
+ const checkpointNumber = CheckpointNumber.fromBigInt(
69
+ BigInt(initialCheckpointNumber) + BigInt(i) / BigInt(messagesPerCheckpoint),
70
+ );
71
+ const leaf = Fr.random();
72
+ const message = overrideFn(
73
+ makeInboxMessage(rollingHash, {
74
+ leaf,
75
+ checkpointNumber,
76
+ index: InboxLeaf.smallestIndexForCheckpoint(checkpointNumber) + BigInt(msgIndex),
77
+ }),
78
+ i,
79
+ );
80
+ rollingHash = message.rollingHash;
81
+ messages.push(message);
82
+ }
83
+ return messages;
84
+ }
85
+
86
+ /** Creates inbox messages distributed across multiple blocks with proper checkpoint numbering. */
87
+ export function makeInboxMessagesWithFullBlocks(
88
+ blockCount: number,
89
+ opts: { initialCheckpointNumber?: CheckpointNumber } = {},
90
+ ): InboxMessage[] {
91
+ const { initialCheckpointNumber = CheckpointNumber(13) } = opts;
92
+ return makeInboxMessages(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP * blockCount, {
93
+ overrideFn: (msg, i) => {
94
+ const checkpointNumber = CheckpointNumber(
95
+ initialCheckpointNumber + Math.floor(i / NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP),
96
+ );
97
+ const index =
98
+ InboxLeaf.smallestIndexForCheckpoint(checkpointNumber) + BigInt(i % NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
99
+ return { ...msg, checkpointNumber, index };
100
+ },
101
+ });
102
+ }
103
+
104
+ /** Creates a deterministic block hash from a block number. */
105
+ export function makeBlockHash(blockNumber: number): `0x${string}` {
106
+ return `0x${blockNumber.toString(16).padStart(64, '0')}`;
107
+ }
108
+
109
+ /**
110
+ * Creates a StateReference with properly calculated noteHashTree.nextAvailableLeafIndex.
111
+ * This ensures LogStore's dataStartIndexForBlock calculation doesn't produce negative values.
112
+ */
113
+ export function makeStateForBlock(blockNumber: number, txsPerBlock: number): StateReference {
114
+ const noteHashIndex = blockNumber * txsPerBlock * MAX_NOTE_HASHES_PER_TX;
115
+ return new StateReference(
116
+ AppendOnlyTreeSnapshot.random(),
117
+ new PartialStateReference(
118
+ new AppendOnlyTreeSnapshot(Fr.random(), noteHashIndex),
119
+ AppendOnlyTreeSnapshot.random(),
120
+ AppendOnlyTreeSnapshot.random(),
121
+ ),
122
+ );
123
+ }
124
+
125
+ /** Creates L1PublishedData with deterministic values based on l1BlockNumber. */
126
+ export function makeL1PublishedData(l1BlockNumber: number): L1PublishedData {
127
+ return new L1PublishedData(BigInt(l1BlockNumber), BigInt(l1BlockNumber * 1000), makeBlockHash(l1BlockNumber));
128
+ }
129
+
130
+ /** Wraps a Checkpoint with L1 published data and random attestations. */
131
+ export function makePublishedCheckpoint(
132
+ checkpoint: Checkpoint,
133
+ l1BlockNumber: number,
134
+ attestationCount = 3,
135
+ ): PublishedCheckpoint {
136
+ return new PublishedCheckpoint(
137
+ checkpoint,
138
+ makeL1PublishedData(l1BlockNumber),
139
+ times(attestationCount, CommitteeAttestation.random),
140
+ );
141
+ }
142
+
143
+ export interface MakeChainedCheckpointsOptions {
144
+ /** Number of L2 blocks per checkpoint. Default: 1 */
145
+ blocksPerCheckpoint?: number;
146
+ /** Number of transactions per block. Default: 4 */
147
+ txsPerBlock?: number;
148
+ /** Starting checkpoint number. Default: CheckpointNumber(1) */
149
+ startCheckpointNumber?: CheckpointNumber;
150
+ /** Starting block number. Default: 1 */
151
+ startBlockNumber?: number;
152
+ /** Starting L1 block number. Default: 10 */
153
+ startL1BlockNumber?: number;
154
+ /** Previous archive to chain from. Default: undefined */
155
+ previousArchive?: AppendOnlyTreeSnapshot;
156
+ /** Optional function to provide per-checkpoint overrides */
157
+ makeCheckpointOptions?: (cpNumber: CheckpointNumber) => Partial<Parameters<typeof Checkpoint.random>[1]>;
158
+ }
159
+
160
+ /**
161
+ * Creates multiple checkpoints with properly chained archives.
162
+ * Each checkpoint's blocks have their lastArchive set to the previous block's archive,
163
+ * ensuring archive chain continuity for testing.
164
+ */
165
+ export async function makeChainedCheckpoints(
166
+ count: number,
167
+ options: MakeChainedCheckpointsOptions = {},
168
+ ): Promise<PublishedCheckpoint[]> {
169
+ const {
170
+ blocksPerCheckpoint = 1,
171
+ txsPerBlock = 4,
172
+ startCheckpointNumber = CheckpointNumber(1),
173
+ startBlockNumber = 1,
174
+ startL1BlockNumber = 10,
175
+ makeCheckpointOptions,
176
+ } = options;
177
+
178
+ let previousArchive = options.previousArchive;
179
+ const checkpoints: PublishedCheckpoint[] = [];
180
+
181
+ for (let i = 0; i < count; i++) {
182
+ const cpNumber = CheckpointNumber(startCheckpointNumber + i);
183
+ const blockStart = startBlockNumber + i * blocksPerCheckpoint;
184
+ const customOptions = makeCheckpointOptions?.(cpNumber) ?? {};
185
+
186
+ const checkpoint = await Checkpoint.random(cpNumber, {
187
+ numBlocks: blocksPerCheckpoint,
188
+ startBlockNumber: blockStart,
189
+ previousArchive,
190
+ txsPerBlock,
191
+ state: makeStateForBlock(blockStart, txsPerBlock),
192
+ txOptions: { numPublicCallsPerTx: 2, numPublicLogsPerCall: 2 },
193
+ ...customOptions,
194
+ });
195
+
196
+ previousArchive = checkpoint.blocks.at(-1)!.archive;
197
+ checkpoints.push(makePublishedCheckpoint(checkpoint, startL1BlockNumber + i * 10));
198
+ }
199
+
200
+ return checkpoints;
201
+ }
202
+
203
+ /**
204
+ * Creates a PublishedCheckpoint with attestations signed by the provided signers.
205
+ * Useful for testing attestation validation.
206
+ */
207
+ export function makeSignedPublishedCheckpoint(
208
+ checkpoint: Checkpoint,
209
+ signers: Secp256k1Signer[],
210
+ committee: EthAddress[],
211
+ l1BlockNumber = 1,
212
+ ): PublishedCheckpoint {
213
+ const attestations = signers.map(signer => makeCheckpointAttestationFromCheckpoint(checkpoint, signer));
214
+ const committeeAttestations = orderAttestations(attestations, committee);
215
+ return new PublishedCheckpoint(checkpoint, makeL1PublishedData(l1BlockNumber), committeeAttestations);
216
+ }
217
+
218
+ /** Creates a deterministic SiloedTag for private log testing. */
219
+ export function makePrivateLogTag(blockNumber: number, txIndex: number, logIndex: number): SiloedTag {
220
+ return new SiloedTag(
221
+ blockNumber === 1 && txIndex === 0 && logIndex === 0
222
+ ? Fr.ZERO
223
+ : new Fr(blockNumber * 100 + txIndex * 10 + logIndex),
224
+ );
225
+ }
226
+
227
+ /** Creates a PrivateLog with fields derived from the tag. */
228
+ export function makePrivateLog(tag: SiloedTag): PrivateLog {
229
+ return PrivateLog.from({
230
+ fields: makeTuple(PRIVATE_LOG_SIZE_IN_FIELDS, i => (!i ? tag.value : new Fr(tag.value.toBigInt() + BigInt(i)))),
231
+ emittedLength: PRIVATE_LOG_SIZE_IN_FIELDS,
232
+ });
233
+ }
234
+
235
+ /** Creates multiple private logs for a transaction. */
236
+ export function mockPrivateLogs(blockNumber: number, txIndex: number, numLogsPerTx: number): PrivateLog[] {
237
+ return times(numLogsPerTx, logIndex => {
238
+ const tag = makePrivateLogTag(blockNumber, txIndex, logIndex);
239
+ return makePrivateLog(tag);
240
+ });
241
+ }
242
+
243
+ /** Creates a deterministic Tag for public log testing. */
244
+ export function makePublicLogTag(blockNumber: number, txIndex: number, logIndex: number): Tag {
245
+ return new Tag(
246
+ blockNumber === 1 && txIndex === 0 && logIndex === 0
247
+ ? Fr.ZERO
248
+ : new Fr((blockNumber * 100 + txIndex * 10 + logIndex) * 123),
249
+ );
250
+ }
251
+
252
+ /** Creates a PublicLog with fields derived from the tag. */
253
+ export function makePublicLog(tag: Tag, contractAddress: AztecAddress = AztecAddress.fromNumber(543254)): PublicLog {
254
+ return PublicLog.from({
255
+ contractAddress,
256
+ fields: new Array(10).fill(null).map((_, i) => (!i ? tag.value : new Fr(tag.value.toBigInt() + BigInt(i)))),
257
+ });
258
+ }
259
+
260
+ /** Creates multiple public logs for a transaction. */
261
+ export function makePublicLogs(
262
+ blockNumber: number,
263
+ txIndex: number,
264
+ numLogsPerTx: number,
265
+ contractAddress: AztecAddress = AztecAddress.fromNumber(543254),
266
+ ): PublicLog[] {
267
+ return times(numLogsPerTx, logIndex => {
268
+ const tag = makePublicLogTag(blockNumber, txIndex, logIndex);
269
+ return makePublicLog(tag, contractAddress);
270
+ });
271
+ }
272
+
273
+ export interface MockCheckpointWithLogsOptions {
274
+ previousArchive?: AppendOnlyTreeSnapshot;
275
+ numTxsPerBlock?: number;
276
+ privateLogs?: { numLogsPerTx: number };
277
+ publicLogs?: { numLogsPerTx: number; contractAddress?: AztecAddress };
278
+ }
279
+
280
+ /** Creates a checkpoint with specified logs on each tx effect. */
281
+ export async function makeCheckpointWithLogs(
282
+ blockNumber: number,
283
+ options: MockCheckpointWithLogsOptions = {},
284
+ ): Promise<PublishedCheckpoint> {
285
+ const { previousArchive, numTxsPerBlock = 4, privateLogs, publicLogs } = options;
286
+
287
+ const block = await L2Block.random(BlockNumber(blockNumber), {
288
+ checkpointNumber: CheckpointNumber.fromBlockNumber(BlockNumber(blockNumber)),
289
+ indexWithinCheckpoint: IndexWithinCheckpoint(0),
290
+ state: makeStateForBlock(blockNumber, numTxsPerBlock),
291
+ ...(previousArchive ? { lastArchive: previousArchive } : {}),
292
+ });
293
+ block.header.globalVariables.blockNumber = BlockNumber(blockNumber);
294
+
295
+ block.body.txEffects = await timesParallel(numTxsPerBlock, async (txIndex: number) => {
296
+ const txEffect = await TxEffect.random();
297
+ txEffect.privateLogs = privateLogs ? mockPrivateLogs(blockNumber, txIndex, privateLogs.numLogsPerTx) : [];
298
+ txEffect.publicLogs = publicLogs
299
+ ? makePublicLogs(blockNumber, txIndex, publicLogs.numLogsPerTx, publicLogs.contractAddress)
300
+ : [];
301
+ return txEffect;
302
+ });
303
+
304
+ const checkpoint = new Checkpoint(
305
+ AppendOnlyTreeSnapshot.random(),
306
+ CheckpointHeader.random(),
307
+ [block],
308
+ CheckpointNumber.fromBlockNumber(BlockNumber(blockNumber)),
309
+ );
310
+ return makePublishedCheckpoint(checkpoint, blockNumber);
311
+ }
@@ -0,0 +1,109 @@
1
+ import type { BlobClientInterface } from '@aztec/blob-client/client';
2
+ import type { RollupContract } from '@aztec/ethereum/contracts';
3
+ import type { ViemPublicClient, ViemPublicDebugClient } from '@aztec/ethereum/types';
4
+ import { Buffer32 } from '@aztec/foundation/buffer';
5
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
+ import { EthAddress } from '@aztec/foundation/eth-address';
7
+ import type { FunctionsOf } from '@aztec/foundation/types';
8
+ import type { ArchiverEmitter } from '@aztec/stdlib/block';
9
+ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
10
+ import { type TelemetryClient, type Tracer, getTelemetryClient } from '@aztec/telemetry-client';
11
+
12
+ import { mock } from 'jest-mock-extended';
13
+ import { EventEmitter } from 'node:events';
14
+
15
+ import { Archiver } from '../archiver.js';
16
+ import { ArchiverInstrumentation } from '../modules/instrumentation.js';
17
+ import type { ArchiverL1Synchronizer } from '../modules/l1_synchronizer.js';
18
+ import type { KVArchiverDataStore } from '../store/kv_archiver_store.js';
19
+
20
+ /** Noop L1 synchronizer for testing without L1 connectivity. */
21
+ class NoopL1Synchronizer implements FunctionsOf<ArchiverL1Synchronizer> {
22
+ public readonly tracer: Tracer;
23
+
24
+ constructor(tracer: Tracer) {
25
+ this.tracer = tracer;
26
+ }
27
+
28
+ setConfig(_config: unknown) {}
29
+ getL1BlockNumber(): bigint | undefined {
30
+ return 0n;
31
+ }
32
+ getL1Timestamp(): bigint | undefined {
33
+ return 0n;
34
+ }
35
+ testEthereumNodeSynced(): Promise<void> {
36
+ return Promise.resolve();
37
+ }
38
+ syncFromL1(_initialSyncComplete: boolean): Promise<void> {
39
+ return Promise.resolve();
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Archiver with mocked L1 connectivity for testing.
45
+ * Uses mock L1 clients and a noop synchronizer, enabling tests that
46
+ * don't require real Ethereum connectivity.
47
+ */
48
+ export class NoopL1Archiver extends Archiver {
49
+ constructor(
50
+ dataStore: KVArchiverDataStore,
51
+ l1Constants: L1RollupConstants & { genesisArchiveRoot: Fr },
52
+ instrumentation: ArchiverInstrumentation,
53
+ ) {
54
+ // Create mocks for L1 clients
55
+ const publicClient = mock<ViemPublicClient>();
56
+ const debugClient = mock<ViemPublicDebugClient>();
57
+ const rollup = mock<RollupContract>();
58
+ const blobClient = mock<BlobClientInterface>();
59
+
60
+ // Mock methods called during start()
61
+ blobClient.testSources.mockResolvedValue();
62
+ publicClient.getBlockNumber.mockResolvedValue(1n);
63
+
64
+ const events = new EventEmitter() as ArchiverEmitter;
65
+ const synchronizer = new NoopL1Synchronizer(instrumentation.tracer);
66
+
67
+ super(
68
+ publicClient,
69
+ debugClient,
70
+ rollup,
71
+ {
72
+ registryAddress: EthAddress.ZERO,
73
+ governanceProposerAddress: EthAddress.ZERO,
74
+ slashFactoryAddress: EthAddress.ZERO,
75
+ slashingProposerAddress: EthAddress.ZERO,
76
+ },
77
+ dataStore,
78
+ {
79
+ pollingIntervalMs: 1000,
80
+ batchSize: 100,
81
+ skipValidateCheckpointAttestations: true,
82
+ maxAllowedEthClientDriftSeconds: 300,
83
+ ethereumAllowNoDebugHosts: true, // Skip trace validation
84
+ },
85
+ blobClient,
86
+ instrumentation,
87
+ { ...l1Constants, l1StartBlockHash: Buffer32.random() },
88
+ synchronizer as ArchiverL1Synchronizer,
89
+ events,
90
+ );
91
+ }
92
+
93
+ /** Override start to skip L1 validation checks. */
94
+ public override start(_blockUntilSynced?: boolean): Promise<void> {
95
+ // Just start the running promise without L1 checks
96
+ this.runningPromise.start();
97
+ return Promise.resolve();
98
+ }
99
+ }
100
+
101
+ /** Creates an archiver with mocked L1 connectivity for testing. */
102
+ export async function createNoopL1Archiver(
103
+ dataStore: KVArchiverDataStore,
104
+ l1Constants: L1RollupConstants & { genesisArchiveRoot: Fr },
105
+ telemetry: TelemetryClient = getTelemetryClient(),
106
+ ): Promise<NoopL1Archiver> {
107
+ const instrumentation = await ArchiverInstrumentation.new(telemetry, () => dataStore.estimateSize());
108
+ return new NoopL1Archiver(dataStore, l1Constants, instrumentation);
109
+ }
@@ -1,197 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
3
- import { type ViemPublicClient } from '@aztec/ethereum';
4
- import type { EthAddress } from '@aztec/foundation/eth-address';
5
- import { Fr } from '@aztec/foundation/fields';
6
- import { type Logger } from '@aztec/foundation/log';
7
- import type { FunctionSelector } from '@aztec/stdlib/abi';
8
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
9
- import { type InBlock, type L2Block, type L2BlockSource, type L2Tips, type NullifierWithBlockSource } from '@aztec/stdlib/block';
10
- import { type ContractClassPublic, type ContractDataSource, type ContractInstanceWithAddress, type PublicFunction } from '@aztec/stdlib/contract';
11
- import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
12
- import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
13
- import type { L2LogsSource } from '@aztec/stdlib/interfaces/server';
14
- import { type LogFilter, type PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
15
- import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
16
- import { type BlockHeader, TxEffect, TxHash, TxReceipt } from '@aztec/stdlib/tx';
17
- import { type TelemetryClient, type Traceable, type Tracer } from '@aztec/telemetry-client';
18
- import { EventEmitter } from 'events';
19
- import type { ArchiverDataStore } from './archiver_store.js';
20
- import type { ArchiverConfig } from './config.js';
21
- import { ArchiverInstrumentation } from './instrumentation.js';
22
- /**
23
- * Helper interface to combine all sources this archiver implementation provides.
24
- */
25
- export type ArchiveSource = L2BlockSource & L2LogsSource & ContractDataSource & L1ToL2MessageSource & NullifierWithBlockSource;
26
- /**
27
- * Pulls L2 blocks in a non-blocking manner and provides interface for their retrieval.
28
- * Responsible for handling robust L1 polling so that other components do not need to
29
- * concern themselves with it.
30
- */
31
- export declare class Archiver extends EventEmitter implements ArchiveSource, Traceable {
32
- private readonly publicClient;
33
- private readonly l1Addresses;
34
- readonly dataStore: ArchiverDataStore;
35
- private readonly config;
36
- private readonly blobSinkClient;
37
- private readonly instrumentation;
38
- private readonly l1constants;
39
- private readonly log;
40
- /**
41
- * A promise in which we will be continually fetching new L2 blocks.
42
- */
43
- private runningPromise?;
44
- private rollup;
45
- private inbox;
46
- private store;
47
- l1BlockNumber: bigint | undefined;
48
- l1Timestamp: bigint | undefined;
49
- readonly tracer: Tracer;
50
- /**
51
- * Creates a new instance of the Archiver.
52
- * @param publicClient - A client for interacting with the Ethereum node.
53
- * @param rollupAddress - Ethereum address of the rollup contract.
54
- * @param inboxAddress - Ethereum address of the inbox contract.
55
- * @param registryAddress - Ethereum address of the registry contract.
56
- * @param pollingIntervalMs - The interval for polling for L1 logs (in milliseconds).
57
- * @param store - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
58
- * @param log - A logger.
59
- */
60
- constructor(publicClient: ViemPublicClient, l1Addresses: {
61
- rollupAddress: EthAddress;
62
- inboxAddress: EthAddress;
63
- registryAddress: EthAddress;
64
- }, dataStore: ArchiverDataStore, config: {
65
- pollingIntervalMs: number;
66
- batchSize: number;
67
- }, blobSinkClient: BlobSinkClientInterface, instrumentation: ArchiverInstrumentation, l1constants: L1RollupConstants, log?: Logger);
68
- /**
69
- * Creates a new instance of the Archiver and blocks until it syncs from chain.
70
- * @param config - The archiver's desired configuration.
71
- * @param archiverStore - The backing store for the archiver.
72
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
73
- * @returns - An instance of the archiver.
74
- */
75
- static createAndSync(config: ArchiverConfig, archiverStore: ArchiverDataStore, deps: {
76
- telemetry: TelemetryClient;
77
- blobSinkClient: BlobSinkClientInterface;
78
- }, blockUntilSynced?: boolean): Promise<Archiver>;
79
- /**
80
- * Starts sync process.
81
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
82
- */
83
- start(blockUntilSynced: boolean): Promise<void>;
84
- private syncSafe;
85
- /**
86
- * Fetches logs from L1 contracts and processes them.
87
- */
88
- private sync;
89
- /** Queries the rollup contract on whether a prune can be executed on the immediatenext L1 block. */
90
- private canPrune;
91
- /** Checks if there'd be a reorg for the next block submission and start pruning now. */
92
- private handleEpochPrune;
93
- private nextRange;
94
- private handleL1ToL2Messages;
95
- private handleL2blocks;
96
- /**
97
- * Stops the archiver.
98
- * @returns A promise signalling completion of the stop process.
99
- */
100
- stop(): Promise<void>;
101
- getL1Constants(): Promise<L1RollupConstants>;
102
- getRollupAddress(): Promise<EthAddress>;
103
- getRegistryAddress(): Promise<EthAddress>;
104
- getL1BlockNumber(): bigint;
105
- getL1Timestamp(): bigint;
106
- getL2SlotNumber(): Promise<bigint>;
107
- getL2EpochNumber(): Promise<bigint>;
108
- getBlocksForEpoch(epochNumber: bigint): Promise<L2Block[]>;
109
- isEpochComplete(epochNumber: bigint): Promise<boolean>;
110
- /**
111
- * Gets up to `limit` amount of L2 blocks starting from `from`.
112
- * @param from - Number of the first block to return (inclusive).
113
- * @param limit - The number of blocks to return.
114
- * @param proven - If true, only return blocks that have been proven.
115
- * @returns The requested L2 blocks.
116
- */
117
- getBlocks(from: number, limit: number, proven?: boolean): Promise<L2Block[]>;
118
- /**
119
- * Gets an l2 block.
120
- * @param number - The block number to return.
121
- * @returns The requested L2 block.
122
- */
123
- getBlock(number: number): Promise<L2Block | undefined>;
124
- getBlockHeader(number: number | 'latest'): Promise<BlockHeader | undefined>;
125
- getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
126
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
127
- /**
128
- * Gets the public function data for a contract.
129
- * @param address - The contract address containing the function to fetch.
130
- * @param selector - The function selector of the function to fetch.
131
- * @returns The public function data (if found).
132
- */
133
- getPublicFunction(address: AztecAddress, selector: FunctionSelector): Promise<PublicFunction | undefined>;
134
- /**
135
- * Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
136
- * @param from - The block number from which to begin retrieving logs.
137
- * @param limit - The maximum number of blocks to retrieve logs from.
138
- * @returns An array of private logs from the specified range of blocks.
139
- */
140
- getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
141
- /**
142
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
143
- * @param tags - The tags to filter the logs by.
144
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
145
- * that tag.
146
- */
147
- getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
148
- /**
149
- * Returns the provided nullifier indexes scoped to the block
150
- * they were first included in, or undefined if they're not present in the tree
151
- * @param blockNumber Max block number to search for the nullifiers
152
- * @param nullifiers Nullifiers to get
153
- * @returns The block scoped indexes of the provided nullifiers, or undefined if the nullifier doesn't exist in the tree
154
- */
155
- findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
156
- /**
157
- * Gets public logs based on the provided filter.
158
- * @param filter - The filter to apply to the logs.
159
- * @returns The requested logs.
160
- */
161
- getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
162
- /**
163
- * Gets contract class logs based on the provided filter.
164
- * @param filter - The filter to apply to the logs.
165
- * @returns The requested logs.
166
- */
167
- getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
168
- /**
169
- * Gets the number of the latest L2 block processed by the block source implementation.
170
- * @returns The number of the latest L2 block processed by the block source implementation.
171
- */
172
- getBlockNumber(): Promise<number>;
173
- getProvenBlockNumber(): Promise<number>;
174
- /** Forcefully updates the last proven block number. Use for testing. */
175
- setProvenBlockNumber(blockNumber: number): Promise<void>;
176
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
177
- getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
178
- getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
179
- /**
180
- * Gets L1 to L2 message (to be) included in a given block.
181
- * @param blockNumber - L2 block number to get messages for.
182
- * @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
183
- */
184
- getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
185
- /**
186
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
187
- * @param l1ToL2Message - The L1 to L2 message.
188
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
189
- */
190
- getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
191
- getContractClassIds(): Promise<Fr[]>;
192
- addContractClass(contractClass: ContractClassPublic): Promise<void>;
193
- registerContractFunctionSignatures(address: AztecAddress, signatures: string[]): Promise<void>;
194
- getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
195
- getL2Tips(): Promise<L2Tips>;
196
- }
197
- //# sourceMappingURL=archiver.d.ts.map
@@ -1 +0,0 @@
1
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