@aztec/sequencer-client 2.0.3-rc.2 → 2.0.3-rc.20

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":"sequencer-client.d.ts","sourceRoot":"","sources":["../../src/client/sequencer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAEL,gBAAgB,EAIjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;A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
  */ static async new(config, deps) {
38
38
  const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, blockBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
39
39
  const { l1RpcUrls: rpcUrls, l1ChainId: chainId } = config;
40
- const log = createLogger('sequencer-client');
40
+ const log = createLogger('sequencer');
41
41
  const publicClient = getPublicClient(config);
42
42
  const l1TxUtils = deps.l1TxUtils;
43
43
  const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
44
- const publisherManager = new PublisherManager(l1TxUtils);
44
+ const publisherManager = new PublisherManager(l1TxUtils, config);
45
45
  const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
46
46
  const [l1GenesisTime, slotDuration] = await Promise.all([
47
47
  rollupContract.getL1GenesisTime(),
@@ -66,7 +66,8 @@ import { Sequencer } from '../sequencer/index.js';
66
66
  rollupContract,
67
67
  dateProvider: deps.dateProvider,
68
68
  publisherManager,
69
- nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore)
69
+ nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore),
70
+ logger: log
70
71
  });
71
72
  const globalsBuilder = new GlobalVariableBuilder(config);
72
73
  const ethereumSlotDuration = config.ethereumSlotDuration;
@@ -92,7 +93,7 @@ import { Sequencer } from '../sequencer/index.js';
92
93
  ...config,
93
94
  maxL1TxInclusionTimeIntoSlot,
94
95
  maxL2BlockGas: sequencerManaLimit
95
- }, telemetryClient);
96
+ }, telemetryClient, log);
96
97
  await sequencer.init();
97
98
  return new SequencerClient(publisherManager, sequencer, blockBuilder, validatorClient, l1Metrics);
98
99
  }
package/dest/config.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
2
2
  import { type ConfigMappingsType } from '@aztec/foundation/config';
3
+ import { type KeyStoreConfig } from '@aztec/node-keystore';
3
4
  import { type P2PConfig } from '@aztec/p2p';
4
5
  import { type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
5
6
  import { type ValidatorClientConfig } from '@aztec/validator-client';
@@ -10,7 +11,7 @@ export declare const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
10
11
  /**
11
12
  * Configuration settings for the SequencerClient.
12
13
  */
13
- export type SequencerClientConfig = PublisherConfig & ValidatorClientConfig & TxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowList'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
14
+ export type SequencerClientConfig = PublisherConfig & KeyStoreConfig & ValidatorClientConfig & TxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowList'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
14
15
  export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
15
16
  export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
16
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,uBAAuB,CAAC;AAE/B,cAAc,uBAAuB,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GACd,eAAe,GACf,cAAc,GACd,WAAW,GACX,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,GACzC,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC,CAAC;AAE/F,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CAuGvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CASnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
package/dest/config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { l1ContractsConfigMappings, l1ReaderConfigMappings } from '@aztec/ethereum';
2
2
  import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
+ import { keyStoreConfigMappings } from '@aztec/node-keystore';
4
5
  import { p2pConfigMappings } from '@aztec/p2p';
5
6
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
6
7
  import { chainConfigMappings } from '@aztec/stdlib/config';
@@ -112,6 +113,7 @@ export const sequencerConfigMappings = {
112
113
  export const sequencerClientConfigMappings = {
113
114
  ...validatorClientConfigMappings,
114
115
  ...sequencerConfigMappings,
116
+ ...keyStoreConfigMappings,
115
117
  ...l1ReaderConfigMappings,
116
118
  ...getTxSenderConfigMappings('SEQ'),
117
119
  ...getPublisherConfigMappings('SEQ'),
@@ -14,15 +14,17 @@ export type TxSenderConfig = L1ReaderConfig & {
14
14
  * Publisher addresses to be used with a remote signer
15
15
  */
16
16
  publisherAddresses?: EthAddress[];
17
+ /** Whether this publisher is enabled */
18
+ publisherEnabled?: boolean;
17
19
  };
18
20
  /**
19
21
  * Configuration of the L1Publisher.
20
22
  */
21
23
  export type PublisherConfig = L1TxUtilsConfig & BlobSinkConfig & {
22
- /**
23
- * The interval to wait between publish retries.
24
- */
24
+ /** The interval to wait between publish retries. */
25
25
  l1PublishRetryIntervalMS: number;
26
+ /** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
27
+ publisherAllowInvalidStates?: boolean;
26
28
  };
27
29
  export declare const getTxSenderConfigMappings: (scope: 'PROVER' | 'SEQ') => ConfigMappingsType<Omit<TxSenderConfig, 'l1Contracts'>>;
28
30
  export declare function getTxSenderConfigFromEnv(scope: 'PROVER' | 'SEQ'): Omit<TxSenderConfig, 'l1Contracts'>;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/publisher/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EAGrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAyB,MAAM,0BAA0B,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C;;OAEG;IACH,oBAAoB,CAAC,EAAE,WAAW,CAAC,KAAK,MAAM,EAAE,CAAC,EAAE,CAAC;IAEpD;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,EAAE,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAC3C,cAAc,GAAG;IACf;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAEJ,eAAO,MAAM,yBAAyB,EAAE,CACtC,KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAezD,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAErG;AAED,eAAO,MAAM,0BAA0B,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KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,eAAe,GAAG,eAAe,CAcvD,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,eAAe,CAElF"}
@@ -1,6 +1,6 @@
1
1
  import { blobSinkConfigMapping } from '@aztec/blob-sink/client';
2
2
  import { l1ReaderConfigMappings, l1TxUtilsConfigMappings } from '@aztec/ethereum';
3
- import { SecretValue, getConfigFromMappings } from '@aztec/foundation/config';
3
+ import { SecretValue, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
4
4
  import { EthAddress } from '@aztec/foundation/eth-address';
5
5
  export const getTxSenderConfigMappings = (scope)=>({
6
6
  ...l1ReaderConfigMappings,
@@ -9,10 +9,8 @@ export const getTxSenderConfigMappings = (scope)=>({
9
9
  description: 'The private keys to be used by the publisher.',
10
10
  parseEnv: (val)=>val.split(',').map((key)=>new SecretValue(`0x${key.replace('0x', '')}`)),
11
11
  defaultValue: [],
12
- fallback: scope === 'PROVER' ? [
13
- 'PROVER_PUBLISHER_PRIVATE_KEY'
14
- ] : [
15
- 'SEQ_PUBLISHER_PRIVATE_KEY'
12
+ fallback: [
13
+ scope === 'PROVER' ? `PROVER_PUBLISHER_PRIVATE_KEY` : `SEQ_PUBLISHER_PRIVATE_KEY`
16
14
  ]
17
15
  },
18
16
  publisherAddresses: {
@@ -20,6 +18,11 @@ export const getTxSenderConfigMappings = (scope)=>({
20
18
  description: 'The addresses of the publishers to use with remote signers',
21
19
  parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
22
20
  defaultValue: []
21
+ },
22
+ publisherEnabled: {
23
+ env: scope === 'PROVER' ? `PROVER_PUBLISHER_ENABLED` : `SEQ_PUBLISHER_ENABLED`,
24
+ description: 'Whether this L1 publisher is enabled',
25
+ ...booleanConfigHelper(true)
23
26
  }
24
27
  });
25
28
  export function getTxSenderConfigFromEnv(scope) {
@@ -32,6 +35,11 @@ export const getPublisherConfigMappings = (scope)=>({
32
35
  defaultValue: 1000,
33
36
  description: 'The interval to wait between publish retries.'
34
37
  },
38
+ publisherAllowInvalidStates: {
39
+ description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
40
+ env: scope === `PROVER` ? `PROVER_PUBLISHER_ALLOW_INVALID_STATES` : `SEQ_PUBLISHER_ALLOW_INVALID_STATES`,
41
+ ...booleanConfigHelper(false)
42
+ },
35
43
  ...l1TxUtilsConfigMappings,
36
44
  ...blobSinkConfigMapping
37
45
  });
@@ -1,4 +1,4 @@
1
- export { SequencerPublisher, SignalType } from './sequencer-publisher.js';
1
+ export { SequencerPublisher } from './sequencer-publisher.js';
2
2
  export { SequencerPublisherFactory } from './sequencer-publisher-factory.js';
3
3
  export { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/publisher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/publisher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -1,4 +1,4 @@
1
- export { SequencerPublisher, SignalType } from './sequencer-publisher.js';
1
+ export { SequencerPublisher } from './sequencer-publisher.js';
2
2
  export { SequencerPublisherFactory } from './sequencer-publisher-factory.js';
3
3
  // Used for tests
4
4
  export { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
@@ -1,4 +1,4 @@
1
- import { EthAddress } from '@aztec/aztec.js';
1
+ import { EthAddress, type Logger } from '@aztec/aztec.js';
2
2
  import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
3
3
  import type { EpochCache } from '@aztec/epoch-cache';
4
4
  import type { GovernanceProposerContract, PublisherManager, RollupContract } from '@aztec/ethereum';
@@ -17,6 +17,9 @@ export declare class SequencerPublisherFactory {
17
17
  private sequencerConfig;
18
18
  private deps;
19
19
  private publisherMetrics;
20
+ /** Stores the last slot in which every action was carried out by a publisher */
21
+ private lastActions;
22
+ private logger;
20
23
  constructor(sequencerConfig: SequencerClientConfig, deps: {
21
24
  telemetry: TelemetryClient;
22
25
  publisherManager: PublisherManager<L1TxUtilsWithBlobs>;
@@ -27,6 +30,7 @@ export declare class SequencerPublisherFactory {
27
30
  governanceProposerContract: GovernanceProposerContract;
28
31
  slashFactoryContract: SlashFactoryContract;
29
32
  nodeKeyStore: NodeKeystoreAdapter;
33
+ logger?: Logger;
30
34
  });
31
35
  /**
32
36
  * Creates a new SequencerPublisher instance.
@@ -1 +1 @@
1
- {"version":3,"file":"sequencer-publisher-factory.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAmB,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACrH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAA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-1,13 +1,18 @@
1
+ import { createLogger } from '@aztec/aztec.js';
1
2
  import { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
2
3
  import { SequencerPublisher } from './sequencer-publisher.js';
3
4
  export class SequencerPublisherFactory {
4
5
  sequencerConfig;
5
6
  deps;
6
7
  publisherMetrics;
8
+ /** Stores the last slot in which every action was carried out by a publisher */ lastActions;
9
+ logger;
7
10
  constructor(sequencerConfig, deps){
8
11
  this.sequencerConfig = sequencerConfig;
9
12
  this.deps = deps;
13
+ this.lastActions = {};
10
14
  this.publisherMetrics = new SequencerPublisherMetrics(deps.telemetry, 'SequencerPublisher');
15
+ this.logger = deps.logger ?? createLogger('sequencer');
11
16
  }
12
17
  /**
13
18
  * Creates a new SequencerPublisher instance.
@@ -34,7 +39,9 @@ export class SequencerPublisherFactory {
34
39
  slashingProposerContract,
35
40
  slashFactoryContract: this.deps.slashFactoryContract,
36
41
  dateProvider: this.deps.dateProvider,
37
- metrics: this.publisherMetrics
42
+ metrics: this.publisherMetrics,
43
+ lastActions: this.lastActions,
44
+ log: this.logger.createChild('publisher')
38
45
  });
39
46
  return {
40
47
  attestorAddress,
@@ -4,20 +4,18 @@ import type { EpochCache } from '@aztec/epoch-cache';
4
4
  import { type EmpireSlashingProposerContract, FormattedViemError, type GasPrice, type GovernanceProposerContract, type L1BlobInputs, type L1ContractsConfig, type L1GasConfig, type L1TxRequest, RollupContract, type TallySlashingProposerContract, type TransactionStats } from '@aztec/ethereum';
5
5
  import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
6
6
  import { EthAddress } from '@aztec/foundation/eth-address';
7
+ import { Signature } from '@aztec/foundation/eth-signature';
7
8
  import type { Fr } from '@aztec/foundation/fields';
9
+ import { type Logger } from '@aztec/foundation/log';
8
10
  import { DateProvider } from '@aztec/foundation/timer';
9
11
  import { type ProposerSlashAction } from '@aztec/slasher';
10
- import { CommitteeAttestation, type ValidateBlockResult } from '@aztec/stdlib/block';
12
+ import { CommitteeAttestationsAndSigners, type ValidateBlockResult } from '@aztec/stdlib/block';
11
13
  import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
12
- import { type ProposedBlockHeader, TxHash } from '@aztec/stdlib/tx';
14
+ import { type ProposedBlockHeader } from '@aztec/stdlib/tx';
13
15
  import { type TelemetryClient } from '@aztec/telemetry-client';
14
16
  import { type TransactionReceipt, type TypedDataDefinition } from 'viem';
15
17
  import type { PublisherConfig, TxSenderConfig } from './config.js';
16
18
  import { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
17
- export declare enum SignalType {
18
- GOVERNANCE = 0,
19
- SLASHING = 1
20
- }
21
19
  export declare const Actions: readonly ["invalidate-by-invalid-attestation", "invalidate-by-insufficient-attestations", "propose", "governance-signal", "empire-slashing-signal", "create-empire-payload", "execute-empire-payload", "vote-offenses", "execute-slash"];
22
20
  export type Action = (typeof Actions)[number];
23
21
  export declare const compareActions: (a: Action, b: Action) => number;
@@ -43,13 +41,14 @@ interface RequestWithExpiry {
43
41
  }
44
42
  export declare class SequencerPublisher {
45
43
  private config;
44
+ private enabled;
46
45
  private interrupted;
47
46
  private metrics;
48
47
  epochCache: EpochCache;
49
- protected governanceLog: import("@aztec/aztec.js").Logger;
50
- protected slashingLog: import("@aztec/aztec.js").Logger;
51
- private myLastSignals;
52
- protected log: import("@aztec/aztec.js").Logger;
48
+ protected governanceLog: Logger;
49
+ protected slashingLog: Logger;
50
+ protected lastActions: Partial<Record<Action, bigint>>;
51
+ protected log: Logger;
53
52
  protected ethereumSlotDuration: bigint;
54
53
  private blobSinkClient;
55
54
  static PROPOSE_GAS_GUESS: bigint;
@@ -72,6 +71,8 @@ export declare class SequencerPublisher {
72
71
  epochCache: EpochCache;
73
72
  dateProvider: DateProvider;
74
73
  metrics: SequencerPublisherMetrics;
74
+ lastActions: Partial<Record<Action, bigint>>;
75
+ log?: Logger;
75
76
  });
76
77
  getRollupContract(): RollupContract;
77
78
  getSenderAddress(): EthAddress;
@@ -138,10 +139,7 @@ export declare class SequencerPublisher {
138
139
  * @param attestationData - The block's attestation data
139
140
  *
140
141
  */
141
- validateBlockForSubmission(block: L2Block, attestationData: {
142
- digest: Buffer;
143
- attestations: CommitteeAttestation[];
144
- } | undefined, options: {
142
+ validateBlockForSubmission(block: L2Block, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, options: {
145
143
  forcePendingBlockNumber?: number;
146
144
  }): Promise<bigint>;
147
145
  private enqueueCastSignalHelper;
@@ -160,7 +158,7 @@ export declare class SequencerPublisher {
160
158
  * @param block - L2 block to propose.
161
159
  * @returns True if the tx has been enqueued, throws otherwise. See #9315
162
160
  */
163
- enqueueProposeL2Block(block: L2Block, attestations?: CommitteeAttestation[], txHashes?: TxHash[], opts?: {
161
+ enqueueProposeL2Block(block: L2Block, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, opts?: {
164
162
  txTimeoutAt?: Date;
165
163
  forcePendingBlockNumber?: number;
166
164
  }): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,8BAA8B,EACnC,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,cAAc,EACd,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EAMtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EA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AsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,EAAE,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO;YA+B9F,yBAAyB;IAoDvC;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;IAsD9B;;;;;OAKG;YACW,iBAAiB;YAoEjB,YAAY;CA+E3B"}
@@ -4,22 +4,17 @@ import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, f
4
4
  import { sumBigint } from '@aztec/foundation/bigint';
5
5
  import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
6
6
  import { EthAddress } from '@aztec/foundation/eth-address';
7
+ import { Signature } from '@aztec/foundation/eth-signature';
7
8
  import { createLogger } from '@aztec/foundation/log';
8
9
  import { bufferToHex } from '@aztec/foundation/string';
9
10
  import { Timer } from '@aztec/foundation/timer';
10
11
  import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
11
12
  import { encodeSlashConsensusVotes } from '@aztec/slasher';
12
- import { CommitteeAttestation } from '@aztec/stdlib/block';
13
- import { ConsensusPayload, SignatureDomainSeparator, getHashedSignaturePayload } from '@aztec/stdlib/p2p';
13
+ import { CommitteeAttestation, CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
14
14
  import { getTelemetryClient } from '@aztec/telemetry-client';
15
15
  import pick from 'lodash.pick';
16
16
  import { encodeFunctionData, toHex } from 'viem';
17
17
  import { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
18
- export var SignalType = /*#__PURE__*/ function(SignalType) {
19
- SignalType[SignalType["GOVERNANCE"] = 0] = "GOVERNANCE";
20
- SignalType[SignalType["SLASHING"] = 1] = "SLASHING";
21
- return SignalType;
22
- }({});
23
18
  export const Actions = [
24
19
  'invalidate-by-invalid-attestation',
25
20
  'invalidate-by-insufficient-attestations',
@@ -35,12 +30,13 @@ export const Actions = [
35
30
  export const compareActions = (a, b)=>Actions.indexOf(a) - Actions.indexOf(b);
36
31
  export class SequencerPublisher {
37
32
  config;
33
+ enabled;
38
34
  interrupted;
39
35
  metrics;
40
36
  epochCache;
41
37
  governanceLog;
42
38
  slashingLog;
43
- myLastSignals;
39
+ lastActions;
44
40
  log;
45
41
  ethereumSlotDuration;
46
42
  blobSinkClient;
@@ -63,14 +59,13 @@ export class SequencerPublisher {
63
59
  this.interrupted = false;
64
60
  this.governanceLog = createLogger('sequencer:publisher:governance');
65
61
  this.slashingLog = createLogger('sequencer:publisher:slashing');
66
- this.myLastSignals = {
67
- [0]: 0n,
68
- [1]: 0n
69
- };
70
- this.log = createLogger('sequencer:publisher');
62
+ this.lastActions = {};
71
63
  this.requests = [];
64
+ this.enabled = config.publisherEnabled ?? true;
65
+ this.log = deps.log ?? createLogger('sequencer:publisher');
72
66
  this.ethereumSlotDuration = BigInt(config.ethereumSlotDuration);
73
67
  this.epochCache = deps.epochCache;
68
+ this.lastActions = deps.lastActions;
74
69
  this.blobSinkClient = deps.blobSinkClient ?? createBlobSinkClient(config, {
75
70
  logger: createLogger('sequencer:blob-sink:client')
76
71
  });
@@ -106,6 +101,13 @@ export class SequencerPublisher {
106
101
  * - a receipt and errorMsg if it failed on L1
107
102
  * - undefined if no valid requests are found OR the tx failed to send.
108
103
  */ async sendRequests() {
104
+ if (!this.enabled) {
105
+ this.log.warn(`Sending L1 txs is disabled`, {
106
+ requestsDiscarded: this.requests.map((r)=>r.action)
107
+ });
108
+ this.requests = [];
109
+ return undefined;
110
+ }
109
111
  const requestsToProcess = [
110
112
  ...this.requests
111
113
  ];
@@ -241,8 +243,9 @@ export class SequencerPublisher {
241
243
  };
242
244
  const args = [
243
245
  header.toViem(),
244
- RollupContract.packAttestations([]),
246
+ CommitteeAttestationsAndSigners.empty().getPackedAttestations(),
245
247
  [],
248
+ Signature.empty().toViemSignature(),
246
249
  `0x${'0'.repeat(64)}`,
247
250
  header.contentCommitment.blobsHash.toString(),
248
251
  flags
@@ -350,10 +353,11 @@ export class SequencerPublisher {
350
353
  reason
351
354
  };
352
355
  this.log.debug(`Simulating invalidate block ${block.blockNumber}`, logData);
356
+ const attestationsAndSigners = new CommitteeAttestationsAndSigners(attestations).getPackedAttestations();
353
357
  if (reason === 'invalid-attestation') {
354
- return this.rollupContract.buildInvalidateBadAttestationRequest(block.blockNumber, attestations.map((a)=>a.toViem()), committee, validationResult.invalidIndex);
358
+ return this.rollupContract.buildInvalidateBadAttestationRequest(block.blockNumber, attestationsAndSigners, committee, validationResult.invalidIndex);
355
359
  } else if (reason === 'insufficient-attestations') {
356
- return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(block.blockNumber, attestations.map((a)=>a.toViem()), committee);
360
+ return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(block.blockNumber, attestationsAndSigners, committee);
357
361
  } else {
358
362
  const _ = reason;
359
363
  throw new Error(`Unknown reason for invalidation`);
@@ -367,45 +371,41 @@ export class SequencerPublisher {
367
371
  * @param block - The block to propose
368
372
  * @param attestationData - The block's attestation data
369
373
  *
370
- */ async validateBlockForSubmission(block, attestationData = {
371
- digest: Buffer.alloc(32),
372
- attestations: []
373
- }, options) {
374
+ */ async validateBlockForSubmission(block, attestationsAndSigners, attestationsAndSignersSignature, options) {
374
375
  const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
375
376
  // If we have no attestations, we still need to provide the empty attestations
376
377
  // so that the committee is recalculated correctly
377
- const ignoreSignatures = attestationData.attestations.length === 0;
378
+ const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
378
379
  if (ignoreSignatures) {
379
380
  const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber.toBigInt());
380
381
  if (!committee) {
381
382
  this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
382
383
  throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
383
384
  }
384
- attestationData.attestations = committee.map((committeeMember)=>CommitteeAttestation.fromAddress(committeeMember));
385
+ attestationsAndSigners.attestations = committee.map((committeeMember)=>CommitteeAttestation.fromAddress(committeeMember));
385
386
  }
386
387
  const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
387
388
  const blobInput = Blob.getPrefixedEthBlobCommitments(blobs);
388
- const formattedAttestations = attestationData.attestations.map((attest)=>attest.toViem());
389
- const signers = attestationData.attestations.filter((attest)=>!attest.signature.isEmpty()).map((attest)=>attest.address.toString());
390
389
  const args = [
391
390
  {
392
391
  header: block.header.toPropose().toViem(),
393
392
  archive: toHex(block.archive.root.toBuffer()),
394
393
  stateReference: block.header.state.toViem(),
395
- txHashes: block.body.txEffects.map((txEffect)=>txEffect.txHash.toString()),
396
394
  oracleInput: {
397
395
  feeAssetPriceModifier: 0n
398
396
  }
399
397
  },
400
- RollupContract.packAttestations(formattedAttestations),
401
- signers,
398
+ attestationsAndSigners.getPackedAttestations(),
399
+ attestationsAndSigners.getSigners().map((signer)=>signer.toString()),
400
+ attestationsAndSignersSignature.toViemSignature(),
402
401
  blobInput
403
402
  ];
404
403
  await this.simulateProposeTx(args, ts, options);
405
404
  return ts;
406
405
  }
407
406
  async enqueueCastSignalHelper(slotNumber, timestamp, signalType, payload, base, signerAddress, signer) {
408
- if (this.myLastSignals[signalType] >= slotNumber) {
407
+ if (this.lastActions[signalType] && this.lastActions[signalType] === slotNumber) {
408
+ this.log.debug(`Skipping duplicate vote cast signal ${signalType} for slot ${slotNumber}`);
409
409
  return false;
410
410
  }
411
411
  if (payload.equals(EthAddress.ZERO)) {
@@ -420,9 +420,9 @@ export class SequencerPublisher {
420
420
  if (roundInfo.lastSignalSlot >= slotNumber) {
421
421
  return false;
422
422
  }
423
- const cachedLastVote = this.myLastSignals[signalType];
424
- this.myLastSignals[signalType] = slotNumber;
425
- const action = signalType === 0 ? 'governance-signal' : 'empire-slashing-signal';
423
+ const cachedLastVote = this.lastActions[signalType];
424
+ this.lastActions[signalType] = slotNumber;
425
+ const action = signalType;
426
426
  const request = await base.createSignalRequestWithSignature(payload.toString(), slotNumber, this.config.l1ChainId, signerAddress.toString(), signer);
427
427
  this.log.debug(`Created ${action} request with signature`, {
428
428
  request,
@@ -459,7 +459,7 @@ export class SequencerPublisher {
459
459
  };
460
460
  if (!success) {
461
461
  this.log.error(`Signaling in [${action}] for ${payload} at slot ${slotNumber} in round ${round} failed`, logData);
462
- this.myLastSignals[signalType] = cachedLastVote;
462
+ this.lastActions[signalType] = cachedLastVote;
463
463
  return false;
464
464
  } else {
465
465
  this.log.info(`Signaling in [${action}] for ${payload} at slot ${slotNumber} in round ${round} succeeded`, logData);
@@ -475,7 +475,7 @@ export class SequencerPublisher {
475
475
  * @param timestamp - The timestamp of the slot to cast a signal for.
476
476
  * @returns True if the signal was successfully enqueued, false otherwise.
477
477
  */ enqueueGovernanceCastSignal(governancePayload, slotNumber, timestamp, signerAddress, signer) {
478
- return this.enqueueCastSignalHelper(slotNumber, timestamp, 0, governancePayload, this.govProposerContract, signerAddress, signer);
478
+ return this.enqueueCastSignalHelper(slotNumber, timestamp, 'governance-signal', governancePayload, this.govProposerContract, signerAddress, signer);
479
479
  }
480
480
  /** Enqueues all slashing actions as returned by the slasher client. */ async enqueueSlashingActions(actions, slotNumber, timestamp, signerAddress, signer) {
481
481
  if (actions.length === 0) {
@@ -493,7 +493,7 @@ export class SequencerPublisher {
493
493
  this.log.debug(`Enqueuing slashing vote for payload ${action.payload} at slot ${slotNumber}`, {
494
494
  signerAddress
495
495
  });
496
- await this.enqueueCastSignalHelper(slotNumber, timestamp, 1, action.payload, this.slashingProposerContract, signerAddress, signer);
496
+ await this.enqueueCastSignalHelper(slotNumber, timestamp, 'empire-slashing-signal', action.payload, this.slashingProposerContract, signerAddress, signer);
497
497
  break;
498
498
  }
499
499
  case 'create-empire-payload':
@@ -569,10 +569,8 @@ export class SequencerPublisher {
569
569
  *
570
570
  * @param block - L2 block to propose.
571
571
  * @returns True if the tx has been enqueued, throws otherwise. See #9315
572
- */ async enqueueProposeL2Block(block, attestations, txHashes, opts = {}) {
572
+ */ async enqueueProposeL2Block(block, attestationsAndSigners, attestationsAndSignersSignature, opts = {}) {
573
573
  const proposedBlockHeader = block.header.toPropose();
574
- const consensusPayload = ConsensusPayload.fromBlock(block);
575
- const digest = getHashedSignaturePayload(consensusPayload, SignatureDomainSeparator.blockAttestation);
576
574
  const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
577
575
  const proposeTxArgs = {
578
576
  header: proposedBlockHeader,
@@ -580,8 +578,8 @@ export class SequencerPublisher {
580
578
  stateReference: block.header.state,
581
579
  body: block.body.toBuffer(),
582
580
  blobs,
583
- attestations,
584
- txHashes: txHashes ?? []
581
+ attestationsAndSigners,
582
+ attestationsAndSignersSignature
585
583
  };
586
584
  let ts;
587
585
  try {
@@ -589,12 +587,8 @@ export class SequencerPublisher {
589
587
  // This means that we can avoid the simulation issues in later checks.
590
588
  // By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
591
589
  // make time consistency checks break.
592
- const attestationData = {
593
- digest: digest.toBuffer(),
594
- attestations: attestations ?? []
595
- };
596
590
  // TODO(palla): Check whether we're validating twice, once here and once within addProposeTx, since we call simulateProposeTx in both places.
597
- ts = await this.validateBlockForSubmission(block, attestationData, opts);
591
+ ts = await this.validateBlockForSubmission(block, attestationsAndSigners, attestationsAndSignersSignature, opts);
598
592
  } catch (err) {
599
593
  this.log.error(`Block validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
600
594
  ...block.getStats(),
@@ -653,8 +647,14 @@ export class SequencerPublisher {
653
647
  timestamp,
654
648
  gasLimit: undefined
655
649
  };
650
+ if (this.lastActions[action] && this.lastActions[action] === slotNumber) {
651
+ this.log.debug(`Skipping duplicate action ${action} for slot ${slotNumber}`);
652
+ return false;
653
+ }
654
+ const cachedLastActionSlot = this.lastActions[action];
655
+ this.lastActions[action] = slotNumber;
656
+ this.log.debug(`Simulating ${action} for slot ${slotNumber}`, logData);
656
657
  let gasUsed;
657
- this.log.debug(`Simulating ${action}`, logData);
658
658
  try {
659
659
  ({ gasUsed } = await this.l1TxUtils.simulate(request, {
660
660
  time: timestamp
@@ -687,6 +687,7 @@ export class SequencerPublisher {
687
687
  ...result,
688
688
  ...logData
689
689
  });
690
+ this.lastActions[action] = cachedLastActionSlot;
690
691
  } else {
691
692
  this.log.info(`Action ${action} at ${slotNumber} succeeded`, {
692
693
  ...result,
@@ -736,9 +737,7 @@ export class SequencerPublisher {
736
737
  });
737
738
  throw new Error('Failed to validate blobs');
738
739
  });
739
- const attestations = encodedData.attestations ? encodedData.attestations.map((attest)=>attest.toViem()) : [];
740
- const txHashes = encodedData.txHashes ? encodedData.txHashes.map((txHash)=>txHash.toString()) : [];
741
- const signers = encodedData.attestations?.filter((attest)=>!attest.signature.isEmpty()).map((attest)=>attest.address.toString());
740
+ const signers = encodedData.attestationsAndSigners.getSigners().map((signer)=>signer.toString());
742
741
  const args = [
743
742
  {
744
743
  header: encodedData.header.toViem(),
@@ -747,11 +746,11 @@ export class SequencerPublisher {
747
746
  oracleInput: {
748
747
  // We are currently not modifying these. See #9963
749
748
  feeAssetPriceModifier: 0n
750
- },
751
- txHashes
749
+ }
752
750
  },
753
- RollupContract.packAttestations(attestations),
754
- signers ?? [],
751
+ encodedData.attestationsAndSigners.getPackedAttestations(),
752
+ signers,
753
+ encodedData.attestationsAndSignersSignature.toViemSignature(),
755
754
  blobInput
756
755
  ];
757
756
  const { rollupData, simulationResult } = await this.simulateProposeTx(args, timestamp, options);