@aztec/stdlib 3.0.0-nightly.20251023 → 3.0.0-nightly.20251025

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 (72) hide show
  1. package/dest/avm/index.d.ts +1 -0
  2. package/dest/avm/index.d.ts.map +1 -1
  3. package/dest/avm/index.js +1 -0
  4. package/dest/avm/message_pack.d.ts +1 -0
  5. package/dest/avm/message_pack.d.ts.map +1 -1
  6. package/dest/avm/message_pack.js +28 -5
  7. package/dest/block/l2_block_source.d.ts +29 -0
  8. package/dest/block/l2_block_source.d.ts.map +1 -1
  9. package/dest/contract/contract_address.d.ts +1 -1
  10. package/dest/contract/contract_address.js +1 -1
  11. package/dest/interfaces/archiver.d.ts +1 -1
  12. package/dest/interfaces/archiver.d.ts.map +1 -1
  13. package/dest/interfaces/archiver.js +7 -0
  14. package/dest/interfaces/aztec-node-admin.d.ts +36 -35
  15. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  16. package/dest/interfaces/aztec-node-admin.js +2 -2
  17. package/dest/interfaces/aztec-node.d.ts +24 -0
  18. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  19. package/dest/interfaces/aztec-node.js +4 -0
  20. package/dest/interfaces/merkle_tree_operations.d.ts +5 -0
  21. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  22. package/dest/interfaces/tx_provider.d.ts +1 -1
  23. package/dest/interfaces/tx_provider.d.ts.map +1 -1
  24. package/dest/interfaces/validator.d.ts +96 -1
  25. package/dest/interfaces/validator.d.ts.map +1 -1
  26. package/dest/interfaces/validator.js +7 -0
  27. package/dest/note/index.d.ts +1 -1
  28. package/dest/note/index.d.ts.map +1 -1
  29. package/dest/note/index.js +1 -1
  30. package/dest/note/unique_note.d.ts +43 -0
  31. package/dest/note/unique_note.d.ts.map +1 -0
  32. package/dest/note/{extended_note.js → unique_note.js} +9 -48
  33. package/dest/p2p/block_attestation.d.ts +2 -8
  34. package/dest/p2p/block_attestation.d.ts.map +1 -1
  35. package/dest/p2p/block_attestation.js +7 -12
  36. package/dest/p2p/block_proposal.d.ts +2 -7
  37. package/dest/p2p/block_proposal.d.ts.map +1 -1
  38. package/dest/p2p/block_proposal.js +7 -11
  39. package/dest/parity/parity_base_private_inputs.d.ts +2 -2
  40. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  41. package/dest/parity/parity_base_private_inputs.js +5 -1
  42. package/dest/rollup/block_root_rollup_private_inputs.d.ts +3 -3
  43. package/dest/tests/mocks.d.ts +1 -2
  44. package/dest/tests/mocks.d.ts.map +1 -1
  45. package/dest/tests/mocks.js +5 -8
  46. package/dest/world-state/index.d.ts +2 -0
  47. package/dest/world-state/index.d.ts.map +1 -0
  48. package/dest/world-state/index.js +1 -0
  49. package/dest/world-state/world_state_revision.d.ts +22 -0
  50. package/dest/world-state/world_state_revision.d.ts.map +1 -0
  51. package/dest/world-state/world_state_revision.js +21 -0
  52. package/package.json +10 -9
  53. package/src/avm/index.ts +1 -0
  54. package/src/avm/message_pack.ts +25 -1
  55. package/src/block/l2_block_source.ts +32 -0
  56. package/src/contract/contract_address.ts +1 -1
  57. package/src/interfaces/archiver.ts +9 -1
  58. package/src/interfaces/aztec-node-admin.ts +2 -2
  59. package/src/interfaces/aztec-node.ts +36 -0
  60. package/src/interfaces/merkle_tree_operations.ts +6 -0
  61. package/src/interfaces/tx_provider.ts +1 -0
  62. package/src/interfaces/validator.ts +15 -1
  63. package/src/note/index.ts +1 -1
  64. package/src/note/{extended_note.ts → unique_note.ts} +14 -75
  65. package/src/p2p/block_attestation.ts +8 -20
  66. package/src/p2p/block_proposal.ts +5 -13
  67. package/src/parity/parity_base_private_inputs.ts +8 -6
  68. package/src/tests/mocks.ts +5 -24
  69. package/src/world-state/index.ts +1 -0
  70. package/src/world-state/world_state_revision.ts +21 -0
  71. package/dest/note/extended_note.d.ts +0 -111
  72. package/dest/note/extended_note.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file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gBAUxC,CAAC;AAEH,eAAO,MAAM,iCAAiC,GAC5C,OAAM;IAAE,eAAe,CAAC,EAAE,EAAE,CAAA;CAAO,EACnC,UAAU,YAAY,KACrB,OAAO,CAAC,2BAA2B,CAUrC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;EAIlC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;CACZ;AAqBD,eAAO,MAAM,0CAA0C,GACrD,wBAAwB,+BAA+B,EACvD,SAAQ,eAA0C,0CAOnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,UAAU,2BAA2B,KAAG,aAIzE,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAAI,UAAU,2BAA2B,KAAG,gBAyB5E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,OAAO,OAAO,EACd,iBAAiB,eAAe,EAChC,iBAAiB,eAAe,KAC/B,gBAsBF,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;CAAO,GACzC,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
@@ -17,8 +17,8 @@ import { Nullifier } from '../kernel/nullifier.js';
17
17
  import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
18
18
  import { PartialPrivateTailPublicInputsForPublic, PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
19
19
  import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
20
- import { ExtendedNote, UniqueNote } from '../note/extended_note.js';
21
20
  import { Note } from '../note/note.js';
21
+ import { UniqueNote } from '../note/unique_note.js';
22
22
  import { BlockAttestation } from '../p2p/block_attestation.js';
23
23
  import { BlockProposal } from '../p2p/block_proposal.js';
24
24
  import { ConsensusPayload } from '../p2p/consensus_payload.js';
@@ -31,9 +31,6 @@ import { TxEffect } from '../tx/tx_effect.js';
31
31
  import { TxHash } from '../tx/tx_hash.js';
32
32
  import { makeGas, makeGlobalVariables, makeL2BlockHeader, makePublicCallRequest } from './factories.js';
33
33
  export const randomTxHash = ()=>TxHash.random();
34
- export const randomExtendedNote = async ({ note = Note.random(), recipient = undefined, contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random() } = {})=>{
35
- return new ExtendedNote(note, recipient ?? await AztecAddress.random(), contractAddress ?? await AztecAddress.random(), storageSlot, txHash);
36
- };
37
34
  export const randomUniqueNote = async ({ note = Note.random(), recipient = undefined, contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random(), noteNonce = Fr.random() } = {})=>{
38
35
  return new UniqueNote(note, recipient ?? await AztecAddress.random(), contractAddress ?? await AztecAddress.random(), storageSlot, txHash, noteNonce);
39
36
  };
@@ -155,7 +152,7 @@ export const makeAndSignCommitteeAttestationsAndSigners = (attestationsAndSigner
155
152
  return signer.sign(hash);
156
153
  };
157
154
  export const makeBlockProposal = (options)=>{
158
- const { blockNumber, payload, signature } = makeAndSignConsensusPayload(SignatureDomainSeparator.blockProposal, options);
155
+ const { payload, signature } = makeAndSignConsensusPayload(SignatureDomainSeparator.blockProposal, options);
159
156
  const txHashes = options?.txHashes ?? [
160
157
  0,
161
158
  1,
@@ -164,7 +161,7 @@ export const makeBlockProposal = (options)=>{
164
161
  4,
165
162
  5
166
163
  ].map(()=>TxHash.random());
167
- return new BlockProposal(blockNumber, payload, signature, txHashes, options?.txs ?? []);
164
+ return new BlockProposal(payload, signature, txHashes, options?.txs ?? []);
168
165
  };
169
166
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028)
170
167
  export const makeBlockAttestation = (options)=>{
@@ -181,7 +178,7 @@ export const makeBlockAttestation = (options)=>{
181
178
  // Sign as proposer
182
179
  const proposalHash = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockProposal);
183
180
  const proposerSignature = proposerSigner.sign(proposalHash);
184
- return new BlockAttestation(header.globalVariables.blockNumber, payload, attestationSignature, proposerSignature);
181
+ return new BlockAttestation(payload, attestationSignature, proposerSignature);
185
182
  };
186
183
  export const makeBlockAttestationFromBlock = (block, attesterSigner, proposerSigner)=>{
187
184
  const header = block.header;
@@ -200,7 +197,7 @@ export const makeBlockAttestationFromBlock = (block, attesterSigner, proposerSig
200
197
  const proposalHash = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockProposal);
201
198
  const proposalSignerToUse = proposerSigner ?? Secp256k1Signer.random();
202
199
  const proposerSignature = proposalSignerToUse.sign(proposalHash);
203
- return new BlockAttestation(header.globalVariables.blockNumber, payload, attestationSignature, proposerSignature);
200
+ return new BlockAttestation(payload, attestationSignature, proposerSignature);
204
201
  };
205
202
  export async function randomPublishedL2Block(l2BlockNumber, opts = {}) {
206
203
  const block = await L2Block.random(l2BlockNumber);
@@ -0,0 +1,2 @@
1
+ export * from './world_state_revision.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/world-state/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './world_state_revision.js';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ export declare class WorldStateRevision {
3
+ readonly forkId: number;
4
+ readonly blockNumber: number;
5
+ readonly includeUncommitted: boolean;
6
+ constructor(forkId: number, blockNumber: number, includeUncommitted: boolean);
7
+ static empty(): WorldStateRevision;
8
+ static get schema(): z.ZodObject<{
9
+ forkId: z.ZodNumber;
10
+ blockNumber: z.ZodNumber;
11
+ includeUncommitted: z.ZodBoolean;
12
+ }, "strip", z.ZodTypeAny, {
13
+ blockNumber: number;
14
+ forkId: number;
15
+ includeUncommitted: boolean;
16
+ }, {
17
+ blockNumber: number;
18
+ forkId: number;
19
+ includeUncommitted: boolean;
20
+ }>;
21
+ }
22
+ //# sourceMappingURL=world_state_revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world_state_revision.d.ts","sourceRoot":"","sources":["../../src/world-state/world_state_revision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAa,kBAAkB;aAEX,MAAM,EAAE,MAAM;aACd,WAAW,EAAE,MAAM;aACnB,kBAAkB,EAAE,OAAO;gBAF3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,OAAO;IAG7C,MAAM,CAAC,KAAK;IAIZ,MAAM,KAAK,MAAM;;;;;;;;;;;;OAMhB;CACF"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export class WorldStateRevision {
3
+ forkId;
4
+ blockNumber;
5
+ includeUncommitted;
6
+ constructor(forkId, blockNumber, includeUncommitted){
7
+ this.forkId = forkId;
8
+ this.blockNumber = blockNumber;
9
+ this.includeUncommitted = includeUncommitted;
10
+ }
11
+ static empty() {
12
+ return new WorldStateRevision(0, 0, false);
13
+ }
14
+ static get schema() {
15
+ return z.object({
16
+ forkId: z.number(),
17
+ blockNumber: z.number(),
18
+ includeUncommitted: z.boolean()
19
+ });
20
+ }
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "3.0.0-nightly.20251023",
3
+ "version": "3.0.0-nightly.20251025",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -52,7 +52,8 @@
52
52
  "./update-checker": "./dest/update-checker/index.js",
53
53
  "./zkpassport": "./dest/zkpassport/index.js",
54
54
  "./slashing": "./dest/slashing/index.js",
55
- "./l1-contracts": "./dest/l1-contracts/index.js"
55
+ "./l1-contracts": "./dest/l1-contracts/index.js",
56
+ "./world-state": "./dest/world-state/index.js"
56
57
  },
57
58
  "typedocOptions": {
58
59
  "entryPoints": [
@@ -70,13 +71,13 @@
70
71
  },
71
72
  "dependencies": {
72
73
  "@aws-sdk/client-s3": "^3.892.0",
73
- "@aztec/bb.js": "3.0.0-nightly.20251023",
74
- "@aztec/blob-lib": "3.0.0-nightly.20251023",
75
- "@aztec/constants": "3.0.0-nightly.20251023",
76
- "@aztec/ethereum": "3.0.0-nightly.20251023",
77
- "@aztec/foundation": "3.0.0-nightly.20251023",
78
- "@aztec/l1-artifacts": "3.0.0-nightly.20251023",
79
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20251023",
74
+ "@aztec/bb.js": "3.0.0-nightly.20251025",
75
+ "@aztec/blob-lib": "3.0.0-nightly.20251025",
76
+ "@aztec/constants": "3.0.0-nightly.20251025",
77
+ "@aztec/ethereum": "3.0.0-nightly.20251025",
78
+ "@aztec/foundation": "3.0.0-nightly.20251025",
79
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251025",
80
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20251025",
80
81
  "@google-cloud/storage": "^7.15.0",
81
82
  "axios": "^1.12.0",
82
83
  "json-stringify-deterministic": "1.0.12",
package/src/avm/index.ts CHANGED
@@ -9,3 +9,4 @@ export * from './contract_storage_read.js';
9
9
  export * from './public_inner_call_request.js';
10
10
  export * from './public_call_stack_item_compressed.js';
11
11
  export * from './avm_proving_request.js';
12
+ export * from './message_pack.js';
@@ -2,7 +2,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import { Fq, Fr, Point } from '@aztec/foundation/fields';
3
3
 
4
4
  import { strict as assert } from 'assert';
5
- import { Encoder, addExtension } from 'msgpackr';
5
+ import { Decoder, Encoder, addExtension } from 'msgpackr';
6
6
 
7
7
  import { AztecAddress } from '../aztec-address/index.js';
8
8
 
@@ -18,6 +18,16 @@ export function serializeWithMessagePack(obj: any): Buffer {
18
18
  return encoder.encode(obj);
19
19
  }
20
20
 
21
+ export function deserializeFromMessagePack<T>(buffer: Buffer): T {
22
+ setUpMessagePackExtensions();
23
+ const decoder = new Decoder({
24
+ useRecords: false,
25
+ int64AsType: 'bigint',
26
+ largeBigIntToString: true,
27
+ });
28
+ return decoder.decode(buffer);
29
+ }
30
+
21
31
  let messagePackWasSetUp = false;
22
32
  function setUpMessagePackExtensions() {
23
33
  if (messagePackWasSetUp) {
@@ -27,15 +37,24 @@ function setUpMessagePackExtensions() {
27
37
  addExtension({
28
38
  Class: Fr,
29
39
  write: (fr: Fr) => fr.toBuffer(),
40
+ read: (data: Buffer) => Fr.fromBuffer(data),
30
41
  });
31
42
  addExtension({
32
43
  Class: Fq,
33
44
  write: (fq: Fq) => fq.toBuffer(),
45
+ read: (data: Buffer) => Fq.fromBuffer(data),
34
46
  });
35
47
  // AztecAddress is a class that has a field in TS, but is itself a field in C++.
36
48
  addExtension({
37
49
  Class: AztecAddress,
38
50
  write: (addr: AztecAddress) => addr.toField(),
51
+ read: (data: Fr | Buffer) => {
52
+ // If C++ sent it as Fr, wrap it. If as buffer, construct from buffer.
53
+ if (data instanceof Fr) {
54
+ return new AztecAddress(data);
55
+ }
56
+ return new AztecAddress(Fr.fromBuffer(data));
57
+ },
39
58
  });
40
59
  // Affine points are a mess, we do our best.
41
60
  addExtension({
@@ -45,11 +64,16 @@ function setUpMessagePackExtensions() {
45
64
  // TODO: should these be Frs?
46
65
  return { x: new Fq(p.x.toBigInt()), y: new Fq(p.y.toBigInt()) };
47
66
  },
67
+ read: (data: { x: Fq; y: Fq }) => {
68
+ // Convert Fq back to Fr for Point constructor
69
+ return new Point(new Fr(data.x.toBigInt()), new Fr(data.y.toBigInt()), false);
70
+ },
48
71
  });
49
72
  // EthAddress is a class that has a buffer in TS, but is itself just a field in C++.
50
73
  addExtension({
51
74
  Class: EthAddress,
52
75
  write: (addr: EthAddress) => addr.toField().toBuffer(),
76
+ read: (data: Buffer) => EthAddress.fromField(Fr.fromBuffer(data)),
53
77
  });
54
78
  messagePackWasSetUp = true;
55
79
  }
@@ -1,4 +1,5 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import type { Fr } from '@aztec/foundation/fields';
2
3
  import type { TypedEventEmitter } from '@aztec/foundation/types';
3
4
 
4
5
  import { z } from 'zod';
@@ -66,6 +67,34 @@ export interface L2BlockSource {
66
67
  /** Equivalent to getBlocks but includes publish data. */
67
68
  getPublishedBlocks(from: number, limit: number, proven?: boolean): Promise<PublishedL2Block[]>;
68
69
 
70
+ /**
71
+ * Gets a published block by its hash.
72
+ * @param blockHash - The block hash to retrieve.
73
+ * @returns The requested published block (or undefined if not found).
74
+ */
75
+ getPublishedBlockByHash(blockHash: Fr): Promise<PublishedL2Block | undefined>;
76
+
77
+ /**
78
+ * Gets a published block by its archive root.
79
+ * @param archive - The archive root to retrieve.
80
+ * @returns The requested published block (or undefined if not found).
81
+ */
82
+ getPublishedBlockByArchive(archive: Fr): Promise<PublishedL2Block | undefined>;
83
+
84
+ /**
85
+ * Gets a block header by its hash.
86
+ * @param blockHash - The block hash to retrieve.
87
+ * @returns The requested block header (or undefined if not found).
88
+ */
89
+ getBlockHeaderByHash(blockHash: Fr): Promise<BlockHeader | undefined>;
90
+
91
+ /**
92
+ * Gets a block header by its archive root.
93
+ * @param archive - The archive root to retrieve.
94
+ * @returns The requested block header (or undefined if not found).
95
+ */
96
+ getBlockHeaderByArchive(archive: Fr): Promise<BlockHeader | undefined>;
97
+
69
98
  /**
70
99
  * Gets a tx effect.
71
100
  * @param txHash - The hash of the tx corresponding to the tx effect.
@@ -120,6 +149,9 @@ export interface L2BlockSource {
120
149
  */
121
150
  getL1Constants(): Promise<L1RollupConstants>;
122
151
 
152
+ /** Returns values for the genesis block */
153
+ getGenesisValues(): Promise<{ genesisArchiveRoot: Fr }>;
154
+
123
155
  /** Latest synced L1 timestamp. */
124
156
  getL1Timestamp(): Promise<bigint>;
125
157
 
@@ -11,7 +11,7 @@ import type { ContractInstance } from './interfaces/contract_instance.js';
11
11
  // TODO(@spalladino): Review all generator indices in this file
12
12
 
13
13
  /**
14
- * Returns the deployment address for a given contract instance as defined on the [Protocol Specs](../../../../docs/docs/protocol-specs/addresses-and-keys/specification.md).
14
+ * Returns the deployment address for a given contract instance.
15
15
  * ```
16
16
  * salted_initialization_hash = pedersen([salt, initialization_hash, deployer], GENERATOR__SALTED_INITIALIZATION_HASH)
17
17
  * partial_address = pedersen([contract_class_id, salted_initialization_hash], GENERATOR__CONTRACT_PARTIAL_ADDRESS_V1)
@@ -44,7 +44,7 @@ export type ArchiverSpecificConfig = {
44
44
  /** The max number of logs that can be obtained in 1 "getPublicLogs" call. */
45
45
  maxLogs?: number;
46
46
 
47
- /** The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKB. */
47
+ /** The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb. */
48
48
  archiverStoreMapSizeKb?: number;
49
49
 
50
50
  /** Whether to skip validating block attestations (use only for testing). */
@@ -83,6 +83,10 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
83
83
  .function()
84
84
  .args(schemas.Integer, schemas.Integer, optional(z.boolean()))
85
85
  .returns(z.array(PublishedL2Block.schema)),
86
+ getPublishedBlockByHash: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
87
+ getPublishedBlockByArchive: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
88
+ getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
89
+ getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
86
90
  getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
87
91
  getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
88
92
  getL2SlotNumber: z.function().args().returns(schemas.BigInt),
@@ -110,6 +114,10 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
110
114
  getL1ToL2MessageIndex: z.function().args(schemas.Fr).returns(schemas.BigInt.optional()),
111
115
  getDebugFunctionName: z.function().args(schemas.AztecAddress, schemas.FunctionSelector).returns(optional(z.string())),
112
116
  getL1Constants: z.function().args().returns(L1RollupConstantsSchema),
117
+ getGenesisValues: z
118
+ .function()
119
+ .args()
120
+ .returns(z.object({ genesisArchiveRoot: schemas.Fr })),
113
121
  getL1Timestamp: z.function().args().returns(schemas.BigInt),
114
122
  syncImmediate: z.function().args().returns(z.void()),
115
123
  isPendingChainInvalid: z.function().args().returns(z.boolean()),
@@ -9,7 +9,7 @@ import { type ArchiverSpecificConfig, ArchiverSpecificConfigSchema } from './arc
9
9
  import { type SequencerConfig, SequencerConfigSchema } from './configs.js';
10
10
  import { type ProverConfig, ProverConfigSchema } from './prover-client.js';
11
11
  import { type SlasherConfig, SlasherConfigSchema } from './slasher.js';
12
- import { ValidatorClientConfigSchema, type ValidatorClientFullConfig } from './validator.js';
12
+ import { type ValidatorClientFullConfig, ValidatorClientFullConfigSchema } from './validator.js';
13
13
 
14
14
  /**
15
15
  * Aztec node admin API.
@@ -62,7 +62,7 @@ export type AztecNodeAdminConfig = ValidatorClientFullConfig &
62
62
 
63
63
  export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
64
64
  .merge(SlasherConfigSchema)
65
- .merge(ValidatorClientConfigSchema)
65
+ .merge(ValidatorClientFullConfigSchema)
66
66
  .merge(
67
67
  ArchiverSpecificConfigSchema.pick({
68
68
  archiverPollingIntervalMS: true,
@@ -225,6 +225,20 @@ export interface AztecNode
225
225
  */
226
226
  getBlock(number: L2BlockNumber): Promise<L2Block | undefined>;
227
227
 
228
+ /**
229
+ * Get a block specified by its hash.
230
+ * @param blockHash - The block hash being requested.
231
+ * @returns The requested block.
232
+ */
233
+ getBlockByHash(blockHash: Fr): Promise<L2Block | undefined>;
234
+
235
+ /**
236
+ * Get a block specified by its archive root.
237
+ * @param archive - The archive root being requested.
238
+ * @returns The requested block.
239
+ */
240
+ getBlockByArchive(archive: Fr): Promise<L2Block | undefined>;
241
+
228
242
  /**
229
243
  * Method to fetch the latest block number synchronized by the node.
230
244
  * @returns The block number.
@@ -400,6 +414,20 @@ export interface AztecNode
400
414
  */
401
415
  getBlockHeader(blockNumber?: L2BlockNumber): Promise<BlockHeader | undefined>;
402
416
 
417
+ /**
418
+ * Get a block header specified by its hash.
419
+ * @param blockHash - The block hash being requested.
420
+ * @returns The requested block header.
421
+ */
422
+ getBlockHeaderByHash(blockHash: Fr): Promise<BlockHeader | undefined>;
423
+
424
+ /**
425
+ * Get a block header specified by its archive root.
426
+ * @param archive - The archive root being requested.
427
+ * @returns The requested block header.
428
+ */
429
+ getBlockHeaderByArchive(archive: Fr): Promise<BlockHeader | undefined>;
430
+
403
431
  /** Returns stats for validators if enabled. */
404
432
  getValidatorsStats(): Promise<ValidatorsStats>;
405
433
 
@@ -523,6 +551,10 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
523
551
 
524
552
  getBlock: z.function().args(L2BlockNumberSchema).returns(L2Block.schema.optional()),
525
553
 
554
+ getBlockByHash: z.function().args(schemas.Fr).returns(L2Block.schema.optional()),
555
+
556
+ getBlockByArchive: z.function().args(schemas.Fr).returns(L2Block.schema.optional()),
557
+
526
558
  getBlockNumber: z.function().returns(z.number()),
527
559
 
528
560
  getProvenBlockNumber: z.function().returns(z.number()),
@@ -596,6 +628,10 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
596
628
 
597
629
  getBlockHeader: z.function().args(optional(L2BlockNumberSchema)).returns(BlockHeader.schema.optional()),
598
630
 
631
+ getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
632
+
633
+ getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
634
+
599
635
  getValidatorsStats: z.function().returns(ValidatorsStatsSchema),
600
636
 
601
637
  getValidatorStats: z
@@ -7,6 +7,7 @@ import type { NullifierLeaf } from '../trees/nullifier_leaf.js';
7
7
  import type { PublicDataTreeLeaf } from '../trees/public_data_leaf.js';
8
8
  import type { BlockHeader } from '../tx/block_header.js';
9
9
  import type { StateReference } from '../tx/state_reference.js';
10
+ import type { WorldStateRevision } from '../world-state/world_state_revision.js';
10
11
 
11
12
  /**
12
13
  * Type alias for the nullifier tree ID.
@@ -132,6 +133,11 @@ export interface MerkleTreeReadOperations {
132
133
  */
133
134
  getInitialHeader(): BlockHeader;
134
135
 
136
+ /**
137
+ * Gets the current revision.
138
+ */
139
+ getRevision(): WorldStateRevision;
140
+
135
141
  /**
136
142
  * Gets sibling path for a leaf.
137
143
  * @param treeId - The tree to be queried for a sibling path.
@@ -9,6 +9,7 @@ export interface ITxProvider {
9
9
 
10
10
  getTxsForBlockProposal(
11
11
  blockProposal: BlockProposal,
12
+ blockNumber: number,
12
13
  opts: { pinnedPeer: PeerId | undefined; deadline: Date },
13
14
  ): Promise<{ txs: Tx[]; missingTxs: TxHash[] }>;
14
15
 
@@ -12,6 +12,7 @@ import { z } from 'zod';
12
12
 
13
13
  import type { CommitteeAttestationsAndSigners } from '../block/index.js';
14
14
  import type { CheckpointHeader } from '../rollup/checkpoint_header.js';
15
+ import { AllowedElementSchema } from './allowed_element.js';
15
16
 
16
17
  /**
17
18
  * Validator client configuration
@@ -44,7 +45,13 @@ export interface ValidatorClientConfig {
44
45
 
45
46
  export type ValidatorClientFullConfig = ValidatorClientConfig &
46
47
  Pick<SequencerConfig, 'txPublicSetupAllowList' | 'broadcastInvalidBlockProposal'> &
47
- Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'>;
48
+ Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'> & {
49
+ /**
50
+ * Whether transactions are disabled for this node
51
+ * @remarks This should match the property in P2PConfig. It's not picked from there to avoid circular dependencies.
52
+ */
53
+ disableTransactions?: boolean;
54
+ };
48
55
 
49
56
  export const ValidatorClientConfigSchema = z.object({
50
57
  validatorAddresses: z.array(schemas.EthAddress).optional(),
@@ -56,6 +63,13 @@ export const ValidatorClientConfigSchema = z.object({
56
63
  alwaysReexecuteBlockProposals: z.boolean().optional(),
57
64
  }) satisfies ZodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>;
58
65
 
66
+ export const ValidatorClientFullConfigSchema = ValidatorClientConfigSchema.extend({
67
+ txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
68
+ broadcastInvalidBlockProposal: z.boolean().optional(),
69
+ slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
70
+ disableTransactions: z.boolean().optional(),
71
+ }) satisfies ZodFor<Omit<ValidatorClientFullConfig, 'validatorPrivateKeys'>>;
72
+
59
73
  export interface Validator {
60
74
  start(): Promise<void>;
61
75
  updateConfig(config: Partial<ValidatorClientFullConfig>): void;
package/src/note/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './comparator.js';
2
- export * from './extended_note.js';
2
+ export * from './unique_note.js';
3
3
  export * from './notes_filter.js';
4
4
  export * from './note_status.js';
5
5
  export * from './note.js';
@@ -10,13 +10,13 @@ import { TxHash } from '../tx/tx_hash.js';
10
10
  import { Note } from './note.js';
11
11
 
12
12
  /**
13
- * A note with contextual data.
13
+ * A note with contextual data and a nonce that makes it unique.
14
14
  */
15
- export class ExtendedNote {
15
+ export class UniqueNote {
16
16
  constructor(
17
17
  /** The note as emitted from the Noir contract. */
18
18
  public note: Note,
19
- /** The address whose public key was used to encrypt the note. */
19
+ /** The recipient whose public key was used to encrypt the note. */
20
20
  public recipient: AztecAddress,
21
21
  /** The contract address this note is created in. */
22
22
  public contractAddress: AztecAddress,
@@ -24,76 +24,11 @@ export class ExtendedNote {
24
24
  public storageSlot: Fr,
25
25
  /** The hash of the tx the note was created in. */
26
26
  public txHash: TxHash,
27
- ) {}
28
-
29
- toBuffer(): Buffer {
30
- return serializeToBuffer([this.note, this.recipient, this.contractAddress, this.storageSlot, this.txHash]);
31
- }
32
-
33
- static fromBuffer(buffer: Buffer | BufferReader) {
34
- const reader = BufferReader.asReader(buffer);
35
-
36
- const note = reader.readObject(Note);
37
- const recipient = reader.readObject(AztecAddress);
38
- const contractAddress = reader.readObject(AztecAddress);
39
- const storageSlot = reader.readObject(Fr);
40
- const txHash = reader.readObject(TxHash);
41
-
42
- return new this(note, recipient, contractAddress, storageSlot, txHash);
43
- }
44
-
45
- static get schema(): ZodFor<ExtendedNote> {
46
- return z
47
- .object({
48
- note: Note.schema,
49
- recipient: schemas.AztecAddress,
50
- contractAddress: schemas.AztecAddress,
51
- storageSlot: schemas.Fr,
52
- txHash: TxHash.schema,
53
- })
54
- .transform(({ note, recipient, contractAddress, storageSlot, txHash }) => {
55
- return new ExtendedNote(note, recipient, contractAddress, storageSlot, txHash);
56
- });
57
- }
58
-
59
- toString() {
60
- return bufferToHex(this.toBuffer());
61
- }
62
-
63
- static fromString(str: string) {
64
- return ExtendedNote.fromBuffer(hexToBuffer(str));
65
- }
66
-
67
- static async random() {
68
- return new ExtendedNote(
69
- Note.random(),
70
- await AztecAddress.random(),
71
- await AztecAddress.random(),
72
- Fr.random(),
73
- TxHash.random(),
74
- );
75
- }
76
- }
77
-
78
- export class UniqueNote extends ExtendedNote {
79
- constructor(
80
- /** The note as emitted from the Noir contract. */
81
- note: Note,
82
- /** The recipient whose public key was used to encrypt the note. */
83
- recipient: AztecAddress,
84
- /** The contract address this note is created in. */
85
- contractAddress: AztecAddress,
86
- /** The specific storage location of the note on the contract. */
87
- storageSlot: Fr,
88
- /** The hash of the tx the note was created in. */
89
- txHash: TxHash,
90
27
  /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
91
28
  public noteNonce: Fr,
92
- ) {
93
- super(note, recipient, contractAddress, storageSlot, txHash);
94
- }
29
+ ) {}
95
30
 
96
- static override get schema() {
31
+ static get schema(): ZodFor<UniqueNote> {
97
32
  return z
98
33
  .object({
99
34
  note: Note.schema,
@@ -108,7 +43,7 @@ export class UniqueNote extends ExtendedNote {
108
43
  });
109
44
  }
110
45
 
111
- override toBuffer(): Buffer {
46
+ toBuffer(): Buffer {
112
47
  return serializeToBuffer([
113
48
  this.note,
114
49
  this.recipient,
@@ -119,7 +54,7 @@ export class UniqueNote extends ExtendedNote {
119
54
  ]);
120
55
  }
121
56
 
122
- static override async random() {
57
+ static async random() {
123
58
  return new UniqueNote(
124
59
  Note.random(),
125
60
  await AztecAddress.random(),
@@ -130,7 +65,7 @@ export class UniqueNote extends ExtendedNote {
130
65
  );
131
66
  }
132
67
 
133
- static override fromBuffer(buffer: Buffer | BufferReader) {
68
+ static fromBuffer(buffer: Buffer | BufferReader) {
134
69
  const reader = BufferReader.asReader(buffer);
135
70
 
136
71
  const note = reader.readObject(Note);
@@ -140,10 +75,14 @@ export class UniqueNote extends ExtendedNote {
140
75
  const txHash = reader.readObject(TxHash);
141
76
  const noteNonce = reader.readObject(Fr);
142
77
 
143
- return new this(note, recipient, contractAddress, storageSlot, txHash, noteNonce);
78
+ return new UniqueNote(note, recipient, contractAddress, storageSlot, txHash, noteNonce);
144
79
  }
145
80
 
146
- static override fromString(str: string) {
81
+ static fromString(str: string) {
147
82
  return UniqueNote.fromBuffer(hexToBuffer(str));
148
83
  }
84
+
85
+ toString() {
86
+ return bufferToHex(this.toBuffer());
87
+ }
149
88
  }