@aztec/archiver 0.0.1-commit.96bb3f7 → 0.0.1-commit.993d240

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 (232) hide show
  1. package/README.md +164 -22
  2. package/dest/archiver.d.ts +158 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +881 -0
  5. package/dest/config.d.ts +33 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/{archiver/config.js → config.js} +31 -14
  8. package/dest/errors.d.ts +87 -0
  9. package/dest/errors.d.ts.map +1 -0
  10. package/dest/errors.js +129 -0
  11. package/dest/factory.d.ts +16 -10
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +112 -20
  14. package/dest/index.d.ts +19 -4
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +17 -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/{archiver/l1 → l1}/bin/retrieve-calldata.d.ts +1 -1
  21. package/dest/l1/bin/retrieve-calldata.d.ts.map +1 -0
  22. package/dest/{archiver/l1 → l1}/bin/retrieve-calldata.js +35 -32
  23. package/dest/l1/calldata_retriever.d.ts +136 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +412 -0
  26. package/dest/l1/data_retrieval.d.ts +97 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/{archiver/l1 → l1}/data_retrieval.js +65 -89
  29. package/dest/{archiver/l1 → l1}/debug_tx.d.ts +1 -1
  30. package/dest/l1/debug_tx.d.ts.map +1 -0
  31. package/dest/{archiver/l1 → l1}/spire_proposer.d.ts +5 -5
  32. package/dest/l1/spire_proposer.d.ts.map +1 -0
  33. package/dest/{archiver/l1 → l1}/spire_proposer.js +9 -17
  34. package/dest/l1/trace_tx.d.ts +43 -0
  35. package/dest/l1/trace_tx.d.ts.map +1 -0
  36. package/dest/l1/types.d.ts +12 -0
  37. package/dest/l1/types.d.ts.map +1 -0
  38. package/dest/l1/validate_historical_logs.d.ts +23 -0
  39. package/dest/l1/validate_historical_logs.d.ts.map +1 -0
  40. package/dest/l1/validate_historical_logs.js +108 -0
  41. package/dest/{archiver/l1 → l1}/validate_trace.d.ts +6 -3
  42. package/dest/l1/validate_trace.d.ts.map +1 -0
  43. package/dest/{archiver/l1 → l1}/validate_trace.js +13 -9
  44. package/dest/modules/contract_data_source_adapter.d.ts +25 -0
  45. package/dest/modules/contract_data_source_adapter.d.ts.map +1 -0
  46. package/dest/modules/contract_data_source_adapter.js +40 -0
  47. package/dest/modules/data_source_base.d.ts +113 -0
  48. package/dest/modules/data_source_base.d.ts.map +1 -0
  49. package/dest/modules/data_source_base.js +351 -0
  50. package/dest/modules/data_store_updater.d.ts +105 -0
  51. package/dest/modules/data_store_updater.d.ts.map +1 -0
  52. package/dest/modules/data_store_updater.js +392 -0
  53. package/dest/modules/instrumentation.d.ts +55 -0
  54. package/dest/modules/instrumentation.d.ts.map +1 -0
  55. package/dest/{archiver → modules}/instrumentation.js +61 -19
  56. package/dest/modules/l1_synchronizer.d.ts +77 -0
  57. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  58. package/dest/modules/l1_synchronizer.js +1344 -0
  59. package/dest/modules/validation.d.ts +18 -0
  60. package/dest/modules/validation.d.ts.map +1 -0
  61. package/dest/{archiver → modules}/validation.js +12 -6
  62. package/dest/store/block_store.d.ts +300 -0
  63. package/dest/store/block_store.d.ts.map +1 -0
  64. package/dest/store/block_store.js +1219 -0
  65. package/dest/store/contract_class_store.d.ts +31 -0
  66. package/dest/store/contract_class_store.d.ts.map +1 -0
  67. package/dest/store/contract_class_store.js +80 -0
  68. package/dest/store/contract_instance_store.d.ts +51 -0
  69. package/dest/store/contract_instance_store.d.ts.map +1 -0
  70. package/dest/{archiver/kv_archiver_store → store}/contract_instance_store.js +38 -3
  71. package/dest/store/data_stores.d.ts +68 -0
  72. package/dest/store/data_stores.d.ts.map +1 -0
  73. package/dest/store/data_stores.js +54 -0
  74. package/dest/store/function_names_cache.d.ts +17 -0
  75. package/dest/store/function_names_cache.d.ts.map +1 -0
  76. package/dest/store/function_names_cache.js +30 -0
  77. package/dest/store/l2_tips_cache.d.ts +25 -0
  78. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  79. package/dest/store/l2_tips_cache.js +26 -0
  80. package/dest/store/log_store.d.ts +59 -0
  81. package/dest/store/log_store.d.ts.map +1 -0
  82. package/dest/store/log_store.js +310 -0
  83. package/dest/store/log_store_codec.d.ts +70 -0
  84. package/dest/store/log_store_codec.d.ts.map +1 -0
  85. package/dest/store/log_store_codec.js +101 -0
  86. package/dest/store/message_store.d.ts +50 -0
  87. package/dest/store/message_store.d.ts.map +1 -0
  88. package/dest/{archiver/kv_archiver_store → store}/message_store.js +51 -9
  89. package/dest/{archiver/structs → structs}/data_retrieval.d.ts +1 -1
  90. package/dest/structs/data_retrieval.d.ts.map +1 -0
  91. package/dest/structs/inbox_message.d.ts +15 -0
  92. package/dest/structs/inbox_message.d.ts.map +1 -0
  93. package/dest/{archiver/structs → structs}/published.d.ts +1 -1
  94. package/dest/structs/published.d.ts.map +1 -0
  95. package/dest/test/fake_l1_state.d.ts +214 -0
  96. package/dest/test/fake_l1_state.d.ts.map +1 -0
  97. package/dest/test/fake_l1_state.js +517 -0
  98. package/dest/test/index.d.ts +2 -1
  99. package/dest/test/index.d.ts.map +1 -1
  100. package/dest/test/index.js +4 -1
  101. package/dest/test/mock_archiver.d.ts +2 -2
  102. package/dest/test/mock_archiver.d.ts.map +1 -1
  103. package/dest/test/mock_archiver.js +3 -3
  104. package/dest/test/mock_l1_to_l2_message_source.d.ts +1 -1
  105. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  106. package/dest/test/mock_l1_to_l2_message_source.js +2 -1
  107. package/dest/test/mock_l2_block_source.d.ts +65 -41
  108. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  109. package/dest/test/mock_l2_block_source.js +330 -151
  110. package/dest/test/mock_structs.d.ts +81 -3
  111. package/dest/test/mock_structs.d.ts.map +1 -1
  112. package/dest/test/mock_structs.js +152 -7
  113. package/dest/test/noop_l1_archiver.d.ts +29 -0
  114. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  115. package/dest/test/noop_l1_archiver.js +85 -0
  116. package/package.json +17 -18
  117. package/src/archiver.ts +681 -0
  118. package/src/{archiver/config.ts → config.ts} +43 -12
  119. package/src/errors.ts +203 -0
  120. package/src/factory.ts +175 -22
  121. package/src/index.ts +27 -3
  122. package/src/interfaces.ts +9 -0
  123. package/src/l1/README.md +55 -0
  124. package/src/{archiver/l1 → l1}/bin/retrieve-calldata.ts +45 -33
  125. package/src/l1/calldata_retriever.ts +522 -0
  126. package/src/{archiver/l1 → l1}/data_retrieval.ts +106 -134
  127. package/src/{archiver/l1 → l1}/spire_proposer.ts +7 -15
  128. package/src/l1/validate_historical_logs.ts +140 -0
  129. package/src/{archiver/l1 → l1}/validate_trace.ts +24 -6
  130. package/src/modules/contract_data_source_adapter.ts +55 -0
  131. package/src/modules/data_source_base.ts +493 -0
  132. package/src/modules/data_store_updater.ts +518 -0
  133. package/src/{archiver → modules}/instrumentation.ts +72 -20
  134. package/src/modules/l1_synchronizer.ts +1257 -0
  135. package/src/{archiver → modules}/validation.ts +15 -9
  136. package/src/store/block_store.ts +1590 -0
  137. package/src/store/contract_class_store.ts +108 -0
  138. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +52 -6
  139. package/src/store/data_stores.ts +104 -0
  140. package/src/store/function_names_cache.ts +37 -0
  141. package/src/store/l2_tips_cache.ts +35 -0
  142. package/src/store/log_store.ts +379 -0
  143. package/src/store/log_store_codec.ts +132 -0
  144. package/src/{archiver/kv_archiver_store → store}/message_store.ts +60 -10
  145. package/src/{archiver/structs → structs}/inbox_message.ts +1 -1
  146. package/src/test/fake_l1_state.ts +770 -0
  147. package/src/test/index.ts +4 -0
  148. package/src/test/mock_archiver.ts +4 -3
  149. package/src/test/mock_l1_to_l2_message_source.ts +1 -0
  150. package/src/test/mock_l2_block_source.ts +403 -171
  151. package/src/test/mock_structs.ts +283 -8
  152. package/src/test/noop_l1_archiver.ts +139 -0
  153. package/dest/archiver/archiver.d.ts +0 -307
  154. package/dest/archiver/archiver.d.ts.map +0 -1
  155. package/dest/archiver/archiver.js +0 -2102
  156. package/dest/archiver/archiver_store.d.ts +0 -315
  157. package/dest/archiver/archiver_store.d.ts.map +0 -1
  158. package/dest/archiver/archiver_store.js +0 -4
  159. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  160. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  161. package/dest/archiver/archiver_store_test_suite.js +0 -2770
  162. package/dest/archiver/config.d.ts +0 -22
  163. package/dest/archiver/config.d.ts.map +0 -1
  164. package/dest/archiver/errors.d.ts +0 -36
  165. package/dest/archiver/errors.d.ts.map +0 -1
  166. package/dest/archiver/errors.js +0 -54
  167. package/dest/archiver/index.d.ts +0 -7
  168. package/dest/archiver/index.d.ts.map +0 -1
  169. package/dest/archiver/index.js +0 -4
  170. package/dest/archiver/instrumentation.d.ts +0 -37
  171. package/dest/archiver/instrumentation.d.ts.map +0 -1
  172. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -164
  173. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  174. package/dest/archiver/kv_archiver_store/block_store.js +0 -626
  175. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  176. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  177. package/dest/archiver/kv_archiver_store/contract_class_store.js +0 -120
  178. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
  179. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  180. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -159
  181. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  182. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -316
  183. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -45
  184. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  185. package/dest/archiver/kv_archiver_store/log_store.js +0 -401
  186. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -40
  187. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  188. package/dest/archiver/l1/bin/retrieve-calldata.d.ts.map +0 -1
  189. package/dest/archiver/l1/calldata_retriever.d.ts +0 -112
  190. package/dest/archiver/l1/calldata_retriever.d.ts.map +0 -1
  191. package/dest/archiver/l1/calldata_retriever.js +0 -471
  192. package/dest/archiver/l1/data_retrieval.d.ts +0 -90
  193. package/dest/archiver/l1/data_retrieval.d.ts.map +0 -1
  194. package/dest/archiver/l1/debug_tx.d.ts.map +0 -1
  195. package/dest/archiver/l1/spire_proposer.d.ts.map +0 -1
  196. package/dest/archiver/l1/trace_tx.d.ts +0 -97
  197. package/dest/archiver/l1/trace_tx.d.ts.map +0 -1
  198. package/dest/archiver/l1/types.d.ts +0 -12
  199. package/dest/archiver/l1/types.d.ts.map +0 -1
  200. package/dest/archiver/l1/validate_trace.d.ts.map +0 -1
  201. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  202. package/dest/archiver/structs/inbox_message.d.ts +0 -15
  203. package/dest/archiver/structs/inbox_message.d.ts.map +0 -1
  204. package/dest/archiver/structs/published.d.ts.map +0 -1
  205. package/dest/archiver/validation.d.ts +0 -17
  206. package/dest/archiver/validation.d.ts.map +0 -1
  207. package/dest/rpc/index.d.ts +0 -9
  208. package/dest/rpc/index.d.ts.map +0 -1
  209. package/dest/rpc/index.js +0 -15
  210. package/src/archiver/archiver.ts +0 -2265
  211. package/src/archiver/archiver_store.ts +0 -380
  212. package/src/archiver/archiver_store_test_suite.ts +0 -2842
  213. package/src/archiver/errors.ts +0 -90
  214. package/src/archiver/index.ts +0 -6
  215. package/src/archiver/kv_archiver_store/block_store.ts +0 -850
  216. package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -176
  217. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -442
  218. package/src/archiver/kv_archiver_store/log_store.ts +0 -516
  219. package/src/archiver/l1/README.md +0 -98
  220. package/src/archiver/l1/calldata_retriever.ts +0 -641
  221. package/src/rpc/index.ts +0 -16
  222. /package/dest/{archiver/l1 → l1}/debug_tx.js +0 -0
  223. /package/dest/{archiver/l1 → l1}/trace_tx.js +0 -0
  224. /package/dest/{archiver/l1 → l1}/types.js +0 -0
  225. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  226. /package/dest/{archiver/structs → structs}/inbox_message.js +0 -0
  227. /package/dest/{archiver/structs → structs}/published.js +0 -0
  228. /package/src/{archiver/l1 → l1}/debug_tx.ts +0 -0
  229. /package/src/{archiver/l1 → l1}/trace_tx.ts +0 -0
  230. /package/src/{archiver/l1 → l1}/types.ts +0 -0
  231. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
  232. /package/src/{archiver/structs → structs}/published.ts +0 -0
@@ -1,626 +0,0 @@
1
- import { INITIAL_CHECKPOINT_NUMBER, INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
2
- import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
3
- import { toArray } from '@aztec/foundation/iterable';
4
- import { createLogger } from '@aztec/foundation/log';
5
- import { BufferReader } from '@aztec/foundation/serialize';
6
- import { bufferToHex } from '@aztec/foundation/string';
7
- import { isDefined } from '@aztec/foundation/types';
8
- import { Body, CheckpointedL2Block, CommitteeAttestation, L2BlockHash, L2BlockNew, deserializeValidateCheckpointResult, serializeValidateCheckpointResult } from '@aztec/stdlib/block';
9
- import { L1PublishedData } from '@aztec/stdlib/checkpoint';
10
- import { CheckpointHeader } from '@aztec/stdlib/rollup';
11
- import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
12
- import { BlockHeader, TxHash, TxReceipt, deserializeIndexedTxEffect, serializeIndexedTxEffect } from '@aztec/stdlib/tx';
13
- import { BlockArchiveNotConsistentError, BlockIndexNotSequentialError, BlockNotFoundError, BlockNumberNotSequentialError, CheckpointNotFoundError, CheckpointNumberNotConsistentError, CheckpointNumberNotSequentialError, InitialBlockNumberNotSequentialError, InitialCheckpointNumberNotSequentialError } from '../errors.js';
14
- export { TxReceipt } from '@aztec/stdlib/tx';
15
- /**
16
- * LMDB implementation of the ArchiverDataStore interface.
17
- */ export class BlockStore {
18
- db;
19
- /** Map block number to block data */ #blocks;
20
- /** Map checkpoint number to checkpoint data */ #checkpoints;
21
- /** Map block hash to list of tx hashes */ #blockTxs;
22
- /** Tx hash to serialized IndexedTxEffect */ #txEffects;
23
- /** Stores L1 block number in which the last processed L2 block was included */ #lastSynchedL1Block;
24
- /** Stores last proven checkpoint */ #lastProvenCheckpoint;
25
- /** Stores the pending chain validation status */ #pendingChainValidationStatus;
26
- /** Index mapping a contract's address (as a string) to its location in a block */ #contractIndex;
27
- /** Index mapping block hash to block number */ #blockHashIndex;
28
- /** Index mapping block archive to block number */ #blockArchiveIndex;
29
- #log;
30
- constructor(db){
31
- this.db = db;
32
- this.#log = createLogger('archiver:block_store');
33
- this.#blocks = db.openMap('archiver_blocks');
34
- this.#blockTxs = db.openMap('archiver_block_txs');
35
- this.#txEffects = db.openMap('archiver_tx_effects');
36
- this.#contractIndex = db.openMap('archiver_contract_index');
37
- this.#blockHashIndex = db.openMap('archiver_block_hash_index');
38
- this.#blockArchiveIndex = db.openMap('archiver_block_archive_index');
39
- this.#lastSynchedL1Block = db.openSingleton('archiver_last_synched_l1_block');
40
- this.#lastProvenCheckpoint = db.openSingleton('archiver_last_proven_l2_checkpoint');
41
- this.#pendingChainValidationStatus = db.openSingleton('archiver_pending_chain_validation_status');
42
- this.#checkpoints = db.openMap('archiver_checkpoints');
43
- }
44
- /**
45
- * Append new blocks to the store's list. All blocks must be for the 'current' checkpoint
46
- * @param blocks - The L2 blocks to be added to the store.
47
- * @returns True if the operation is successful.
48
- */ async addBlocks(blocks, opts = {}) {
49
- if (blocks.length === 0) {
50
- return true;
51
- }
52
- return await this.db.transactionAsync(async ()=>{
53
- // Check that the block immediately before the first block to be added is present in the store.
54
- const firstBlockNumber = blocks[0].number;
55
- const firstBlockCheckpointNumber = blocks[0].checkpointNumber;
56
- const firstBlockIndex = blocks[0].indexWithinCheckpoint;
57
- const firstBlockLastArchive = blocks[0].header.lastArchive.root;
58
- // Extract the latest block and checkpoint numbers
59
- const previousBlockNumber = await this.getLatestBlockNumber();
60
- const previousCheckpointNumber = await this.getLatestCheckpointNumber();
61
- // Check that the first block number is the expected one
62
- if (!opts.force && previousBlockNumber !== firstBlockNumber - 1) {
63
- throw new InitialBlockNumberNotSequentialError(firstBlockNumber, previousBlockNumber);
64
- }
65
- // The same check as above but for checkpoints
66
- if (!opts.force && previousCheckpointNumber !== firstBlockCheckpointNumber - 1) {
67
- throw new InitialCheckpointNumberNotSequentialError(firstBlockCheckpointNumber, previousCheckpointNumber);
68
- }
69
- // Extract the previous block if there is one and see if it is for the same checkpoint or not
70
- const previousBlockResult = await this.getBlock(previousBlockNumber);
71
- let expectedFirstblockIndex = 0;
72
- let previousBlockIndex = undefined;
73
- if (previousBlockResult !== undefined) {
74
- if (previousBlockResult.checkpointNumber === firstBlockCheckpointNumber) {
75
- // The previous block is for the same checkpoint, therefore our index should follow it
76
- previousBlockIndex = previousBlockResult.indexWithinCheckpoint;
77
- expectedFirstblockIndex = previousBlockIndex + 1;
78
- }
79
- if (!previousBlockResult.archive.root.equals(firstBlockLastArchive)) {
80
- throw new BlockArchiveNotConsistentError(firstBlockNumber, previousBlockResult.number, firstBlockLastArchive, previousBlockResult.archive.root);
81
- }
82
- }
83
- // Now check that the first block has the expected index value
84
- if (!opts.force && expectedFirstblockIndex !== firstBlockIndex) {
85
- throw new BlockIndexNotSequentialError(firstBlockIndex, previousBlockIndex);
86
- }
87
- // Iterate over blocks array and insert them, checking that the block numbers and indexes are sequential. Also check they are for the correct checkpoint.
88
- let previousBlock = undefined;
89
- for (const block of blocks){
90
- if (!opts.force && previousBlock) {
91
- if (previousBlock.number + 1 !== block.number) {
92
- throw new BlockNumberNotSequentialError(block.number, previousBlock.number);
93
- }
94
- if (previousBlock.indexWithinCheckpoint + 1 !== block.indexWithinCheckpoint) {
95
- throw new BlockIndexNotSequentialError(block.indexWithinCheckpoint, previousBlock.indexWithinCheckpoint);
96
- }
97
- if (!previousBlock.archive.root.equals(block.header.lastArchive.root)) {
98
- throw new BlockArchiveNotConsistentError(block.number, previousBlock.number, block.header.lastArchive.root, previousBlock.archive.root);
99
- }
100
- }
101
- if (!opts.force && firstBlockCheckpointNumber !== block.checkpointNumber) {
102
- throw new CheckpointNumberNotConsistentError(block.checkpointNumber, firstBlockCheckpointNumber);
103
- }
104
- previousBlock = block;
105
- await this.addBlockToDatabase(block, block.checkpointNumber, block.indexWithinCheckpoint);
106
- }
107
- return true;
108
- });
109
- }
110
- /**
111
- * Append new cheskpoints to the store's list.
112
- * @param checkpoints - The L2 checkpoints to be added to the store.
113
- * @returns True if the operation is successful.
114
- */ async addCheckpoints(checkpoints, opts = {}) {
115
- if (checkpoints.length === 0) {
116
- return true;
117
- }
118
- return await this.db.transactionAsync(async ()=>{
119
- // Check that the checkpoint immediately before the first block to be added is present in the store.
120
- const firstCheckpointNumber = checkpoints[0].checkpoint.number;
121
- const previousCheckpointNumber = await this.getLatestCheckpointNumber();
122
- if (previousCheckpointNumber !== firstCheckpointNumber - 1 && !opts.force) {
123
- throw new InitialCheckpointNumberNotSequentialError(firstCheckpointNumber, previousCheckpointNumber);
124
- }
125
- // Extract the previous checkpoint if there is one
126
- let previousCheckpointData = undefined;
127
- if (previousCheckpointNumber !== INITIAL_CHECKPOINT_NUMBER - 1) {
128
- // There should be a previous checkpoint
129
- previousCheckpointData = await this.getCheckpointData(previousCheckpointNumber);
130
- if (previousCheckpointData === undefined) {
131
- throw new CheckpointNotFoundError(previousCheckpointNumber);
132
- }
133
- }
134
- let previousBlockNumber = undefined;
135
- let previousBlock = undefined;
136
- // If we have a previous checkpoint then we need to get the previous block number
137
- if (previousCheckpointData !== undefined) {
138
- previousBlockNumber = BlockNumber(previousCheckpointData.startBlock + previousCheckpointData.numBlocks - 1);
139
- previousBlock = await this.getBlock(previousBlockNumber);
140
- if (previousBlock === undefined) {
141
- // We should be able to get the required previous block
142
- throw new BlockNotFoundError(previousBlockNumber);
143
- }
144
- }
145
- // Iterate over checkpoints array and insert them, checking that the block numbers are sequential.
146
- let previousCheckpoint = undefined;
147
- for (const checkpoint of checkpoints){
148
- if (!opts.force && previousCheckpoint && previousCheckpoint.checkpoint.number + 1 !== checkpoint.checkpoint.number) {
149
- throw new CheckpointNumberNotSequentialError(checkpoint.checkpoint.number, previousCheckpoint.checkpoint.number);
150
- }
151
- previousCheckpoint = checkpoint;
152
- // Store every block in the database. the block may already exist, but this has come from chain and is assumed to be correct.
153
- for(let i = 0; i < checkpoint.checkpoint.blocks.length; i++){
154
- const block = checkpoint.checkpoint.blocks[i];
155
- if (previousBlock) {
156
- // The blocks should have a sequential block number
157
- if (previousBlock.number !== block.number - 1) {
158
- throw new BlockNumberNotSequentialError(block.number, previousBlock.number);
159
- }
160
- // If the blocks are for the same checkpoint then they should have sequential indexes
161
- if (previousBlock.checkpointNumber === block.checkpointNumber && previousBlock.indexWithinCheckpoint !== block.indexWithinCheckpoint - 1) {
162
- throw new BlockIndexNotSequentialError(block.indexWithinCheckpoint, previousBlock.indexWithinCheckpoint);
163
- }
164
- if (!previousBlock.archive.root.equals(block.header.lastArchive.root)) {
165
- throw new BlockArchiveNotConsistentError(block.number, previousBlock.number, block.header.lastArchive.root, previousBlock.archive.root);
166
- }
167
- } else {
168
- // No previous block, must be block 1 at checkpoint index 0
169
- if (block.indexWithinCheckpoint !== 0) {
170
- throw new BlockIndexNotSequentialError(block.indexWithinCheckpoint, undefined);
171
- }
172
- if (block.number !== INITIAL_L2_BLOCK_NUM) {
173
- throw new BlockNumberNotSequentialError(block.number, undefined);
174
- }
175
- }
176
- previousBlock = block;
177
- await this.addBlockToDatabase(block, checkpoint.checkpoint.number, i);
178
- }
179
- // Store the checkpoint in the database
180
- await this.#checkpoints.set(checkpoint.checkpoint.number, {
181
- header: checkpoint.checkpoint.header.toBuffer(),
182
- archive: checkpoint.checkpoint.archive.toBuffer(),
183
- l1: checkpoint.l1.toBuffer(),
184
- attestations: checkpoint.attestations.map((attestation)=>attestation.toBuffer()),
185
- checkpointNumber: checkpoint.checkpoint.number,
186
- startBlock: checkpoint.checkpoint.blocks[0].number,
187
- numBlocks: checkpoint.checkpoint.blocks.length
188
- });
189
- }
190
- await this.#lastSynchedL1Block.set(checkpoints[checkpoints.length - 1].l1.blockNumber);
191
- return true;
192
- });
193
- }
194
- async addBlockToDatabase(block, checkpointNumber, indexWithinCheckpoint) {
195
- const blockHash = L2BlockHash.fromField(await block.hash());
196
- await this.#blocks.set(block.number, {
197
- header: block.header.toBuffer(),
198
- blockHash: blockHash.toBuffer(),
199
- archive: block.archive.toBuffer(),
200
- checkpointNumber,
201
- indexWithinCheckpoint
202
- });
203
- for(let i = 0; i < block.body.txEffects.length; i++){
204
- const txEffect = {
205
- data: block.body.txEffects[i],
206
- l2BlockNumber: block.number,
207
- l2BlockHash: blockHash,
208
- txIndexInBlock: i
209
- };
210
- await this.#txEffects.set(txEffect.data.txHash.toString(), serializeIndexedTxEffect(txEffect));
211
- }
212
- await this.#blockTxs.set(blockHash.toString(), Buffer.concat(block.body.txEffects.map((tx)=>tx.txHash.toBuffer())));
213
- // Update indices for block hash and archive
214
- await this.#blockHashIndex.set(blockHash.toString(), block.number);
215
- await this.#blockArchiveIndex.set(block.archive.root.toString(), block.number);
216
- }
217
- /**
218
- * Unwinds checkpoints from the database
219
- * @param from - The tip of the chain, passed for verification purposes,
220
- * ensuring that we don't end up deleting something we did not intend
221
- * @param checkpointsToUnwind - The number of checkpoints we are to unwind
222
- * @returns True if the operation is successful
223
- */ async unwindCheckpoints(from, checkpointsToUnwind) {
224
- return await this.db.transactionAsync(async ()=>{
225
- const last = await this.getLatestCheckpointNumber();
226
- if (from !== last) {
227
- throw new Error(`Can only unwind checkpoints from the tip (requested ${from} but current tip is ${last})`);
228
- }
229
- const proven = await this.getProvenCheckpointNumber();
230
- if (from - checkpointsToUnwind < proven) {
231
- await this.setProvenCheckpointNumber(CheckpointNumber(from - checkpointsToUnwind));
232
- }
233
- for(let i = 0; i < checkpointsToUnwind; i++){
234
- const checkpointNumber = from - i;
235
- const checkpoint = await this.#checkpoints.getAsync(checkpointNumber);
236
- if (checkpoint === undefined) {
237
- this.#log.warn(`Cannot remove checkpoint ${checkpointNumber} from the store since we don't have it`);
238
- continue;
239
- }
240
- await this.#checkpoints.delete(checkpointNumber);
241
- const maxBlock = checkpoint.startBlock + checkpoint.numBlocks - 1;
242
- for(let blockNumber = checkpoint.startBlock; blockNumber <= maxBlock; blockNumber++){
243
- const block = await this.getBlock(BlockNumber(blockNumber));
244
- if (block === undefined) {
245
- this.#log.warn(`Cannot remove block ${blockNumber} from the store since we don't have it`);
246
- continue;
247
- }
248
- await this.#blocks.delete(block.number);
249
- await Promise.all(block.body.txEffects.map((tx)=>this.#txEffects.delete(tx.txHash.toString())));
250
- const blockHash = (await block.hash()).toString();
251
- await this.#blockTxs.delete(blockHash);
252
- // Clean up indices
253
- await this.#blockHashIndex.delete(blockHash);
254
- await this.#blockArchiveIndex.delete(block.archive.root.toString());
255
- this.#log.debug(`Unwound block ${blockNumber} ${blockHash} for checkpoint ${checkpointNumber}`);
256
- }
257
- }
258
- return true;
259
- });
260
- }
261
- async getCheckpointData(checkpointNumber) {
262
- const checkpointStorage = await this.#checkpoints.getAsync(checkpointNumber);
263
- if (!checkpointStorage) {
264
- return undefined;
265
- }
266
- return this.checkpointDataFromCheckpointStorage(checkpointStorage);
267
- }
268
- async getRangeOfCheckpoints(from, limit) {
269
- const checkpoints = [];
270
- for(let checkpointNumber = from; checkpointNumber < from + limit; checkpointNumber++){
271
- const checkpoint = await this.#checkpoints.getAsync(checkpointNumber);
272
- if (!checkpoint) {
273
- break;
274
- }
275
- checkpoints.push(this.checkpointDataFromCheckpointStorage(checkpoint));
276
- }
277
- return checkpoints;
278
- }
279
- checkpointDataFromCheckpointStorage(checkpointStorage) {
280
- const data = {
281
- header: CheckpointHeader.fromBuffer(checkpointStorage.header),
282
- archive: AppendOnlyTreeSnapshot.fromBuffer(checkpointStorage.archive),
283
- checkpointNumber: CheckpointNumber(checkpointStorage.checkpointNumber),
284
- startBlock: checkpointStorage.startBlock,
285
- numBlocks: checkpointStorage.numBlocks,
286
- l1: L1PublishedData.fromBuffer(checkpointStorage.l1),
287
- attestations: checkpointStorage.attestations
288
- };
289
- return data;
290
- }
291
- async getBlocksForCheckpoint(checkpointNumber) {
292
- const checkpoint = await this.#checkpoints.getAsync(checkpointNumber);
293
- if (!checkpoint) {
294
- return undefined;
295
- }
296
- const blocksForCheckpoint = await toArray(this.#blocks.entriesAsync({
297
- start: checkpoint.startBlock,
298
- end: checkpoint.startBlock + checkpoint.numBlocks
299
- }));
300
- const converted = await Promise.all(blocksForCheckpoint.map((x)=>this.getBlockFromBlockStorage(x[0], x[1])));
301
- return converted.filter(isDefined);
302
- }
303
- async getProvenBlockNumber() {
304
- const provenCheckpointNumber = await this.getProvenCheckpointNumber();
305
- if (provenCheckpointNumber === INITIAL_CHECKPOINT_NUMBER - 1) {
306
- return BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
307
- }
308
- const checkpointStorage = await this.#checkpoints.getAsync(provenCheckpointNumber);
309
- if (!checkpointStorage) {
310
- throw new CheckpointNotFoundError(provenCheckpointNumber);
311
- } else {
312
- return BlockNumber(checkpointStorage.startBlock + checkpointStorage.numBlocks - 1);
313
- }
314
- }
315
- async getLatestBlockNumber() {
316
- const [latestBlocknumber] = await toArray(this.#blocks.keysAsync({
317
- reverse: true,
318
- limit: 1
319
- }));
320
- return typeof latestBlocknumber === 'number' ? BlockNumber(latestBlocknumber) : BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
321
- }
322
- async getLatestCheckpointNumber() {
323
- const [latestCheckpointNumber] = await toArray(this.#checkpoints.keysAsync({
324
- reverse: true,
325
- limit: 1
326
- }));
327
- if (latestCheckpointNumber === undefined) {
328
- return CheckpointNumber(INITIAL_CHECKPOINT_NUMBER - 1);
329
- }
330
- return CheckpointNumber(latestCheckpointNumber);
331
- }
332
- async getCheckpointedBlock(number) {
333
- const blockStorage = await this.#blocks.getAsync(number);
334
- if (!blockStorage) {
335
- return undefined;
336
- }
337
- const checkpoint = await this.#checkpoints.getAsync(blockStorage.checkpointNumber);
338
- if (!checkpoint) {
339
- return undefined;
340
- }
341
- const block = await this.getBlockFromBlockStorage(number, blockStorage);
342
- if (!block) {
343
- return undefined;
344
- }
345
- return new CheckpointedL2Block(CheckpointNumber(checkpoint.checkpointNumber), block, L1PublishedData.fromBuffer(checkpoint.l1), checkpoint.attestations.map((buf)=>CommitteeAttestation.fromBuffer(buf)));
346
- }
347
- /**
348
- * Gets up to `limit` amount of Checkpointed L2 blocks starting from `from`.
349
- * @param start - Number of the first block to return (inclusive).
350
- * @param limit - The number of blocks to return.
351
- * @returns The requested L2 blocks
352
- */ async *getCheckpointedBlocks(start, limit) {
353
- const checkpointCache = new Map();
354
- for await (const [blockNumber, blockStorage] of this.getBlockStorages(start, limit)){
355
- const block = await this.getBlockFromBlockStorage(blockNumber, blockStorage);
356
- if (block) {
357
- const checkpoint = checkpointCache.get(CheckpointNumber(blockStorage.checkpointNumber)) ?? await this.#checkpoints.getAsync(blockStorage.checkpointNumber);
358
- if (checkpoint) {
359
- checkpointCache.set(CheckpointNumber(blockStorage.checkpointNumber), checkpoint);
360
- const checkpointedBlock = new CheckpointedL2Block(CheckpointNumber(checkpoint.checkpointNumber), block, L1PublishedData.fromBuffer(checkpoint.l1), checkpoint.attestations.map((buf)=>CommitteeAttestation.fromBuffer(buf)));
361
- yield checkpointedBlock;
362
- }
363
- }
364
- }
365
- }
366
- async getCheckpointedBlockByHash(blockHash) {
367
- const blockNumber = await this.#blockHashIndex.getAsync(blockHash.toString());
368
- if (blockNumber === undefined) {
369
- return undefined;
370
- }
371
- return this.getCheckpointedBlock(BlockNumber(blockNumber));
372
- }
373
- async getCheckpointedBlockByArchive(archive) {
374
- const blockNumber = await this.#blockArchiveIndex.getAsync(archive.toString());
375
- if (blockNumber === undefined) {
376
- return undefined;
377
- }
378
- return this.getCheckpointedBlock(BlockNumber(blockNumber));
379
- }
380
- /**
381
- * Gets up to `limit` amount of L2 blocks starting from `from`.
382
- * @param start - Number of the first block to return (inclusive).
383
- * @param limit - The number of blocks to return.
384
- * @returns The requested L2 blocks
385
- */ async *getBlocks(start, limit) {
386
- for await (const [blockNumber, blockStorage] of this.getBlockStorages(start, limit)){
387
- const block = await this.getBlockFromBlockStorage(blockNumber, blockStorage);
388
- if (block) {
389
- yield block;
390
- }
391
- }
392
- }
393
- /**
394
- * Gets an L2 block.
395
- * @param blockNumber - The number of the block to return.
396
- * @returns The requested L2 block.
397
- */ async getBlock(blockNumber) {
398
- const blockStorage = await this.#blocks.getAsync(blockNumber);
399
- if (!blockStorage || !blockStorage.header) {
400
- return Promise.resolve(undefined);
401
- }
402
- return this.getBlockFromBlockStorage(blockNumber, blockStorage);
403
- }
404
- /**
405
- * Gets an L2 block by its hash.
406
- * @param blockHash - The hash of the block to return.
407
- * @returns The requested L2 block.
408
- */ async getBlockByHash(blockHash) {
409
- const blockNumber = await this.#blockHashIndex.getAsync(blockHash.toString());
410
- if (blockNumber === undefined) {
411
- return undefined;
412
- }
413
- return this.getBlock(BlockNumber(blockNumber));
414
- }
415
- /**
416
- * Gets an L2 block by its archive root.
417
- * @param archive - The archive root of the block to return.
418
- * @returns The requested L2 block.
419
- */ async getBlockByArchive(archive) {
420
- const blockNumber = await this.#blockArchiveIndex.getAsync(archive.toString());
421
- if (blockNumber === undefined) {
422
- return undefined;
423
- }
424
- return this.getBlock(BlockNumber(blockNumber));
425
- }
426
- /**
427
- * Gets a block header by its hash.
428
- * @param blockHash - The hash of the block to return.
429
- * @returns The requested block header.
430
- */ async getBlockHeaderByHash(blockHash) {
431
- const blockNumber = await this.#blockHashIndex.getAsync(blockHash.toString());
432
- if (blockNumber === undefined) {
433
- return undefined;
434
- }
435
- const blockStorage = await this.#blocks.getAsync(blockNumber);
436
- if (!blockStorage || !blockStorage.header) {
437
- return undefined;
438
- }
439
- return BlockHeader.fromBuffer(blockStorage.header);
440
- }
441
- /**
442
- * Gets a block header by its archive root.
443
- * @param archive - The archive root of the block to return.
444
- * @returns The requested block header.
445
- */ async getBlockHeaderByArchive(archive) {
446
- const blockNumber = await this.#blockArchiveIndex.getAsync(archive.toString());
447
- if (blockNumber === undefined) {
448
- return undefined;
449
- }
450
- const blockStorage = await this.#blocks.getAsync(blockNumber);
451
- if (!blockStorage || !blockStorage.header) {
452
- return undefined;
453
- }
454
- return BlockHeader.fromBuffer(blockStorage.header);
455
- }
456
- /**
457
- * Gets the headers for a sequence of L2 blocks.
458
- * @param start - Number of the first block to return (inclusive).
459
- * @param limit - The number of blocks to return.
460
- * @returns The requested L2 block headers
461
- */ async *getBlockHeaders(start, limit) {
462
- for await (const [blockNumber, blockStorage] of this.getBlockStorages(start, limit)){
463
- const header = BlockHeader.fromBuffer(blockStorage.header);
464
- if (header.getBlockNumber() !== blockNumber) {
465
- throw new Error(`Block number mismatch when retrieving block header from archive (expected ${blockNumber} but got ${header.getBlockNumber()})`);
466
- }
467
- yield header;
468
- }
469
- }
470
- async *getBlockStorages(start, limit) {
471
- let expectedBlockNumber = start;
472
- for await (const [blockNumber, blockStorage] of this.#blocks.entriesAsync(this.#computeBlockRange(start, limit))){
473
- if (blockNumber !== expectedBlockNumber) {
474
- throw new Error(`Block number mismatch when iterating blocks from archive (expected ${expectedBlockNumber} but got ${blockNumber})`);
475
- }
476
- expectedBlockNumber++;
477
- yield [
478
- blockNumber,
479
- blockStorage
480
- ];
481
- }
482
- }
483
- async getBlockFromBlockStorage(blockNumber, blockStorage) {
484
- const header = BlockHeader.fromBuffer(blockStorage.header);
485
- const archive = AppendOnlyTreeSnapshot.fromBuffer(blockStorage.archive);
486
- const blockHash = blockStorage.blockHash;
487
- const blockHashString = bufferToHex(blockHash);
488
- const blockTxsBuffer = await this.#blockTxs.getAsync(blockHashString);
489
- if (blockTxsBuffer === undefined) {
490
- this.#log.warn(`Could not find body for block ${header.globalVariables.blockNumber} ${blockHash}`);
491
- return undefined;
492
- }
493
- const txEffects = [];
494
- const reader = BufferReader.asReader(blockTxsBuffer);
495
- while(!reader.isEmpty()){
496
- const txHash = reader.readObject(TxHash);
497
- const txEffect = await this.#txEffects.getAsync(txHash.toString());
498
- if (txEffect === undefined) {
499
- this.#log.warn(`Could not find tx effect for tx ${txHash} in block ${blockNumber}`);
500
- return undefined;
501
- }
502
- txEffects.push(deserializeIndexedTxEffect(txEffect).data);
503
- }
504
- const body = new Body(txEffects);
505
- const block = new L2BlockNew(archive, header, body, CheckpointNumber(blockStorage.checkpointNumber), blockStorage.indexWithinCheckpoint);
506
- if (block.number !== blockNumber) {
507
- throw new Error(`Block number mismatch when retrieving block from archive (expected ${blockNumber} but got ${block.number} with hash ${blockHashString})`);
508
- }
509
- return block;
510
- }
511
- /**
512
- * Gets a tx effect.
513
- * @param txHash - The hash of the tx corresponding to the tx effect.
514
- * @returns The requested tx effect with block info (or undefined if not found).
515
- */ async getTxEffect(txHash) {
516
- const buffer = await this.#txEffects.getAsync(txHash.toString());
517
- if (!buffer) {
518
- return undefined;
519
- }
520
- return deserializeIndexedTxEffect(buffer);
521
- }
522
- /**
523
- * Gets a receipt of a settled tx.
524
- * @param txHash - The hash of a tx we try to get the receipt for.
525
- * @returns The requested tx receipt (or undefined if not found).
526
- */ async getSettledTxReceipt(txHash) {
527
- const txEffect = await this.getTxEffect(txHash);
528
- if (!txEffect) {
529
- return undefined;
530
- }
531
- return new TxReceipt(txHash, TxReceipt.statusFromRevertCode(txEffect.data.revertCode), '', txEffect.data.transactionFee.toBigInt(), txEffect.l2BlockHash, BlockNumber(txEffect.l2BlockNumber));
532
- }
533
- /**
534
- * Looks up which block included the requested tx effect.
535
- * @param txHash - The txHash of the tx.
536
- * @returns The block number and index of the tx.
537
- */ async getTxLocation(txHash) {
538
- const txEffect = await this.#txEffects.getAsync(txHash.toString());
539
- if (!txEffect) {
540
- return undefined;
541
- }
542
- const { l2BlockNumber, txIndexInBlock } = deserializeIndexedTxEffect(txEffect);
543
- return [
544
- l2BlockNumber,
545
- txIndexInBlock
546
- ];
547
- }
548
- /**
549
- * Looks up which block deployed a particular contract.
550
- * @param contractAddress - The address of the contract to look up.
551
- * @returns The block number and index of the contract.
552
- */ getContractLocation(contractAddress) {
553
- return this.#contractIndex.getAsync(contractAddress.toString());
554
- }
555
- /**
556
- * Gets the number of the latest L2 block checkpointed.
557
- * @returns The number of the latest L2 block checkpointed.
558
- */ async getCheckpointedL2BlockNumber() {
559
- const latestCheckpointNumber = await this.getLatestCheckpointNumber();
560
- const checkpoint = await this.getCheckpointData(latestCheckpointNumber);
561
- if (!checkpoint) {
562
- return BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
563
- }
564
- return BlockNumber(checkpoint.startBlock + checkpoint.numBlocks - 1);
565
- }
566
- async getLatestL2BlockNumber() {
567
- const [lastBlockNumber] = await toArray(this.#blocks.keysAsync({
568
- reverse: true,
569
- limit: 1
570
- }));
571
- return typeof lastBlockNumber === 'number' ? BlockNumber(lastBlockNumber) : BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
572
- }
573
- /**
574
- * Gets the most recent L1 block processed.
575
- * @returns The L1 block that published the latest L2 block
576
- */ getSynchedL1BlockNumber() {
577
- return this.#lastSynchedL1Block.getAsync();
578
- }
579
- setSynchedL1BlockNumber(l1BlockNumber) {
580
- return this.#lastSynchedL1Block.set(l1BlockNumber);
581
- }
582
- async getProvenCheckpointNumber() {
583
- const [latestCheckpointNumber, provenCheckpointNumber] = await Promise.all([
584
- this.getLatestCheckpointNumber(),
585
- this.#lastProvenCheckpoint.getAsync()
586
- ]);
587
- return (provenCheckpointNumber ?? 0) > latestCheckpointNumber ? latestCheckpointNumber : CheckpointNumber(provenCheckpointNumber ?? 0);
588
- }
589
- async setProvenCheckpointNumber(checkpointNumber) {
590
- const result = await this.#lastProvenCheckpoint.set(checkpointNumber);
591
- return result;
592
- }
593
- #computeBlockRange(start, limit) {
594
- if (limit < 1) {
595
- throw new Error(`Invalid limit: ${limit}`);
596
- }
597
- if (start < INITIAL_L2_BLOCK_NUM) {
598
- throw new Error(`Invalid start: ${start}`);
599
- }
600
- return {
601
- start,
602
- limit
603
- };
604
- }
605
- /**
606
- * Gets the pending chain validation status.
607
- * @returns The validation status or undefined if not set.
608
- */ async getPendingChainValidationStatus() {
609
- const buffer = await this.#pendingChainValidationStatus.getAsync();
610
- if (!buffer) {
611
- return undefined;
612
- }
613
- return deserializeValidateCheckpointResult(buffer);
614
- }
615
- /**
616
- * Sets the pending chain validation status.
617
- * @param status - The validation status to store.
618
- */ async setPendingChainValidationStatus(status) {
619
- if (status) {
620
- const buffer = serializeValidateCheckpointResult(status);
621
- await this.#pendingChainValidationStatus.set(buffer);
622
- } else {
623
- await this.#pendingChainValidationStatus.delete();
624
- }
625
- }
626
- }
@@ -1,18 +0,0 @@
1
- import { Fr } from '@aztec/foundation/curves/bn254';
2
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- import type { ContractClassPublic, ExecutablePrivateFunctionWithMembershipProof, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
4
- /**
5
- * LMDB implementation of the ArchiverDataStore interface.
6
- */
7
- export declare class ContractClassStore {
8
- #private;
9
- private db;
10
- constructor(db: AztecAsyncKVStore);
11
- addContractClass(contractClass: ContractClassPublic, bytecodeCommitment: Fr, blockNumber: number): Promise<void>;
12
- deleteContractClasses(contractClass: ContractClassPublic, blockNumber: number): Promise<void>;
13
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
14
- getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
15
- getContractClassIds(): Promise<Fr[]>;
16
- addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUtilityFunctions: UtilityFunctionWithMembershipProof[]): Promise<boolean>;
17
- }
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3Nfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcmNoaXZlci9rdl9hcmNoaXZlcl9zdG9yZS9jb250cmFjdF9jbGFzc19zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFFeEUsT0FBTyxLQUFLLEVBQ1YsbUJBQW1CLEVBRW5CLDRDQUE0QyxFQUM1QyxrQ0FBa0MsRUFDbkMsTUFBTSx3QkFBd0IsQ0FBQztBQUdoQzs7R0FFRztBQUNILHFCQUFhLGtCQUFrQjs7SUFJakIsT0FBTyxDQUFDLEVBQUU7SUFBdEIsWUFBb0IsRUFBRSxFQUFFLGlCQUFpQixFQUd4QztJQUVLLGdCQUFnQixDQUNwQixhQUFhLEVBQUUsbUJBQW1CLEVBQ2xDLGtCQUFrQixFQUFFLEVBQUUsRUFDdEIsV0FBVyxFQUFFLE1BQU0sR0FDbEIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1mO0lBRUsscUJBQXFCLENBQUMsYUFBYSxFQUFFLG1CQUFtQixFQUFFLFdBQVcsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1sRztJQUVLLGdCQUFnQixDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLG1CQUFtQixHQUFHLFNBQVMsQ0FBQyxDQUd2RTtJQUVLLHFCQUFxQixDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLEVBQUUsR0FBRyxTQUFTLENBQUMsQ0FHM0Q7SUFFSyxtQkFBbUIsSUFBSSxPQUFPLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FFekM7SUFFSyxZQUFZLENBQ2hCLGVBQWUsRUFBRSxFQUFFLEVBQ25CLG1CQUFtQixFQUFFLDRDQUE0QyxFQUFFLEVBQ25FLG1CQUFtQixFQUFFLGtDQUFrQyxFQUFFLEdBQ3hELE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0F5QmxCO0NBQ0YifQ==
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_class_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_class_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EACV,mBAAmB,EAEnB,4CAA4C,EAC5C,kCAAkC,EACnC,MAAM,wBAAwB,CAAC;AAGhC;;GAEG;AACH,qBAAa,kBAAkB;;IAIjB,OAAO,CAAC,EAAE;IAAtB,YAAoB,EAAE,EAAE,iBAAiB,EAGxC;IAEK,gBAAgB,CACpB,aAAa,EAAE,mBAAmB,EAClC,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAMf;IAEK,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMlG;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAGvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEzC;IAEK,YAAY,CAChB,eAAe,EAAE,EAAE,EACnB,mBAAmB,EAAE,4CAA4C,EAAE,EACnE,mBAAmB,EAAE,kCAAkC,EAAE,GACxD,OAAO,CAAC,OAAO,CAAC,CAyBlB;CACF"}