@aztec/sequencer-client 1.2.1 → 2.0.0-nightly.20250813

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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/sequencer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,oBAAY,cAAc;IACxB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,aAAa,kBAAkB;IAC/B;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,qBAAqB,0BAA0B;IAC/C;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,uBAAuB,4BAA4B;IACnD;;OAEG;IACH,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,gBAAgB,EAAE,EAChC,cAAc,EAAE,UAAU,EAAE,GAC3B,oBAAoB,EAAE,CAqBxB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/sequencer/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,aAAa,kBAAkB;IAC/B;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,qBAAqB,0BAA0B;IAC/C;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,uBAAuB,4BAA4B;IACnD;;OAEG;IACH,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,sBAAsB,GAC9B,cAAc,CAAC,qBAAqB,GACpC,cAAc,CAAC,cAAc,GAC7B,cAAc,CAAC,uBAAuB,GACtC,cAAc,CAAC,gBAAgB,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEpE"}
@@ -1,4 +1,3 @@
1
- import { CommitteeAttestation } from '@aztec/stdlib/block';
2
1
  export var SequencerState = /*#__PURE__*/ function(SequencerState) {
3
2
  /**
4
3
  * Sequencer is stopped and not processing any txs from the pool.
@@ -29,25 +28,3 @@ export var SequencerState = /*#__PURE__*/ function(SequencerState) {
29
28
  export function sequencerStateToNumber(state) {
30
29
  return Object.values(SequencerState).indexOf(state);
31
30
  }
32
- /** Order Attestations
33
- *
34
- * Returns attestation signatures in the order of a series of provided ethereum addresses
35
- * The rollup smart contract expects attestations to appear in the order of the committee
36
- *
37
- * @todo: perform this logic within the memory attestation store instead?
38
- */ export function orderAttestations(attestations, orderAddresses) {
39
- // Create a map of sender addresses to BlockAttestations
40
- const attestationMap = new Map();
41
- for (const attestation of attestations){
42
- const sender = attestation.getSender();
43
- if (sender) {
44
- attestationMap.set(sender.toString(), CommitteeAttestation.fromAddressAndSignature(sender, attestation.signature));
45
- }
46
- }
47
- // Create the ordered array based on the orderAddresses, else return an empty attestation
48
- const orderedAttestations = orderAddresses.map((address)=>{
49
- const addressString = address.toString();
50
- return attestationMap.get(addressString) || CommitteeAttestation.fromAddress(address);
51
- });
52
- return orderedAttestations;
53
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/sequencer-client",
3
- "version": "1.2.1",
3
+ "version": "2.0.0-nightly.20250813",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -26,37 +26,37 @@
26
26
  "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json"
27
27
  },
28
28
  "dependencies": {
29
- "@aztec/aztec.js": "1.2.1",
30
- "@aztec/bb-prover": "1.2.1",
31
- "@aztec/blob-lib": "1.2.1",
32
- "@aztec/blob-sink": "1.2.1",
33
- "@aztec/constants": "1.2.1",
34
- "@aztec/epoch-cache": "1.2.1",
35
- "@aztec/ethereum": "1.2.1",
36
- "@aztec/foundation": "1.2.1",
37
- "@aztec/l1-artifacts": "1.2.1",
38
- "@aztec/merkle-tree": "1.2.1",
39
- "@aztec/noir-acvm_js": "1.2.1",
40
- "@aztec/noir-contracts.js": "1.2.1",
41
- "@aztec/noir-protocol-circuits-types": "1.2.1",
42
- "@aztec/noir-types": "1.2.1",
43
- "@aztec/p2p": "1.2.1",
44
- "@aztec/protocol-contracts": "1.2.1",
45
- "@aztec/prover-client": "1.2.1",
46
- "@aztec/simulator": "1.2.1",
47
- "@aztec/slasher": "1.2.1",
48
- "@aztec/stdlib": "1.2.1",
49
- "@aztec/telemetry-client": "1.2.1",
50
- "@aztec/validator-client": "1.2.1",
51
- "@aztec/world-state": "1.2.1",
29
+ "@aztec/aztec.js": "2.0.0-nightly.20250813",
30
+ "@aztec/bb-prover": "2.0.0-nightly.20250813",
31
+ "@aztec/blob-lib": "2.0.0-nightly.20250813",
32
+ "@aztec/blob-sink": "2.0.0-nightly.20250813",
33
+ "@aztec/constants": "2.0.0-nightly.20250813",
34
+ "@aztec/epoch-cache": "2.0.0-nightly.20250813",
35
+ "@aztec/ethereum": "2.0.0-nightly.20250813",
36
+ "@aztec/foundation": "2.0.0-nightly.20250813",
37
+ "@aztec/l1-artifacts": "2.0.0-nightly.20250813",
38
+ "@aztec/merkle-tree": "2.0.0-nightly.20250813",
39
+ "@aztec/noir-acvm_js": "2.0.0-nightly.20250813",
40
+ "@aztec/noir-contracts.js": "2.0.0-nightly.20250813",
41
+ "@aztec/noir-protocol-circuits-types": "2.0.0-nightly.20250813",
42
+ "@aztec/noir-types": "2.0.0-nightly.20250813",
43
+ "@aztec/p2p": "2.0.0-nightly.20250813",
44
+ "@aztec/protocol-contracts": "2.0.0-nightly.20250813",
45
+ "@aztec/prover-client": "2.0.0-nightly.20250813",
46
+ "@aztec/simulator": "2.0.0-nightly.20250813",
47
+ "@aztec/slasher": "2.0.0-nightly.20250813",
48
+ "@aztec/stdlib": "2.0.0-nightly.20250813",
49
+ "@aztec/telemetry-client": "2.0.0-nightly.20250813",
50
+ "@aztec/validator-client": "2.0.0-nightly.20250813",
51
+ "@aztec/world-state": "2.0.0-nightly.20250813",
52
52
  "lodash.chunk": "^4.2.0",
53
53
  "lodash.pick": "^4.4.0",
54
54
  "tslib": "^2.4.0",
55
55
  "viem": "2.23.7"
56
56
  },
57
57
  "devDependencies": {
58
- "@aztec/archiver": "1.2.1",
59
- "@aztec/kv-store": "1.2.1",
58
+ "@aztec/archiver": "2.0.0-nightly.20250813",
59
+ "@aztec/kv-store": "2.0.0-nightly.20250813",
60
60
  "@jest/globals": "^30.0.0",
61
61
  "@types/jest": "^30.0.0",
62
62
  "@types/lodash.chunk": "^4.2.7",
@@ -79,7 +79,7 @@ export class SequencerClient {
79
79
  const chain = createEthereumChain(rpcUrls, chainId);
80
80
  const log = createLogger('sequencer-client');
81
81
  const l1Client = createExtendedL1Client(rpcUrls, publisherPrivateKey.getValue(), chain.chainInfo);
82
- const l1TxUtils = deps.l1TxUtils ?? new L1TxUtilsWithBlobs(l1Client, log, config);
82
+ const l1TxUtils = deps.l1TxUtils ?? new L1TxUtilsWithBlobs(l1Client, log, deps.dateProvider, config);
83
83
  const rollupContract = new RollupContract(l1Client, config.l1Contracts.rollupAddress.toString());
84
84
  const [l1GenesisTime, slotDuration] = await Promise.all([
85
85
  rollupContract.getL1GenesisTime(),
@@ -117,6 +117,7 @@ export class SequencerClient {
117
117
  epochCache,
118
118
  governanceProposerContract,
119
119
  slashingProposerContract,
120
+ dateProvider: deps.dateProvider,
120
121
  });
121
122
  const globalsBuilder = new GlobalVariableBuilder(config);
122
123
 
@@ -131,14 +132,14 @@ export class SequencerClient {
131
132
  sequencerManaLimit = rollupManaLimit;
132
133
  }
133
134
 
134
- // When running in anvil, assume we can post a tx up until the very last second of an L1 slot.
135
+ // When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
135
136
  // Otherwise, assume we must have broadcasted the tx before the slot started (we use a default
136
137
  // maxL1TxInclusionTimeIntoSlot of zero) to get the tx into that L1 slot.
137
138
  // In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
138
139
  // make it with a propagation time into slot equal to 4s. However, we prefer being conservative.
139
140
  // See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
140
141
  const maxL1TxInclusionTimeIntoSlot =
141
- (config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId)) ? ethereumSlotDuration : 0;
142
+ (config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId)) ? ethereumSlotDuration - 1 : 0;
142
143
 
143
144
  const l1Constants = {
144
145
  l1GenesisTime,
@@ -185,11 +186,6 @@ export class SequencerClient {
185
186
  await this.sequencer.stop();
186
187
  }
187
188
 
188
- /** Forces the sequencer to bypass all time and tx count checks for the next block and build anyway. */
189
- public flush() {
190
- this.sequencer.flush();
191
- }
192
-
193
189
  /**
194
190
  * Restarts the sequencer after being stopped.
195
191
  */
package/src/config.ts CHANGED
@@ -27,6 +27,8 @@ import {
27
27
  export * from './publisher/config.js';
28
28
  export type { SequencerConfig };
29
29
 
30
+ export const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
31
+
30
32
  /**
31
33
  * Configuration settings for the SequencerClient.
32
34
  */
@@ -110,6 +112,37 @@ export const sequencerConfigMappings: ConfigMappingsType<SequencerConfig> = {
110
112
  description: 'How many seconds into an L1 slot we can still send a tx and get it mined.',
111
113
  parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
112
114
  },
115
+ attestationPropagationTime: {
116
+ env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
117
+ description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
118
+ ...numberConfigHelper(DEFAULT_ATTESTATION_PROPAGATION_TIME),
119
+ },
120
+ fakeProcessingDelayPerTxMs: {
121
+ description: 'Used for testing to introduce a fake delay after processing each tx',
122
+ },
123
+ secondsBeforeInvalidatingBlockAsCommitteeMember: {
124
+ env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
125
+ description:
126
+ 'How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate).' +
127
+ ' The next proposer is expected to invalidate, so the committee acts as a fallback.',
128
+ ...numberConfigHelper(144), // 12 L1 blocks
129
+ },
130
+ secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
131
+ env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
132
+ description:
133
+ 'How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate).' +
134
+ ' The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback.',
135
+ ...numberConfigHelper(432), // 36 L1 blocks
136
+ },
137
+ skipCollectingAttestations: {
138
+ description:
139
+ 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
140
+ ...booleanConfigHelper(false),
141
+ },
142
+ skipInvalidateBlockAsProposer: {
143
+ description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
144
+ ...booleanConfigHelper(false),
145
+ },
113
146
  ...pickConfigMappings(p2pConfigMappings, ['txPublicSetupAllowList']),
114
147
  };
115
148
 
@@ -1 +1 @@
1
- export { SequencerPublisher } from './sequencer-publisher.js';
1
+ export { SequencerPublisher, SignalType } from './sequencer-publisher.js';