@aztec/stdlib 0.0.1-commit.0dc957cde → 0.0.1-commit.0ec55a70b

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 (132) hide show
  1. package/dest/avm/avm.d.ts +300 -300
  2. package/dest/block/attestation_info.d.ts +3 -2
  3. package/dest/block/attestation_info.d.ts.map +1 -1
  4. package/dest/block/attestation_info.js +7 -5
  5. package/dest/block/block_data.d.ts +290 -1
  6. package/dest/block/block_data.d.ts.map +1 -1
  7. package/dest/block/block_data.js +14 -0
  8. package/dest/block/block_parameter.d.ts +30 -3
  9. package/dest/block/block_parameter.d.ts.map +1 -1
  10. package/dest/block/block_parameter.js +36 -2
  11. package/dest/block/l2_block_source.d.ts +39 -4
  12. package/dest/block/l2_block_source.d.ts.map +1 -1
  13. package/dest/block/proposal/attestations_and_signers.d.ts +13 -6
  14. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  15. package/dest/block/proposal/attestations_and_signers.js +26 -18
  16. package/dest/checkpoint/checkpoint_data.d.ts +7 -1
  17. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  18. package/dest/checkpoint/checkpoint_data.js +2 -0
  19. package/dest/config/chain-config.d.ts +2 -2
  20. package/dest/config/chain-config.d.ts.map +1 -1
  21. package/dest/config/chain-config.js +2 -2
  22. package/dest/config/sequencer-config.d.ts +5 -3
  23. package/dest/config/sequencer-config.d.ts.map +1 -1
  24. package/dest/config/sequencer-config.js +13 -6
  25. package/dest/ha-signing/local_config.d.ts +1 -1
  26. package/dest/ha-signing/local_config.d.ts.map +1 -1
  27. package/dest/ha-signing/local_config.js +2 -2
  28. package/dest/interfaces/archiver.d.ts +1 -1
  29. package/dest/interfaces/archiver.d.ts.map +1 -1
  30. package/dest/interfaces/archiver.js +7 -3
  31. package/dest/interfaces/aztec-node-admin.d.ts +14 -1
  32. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  33. package/dest/interfaces/aztec-node-admin.js +2 -1
  34. package/dest/interfaces/aztec-node.d.ts +45 -55
  35. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  36. package/dest/interfaces/aztec-node.js +18 -16
  37. package/dest/interfaces/block_response.d.ts +156 -0
  38. package/dest/interfaces/block_response.d.ts.map +1 -0
  39. package/dest/interfaces/block_response.js +24 -0
  40. package/dest/interfaces/chain_tips.d.ts +304 -0
  41. package/dest/interfaces/chain_tips.d.ts.map +1 -0
  42. package/dest/interfaces/chain_tips.js +11 -0
  43. package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
  44. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
  45. package/dest/interfaces/checkpoint_parameter.js +20 -0
  46. package/dest/interfaces/checkpoint_response.d.ts +312 -0
  47. package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
  48. package/dest/interfaces/checkpoint_response.js +26 -0
  49. package/dest/interfaces/client.d.ts +6 -1
  50. package/dest/interfaces/client.d.ts.map +1 -1
  51. package/dest/interfaces/client.js +5 -0
  52. package/dest/interfaces/configs.d.ts +12 -2
  53. package/dest/interfaces/configs.d.ts.map +1 -1
  54. package/dest/interfaces/configs.js +3 -1
  55. package/dest/interfaces/l1_publish_info.d.ts +43 -0
  56. package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
  57. package/dest/interfaces/l1_publish_info.js +26 -0
  58. package/dest/interfaces/proving-job.d.ts +166 -166
  59. package/dest/interfaces/server.d.ts +6 -1
  60. package/dest/interfaces/server.d.ts.map +1 -1
  61. package/dest/interfaces/server.js +5 -0
  62. package/dest/interfaces/validator.d.ts +14 -2
  63. package/dest/interfaces/validator.d.ts.map +1 -1
  64. package/dest/interfaces/validator.js +2 -0
  65. package/dest/p2p/block_proposal.d.ts +19 -9
  66. package/dest/p2p/block_proposal.d.ts.map +1 -1
  67. package/dest/p2p/block_proposal.js +42 -32
  68. package/dest/p2p/checkpoint_attestation.d.ts +7 -3
  69. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  70. package/dest/p2p/checkpoint_attestation.js +15 -17
  71. package/dest/p2p/checkpoint_proposal.d.ts +15 -7
  72. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  73. package/dest/p2p/checkpoint_proposal.js +31 -29
  74. package/dest/p2p/consensus_payload.d.ts +18 -7
  75. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  76. package/dest/p2p/consensus_payload.js +31 -19
  77. package/dest/p2p/signature_utils.d.ts +28 -19
  78. package/dest/p2p/signature_utils.d.ts.map +1 -1
  79. package/dest/p2p/signature_utils.js +118 -21
  80. package/dest/p2p/signed_txs.d.ts +15 -13
  81. package/dest/p2p/signed_txs.d.ts.map +1 -1
  82. package/dest/p2p/signed_txs.js +26 -24
  83. package/dest/parity/parity_base_private_inputs.d.ts +7 -3
  84. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  85. package/dest/parity/parity_base_private_inputs.js +7 -5
  86. package/dest/parity/parity_public_inputs.d.ts +7 -3
  87. package/dest/parity/parity_public_inputs.d.ts.map +1 -1
  88. package/dest/parity/parity_public_inputs.js +6 -3
  89. package/dest/tests/factories.d.ts +1 -1
  90. package/dest/tests/factories.d.ts.map +1 -1
  91. package/dest/tests/factories.js +2 -2
  92. package/dest/tests/mocks.d.ts +7 -1
  93. package/dest/tests/mocks.d.ts.map +1 -1
  94. package/dest/tests/mocks.js +28 -14
  95. package/dest/timetable/index.d.ts +1 -1
  96. package/dest/timetable/index.d.ts.map +1 -1
  97. package/dest/timetable/index.js +25 -11
  98. package/dest/tx/profiling.js +4 -4
  99. package/package.json +8 -8
  100. package/src/block/attestation_info.ts +11 -11
  101. package/src/block/block_data.ts +17 -0
  102. package/src/block/block_parameter.ts +35 -2
  103. package/src/block/l2_block_source.ts +43 -3
  104. package/src/block/proposal/attestations_and_signers.ts +32 -17
  105. package/src/checkpoint/checkpoint_data.ts +4 -0
  106. package/src/config/chain-config.ts +2 -3
  107. package/src/config/sequencer-config.ts +25 -7
  108. package/src/ha-signing/local_config.ts +2 -2
  109. package/src/interfaces/archiver.ts +13 -3
  110. package/src/interfaces/aztec-node-admin.ts +3 -1
  111. package/src/interfaces/aztec-node.ts +105 -95
  112. package/src/interfaces/block_response.ts +79 -0
  113. package/src/interfaces/chain_tips.ts +24 -0
  114. package/src/interfaces/checkpoint_parameter.ts +22 -0
  115. package/src/interfaces/checkpoint_response.ts +84 -0
  116. package/src/interfaces/client.ts +5 -0
  117. package/src/interfaces/configs.ts +8 -1
  118. package/src/interfaces/l1_publish_info.ts +40 -0
  119. package/src/interfaces/server.ts +5 -0
  120. package/src/interfaces/validator.ts +7 -1
  121. package/src/p2p/block_proposal.ts +84 -28
  122. package/src/p2p/checkpoint_attestation.ts +15 -20
  123. package/src/p2p/checkpoint_proposal.ts +69 -37
  124. package/src/p2p/consensus_payload.ts +50 -28
  125. package/src/p2p/signature_utils.ts +110 -25
  126. package/src/p2p/signed_txs.ts +46 -28
  127. package/src/parity/parity_base_private_inputs.ts +10 -4
  128. package/src/parity/parity_public_inputs.ts +9 -2
  129. package/src/tests/factories.ts +6 -1
  130. package/src/tests/mocks.ts +46 -26
  131. package/src/timetable/index.ts +26 -11
  132. package/src/tx/profiling.ts +4 -4
@@ -14,7 +14,7 @@ import { z } from 'zod';
14
14
 
15
15
  import type { Checkpoint } from '../checkpoint/checkpoint.js';
16
16
  import type { CheckpointData, CommonCheckpointData, ProposedCheckpointData } from '../checkpoint/checkpoint_data.js';
17
- import type { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
17
+ import type { L1PublishedData, PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
18
18
  import type { L1RollupConstants } from '../epoch-helpers/index.js';
19
19
  import { CheckpointHeader } from '../rollup/checkpoint_header.js';
20
20
  import type { BlockHeader } from '../tx/block_header.js';
@@ -25,8 +25,17 @@ import type { BlockData } from './block_data.js';
25
25
  import type { BlockHash } from './block_hash.js';
26
26
  import type { CheckpointedL2Block } from './checkpointed_l2_block.js';
27
27
  import type { L2Block } from './l2_block.js';
28
+ import type { CommitteeAttestation } from './proposal/committee_attestation.js';
28
29
  import type { ValidateCheckpointNegativeResult, ValidateCheckpointResult } from './validate_block_result.js';
29
30
 
31
+ /** Block metadata plus checkpoint-derived context (L1 publish info, attestations). */
32
+ export type BlockDataWithCheckpointContext = {
33
+ data: BlockData;
34
+ checkpoint?: CheckpointData;
35
+ l1?: L1PublishedData;
36
+ attestations: CommitteeAttestation[];
37
+ };
38
+
30
39
  /**
31
40
  * Interface of classes allowing for the retrieval of L2 blocks.
32
41
  */
@@ -111,6 +120,37 @@ export interface L2BlockSource {
111
120
  */
112
121
  getCheckpointsDataForEpoch(epochNumber: EpochNumber): Promise<CheckpointData[]>;
113
122
 
123
+ /**
124
+ * Gets lightweight checkpoint metadata for a single checkpoint.
125
+ * Cheap passthrough for metadata-only queries (no block body reads).
126
+ * @param checkpointNumber - The checkpoint number to retrieve.
127
+ * @returns The requested checkpoint data (or undefined if not found).
128
+ */
129
+ getCheckpointData(checkpointNumber: CheckpointNumber): Promise<CheckpointData | undefined>;
130
+
131
+ /**
132
+ * Gets up to `limit` amount of checkpoint metadata entries starting from `from`.
133
+ * Cheap passthrough for metadata-only queries (no block body reads).
134
+ * @param from - The first checkpoint number to return (inclusive).
135
+ * @param limit - The maximum number of checkpoints to return.
136
+ */
137
+ getCheckpointDataRange(from: CheckpointNumber, limit: number): Promise<CheckpointData[]>;
138
+
139
+ /**
140
+ * Looks up the checkpoint number that contains the given slot.
141
+ * @param slot - The slot number to look up.
142
+ * @returns The checkpoint number (or undefined if not found).
143
+ */
144
+ getCheckpointNumberBySlot(slot: SlotNumber): Promise<CheckpointNumber | undefined>;
145
+
146
+ /**
147
+ * Gets block metadata plus checkpoint-derived context (L1 publish info, attestations)
148
+ * without deserializing tx bodies. Uses checkpoint-level values when the block is
149
+ * checkpointed; otherwise returns `l1: undefined` and empty attestations.
150
+ * @param number - The block number to retrieve.
151
+ */
152
+ getBlockDataWithCheckpointContext(number: BlockNumber): Promise<BlockDataWithCheckpointContext | undefined>;
153
+
114
154
  /**
115
155
  * Gets a block header by its hash.
116
156
  * @param blockHash - The block hash to retrieve.
@@ -230,10 +270,10 @@ export interface L2BlockSource {
230
270
  getPendingChainValidationStatus(): Promise<ValidateCheckpointResult>;
231
271
 
232
272
  /** Returns the checkpoint at the proposed chain tip. */
233
- getProposedCheckpoint(): Promise<CommonCheckpointData | undefined>;
273
+ getLastCheckpoint(): Promise<CommonCheckpointData | undefined>;
234
274
 
235
275
  /** Returns proposed checkpoint, if set, undefined if not*/
236
- getProposedCheckpointOnly(): Promise<ProposedCheckpointData | undefined>;
276
+ getLastProposedCheckpoint(): Promise<ProposedCheckpointData | undefined>;
237
277
 
238
278
  /** Force a sync. */
239
279
  syncImmediate(): Promise<void>;
@@ -4,26 +4,37 @@ import { hexToBuffer } from '@aztec/foundation/string';
4
4
  import { encodeAbiParameters, parseAbiParameters } from 'viem';
5
5
  import { z } from 'zod';
6
6
 
7
- import type { Signable, SignatureDomainSeparator } from '../../p2p/signature_utils.js';
7
+ import {
8
+ type CoordinationSignatureContext,
9
+ type CoordinationSignatureType,
10
+ type Signable,
11
+ coordinationSignatureContextSchema,
12
+ } from '../../p2p/signature_utils.js';
8
13
  import { CommitteeAttestation, EthAddress } from './committee_attestation.js';
9
14
 
10
15
  export class CommitteeAttestationsAndSigners implements Signable {
11
- constructor(public attestations: CommitteeAttestation[]) {}
16
+ readonly primaryType: CoordinationSignatureType = 'AttestationsAndSigners';
17
+
18
+ constructor(
19
+ public attestations: CommitteeAttestation[],
20
+ public readonly signatureContext: CoordinationSignatureContext,
21
+ ) {}
12
22
 
13
23
  static get schema() {
14
24
  return z
15
25
  .object({
16
26
  attestations: CommitteeAttestation.schema.array(),
27
+ signatureContext: coordinationSignatureContextSchema,
17
28
  })
18
- .transform(obj => new CommitteeAttestationsAndSigners(obj.attestations));
29
+ .transform(obj => new CommitteeAttestationsAndSigners(obj.attestations, obj.signatureContext));
19
30
  }
20
31
 
21
- getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
22
- const abi = parseAbiParameters('uint8,(bytes,bytes),address[]');
32
+ getPayloadToSign(): Buffer {
33
+ // Matches the L1 abi.encode(attestations, signers) in AttestationLib.sol#getAttestationsAndSignersDigest.
34
+ const abi = parseAbiParameters('(bytes,bytes),address[]');
23
35
  const packed = this.getPackedAttestations();
24
36
 
25
37
  const encodedData = encodeAbiParameters(abi, [
26
- domainSeparator,
27
38
  [packed.signatureIndices, packed.signaturesOrAddresses],
28
39
  this.getSigners().map(s => s.toString()),
29
40
  ]);
@@ -31,8 +42,8 @@ export class CommitteeAttestationsAndSigners implements Signable {
31
42
  return hexToBuffer(encodedData);
32
43
  }
33
44
 
34
- static empty(): CommitteeAttestationsAndSigners {
35
- return new CommitteeAttestationsAndSigners([]);
45
+ static empty(signatureContext: CoordinationSignatureContext): CommitteeAttestationsAndSigners {
46
+ return new CommitteeAttestationsAndSigners([], signatureContext);
36
47
  }
37
48
 
38
49
  toString() {
@@ -53,9 +64,9 @@ export class CommitteeAttestationsAndSigners implements Signable {
53
64
  * @param attestations - Array of committee attestations with addresses and signatures
54
65
  * @returns Packed attestations with bitmap and tightly packed signature/address data
55
66
  */
56
- getPackedAttestations(): ViemCommitteeAttestations {
57
- const length = this.attestations.length;
58
- const attestations = this.attestations.map(a => a.toViem());
67
+ static packAttestations(attestations: CommitteeAttestation[]): ViemCommitteeAttestations {
68
+ const length = attestations.length;
69
+ const viemAttestations = attestations.map(a => a.toViem());
59
70
 
60
71
  // Calculate bitmap size (1 bit per attestation, rounded up to nearest byte)
61
72
  const bitmapSize = Math.ceil(length / 8);
@@ -63,8 +74,8 @@ export class CommitteeAttestationsAndSigners implements Signable {
63
74
 
64
75
  // Calculate total data size needed
65
76
  let totalDataSize = 0;
66
- for (let i = 0; i < length; i++) {
67
- const signature = attestations[i].signature;
77
+ for (const attestation of viemAttestations) {
78
+ const signature = attestation.signature;
68
79
  // Check if signature is empty (v = 0)
69
80
  const isEmpty = signature.v === 0;
70
81
 
@@ -79,8 +90,7 @@ export class CommitteeAttestationsAndSigners implements Signable {
79
90
  let dataIndex = 0;
80
91
 
81
92
  // Pack the data
82
- for (let i = 0; i < length; i++) {
83
- const attestation = attestations[i];
93
+ for (const [i, attestation] of viemAttestations.entries()) {
84
94
  const signature = attestation.signature;
85
95
 
86
96
  // Check if signature is empty
@@ -90,7 +100,7 @@ export class CommitteeAttestationsAndSigners implements Signable {
90
100
  // Set bit in bitmap (bit 7-0 in each byte, left to right)
91
101
  const byteIndex = Math.floor(i / 8);
92
102
  const bitIndex = 7 - (i % 8);
93
- signatureIndices[byteIndex] |= 1 << bitIndex;
103
+ signatureIndices[byteIndex] = (signatureIndices[byteIndex] ?? 0) | (1 << bitIndex);
94
104
 
95
105
  // Pack signature: v + r + s
96
106
  signaturesOrAddresses[dataIndex] = signature.v;
@@ -118,6 +128,10 @@ export class CommitteeAttestationsAndSigners implements Signable {
118
128
  signaturesOrAddresses: `0x${Buffer.from(signaturesOrAddresses).toString('hex')}`,
119
129
  };
120
130
  }
131
+
132
+ getPackedAttestations(): ViemCommitteeAttestations {
133
+ return CommitteeAttestationsAndSigners.packAttestations(this.attestations);
134
+ }
121
135
  }
122
136
 
123
137
  /**
@@ -130,8 +144,9 @@ export class MaliciousCommitteeAttestationsAndSigners extends CommitteeAttestati
130
144
  constructor(
131
145
  attestations: CommitteeAttestation[],
132
146
  private signers: EthAddress[],
147
+ signatureContext: CoordinationSignatureContext,
133
148
  ) {
134
- super(attestations);
149
+ super(attestations, signatureContext);
135
150
  }
136
151
 
137
152
  override getSigners(): EthAddress[] {
@@ -32,6 +32,8 @@ export type L1EnrichedCheckpointData = {
32
32
  export type StorageEnrichedCheckpointData = {
33
33
  archive: AppendOnlyTreeSnapshot;
34
34
  checkpointOutHash: Fr;
35
+ /** Fee asset price modifier in basis points. Defaults to 0 (no change) when not explicitly set. */
36
+ feeAssetPriceModifier: bigint;
35
37
  };
36
38
 
37
39
  /** Data stored only with proposed checkpoint data */
@@ -70,6 +72,7 @@ export const CheckpointDataSchema = z
70
72
  checkpointOutHash: schemas.Fr,
71
73
  startBlock: BlockNumberSchema,
72
74
  blockCount: schemas.Integer,
75
+ feeAssetPriceModifier: schemas.BigInt,
73
76
  attestations: z.array(CommitteeAttestation.schema),
74
77
  l1: L1PublishedData.schema,
75
78
  })
@@ -81,6 +84,7 @@ export const CheckpointDataSchema = z
81
84
  checkpointOutHash: obj.checkpointOutHash,
82
85
  startBlock: obj.startBlock,
83
86
  blockCount: obj.blockCount,
87
+ feeAssetPriceModifier: obj.feeAssetPriceModifier,
84
88
  attestations: obj.attestations,
85
89
  l1: obj.l1,
86
90
  }),
@@ -1,5 +1,5 @@
1
1
  import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
2
- import type { ConfigMappingsType } from '@aztec/foundation/config';
2
+ import { type ConfigMappingsType, numberConfigHelper } from '@aztec/foundation/config';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
 
5
5
  export { type SequencerConfig, SequencerConfigSchema } from '../interfaces/configs.js';
@@ -14,8 +14,7 @@ export const emptyChainConfig: ChainConfig = {
14
14
  export const chainConfigMappings: ConfigMappingsType<ChainConfig> = {
15
15
  l1ChainId: {
16
16
  env: 'L1_CHAIN_ID',
17
- parseEnv: (val: string) => +val,
18
- defaultValue: 31337,
17
+ ...numberConfigHelper(31337),
19
18
  description: 'The chain ID of the ethereum host.',
20
19
  },
21
20
  rollupVersion: {
@@ -1,4 +1,9 @@
1
- import type { ConfigMappingsType } from '@aztec/foundation/config';
1
+ import {
2
+ type ConfigMappingsType,
3
+ floatConfigHelper,
4
+ numberConfigHelper,
5
+ optionalNumberConfigHelper,
6
+ } from '@aztec/foundation/config';
2
7
 
3
8
  import type { SequencerConfig } from '../interfaces/configs.js';
4
9
  import { DEFAULT_P2P_PROPAGATION_TIME } from '../timetable/index.js';
@@ -6,6 +11,9 @@ import { DEFAULT_P2P_PROPAGATION_TIME } from '../timetable/index.js';
6
11
  /** Default maximum number of transactions per block. */
7
12
  export const DEFAULT_MAX_TXS_PER_BLOCK = 32;
8
13
 
14
+ /** Default maximum number of blocks the sequencer packs into a single checkpoint. */
15
+ export const DEFAULT_MAX_BLOCKS_PER_CHECKPOINT = 24;
16
+
9
17
  /**
10
18
  * Partial sequencer config mappings for fields that need to be shared across packages.
11
19
  * The full sequencer config mappings remain in sequencer-client, but shared fields
@@ -15,7 +23,11 @@ export const DEFAULT_MAX_TXS_PER_BLOCK = 32;
15
23
  export const sharedSequencerConfigMappings: ConfigMappingsType<
16
24
  Pick<
17
25
  SequencerConfig,
18
- 'blockDurationMs' | 'expectedBlockProposalsPerSlot' | 'maxTxsPerBlock' | 'attestationPropagationTime'
26
+ | 'blockDurationMs'
27
+ | 'expectedBlockProposalsPerSlot'
28
+ | 'maxTxsPerBlock'
29
+ | 'attestationPropagationTime'
30
+ | 'maxBlocksPerCheckpoint'
19
31
  >
20
32
  > = {
21
33
  blockDurationMs: {
@@ -23,25 +35,31 @@ export const sharedSequencerConfigMappings: ConfigMappingsType<
23
35
  description:
24
36
  'Duration per block in milliseconds when building multiple blocks per slot. ' +
25
37
  'If undefined (default), builds a single block per slot using the full slot duration.',
26
- parseEnv: (val: string) => parseInt(val, 10),
38
+ ...optionalNumberConfigHelper(),
27
39
  },
28
40
  expectedBlockProposalsPerSlot: {
29
41
  env: 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT',
30
42
  description:
31
43
  'Expected number of block proposals per slot for P2P peer scoring. ' +
32
44
  '0 (default) disables block proposal scoring. Set to a positive value to enable.',
33
- parseEnv: (val: string) => parseInt(val, 10),
34
- defaultValue: 0,
45
+ ...numberConfigHelper(0),
35
46
  },
36
47
  maxTxsPerBlock: {
37
48
  env: 'SEQ_MAX_TX_PER_BLOCK',
38
49
  description: 'The maximum number of txs to include in a block.',
39
- parseEnv: (val: string) => parseInt(val, 10),
50
+ ...optionalNumberConfigHelper(),
40
51
  },
41
52
  attestationPropagationTime: {
42
53
  env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
43
54
  description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way).',
44
- parseEnv: (val: string) => parseFloat(val),
45
55
  defaultValue: DEFAULT_P2P_PROPAGATION_TIME,
56
+ ...floatConfigHelper(DEFAULT_P2P_PROPAGATION_TIME),
57
+ },
58
+ maxBlocksPerCheckpoint: {
59
+ env: 'MAX_BLOCKS_PER_CHECKPOINT',
60
+ description:
61
+ 'Maximum number of blocks the sequencer packs into a single checkpoint, and the maximum indexWithinCheckpoint accepted on inbound block proposals.',
62
+ parseEnv: (val: string) => parseInt(val, 10),
63
+ defaultValue: DEFAULT_MAX_BLOCKS_PER_CHECKPOINT,
46
64
  },
47
65
  };
@@ -1,4 +1,4 @@
1
- import { type ConfigMappingsType, getConfigFromMappings } from '@aztec/foundation/config';
1
+ import { type ConfigMappingsType, getConfigFromMappings, optionalNumberConfigHelper } from '@aztec/foundation/config';
2
2
  import { zodFor } from '@aztec/foundation/schemas';
3
3
  import { type DataStoreConfig, dataConfigMappings } from '@aztec/stdlib/kv-store';
4
4
 
@@ -26,7 +26,7 @@ export const localSignerConfigMappings: ConfigMappingsType<LocalSignerConfig> =
26
26
  env: 'SIGNING_PROTECTION_MAP_SIZE_KB',
27
27
  description:
28
28
  'Maximum size of the local signing-protection LMDB store in KB. Overwrites the general dataStoreMapSizeKb.',
29
- parseEnv: (val: string) => +val,
29
+ ...optionalNumberConfigHelper(),
30
30
  },
31
31
  };
32
32
 
@@ -4,7 +4,7 @@ import type { ApiSchemaFor } from '@aztec/foundation/schemas';
4
4
 
5
5
  import { z } from 'zod';
6
6
 
7
- import { BlockDataSchema } from '../block/block_data.js';
7
+ import { BlockDataSchema, BlockDataWithCheckpointContextSchema } from '../block/block_data.js';
8
8
  import { BlockHash } from '../block/block_hash.js';
9
9
  import { CheckpointedL2Block } from '../block/checkpointed_l2_block.js';
10
10
  import { L2Block } from '../block/l2_block.js';
@@ -117,6 +117,16 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
117
117
  getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
118
118
  getBlockData: z.function().args(BlockNumberSchema).returns(BlockDataSchema.optional()),
119
119
  getBlockDataByArchive: z.function().args(schemas.Fr).returns(BlockDataSchema.optional()),
120
+ getBlockDataWithCheckpointContext: z
121
+ .function()
122
+ .args(BlockNumberSchema)
123
+ .returns(BlockDataWithCheckpointContextSchema.optional()),
124
+ getCheckpointData: z.function().args(CheckpointNumberSchema).returns(CheckpointDataSchema.optional()),
125
+ getCheckpointDataRange: z
126
+ .function()
127
+ .args(CheckpointNumberSchema, schemas.Integer)
128
+ .returns(z.array(CheckpointDataSchema)),
129
+ getCheckpointNumberBySlot: z.function().args(schemas.SlotNumber).returns(CheckpointNumberSchema.optional()),
120
130
  getL2Block: z.function().args(BlockNumberSchema).returns(L2Block.schema.optional()),
121
131
  getL2BlockByHash: z.function().args(BlockHash.schema).returns(L2Block.schema.optional()),
122
132
  getL2BlockByArchive: z.function().args(schemas.Fr).returns(L2Block.schema.optional()),
@@ -158,8 +168,8 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
158
168
  .args()
159
169
  .returns(z.object({ genesisArchiveRoot: schemas.Fr })),
160
170
  getL1Timestamp: z.function().args().returns(schemas.BigInt.optional()),
161
- getProposedCheckpoint: z.function().args().returns(ProposedCheckpointDataSchema.optional()),
162
- getProposedCheckpointOnly: z.function().args().returns(ProposedCheckpointDataSchema.optional()),
171
+ getLastCheckpoint: z.function().args().returns(ProposedCheckpointDataSchema.optional()),
172
+ getLastProposedCheckpoint: z.function().args().returns(ProposedCheckpointDataSchema.optional()),
163
173
  syncImmediate: z.function().args().returns(z.void()),
164
174
  isPendingChainInvalid: z.function().args().returns(z.boolean()),
165
175
  getPendingChainValidationStatus: z.function().args().returns(ValidateCheckpointResultSchema),
@@ -81,6 +81,8 @@ export type AztecNodeAdminConfig = Omit<ValidatorClientFullConfig, 'l1Contracts'
81
81
  'archiverPollingIntervalMS' | 'archiverBatchSize' | 'skipValidateCheckpointAttestations'
82
82
  > & {
83
83
  maxPendingTxCount: number;
84
+ // Keep in sync with P2PConfig.skipIncomingProposals (circular dep prevents Pick<P2PConfig, ...> here)
85
+ skipIncomingProposals?: boolean;
84
86
  };
85
87
 
86
88
  export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
@@ -93,7 +95,7 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
93
95
  skipValidateCheckpointAttestations: true,
94
96
  }),
95
97
  )
96
- .merge(z.object({ maxPendingTxCount: z.number() }));
98
+ .merge(z.object({ maxPendingTxCount: z.number(), skipIncomingProposals: z.boolean().optional() }));
97
99
 
98
100
  export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
99
101
  getConfig: z.function().returns(AztecNodeAdminConfigSchema),