@aztec/sequencer-client 1.2.1 → 2.0.0-nightly.20250814
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.
- package/dest/client/sequencer-client.d.ts +0 -2
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +5 -7
- package/dest/config.d.ts +1 -0
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +27 -0
- package/dest/publisher/index.d.ts +1 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/index.js +1 -1
- package/dest/publisher/sequencer-publisher.d.ts +48 -33
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +272 -114
- package/dest/sequencer/block_builder.d.ts +2 -7
- package/dest/sequencer/block_builder.d.ts.map +1 -1
- package/dest/sequencer/block_builder.js +3 -7
- package/dest/sequencer/sequencer.d.ts +27 -15
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +141 -85
- package/dest/sequencer/timetable.d.ts +15 -5
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +25 -12
- package/dest/sequencer/utils.d.ts +1 -11
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +0 -23
- package/package.json +26 -26
- package/src/client/sequencer-client.ts +4 -8
- package/src/config.ts +33 -0
- package/src/publisher/index.ts +1 -1
- package/src/publisher/sequencer-publisher.ts +318 -131
- package/src/sequencer/block_builder.ts +15 -8
- package/src/sequencer/sequencer.ts +217 -87
- package/src/sequencer/timetable.ts +43 -7
- package/src/sequencer/utils.ts +6 -37
|
@@ -59,8 +59,6 @@ export declare class SequencerClient {
|
|
|
59
59
|
* Stops the sequencer from processing new txs.
|
|
60
60
|
*/
|
|
61
61
|
stop(): Promise<void>;
|
|
62
|
-
/** Forces the sequencer to bypass all time and tx count checks for the next block and build anyway. */
|
|
63
|
-
flush(): void;
|
|
64
62
|
/**
|
|
65
63
|
* Restarts the sequencer after being stopped.
|
|
66
64
|
*/
|
|
@@ -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;AAShD,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,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACrG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE;;GAEG;AACH,qBAAa,eAAe;IAExB,SAAS,CAAC,SAAS,EAAE,SAAS;IAC9B,SAAS,CAAC,eAAe,CAAC,EAAE,eAAe;gBADjC,SAAS,EAAE,SAAS,EACpB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IAAI,QAAQ,IAAI,UAAU,CAEzB;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,IAAI,kBAAkB,IAAI,UAAU,EAAE,GAAG,SAAS,CAEjD;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF"}
|
|
@@ -31,7 +31,7 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
31
31
|
const chain = createEthereumChain(rpcUrls, chainId);
|
|
32
32
|
const log = createLogger('sequencer-client');
|
|
33
33
|
const l1Client = createExtendedL1Client(rpcUrls, publisherPrivateKey.getValue(), chain.chainInfo);
|
|
34
|
-
const l1TxUtils = deps.l1TxUtils ?? new L1TxUtilsWithBlobs(l1Client, log, config);
|
|
34
|
+
const l1TxUtils = deps.l1TxUtils ?? new L1TxUtilsWithBlobs(l1Client, log, deps.dateProvider, config);
|
|
35
35
|
const rollupContract = new RollupContract(l1Client, config.l1Contracts.rollupAddress.toString());
|
|
36
36
|
const [l1GenesisTime, slotDuration] = await Promise.all([
|
|
37
37
|
rollupContract.getL1GenesisTime(),
|
|
@@ -57,7 +57,8 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
57
57
|
rollupContract,
|
|
58
58
|
epochCache,
|
|
59
59
|
governanceProposerContract,
|
|
60
|
-
slashingProposerContract
|
|
60
|
+
slashingProposerContract,
|
|
61
|
+
dateProvider: deps.dateProvider
|
|
61
62
|
});
|
|
62
63
|
const globalsBuilder = new GlobalVariableBuilder(config);
|
|
63
64
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
@@ -67,13 +68,13 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
67
68
|
log.warn(`Provided maxL2BlockGas of ${sequencerManaLimit} is greater than the maximum allowed by the L1 (${rollupManaLimit}), setting limit to ${rollupManaLimit}`);
|
|
68
69
|
sequencerManaLimit = rollupManaLimit;
|
|
69
70
|
}
|
|
70
|
-
// When running in anvil, assume we can post a tx up until
|
|
71
|
+
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
71
72
|
// Otherwise, assume we must have broadcasted the tx before the slot started (we use a default
|
|
72
73
|
// maxL1TxInclusionTimeIntoSlot of zero) to get the tx into that L1 slot.
|
|
73
74
|
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
74
75
|
// make it with a propagation time into slot equal to 4s. However, we prefer being conservative.
|
|
75
76
|
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
76
|
-
const maxL1TxInclusionTimeIntoSlot = config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId) ? ethereumSlotDuration : 0;
|
|
77
|
+
const maxL1TxInclusionTimeIntoSlot = config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId) ? ethereumSlotDuration - 1 : 0;
|
|
77
78
|
const l1Constants = {
|
|
78
79
|
l1GenesisTime,
|
|
79
80
|
slotDuration: Number(slotDuration),
|
|
@@ -101,9 +102,6 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
101
102
|
*/ async stop() {
|
|
102
103
|
await this.sequencer.stop();
|
|
103
104
|
}
|
|
104
|
-
/** Forces the sequencer to bypass all time and tx count checks for the next block and build anyway. */ flush() {
|
|
105
|
-
this.sequencer.flush();
|
|
106
|
-
}
|
|
107
105
|
/**
|
|
108
106
|
* Restarts the sequencer after being stopped.
|
|
109
107
|
*/ resume() {
|
package/dest/config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type ValidatorClientConfig } from '@aztec/validator-client';
|
|
|
6
6
|
import { type PublisherConfig, type TxSenderConfig } from './publisher/config.js';
|
|
7
7
|
export * from './publisher/config.js';
|
|
8
8
|
export type { SequencerConfig };
|
|
9
|
+
export declare const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
|
|
9
10
|
/**
|
|
10
11
|
* Configuration settings for the SequencerClient.
|
|
11
12
|
*/
|
package/dest/config.d.ts.map
CHANGED
|
@@ -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,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GACjD,qBAAqB,GACrB,cAAc,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,
|
|
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,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,eAAO,MAAM,oCAAoC,IAAI,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GACjD,qBAAqB,GACrB,cAAc,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,CAQnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -7,6 +7,7 @@ import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
|
7
7
|
import { validatorClientConfigMappings } from '@aztec/validator-client';
|
|
8
8
|
import { getPublisherConfigMappings, getTxSenderConfigMappings } from './publisher/config.js';
|
|
9
9
|
export * from './publisher/config.js';
|
|
10
|
+
export const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
|
|
10
11
|
export const sequencerConfigMappings = {
|
|
11
12
|
transactionPollingIntervalMS: {
|
|
12
13
|
env: 'SEQ_TX_POLLING_INTERVAL_MS',
|
|
@@ -78,6 +79,32 @@ export const sequencerConfigMappings = {
|
|
|
78
79
|
description: 'How many seconds into an L1 slot we can still send a tx and get it mined.',
|
|
79
80
|
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
80
81
|
},
|
|
82
|
+
attestationPropagationTime: {
|
|
83
|
+
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
84
|
+
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
|
|
85
|
+
...numberConfigHelper(DEFAULT_ATTESTATION_PROPAGATION_TIME)
|
|
86
|
+
},
|
|
87
|
+
fakeProcessingDelayPerTxMs: {
|
|
88
|
+
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
89
|
+
},
|
|
90
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: {
|
|
91
|
+
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
|
|
92
|
+
description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, so the committee acts as a fallback.',
|
|
93
|
+
...numberConfigHelper(144)
|
|
94
|
+
},
|
|
95
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
|
|
96
|
+
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
|
|
97
|
+
description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback.',
|
|
98
|
+
...numberConfigHelper(432)
|
|
99
|
+
},
|
|
100
|
+
skipCollectingAttestations: {
|
|
101
|
+
description: 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
|
|
102
|
+
...booleanConfigHelper(false)
|
|
103
|
+
},
|
|
104
|
+
skipInvalidateBlockAsProposer: {
|
|
105
|
+
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
106
|
+
...booleanConfigHelper(false)
|
|
107
|
+
},
|
|
81
108
|
...pickConfigMappings(p2pConfigMappings, [
|
|
82
109
|
'txPublicSetupAllowList'
|
|
83
110
|
])
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SequencerPublisher } from './sequencer-publisher.js';
|
|
1
|
+
export { SequencerPublisher, SignalType } from './sequencer-publisher.js';
|
|
2
2
|
//# 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,MAAM,0BAA0B,CAAC"}
|
|
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"}
|
package/dest/publisher/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SequencerPublisher } from './sequencer-publisher.js';
|
|
1
|
+
export { SequencerPublisher, SignalType } from './sequencer-publisher.js';
|
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
import type { L2Block } from '@aztec/aztec.js';
|
|
2
|
-
import { Blob } from '@aztec/blob-lib';
|
|
3
2
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
4
3
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
5
4
|
import { FormattedViemError, type GasPrice, type GovernanceProposerContract, type L1BlobInputs, type L1ContractsConfig, type L1GasConfig, type L1TxRequest, RollupContract, type SlashingProposerContract, type TransactionStats } from '@aztec/ethereum';
|
|
6
5
|
import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
|
|
7
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
|
-
import {
|
|
7
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
8
|
+
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
|
+
import { CommitteeAttestation, type ValidateBlockResult } from '@aztec/stdlib/block';
|
|
9
10
|
import { type ProposedBlockHeader, TxHash } from '@aztec/stdlib/tx';
|
|
10
11
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
11
|
-
import { type TransactionReceipt } from 'viem';
|
|
12
|
+
import { type TransactionReceipt, type TypedDataDefinition } from 'viem';
|
|
12
13
|
import type { PublisherConfig, TxSenderConfig } from './config.js';
|
|
13
|
-
export declare enum
|
|
14
|
+
export declare enum SignalType {
|
|
14
15
|
GOVERNANCE = 0,
|
|
15
16
|
SLASHING = 1
|
|
16
17
|
}
|
|
17
18
|
type GetSlashPayloadCallBack = (slotNumber: bigint) => Promise<EthAddress | undefined>;
|
|
18
|
-
declare const Actions: readonly ["propose", "governance-
|
|
19
|
+
declare const Actions: readonly ["propose", "governance-signal", "slashing-signal", "invalidate-by-invalid-attestation", "invalidate-by-insufficient-attestations"];
|
|
19
20
|
export type Action = (typeof Actions)[number];
|
|
21
|
+
export type InvalidateBlockRequest = {
|
|
22
|
+
request: L1TxRequest;
|
|
23
|
+
reason: 'invalid-attestation' | 'insufficient-attestations';
|
|
24
|
+
gasUsed: bigint;
|
|
25
|
+
blockNumber: number;
|
|
26
|
+
forcePendingBlockNumber: number;
|
|
27
|
+
};
|
|
20
28
|
interface RequestWithExpiry {
|
|
21
29
|
action: Action;
|
|
22
30
|
request: L1TxRequest;
|
|
23
31
|
lastValidL2Slot: bigint;
|
|
24
32
|
gasConfig?: Pick<L1GasConfig, 'txTimeoutAt' | 'gasLimit'>;
|
|
25
33
|
blobConfig?: L1BlobInputs;
|
|
26
|
-
|
|
34
|
+
checkSuccess: (request: L1TxRequest, result?: {
|
|
27
35
|
receipt: TransactionReceipt;
|
|
28
36
|
gasPrice: GasPrice;
|
|
29
37
|
stats?: TransactionStats;
|
|
30
38
|
errorMsg?: string;
|
|
31
|
-
}) =>
|
|
39
|
+
}) => boolean;
|
|
32
40
|
}
|
|
33
41
|
export declare class SequencerPublisher {
|
|
34
42
|
private config;
|
|
@@ -36,12 +44,10 @@ export declare class SequencerPublisher {
|
|
|
36
44
|
private metrics;
|
|
37
45
|
epochCache: EpochCache;
|
|
38
46
|
protected governanceLog: import("@aztec/foundation/log").Logger;
|
|
39
|
-
protected governanceProposerAddress?: EthAddress;
|
|
40
47
|
private governancePayload;
|
|
41
48
|
protected slashingLog: import("@aztec/foundation/log").Logger;
|
|
42
|
-
protected slashingProposerAddress?: EthAddress;
|
|
43
49
|
private getSlashPayload?;
|
|
44
|
-
private
|
|
50
|
+
private myLastSignals;
|
|
45
51
|
protected log: import("@aztec/foundation/log").Logger;
|
|
46
52
|
protected ethereumSlotDuration: bigint;
|
|
47
53
|
private blobSinkClient;
|
|
@@ -61,6 +67,7 @@ export declare class SequencerPublisher {
|
|
|
61
67
|
slashingProposerContract: SlashingProposerContract;
|
|
62
68
|
governanceProposerContract: GovernanceProposerContract;
|
|
63
69
|
epochCache: EpochCache;
|
|
70
|
+
dateProvider: DateProvider;
|
|
64
71
|
});
|
|
65
72
|
getRollupContract(): RollupContract;
|
|
66
73
|
registerSlashPayloadGetter(callback: GetSlashPayloadCallBack): void;
|
|
@@ -88,8 +95,10 @@ export declare class SequencerPublisher {
|
|
|
88
95
|
errorMsg: string | undefined;
|
|
89
96
|
stats?: undefined;
|
|
90
97
|
};
|
|
91
|
-
expiredActions: ("propose" | "governance-
|
|
92
|
-
|
|
98
|
+
expiredActions: ("propose" | "governance-signal" | "slashing-signal" | "invalidate-by-invalid-attestation" | "invalidate-by-insufficient-attestations")[];
|
|
99
|
+
sentActions: ("propose" | "governance-signal" | "slashing-signal" | "invalidate-by-invalid-attestation" | "invalidate-by-insufficient-attestations")[];
|
|
100
|
+
successfulActions: ("propose" | "governance-signal" | "slashing-signal" | "invalidate-by-invalid-attestation" | "invalidate-by-insufficient-attestations")[];
|
|
101
|
+
failedActions: ("propose" | "governance-signal" | "slashing-signal" | "invalidate-by-invalid-attestation" | "invalidate-by-insufficient-attestations")[];
|
|
93
102
|
} | undefined>;
|
|
94
103
|
private callbackBundledTransactions;
|
|
95
104
|
/**
|
|
@@ -97,7 +106,9 @@ export declare class SequencerPublisher {
|
|
|
97
106
|
* @param tipArchive - The archive to check
|
|
98
107
|
* @returns The slot and block number if it is possible to propose, undefined otherwise
|
|
99
108
|
*/
|
|
100
|
-
canProposeAtNextEthBlock(tipArchive:
|
|
109
|
+
canProposeAtNextEthBlock(tipArchive: Fr, msgSender: EthAddress, opts?: {
|
|
110
|
+
forcePendingBlockNumber?: number;
|
|
111
|
+
}): Promise<{
|
|
101
112
|
slot: bigint;
|
|
102
113
|
blockNumber: bigint;
|
|
103
114
|
timeOfNextL1Slot: bigint;
|
|
@@ -108,7 +119,15 @@ export declare class SequencerPublisher {
|
|
|
108
119
|
* It will throw if the block header is invalid.
|
|
109
120
|
* @param header - The block header to validate
|
|
110
121
|
*/
|
|
111
|
-
validateBlockHeader(header: ProposedBlockHeader
|
|
122
|
+
validateBlockHeader(header: ProposedBlockHeader, opts?: {
|
|
123
|
+
forcePendingBlockNumber: number | undefined;
|
|
124
|
+
}): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Simulate making a call to invalidate a block with invalid attestations. Returns undefined if no need to invalidate.
|
|
127
|
+
* @param block - The block to invalidate and the criteria for invalidation (as returned by the archiver)
|
|
128
|
+
*/
|
|
129
|
+
simulateInvalidateBlock(validationResult: ValidateBlockResult): Promise<InvalidateBlockRequest | undefined>;
|
|
130
|
+
private buildInvalidateBlockRequest;
|
|
112
131
|
/**
|
|
113
132
|
* @notice Will simulate `propose` to make sure that the block is valid for submission
|
|
114
133
|
*
|
|
@@ -118,21 +137,22 @@ export declare class SequencerPublisher {
|
|
|
118
137
|
* @param attestationData - The block's attestation data
|
|
119
138
|
*
|
|
120
139
|
*/
|
|
121
|
-
validateBlockForSubmission(block: L2Block, attestationData
|
|
140
|
+
validateBlockForSubmission(block: L2Block, attestationData: {
|
|
122
141
|
digest: Buffer;
|
|
123
142
|
attestations: CommitteeAttestation[];
|
|
143
|
+
} | undefined, options: {
|
|
144
|
+
forcePendingBlockNumber?: number;
|
|
124
145
|
}): Promise<bigint>;
|
|
125
|
-
|
|
126
|
-
private
|
|
127
|
-
private getVoteConfig;
|
|
146
|
+
private enqueueCastSignalHelper;
|
|
147
|
+
private getSignalConfig;
|
|
128
148
|
/**
|
|
129
|
-
* Enqueues a
|
|
130
|
-
* @param slotNumber - The slot number to cast a
|
|
131
|
-
* @param timestamp - The timestamp of the slot to cast a
|
|
132
|
-
* @param
|
|
133
|
-
* @returns True if the
|
|
149
|
+
* Enqueues a castSignal transaction to cast a signal for a given slot number.
|
|
150
|
+
* @param slotNumber - The slot number to cast a signal for.
|
|
151
|
+
* @param timestamp - The timestamp of the slot to cast a signal for.
|
|
152
|
+
* @param signalType - The type of signal to cast.
|
|
153
|
+
* @returns True if the signal was successfully enqueued, false otherwise.
|
|
134
154
|
*/
|
|
135
|
-
|
|
155
|
+
enqueueCastSignal(slotNumber: bigint, timestamp: bigint, signalType: SignalType, signerAddress: EthAddress, signer: (msg: TypedDataDefinition) => Promise<`0x${string}`>): Promise<boolean>;
|
|
136
156
|
/**
|
|
137
157
|
* Proposes a L2 block on L1.
|
|
138
158
|
*
|
|
@@ -141,7 +161,11 @@ export declare class SequencerPublisher {
|
|
|
141
161
|
*/
|
|
142
162
|
enqueueProposeL2Block(block: L2Block, attestations?: CommitteeAttestation[], txHashes?: TxHash[], opts?: {
|
|
143
163
|
txTimeoutAt?: Date;
|
|
164
|
+
forcePendingBlockNumber?: number;
|
|
144
165
|
}): Promise<boolean>;
|
|
166
|
+
enqueueInvalidateBlock(request: InvalidateBlockRequest | undefined, opts?: {
|
|
167
|
+
txTimeoutAt?: Date;
|
|
168
|
+
}): void;
|
|
145
169
|
/**
|
|
146
170
|
* Calling `interrupt` will cause any in progress call to `publishRollup` to return `false` asap.
|
|
147
171
|
* Be warned, the call may return false even if the tx subsequently gets successfully mined.
|
|
@@ -160,15 +184,6 @@ export declare class SequencerPublisher {
|
|
|
160
184
|
*/
|
|
161
185
|
private simulateProposeTx;
|
|
162
186
|
private addProposeTx;
|
|
163
|
-
/**
|
|
164
|
-
* Send blobs to the blob sink
|
|
165
|
-
*
|
|
166
|
-
* If a blob sink url is configured, then we send blobs to the blob sink
|
|
167
|
-
* - for now we use the blockHash as the identifier for the blobs;
|
|
168
|
-
* In the future this will move to be the beacon block id - which takes a bit more work
|
|
169
|
-
* to calculate and will need to be mocked in e2e tests
|
|
170
|
-
*/
|
|
171
|
-
protected sendBlobsToBlobSink(blockHash: string, blobs: Blob[]): Promise<boolean>;
|
|
172
187
|
}
|
|
173
188
|
export {};
|
|
174
189
|
//# sourceMappingURL=sequencer-publisher.d.ts.map
|
|
@@ -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;
|
|
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,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EAMtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAS,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAGrF,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,KAAK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