@aztec/sequencer-client 0.7.2 → 0.7.4

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 (105) hide show
  1. package/.tsbuildinfo +1 -0
  2. package/dest/block_builder/index.d.ts +19 -0
  3. package/dest/block_builder/index.d.ts.map +1 -0
  4. package/dest/block_builder/index.js +2 -0
  5. package/dest/block_builder/solo_block_builder.d.ts +77 -0
  6. package/dest/block_builder/solo_block_builder.d.ts.map +1 -0
  7. package/dest/block_builder/solo_block_builder.js +464 -0
  8. package/dest/block_builder/solo_block_builder.test.d.ts +3 -0
  9. package/dest/block_builder/solo_block_builder.test.d.ts.map +1 -0
  10. package/dest/block_builder/solo_block_builder.test.js +277 -0
  11. package/dest/block_builder/types.d.ts +12 -0
  12. package/dest/block_builder/types.d.ts.map +1 -0
  13. package/dest/block_builder/types.js +2 -0
  14. package/dest/client/index.d.ts +2 -0
  15. package/dest/client/index.d.ts.map +1 -0
  16. package/dest/client/index.js +2 -0
  17. package/dest/client/sequencer-client.d.ts +32 -0
  18. package/dest/client/sequencer-client.d.ts.map +1 -0
  19. package/dest/client/sequencer-client.js +47 -0
  20. package/dest/config.d.ts +12 -0
  21. package/dest/config.d.ts.map +1 -0
  22. package/dest/config.js +28 -0
  23. package/dest/global_variable_builder/config.d.ts +19 -0
  24. package/dest/global_variable_builder/config.d.ts.map +1 -0
  25. package/dest/global_variable_builder/config.js +2 -0
  26. package/dest/global_variable_builder/global_builder.d.ts +58 -0
  27. package/dest/global_variable_builder/global_builder.d.ts.map +1 -0
  28. package/dest/global_variable_builder/global_builder.js +36 -0
  29. package/dest/global_variable_builder/index.d.ts +12 -0
  30. package/dest/global_variable_builder/index.d.ts.map +1 -0
  31. package/dest/global_variable_builder/index.js +12 -0
  32. package/dest/global_variable_builder/viem-reader.d.ts +16 -0
  33. package/dest/global_variable_builder/viem-reader.d.ts.map +1 -0
  34. package/dest/global_variable_builder/viem-reader.js +37 -0
  35. package/dest/index.d.ts +12 -0
  36. package/dest/index.d.ts.map +1 -0
  37. package/dest/index.js +14 -0
  38. package/dest/mocks/verification_keys.d.ts +28 -0
  39. package/dest/mocks/verification_keys.d.ts.map +1 -0
  40. package/dest/mocks/verification_keys.js +14 -0
  41. package/dest/prover/empty.d.ts +41 -0
  42. package/dest/prover/empty.d.ts.map +1 -0
  43. package/dest/prover/empty.js +57 -0
  44. package/dest/prover/index.d.ts +40 -0
  45. package/dest/prover/index.d.ts.map +1 -0
  46. package/dest/prover/index.js +2 -0
  47. package/dest/publisher/config.d.ts +32 -0
  48. package/dest/publisher/config.d.ts.map +1 -0
  49. package/dest/publisher/config.js +2 -0
  50. package/dest/publisher/index.d.ts +10 -0
  51. package/dest/publisher/index.d.ts.map +1 -0
  52. package/dest/publisher/index.js +11 -0
  53. package/dest/publisher/l1-publisher.d.ts +105 -0
  54. package/dest/publisher/l1-publisher.d.ts.map +1 -0
  55. package/dest/publisher/l1-publisher.js +156 -0
  56. package/dest/publisher/l1-publisher.test.d.ts +2 -0
  57. package/dest/publisher/l1-publisher.test.d.ts.map +1 -0
  58. package/dest/publisher/l1-publisher.test.js +58 -0
  59. package/dest/publisher/viem-tx-sender.d.ts +42 -0
  60. package/dest/publisher/viem-tx-sender.d.ts.map +1 -0
  61. package/dest/publisher/viem-tx-sender.js +121 -0
  62. package/dest/receiver.d.ts +13 -0
  63. package/dest/receiver.d.ts.map +1 -0
  64. package/dest/receiver.js +2 -0
  65. package/dest/sequencer/config.d.ts +26 -0
  66. package/dest/sequencer/config.d.ts.map +1 -0
  67. package/dest/sequencer/config.js +2 -0
  68. package/dest/sequencer/index.d.ts +4 -0
  69. package/dest/sequencer/index.d.ts.map +1 -0
  70. package/dest/sequencer/index.js +4 -0
  71. package/dest/sequencer/processed_tx.d.ts +51 -0
  72. package/dest/sequencer/processed_tx.d.ts.map +1 -0
  73. package/dest/sequencer/processed_tx.js +40 -0
  74. package/dest/sequencer/public_processor.d.ts +75 -0
  75. package/dest/sequencer/public_processor.d.ts.map +1 -0
  76. package/dest/sequencer/public_processor.js +269 -0
  77. package/dest/sequencer/public_processor.test.d.ts +2 -0
  78. package/dest/sequencer/public_processor.test.d.ts.map +1 -0
  79. package/dest/sequencer/public_processor.test.js +164 -0
  80. package/dest/sequencer/sequencer.d.ts +134 -0
  81. package/dest/sequencer/sequencer.d.ts.map +1 -0
  82. package/dest/sequencer/sequencer.js +306 -0
  83. package/dest/sequencer/sequencer.test.d.ts +2 -0
  84. package/dest/sequencer/sequencer.test.d.ts.map +1 -0
  85. package/dest/sequencer/sequencer.test.js +99 -0
  86. package/dest/sequencer/utils.d.ts +7 -0
  87. package/dest/sequencer/utils.d.ts.map +1 -0
  88. package/dest/sequencer/utils.js +12 -0
  89. package/dest/simulator/index.d.ts +43 -0
  90. package/dest/simulator/index.d.ts.map +1 -0
  91. package/dest/simulator/index.js +2 -0
  92. package/dest/simulator/public_executor.d.ts +22 -0
  93. package/dest/simulator/public_executor.d.ts.map +1 -0
  94. package/dest/simulator/public_executor.js +87 -0
  95. package/dest/simulator/public_kernel.d.ts +20 -0
  96. package/dest/simulator/public_kernel.d.ts.map +1 -0
  97. package/dest/simulator/public_kernel.js +27 -0
  98. package/dest/simulator/rollup.d.ts +33 -0
  99. package/dest/simulator/rollup.d.ts.map +1 -0
  100. package/dest/simulator/rollup.js +53 -0
  101. package/dest/utils.d.ts +12 -0
  102. package/dest/utils.d.ts.map +1 -0
  103. package/dest/utils.js +16 -0
  104. package/package.json +10 -10
  105. package/Dockerfile +0 -21
@@ -0,0 +1,43 @@
1
+ import { BaseOrMergeRollupPublicInputs, BaseRollupInputs, MergeRollupInputs, PublicKernelInputs, PublicKernelPublicInputs, RootRollupInputs, RootRollupPublicInputs } from '@aztec/circuits.js';
2
+ export { getPublicExecutor } from './public_executor.js';
3
+ /**
4
+ * Circuit simulator for the rollup circuits.
5
+ */
6
+ export interface RollupSimulator {
7
+ /**
8
+ * Simulates the base rollup circuit from its inputs.
9
+ * @param input - Inputs to the circuit.
10
+ * @returns The public inputs as outputs of the simulation.
11
+ */
12
+ baseRollupCircuit(input: BaseRollupInputs): Promise<BaseOrMergeRollupPublicInputs>;
13
+ /**
14
+ * Simulates the merge rollup circuit from its inputs.
15
+ * @param input - Inputs to the circuit.
16
+ * @returns The public inputs as outputs of the simulation.
17
+ */
18
+ mergeRollupCircuit(input: MergeRollupInputs): Promise<BaseOrMergeRollupPublicInputs>;
19
+ /**
20
+ * Simulates the root rollup circuit from its inputs.
21
+ * @param input - Inputs to the circuit.
22
+ * @returns The public inputs as outputs of the simulation.
23
+ */
24
+ rootRollupCircuit(input: RootRollupInputs): Promise<RootRollupPublicInputs>;
25
+ }
26
+ /**
27
+ * Circuit simulator for the public kernel circuits.
28
+ */
29
+ export interface PublicKernelCircuitSimulator {
30
+ /**
31
+ * Simulates the public kernel circuit (with a previous private kernel circuit run) from its inputs.
32
+ * @param inputs - Inputs to the circuit.
33
+ * @returns The public inputs as outputs of the simulation.
34
+ */
35
+ publicKernelCircuitPrivateInput(inputs: PublicKernelInputs): Promise<PublicKernelPublicInputs>;
36
+ /**
37
+ * Simulates the public kernel circuit (with no previous public kernel circuit run) from its inputs.
38
+ * @param inputs - Inputs to the circuit.
39
+ * @returns The public inputs as outputs of the simulation.
40
+ */
41
+ publicKernelCircuitNonFirstIteration(inputs: PublicKernelInputs): Promise<PublicKernelPublicInputs>;
42
+ }
43
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simulator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACnF;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACrF;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC/F;;;;OAIG;IACH,oCAAoC,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACrG"}
@@ -0,0 +1,2 @@
1
+ export { getPublicExecutor } from './public_executor.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2ltdWxhdG9yL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVBLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHNCQUFzQixDQUFDIn0=
@@ -0,0 +1,22 @@
1
+ import { CommitmentsDB, MessageLoadOracleInputs, PublicExecutor } from '@aztec/acir-simulator';
2
+ import { Fr, HistoricBlockData } from '@aztec/circuits.js';
3
+ import { ContractDataSource, L1ToL2MessageSource } from '@aztec/types';
4
+ import { MerkleTreeOperations } from '@aztec/world-state';
5
+ /**
6
+ * Returns a new PublicExecutor simulator backed by the supplied merkle tree db and contract data source.
7
+ * @param merkleTree - A merkle tree database.
8
+ * @param contractDataSource - A contract data source.
9
+ * @returns A new instance of a PublicExecutor.
10
+ */
11
+ export declare function getPublicExecutor(merkleTree: MerkleTreeOperations, contractDataSource: ContractDataSource, l1toL2MessageSource: L1ToL2MessageSource, blockData: HistoricBlockData): PublicExecutor;
12
+ /**
13
+ * Implements WorldState db using a world state database.
14
+ */
15
+ export declare class WorldStateDB implements CommitmentsDB {
16
+ private db;
17
+ private l1ToL2MessageSource;
18
+ constructor(db: MerkleTreeOperations, l1ToL2MessageSource: L1ToL2MessageSource);
19
+ getL1ToL2Message(messageKey: Fr): Promise<MessageLoadOracleInputs>;
20
+ getCommitmentIndex(commitment: Fr): Promise<bigint | undefined>;
21
+ }
22
+ //# sourceMappingURL=public_executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_executor.d.ts","sourceRoot":"","sources":["../../src/simulator/public_executor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,cAAc,EAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAA0C,EAAE,EAAoB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAgB,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAkC,MAAM,oBAAoB,CAAC;AAE1F;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,oBAAoB,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,EACxC,SAAS,EAAE,iBAAiB,kBAQ7B;AAoDD;;GAEG;AACH,qBAAa,YAAa,YAAW,aAAa;IACpC,OAAO,CAAC,EAAE;IAAwB,OAAO,CAAC,mBAAmB;gBAArD,EAAE,EAAE,oBAAoB,EAAU,mBAAmB,EAAE,mBAAmB;IAEjF,gBAAgB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAalE,kBAAkB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAG7E"}
@@ -0,0 +1,87 @@
1
+ import { PublicExecutor, } from '@aztec/acir-simulator';
2
+ import { CircuitsWasm, Fr } from '@aztec/circuits.js';
3
+ import { MerkleTreeId } from '@aztec/types';
4
+ import { computePublicDataTreeLeafIndex } from '@aztec/world-state';
5
+ /**
6
+ * Returns a new PublicExecutor simulator backed by the supplied merkle tree db and contract data source.
7
+ * @param merkleTree - A merkle tree database.
8
+ * @param contractDataSource - A contract data source.
9
+ * @returns A new instance of a PublicExecutor.
10
+ */
11
+ export function getPublicExecutor(merkleTree, contractDataSource, l1toL2MessageSource, blockData) {
12
+ return new PublicExecutor(new WorldStatePublicDB(merkleTree), new ContractsDataSourcePublicDB(contractDataSource), new WorldStateDB(merkleTree, l1toL2MessageSource), blockData);
13
+ }
14
+ /**
15
+ * Implements the PublicContractsDB using a ContractDataSource.
16
+ */
17
+ class ContractsDataSourcePublicDB {
18
+ constructor(db) {
19
+ this.db = db;
20
+ }
21
+ async getBytecode(address, selector) {
22
+ return (await this.db.getPublicFunction(address, selector))?.bytecode;
23
+ }
24
+ async getIsInternal(address, selector) {
25
+ return (await this.db.getPublicFunction(address, selector))?.isInternal;
26
+ }
27
+ async getPortalContractAddress(address) {
28
+ return (await this.db.getContractData(address))?.portalContractAddress;
29
+ }
30
+ }
31
+ /**
32
+ * Implements the PublicStateDB using a world-state database.
33
+ */
34
+ class WorldStatePublicDB {
35
+ constructor(db) {
36
+ this.db = db;
37
+ this.writeCache = new Map();
38
+ }
39
+ /**
40
+ * Reads a value from public storage, returning zero if none.
41
+ * @param contract - Owner of the storage.
42
+ * @param slot - Slot to read in the contract storage.
43
+ * @returns The current value in the storage slot.
44
+ */
45
+ async storageRead(contract, slot) {
46
+ const index = computePublicDataTreeLeafIndex(contract, slot, await CircuitsWasm.get());
47
+ const cached = this.writeCache.get(index);
48
+ if (cached !== undefined)
49
+ return cached;
50
+ const value = await this.db.getLeafValue(MerkleTreeId.PUBLIC_DATA_TREE, index);
51
+ return value ? Fr.fromBuffer(value) : Fr.ZERO;
52
+ }
53
+ /**
54
+ * Records a write to public storage.
55
+ * @param contract - Owner of the storage.
56
+ * @param slot - Slot to read in the contract storage.
57
+ * @param newValue - The new value to store.
58
+ */
59
+ async storageWrite(contract, slot, newValue) {
60
+ const index = computePublicDataTreeLeafIndex(contract, slot, await CircuitsWasm.get());
61
+ this.writeCache.set(index, newValue);
62
+ }
63
+ }
64
+ /**
65
+ * Implements WorldState db using a world state database.
66
+ */
67
+ export class WorldStateDB {
68
+ constructor(db, l1ToL2MessageSource) {
69
+ this.db = db;
70
+ this.l1ToL2MessageSource = l1ToL2MessageSource;
71
+ }
72
+ async getL1ToL2Message(messageKey) {
73
+ // todo: #697 - make this one lookup.
74
+ const message = await this.l1ToL2MessageSource.getConfirmedL1ToL2Message(messageKey);
75
+ const index = (await this.db.findLeafIndex(MerkleTreeId.L1_TO_L2_MESSAGES_TREE, messageKey.toBuffer()));
76
+ const siblingPath = await this.db.getSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGES_TREE, index);
77
+ return {
78
+ message: message.toFieldArray(),
79
+ siblingPath: siblingPath.toFieldArray(),
80
+ index,
81
+ };
82
+ }
83
+ async getCommitmentIndex(commitment) {
84
+ return await this.db.findLeafIndex(MerkleTreeId.PRIVATE_DATA_TREE, commitment.toBuffer());
85
+ }
86
+ }
87
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2V4ZWN1dG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NpbXVsYXRvci9wdWJsaWNfZXhlY3V0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUlMLGNBQWMsR0FFZixNQUFNLHVCQUF1QixDQUFDO0FBQy9CLE9BQU8sRUFBZ0IsWUFBWSxFQUFjLEVBQUUsRUFBdUMsTUFBTSxvQkFBb0IsQ0FBQztBQUNySCxPQUFPLEVBQTJDLFlBQVksRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUNyRixP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0,0 +1,20 @@
1
+ import { PublicKernelInputs, PublicKernelPublicInputs } from '@aztec/circuits.js';
2
+ import { PublicKernelCircuitSimulator } from './index.js';
3
+ /**
4
+ * Implements the PublicKernelCircuitSimulator by calling the wasm implementations of the circuits.
5
+ */
6
+ export declare class WasmPublicKernelCircuitSimulator implements PublicKernelCircuitSimulator {
7
+ /**
8
+ * Simulates the public kernel circuit (with a previous private kernel circuit run) from its inputs.
9
+ * @param input - Inputs to the circuit.
10
+ * @returns The public inputs as outputs of the simulation.
11
+ */
12
+ publicKernelCircuitPrivateInput(input: PublicKernelInputs): Promise<PublicKernelPublicInputs>;
13
+ /**
14
+ * Simulates the public kernel circuit (with no previous public kernel circuit run) from its inputs.
15
+ * @param input - Inputs to the circuit.
16
+ * @returns The public inputs as outputs of the simulation.
17
+ */
18
+ publicKernelCircuitNonFirstIteration(input: PublicKernelInputs): Promise<PublicKernelPublicInputs>;
19
+ }
20
+ //# sourceMappingURL=public_kernel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_kernel.d.ts","sourceRoot":"","sources":["../../src/simulator/public_kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAA+B,MAAM,oBAAoB,CAAC;AAE/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,qBAAa,gCAAiC,YAAW,4BAA4B;IACnF;;;;OAIG;IACI,+BAA+B,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKpG;;;;OAIG;IACH,oCAAoC,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAInG"}
@@ -0,0 +1,27 @@
1
+ import { simulatePublicKernelCircuit } from '@aztec/circuits.js';
2
+ /**
3
+ * Implements the PublicKernelCircuitSimulator by calling the wasm implementations of the circuits.
4
+ */
5
+ export class WasmPublicKernelCircuitSimulator {
6
+ /**
7
+ * Simulates the public kernel circuit (with a previous private kernel circuit run) from its inputs.
8
+ * @param input - Inputs to the circuit.
9
+ * @returns The public inputs as outputs of the simulation.
10
+ */
11
+ publicKernelCircuitPrivateInput(input) {
12
+ if (!input.previousKernel.publicInputs.isPrivate)
13
+ throw new Error(`Expected private kernel previous inputs`);
14
+ return simulatePublicKernelCircuit(input);
15
+ }
16
+ /**
17
+ * Simulates the public kernel circuit (with no previous public kernel circuit run) from its inputs.
18
+ * @param input - Inputs to the circuit.
19
+ * @returns The public inputs as outputs of the simulation.
20
+ */
21
+ publicKernelCircuitNonFirstIteration(input) {
22
+ if (input.previousKernel.publicInputs.isPrivate)
23
+ throw new Error(`Expected public kernel previous inputs`);
24
+ return simulatePublicKernelCircuit(input);
25
+ }
26
+ }
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2tlcm5lbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaW11bGF0b3IvcHVibGljX2tlcm5lbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdELDJCQUEyQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFJL0c7O0dBRUc7QUFDSCxNQUFNLE9BQU8sZ0NBQWdDO0lBQzNDOzs7O09BSUc7SUFDSSwrQkFBK0IsQ0FBQyxLQUF5QjtRQUM5RCxJQUFJLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxZQUFZLENBQUMsU0FBUztZQUFFLE1BQU0sSUFBSSxLQUFLLENBQUMseUNBQXlDLENBQUMsQ0FBQztRQUM3RyxPQUFPLDJCQUEyQixDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzVDLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsb0NBQW9DLENBQUMsS0FBeUI7UUFDNUQsSUFBSSxLQUFLLENBQUMsY0FBYyxDQUFDLFlBQVksQ0FBQyxTQUFTO1lBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQyx3Q0FBd0MsQ0FBQyxDQUFDO1FBQzNHLE9BQU8sMkJBQTJCLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDNUMsQ0FBQztDQUNGIn0=
@@ -0,0 +1,33 @@
1
+ import { BaseOrMergeRollupPublicInputs, BaseRollupInputs, CircuitsWasm, MergeRollupInputs, RootRollupInputs, RootRollupPublicInputs } from '@aztec/circuits.js';
2
+ import { RollupSimulator } from './index.js';
3
+ /**
4
+ * Implements the rollup circuit simulator using the wasm circuits implementation.
5
+ */
6
+ export declare class WasmRollupCircuitSimulator implements RollupSimulator {
7
+ private wasm;
8
+ constructor(wasm: CircuitsWasm);
9
+ /**
10
+ * Creates a new instance using the default CircuitsWasm module.
11
+ * @returns A new instance.
12
+ */
13
+ static new(): Promise<WasmRollupCircuitSimulator>;
14
+ /**
15
+ * Simulates the base rollup circuit from its inputs.
16
+ * @param input - Inputs to the circuit.
17
+ * @returns The public inputs as outputs of the simulation.
18
+ */
19
+ baseRollupCircuit(input: BaseRollupInputs): Promise<BaseOrMergeRollupPublicInputs>;
20
+ /**
21
+ * Simulates the merge rollup circuit from its inputs.
22
+ * @param input - Inputs to the circuit.
23
+ * @returns The public inputs as outputs of the simulation.
24
+ */
25
+ mergeRollupCircuit(input: MergeRollupInputs): Promise<BaseOrMergeRollupPublicInputs>;
26
+ /**
27
+ * Simulates the root rollup circuit from its inputs.
28
+ * @param input - Inputs to the circuit.
29
+ * @returns The public inputs as outputs of the simulation.
30
+ */
31
+ rootRollupCircuit(input: RootRollupInputs): Promise<RootRollupPublicInputs>;
32
+ }
33
+ //# sourceMappingURL=rollup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/simulator/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAEhB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,IAAI,CAAe;gBAEf,IAAI,EAAE,YAAY;IAI9B;;;OAGG;WACiB,GAAG;IAIvB;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAQlF;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IASpF;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAQ5E"}
@@ -0,0 +1,53 @@
1
+ import { CircuitError, CircuitsWasm, baseRollupSim, mergeRollupSim, rootRollupSim, } from '@aztec/circuits.js';
2
+ /**
3
+ * Implements the rollup circuit simulator using the wasm circuits implementation.
4
+ */
5
+ export class WasmRollupCircuitSimulator {
6
+ constructor(wasm) {
7
+ this.wasm = wasm;
8
+ }
9
+ /**
10
+ * Creates a new instance using the default CircuitsWasm module.
11
+ * @returns A new instance.
12
+ */
13
+ static async new() {
14
+ return new this(await CircuitsWasm.get());
15
+ }
16
+ /**
17
+ * Simulates the base rollup circuit from its inputs.
18
+ * @param input - Inputs to the circuit.
19
+ * @returns The public inputs as outputs of the simulation.
20
+ */
21
+ baseRollupCircuit(input) {
22
+ const result = baseRollupSim(this.wasm, input);
23
+ if (result instanceof CircuitError) {
24
+ throw new CircuitError(result.code, result.message);
25
+ }
26
+ return Promise.resolve(result);
27
+ }
28
+ /**
29
+ * Simulates the merge rollup circuit from its inputs.
30
+ * @param input - Inputs to the circuit.
31
+ * @returns The public inputs as outputs of the simulation.
32
+ */
33
+ mergeRollupCircuit(input) {
34
+ const result = mergeRollupSim(this.wasm, input);
35
+ if (result instanceof CircuitError) {
36
+ throw new CircuitError(result.code, result.message);
37
+ }
38
+ return Promise.resolve(result);
39
+ }
40
+ /**
41
+ * Simulates the root rollup circuit from its inputs.
42
+ * @param input - Inputs to the circuit.
43
+ * @returns The public inputs as outputs of the simulation.
44
+ */
45
+ rootRollupCircuit(input) {
46
+ const result = rootRollupSim(this.wasm, input);
47
+ if (result instanceof CircuitError) {
48
+ throw new CircuitError(result.code, result.message);
49
+ }
50
+ return Promise.resolve(result);
51
+ }
52
+ }
53
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sbHVwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NpbXVsYXRvci9yb2xsdXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUdMLFlBQVksRUFDWixZQUFZLEVBSVosYUFBYSxFQUNiLGNBQWMsRUFDZCxhQUFhLEdBQ2QsTUFBTSxvQkFBb0IsQ0FBQztBQUk1Qjs7R0FFRztBQUNILE1BQU0sT0FBTywwQkFBMEI7SUFHckMsWUFBWSxJQUFrQjtRQUM1QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNuQixDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksTUFBTSxDQUFDLEtBQUssQ0FBQyxHQUFHO1FBQ3JCLE9BQU8sSUFBSSxJQUFJLENBQUMsTUFBTSxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUMsQ0FBQztJQUM1QyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILGlCQUFpQixDQUFDLEtBQXVCO1FBQ3ZDLE1BQU0sTUFBTSxHQUFHLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFDO1FBQy9DLElBQUksTUFBTSxZQUFZLFlBQVksRUFBRTtZQUNsQyxNQUFNLElBQUksWUFBWSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDO1NBQ3JEO1FBRUQsT0FBTyxPQUFPLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ2pDLENBQUM7SUFDRDs7OztPQUlHO0lBQ0gsa0JBQWtCLENBQUMsS0FBd0I7UUFDekMsTUFBTSxNQUFNLEdBQUcsY0FBYyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFDaEQsSUFBSSxNQUFNLFlBQVksWUFBWSxFQUFFO1lBQ2xDLE1BQU0sSUFBSSxZQUFZLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDckQ7UUFFRCxPQUFPLE9BQU8sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDakMsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxpQkFBaUIsQ0FBQyxLQUF1QjtRQUN2QyxNQUFNLE1BQU0sR0FBRyxhQUFhLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztRQUMvQyxJQUFJLE1BQU0sWUFBWSxZQUFZLEVBQUU7WUFDbEMsTUFBTSxJQUFJLFlBQVksQ0FBQyxNQUFNLENBQUMsSUFBSSxFQUFFLE1BQU0sQ0FBQyxPQUFPLENBQUMsQ0FBQztTQUNyRDtRQUVELE9BQU8sT0FBTyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUNqQyxDQUFDO0NBQ0YifQ==
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Returns a promise that resolves after ms milliseconds, returning retval.
3
+ * @param ms - How many milliseconds to sleep.
4
+ * @param retval - The return value of the promise.
5
+ */
6
+ export declare function sleep<T>(ms: number, retval: T): Promise<T>;
7
+ /**
8
+ * Returns the lowest power of two that is greater of equal to the input.
9
+ * @param num - The input.
10
+ */
11
+ export declare function ceilPowerOfTwo(num: number): number;
12
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE1D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD"}
package/dest/utils.js ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Returns a promise that resolves after ms milliseconds, returning retval.
3
+ * @param ms - How many milliseconds to sleep.
4
+ * @param retval - The return value of the promise.
5
+ */
6
+ export function sleep(ms, retval) {
7
+ return new Promise(resolve => setTimeout(() => resolve(retval), ms));
8
+ }
9
+ /**
10
+ * Returns the lowest power of two that is greater of equal to the input.
11
+ * @param num - The input.
12
+ */
13
+ export function ceilPowerOfTwo(num) {
14
+ return 2 ** Math.ceil(Math.log2(num));
15
+ }
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILE1BQU0sVUFBVSxLQUFLLENBQUksRUFBVSxFQUFFLE1BQVM7SUFDNUMsT0FBTyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUN2RSxDQUFDO0FBRUQ7OztHQUdHO0FBQ0gsTUFBTSxVQUFVLGNBQWMsQ0FBQyxHQUFXO0lBQ3hDLE9BQU8sQ0FBQyxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0FBQ3hDLENBQUMifQ==
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@aztec/sequencer-client",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "exports": "./dest/index.js",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@aztec/acir-simulator": "0.7.2",
8
- "@aztec/circuits.js": "0.7.2",
9
- "@aztec/ethereum": "0.7.2",
10
- "@aztec/foundation": "0.7.2",
11
- "@aztec/l1-artifacts": "0.7.2",
12
- "@aztec/merkle-tree": "0.7.2",
13
- "@aztec/p2p": "0.7.2",
14
- "@aztec/types": "0.7.2",
15
- "@aztec/world-state": "0.7.2",
7
+ "@aztec/acir-simulator": "0.7.4",
8
+ "@aztec/circuits.js": "0.7.4",
9
+ "@aztec/ethereum": "0.7.4",
10
+ "@aztec/foundation": "0.7.4",
11
+ "@aztec/l1-artifacts": "0.7.4",
12
+ "@aztec/merkle-tree": "0.7.4",
13
+ "@aztec/p2p": "0.7.4",
14
+ "@aztec/types": "0.7.4",
15
+ "@aztec/world-state": "0.7.4",
16
16
  "lodash.chunk": "^4.2.0",
17
17
  "lodash.flatmap": "^4.5.0",
18
18
  "lodash.pick": "^4.4.0",
package/Dockerfile DELETED
@@ -1,21 +0,0 @@
1
- FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder
2
-
3
- # (1) project
4
- COPY . .
5
-
6
- # (2) build
7
- WORKDIR /usr/src/yarn-project/sequencer-client
8
- RUN yarn build && yarn formatting
9
-
10
- # (3) test
11
- RUN yarn test
12
-
13
- # (4) Prune dev dependencies. See comment in base image.
14
- RUN yarn cache clean
15
- RUN yarn workspaces focus --production > /dev/null
16
-
17
- # (5) set up entry point
18
- FROM node:18-alpine
19
- COPY --from=builder /usr/src/yarn-project /usr/src/yarn-project
20
- WORKDIR /usr/src/yarn-project/sequencer-client
21
- ENTRYPOINT ["yarn", "test"]