@aztec/sequencer-client 0.0.1-commit.b655e406 → 0.0.1-commit.c0b82b2
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/index.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts +21 -16
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +45 -26
- package/dest/config.d.ts +14 -8
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +90 -33
- package/dest/global_variable_builder/global_builder.d.ts +20 -16
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +52 -39
- package/dest/global_variable_builder/index.d.ts +1 -1
- package/dest/index.d.ts +2 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -2
- package/dest/publisher/config.d.ts +43 -20
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +109 -34
- package/dest/publisher/index.d.ts +2 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
- package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +59 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +1 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +34 -0
- package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
- package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/index.js +2 -0
- package/dest/publisher/sequencer-publisher-factory.d.ts +15 -6
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +14 -3
- package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +23 -86
- package/dest/publisher/sequencer-publisher.d.ts +95 -67
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +935 -182
- package/dest/sequencer/checkpoint_proposal_job.d.ts +102 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_proposal_job.js +1219 -0
- package/dest/sequencer/checkpoint_voter.d.ts +35 -0
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_voter.js +109 -0
- package/dest/sequencer/config.d.ts +3 -2
- package/dest/sequencer/config.d.ts.map +1 -1
- package/dest/sequencer/errors.d.ts +1 -1
- package/dest/sequencer/errors.d.ts.map +1 -1
- package/dest/sequencer/events.d.ts +46 -0
- package/dest/sequencer/events.d.ts.map +1 -0
- package/dest/sequencer/events.js +1 -0
- package/dest/sequencer/index.d.ts +4 -2
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +3 -1
- package/dest/sequencer/metrics.d.ts +44 -3
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +232 -50
- package/dest/sequencer/sequencer.d.ts +122 -144
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +736 -521
- package/dest/sequencer/timetable.d.ts +51 -14
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +145 -59
- package/dest/sequencer/types.d.ts +3 -0
- package/dest/sequencer/types.d.ts.map +1 -0
- package/dest/sequencer/types.js +1 -0
- package/dest/sequencer/utils.d.ts +14 -8
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +7 -4
- package/dest/test/index.d.ts +6 -7
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.d.ts +97 -0
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
- package/dest/test/mock_checkpoint_builder.js +222 -0
- package/dest/test/utils.d.ts +53 -0
- package/dest/test/utils.d.ts.map +1 -0
- package/dest/test/utils.js +104 -0
- package/package.json +33 -30
- package/src/client/sequencer-client.ts +54 -47
- package/src/config.ts +103 -42
- package/src/global_variable_builder/global_builder.ts +67 -59
- package/src/index.ts +1 -7
- package/src/publisher/config.ts +139 -50
- package/src/publisher/index.ts +3 -0
- package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
- package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +55 -0
- package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +46 -0
- package/src/publisher/l1_tx_failed_store/index.ts +3 -0
- package/src/publisher/sequencer-publisher-factory.ts +30 -11
- package/src/publisher/sequencer-publisher-metrics.ts +19 -71
- package/src/publisher/sequencer-publisher.ts +633 -234
- package/src/sequencer/README.md +531 -0
- package/src/sequencer/checkpoint_proposal_job.ts +926 -0
- package/src/sequencer/checkpoint_voter.ts +130 -0
- package/src/sequencer/config.ts +2 -1
- package/src/sequencer/events.ts +27 -0
- package/src/sequencer/index.ts +3 -1
- package/src/sequencer/metrics.ts +296 -61
- package/src/sequencer/sequencer.ts +488 -711
- package/src/sequencer/timetable.ts +175 -80
- package/src/sequencer/types.ts +6 -0
- package/src/sequencer/utils.ts +18 -9
- package/src/test/index.ts +5 -6
- package/src/test/mock_checkpoint_builder.ts +320 -0
- package/src/test/utils.ts +167 -0
- package/dest/sequencer/block_builder.d.ts +0 -27
- package/dest/sequencer/block_builder.d.ts.map +0 -1
- package/dest/sequencer/block_builder.js +0 -130
- package/dest/tx_validator/nullifier_cache.d.ts +0 -14
- package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
- package/dest/tx_validator/nullifier_cache.js +0 -24
- package/dest/tx_validator/tx_validator_factory.d.ts +0 -17
- package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
- package/dest/tx_validator/tx_validator_factory.js +0 -53
- package/src/sequencer/block_builder.ts +0 -218
- package/src/tx_validator/nullifier_cache.ts +0 -30
- package/src/tx_validator/tx_validator_factory.ts +0 -132
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
2
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
3
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
5
|
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
+
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
4
7
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
5
8
|
import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
6
9
|
import { createPublicClient, fallback, http } from 'viem';
|
|
@@ -8,77 +11,87 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
8
11
|
* Simple global variables builder.
|
|
9
12
|
*/ export class GlobalVariableBuilder {
|
|
10
13
|
log = createLogger('sequencer:global_variable_builder');
|
|
11
|
-
|
|
14
|
+
currentMinFees = Promise.resolve(new GasFees(0, 0));
|
|
12
15
|
currentL1BlockNumber = undefined;
|
|
13
16
|
rollupContract;
|
|
14
17
|
publicClient;
|
|
15
18
|
ethereumSlotDuration;
|
|
19
|
+
aztecSlotDuration;
|
|
20
|
+
l1GenesisTime;
|
|
16
21
|
chainId;
|
|
17
22
|
version;
|
|
18
23
|
constructor(config){
|
|
19
24
|
const { l1RpcUrls, l1ChainId: chainId, l1Contracts } = config;
|
|
20
25
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
26
|
+
this.version = new Fr(config.rollupVersion);
|
|
27
|
+
this.chainId = new Fr(chainId);
|
|
21
28
|
this.ethereumSlotDuration = config.ethereumSlotDuration;
|
|
29
|
+
this.aztecSlotDuration = config.slotDuration;
|
|
30
|
+
this.l1GenesisTime = config.l1GenesisTime;
|
|
22
31
|
this.publicClient = createPublicClient({
|
|
23
32
|
chain: chain.chainInfo,
|
|
24
|
-
transport: fallback(chain.rpcUrls.map((url)=>http(url
|
|
33
|
+
transport: fallback(chain.rpcUrls.map((url)=>http(url, {
|
|
34
|
+
batch: false
|
|
35
|
+
}))),
|
|
25
36
|
pollingInterval: config.viemPollingIntervalMS
|
|
26
37
|
});
|
|
27
38
|
this.rollupContract = new RollupContract(this.publicClient, l1Contracts.rollupAddress);
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
30
|
-
* Computes the "current"
|
|
31
|
-
* @returns
|
|
32
|
-
*/ async
|
|
41
|
+
* Computes the "current" min fees, e.g., the price that you currently should pay to get include in the next block
|
|
42
|
+
* @returns Min fees for the next block
|
|
43
|
+
*/ async computeCurrentMinFees() {
|
|
33
44
|
// Since this might be called in the middle of a slot where a block might have been published,
|
|
34
45
|
// we need to fetch the last block written, and estimate the earliest timestamp for the next block.
|
|
35
46
|
// The timestamp of that last block will act as a lower bound for the next block.
|
|
36
|
-
const
|
|
37
|
-
const earliestTimestamp = await this.rollupContract.getTimestampForSlot(
|
|
47
|
+
const lastCheckpoint = await this.rollupContract.getPendingCheckpoint();
|
|
48
|
+
const earliestTimestamp = await this.rollupContract.getTimestampForSlot(SlotNumber.fromBigInt(BigInt(lastCheckpoint.slotNumber) + 1n));
|
|
38
49
|
const nextEthTimestamp = BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration));
|
|
39
50
|
const timestamp = earliestTimestamp > nextEthTimestamp ? earliestTimestamp : nextEthTimestamp;
|
|
40
|
-
return new GasFees(0, await this.rollupContract.
|
|
51
|
+
return new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true));
|
|
41
52
|
}
|
|
42
|
-
async
|
|
53
|
+
async getCurrentMinFees() {
|
|
43
54
|
// Get the current block number
|
|
44
55
|
const blockNumber = await this.publicClient.getBlockNumber();
|
|
45
|
-
// If the L1 block number has changed then chain a new promise to get the current
|
|
56
|
+
// If the L1 block number has changed then chain a new promise to get the current min fees
|
|
46
57
|
if (this.currentL1BlockNumber === undefined || blockNumber > this.currentL1BlockNumber) {
|
|
47
58
|
this.currentL1BlockNumber = blockNumber;
|
|
48
|
-
this.
|
|
59
|
+
this.currentMinFees = this.currentMinFees.then(()=>this.computeCurrentMinFees());
|
|
49
60
|
}
|
|
50
|
-
return this.
|
|
51
|
-
}
|
|
52
|
-
async getGlobalConstantVariables() {
|
|
53
|
-
if (!this.chainId) {
|
|
54
|
-
this.chainId = new Fr(this.publicClient.chain.id);
|
|
55
|
-
}
|
|
56
|
-
if (!this.version) {
|
|
57
|
-
this.version = new Fr(await this.rollupContract.getVersion());
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
chainId: this.chainId,
|
|
61
|
-
version: this.version
|
|
62
|
-
};
|
|
61
|
+
return this.currentMinFees;
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
|
-
* Simple builder of global variables
|
|
64
|
+
* Simple builder of global variables.
|
|
66
65
|
* @param blockNumber - The block number to build global variables for.
|
|
67
66
|
* @param coinbase - The address to receive block reward.
|
|
68
67
|
* @param feeRecipient - The address to receive fees.
|
|
69
68
|
* @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
|
|
70
69
|
* @returns The global variables for the given block number.
|
|
71
|
-
*/ async buildGlobalVariables(blockNumber, coinbase, feeRecipient,
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
70
|
+
*/ async buildGlobalVariables(blockNumber, coinbase, feeRecipient, maybeSlot) {
|
|
71
|
+
const slot = maybeSlot ?? await this.rollupContract.getSlotAt(BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration)));
|
|
72
|
+
const checkpointGlobalVariables = await this.buildCheckpointGlobalVariables(coinbase, feeRecipient, slot);
|
|
73
|
+
return GlobalVariables.from({
|
|
74
|
+
blockNumber,
|
|
75
|
+
...checkpointGlobalVariables
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Builds global variables that are constant throughout a checkpoint. */ async buildCheckpointGlobalVariables(coinbase, feeRecipient, slotNumber) {
|
|
79
|
+
const { chainId, version } = this;
|
|
80
|
+
const timestamp = getTimestampForSlot(slotNumber, {
|
|
81
|
+
slotDuration: this.aztecSlotDuration,
|
|
82
|
+
l1GenesisTime: this.l1GenesisTime
|
|
83
|
+
});
|
|
84
|
+
// We can skip much of the logic in getCurrentMinFees since it we already check that we are not within a slot elsewhere.
|
|
85
|
+
// TODO(palla/mbps): Can we use a cached value here?
|
|
86
|
+
const gasFees = new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true));
|
|
87
|
+
return {
|
|
88
|
+
chainId,
|
|
89
|
+
version,
|
|
90
|
+
slotNumber,
|
|
91
|
+
timestamp,
|
|
92
|
+
coinbase,
|
|
93
|
+
feeRecipient,
|
|
94
|
+
gasFees
|
|
95
|
+
};
|
|
83
96
|
}
|
|
84
97
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { GlobalVariableBuilder } from './global_builder.js';
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWxfdmFyaWFibGVfYnVpbGRlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQyJ9
|
package/dest/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './client/index.js';
|
|
2
2
|
export * from './config.js';
|
|
3
3
|
export * from './publisher/index.js';
|
|
4
|
-
export {
|
|
5
|
-
export * from './tx_validator/tx_validator_factory.js';
|
|
4
|
+
export { Sequencer, SequencerState, type SequencerEvents } from './sequencer/index.js';
|
|
6
5
|
export * from './global_variable_builder/index.js';
|
|
7
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsT0FBTyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUl2RixjQUFjLG9DQUFvQyxDQUFDIn0=
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvF,cAAc,oCAAoC,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './client/index.js';
|
|
2
2
|
export * from './config.js';
|
|
3
3
|
export * from './publisher/index.js';
|
|
4
|
-
export {
|
|
5
|
-
export * from './tx_validator/tx_validator_factory.js';
|
|
4
|
+
export { Sequencer, SequencerState } from './sequencer/index.js';
|
|
6
5
|
// Used by the node to simulate public parts of transactions. Should these be moved to a shared library?
|
|
7
6
|
// ISSUE(#9832)
|
|
8
7
|
export * from './global_variable_builder/index.js';
|
|
@@ -1,29 +1,52 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type L1ReaderConfig
|
|
1
|
+
import { type BlobClientConfig } from '@aztec/blob-client/client/config';
|
|
2
|
+
import { type L1ReaderConfig } from '@aztec/ethereum/l1-reader';
|
|
3
|
+
import { type L1TxUtilsConfig } from '@aztec/ethereum/l1-tx-utils/config';
|
|
3
4
|
import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
|
|
4
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
/**
|
|
6
|
-
* The configuration of the rollup transaction publisher.
|
|
7
|
-
*/
|
|
6
|
+
/** Configuration of the transaction publisher. */
|
|
8
7
|
export type TxSenderConfig = L1ReaderConfig & {
|
|
9
|
-
/**
|
|
10
|
-
* The private key to be used by the publisher.
|
|
11
|
-
*/
|
|
8
|
+
/** The private key to be used by the publisher. */
|
|
12
9
|
publisherPrivateKeys?: SecretValue<`0x${string}`>[];
|
|
13
|
-
/**
|
|
14
|
-
* Publisher addresses to be used with a remote signer
|
|
15
|
-
*/
|
|
10
|
+
/** Publisher addresses to be used with a remote signer */
|
|
16
11
|
publisherAddresses?: EthAddress[];
|
|
17
12
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
export type ProverTxSenderConfig = L1ReaderConfig & {
|
|
14
|
+
proverPublisherPrivateKeys?: SecretValue<`0x${string}`>[];
|
|
15
|
+
proverPublisherAddresses?: EthAddress[];
|
|
16
|
+
};
|
|
17
|
+
export type SequencerTxSenderConfig = L1ReaderConfig & {
|
|
18
|
+
sequencerPublisherPrivateKeys?: SecretValue<`0x${string}`>[];
|
|
19
|
+
sequencerPublisherAddresses?: EthAddress[];
|
|
20
|
+
};
|
|
21
|
+
export declare function getTxSenderConfigFromProverConfig(config: ProverTxSenderConfig): TxSenderConfig;
|
|
22
|
+
export declare function getTxSenderConfigFromSequencerConfig(config: SequencerTxSenderConfig): TxSenderConfig;
|
|
23
|
+
/** Configuration of the L1Publisher. */
|
|
24
|
+
export type PublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
|
|
22
25
|
/** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
|
|
23
26
|
publisherAllowInvalidStates?: boolean;
|
|
27
|
+
/** Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1 */
|
|
28
|
+
fishermanMode?: boolean;
|
|
29
|
+
/** Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only) */
|
|
30
|
+
publisherForwarderAddress?: EthAddress;
|
|
31
|
+
/** Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path */
|
|
32
|
+
l1TxFailedStore?: string;
|
|
33
|
+
};
|
|
34
|
+
export type ProverPublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
|
|
35
|
+
fishermanMode?: boolean;
|
|
36
|
+
proverPublisherAllowInvalidStates?: boolean;
|
|
37
|
+
proverPublisherForwarderAddress?: EthAddress;
|
|
38
|
+
};
|
|
39
|
+
export type SequencerPublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
|
|
40
|
+
fishermanMode?: boolean;
|
|
41
|
+
sequencerPublisherAllowInvalidStates?: boolean;
|
|
42
|
+
sequencerPublisherForwarderAddress?: EthAddress;
|
|
43
|
+
/** Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path */
|
|
44
|
+
l1TxFailedStore?: string;
|
|
24
45
|
};
|
|
25
|
-
export declare
|
|
26
|
-
export declare function
|
|
27
|
-
export declare const
|
|
28
|
-
export declare
|
|
29
|
-
|
|
46
|
+
export declare function getPublisherConfigFromProverConfig(config: ProverPublisherConfig): PublisherConfig;
|
|
47
|
+
export declare function getPublisherConfigFromSequencerConfig(config: SequencerPublisherConfig): PublisherConfig;
|
|
48
|
+
export declare const proverTxSenderConfigMappings: ConfigMappingsType<Omit<ProverTxSenderConfig, 'l1Contracts'>>;
|
|
49
|
+
export declare const sequencerTxSenderConfigMappings: ConfigMappingsType<Omit<SequencerTxSenderConfig, 'l1Contracts'>>;
|
|
50
|
+
export declare const sequencerPublisherConfigMappings: ConfigMappingsType<SequencerPublisherConfig & L1TxUtilsConfig>;
|
|
51
|
+
export declare const proverPublisherConfigMappings: ConfigMappingsType<ProverPublisherConfig & L1TxUtilsConfig>;
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGlzaGVyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMkIsTUFBTSxrQ0FBa0MsQ0FBQztBQUNsRyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sMkJBQTJCLENBQUM7QUFDeEYsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUEyQixNQUFNLG9DQUFvQyxDQUFDO0FBQ25HLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUFFLFdBQVcsRUFBdUIsTUFBTSwwQkFBMEIsQ0FBQztBQUNyRyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFM0Qsa0RBQWtEO0FBQ2xELE1BQU0sTUFBTSxjQUFjLEdBQUcsY0FBYyxHQUFHO0lBQzVDLG1EQUFtRDtJQUNuRCxvQkFBb0IsQ0FBQyxFQUFFLFdBQVcsQ0FBQyxLQUFLLE1BQU0sRUFBRSxDQUFDLEVBQUUsQ0FBQztJ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|
+
import { blobClientConfigMapping } from '@aztec/blob-client/client/config';
|
|
2
|
+
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
3
|
+
import { l1TxUtilsConfigMappings } from '@aztec/ethereum/l1-tx-utils/config';
|
|
4
|
+
import { SecretValue, booleanConfigHelper } from '@aztec/foundation/config';
|
|
4
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
defaultValue: [],
|
|
12
|
-
fallback: [
|
|
13
|
-
scope === 'PROVER' ? `PROVER_PUBLISHER_PRIVATE_KEY` : `SEQ_PUBLISHER_PRIVATE_KEY`
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
publisherAddresses: {
|
|
17
|
-
env: scope === 'PROVER' ? `PROVER_PUBLISHER_ADDRESSES` : `SEQ_PUBLISHER_ADDRESSES`,
|
|
18
|
-
description: 'The addresses of the publishers to use with remote signers',
|
|
19
|
-
parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
|
|
20
|
-
defaultValue: []
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export function getTxSenderConfigFromEnv(scope) {
|
|
24
|
-
return getConfigFromMappings(getTxSenderConfigMappings(scope));
|
|
6
|
+
export function getTxSenderConfigFromProverConfig(config) {
|
|
7
|
+
return {
|
|
8
|
+
...config,
|
|
9
|
+
publisherPrivateKeys: config.proverPublisherPrivateKeys,
|
|
10
|
+
publisherAddresses: config.proverPublisherAddresses
|
|
11
|
+
};
|
|
25
12
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...l1TxUtilsConfigMappings,
|
|
33
|
-
...blobSinkConfigMapping
|
|
34
|
-
});
|
|
35
|
-
export function getPublisherConfigFromEnv(scope) {
|
|
36
|
-
return getConfigFromMappings(getPublisherConfigMappings(scope));
|
|
13
|
+
export function getTxSenderConfigFromSequencerConfig(config) {
|
|
14
|
+
return {
|
|
15
|
+
...config,
|
|
16
|
+
publisherPrivateKeys: config.sequencerPublisherPrivateKeys,
|
|
17
|
+
publisherAddresses: config.sequencerPublisherAddresses
|
|
18
|
+
};
|
|
37
19
|
}
|
|
20
|
+
export function getPublisherConfigFromProverConfig(config) {
|
|
21
|
+
return {
|
|
22
|
+
...config,
|
|
23
|
+
publisherAllowInvalidStates: config.proverPublisherAllowInvalidStates,
|
|
24
|
+
publisherForwarderAddress: config.proverPublisherForwarderAddress
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function getPublisherConfigFromSequencerConfig(config) {
|
|
28
|
+
return {
|
|
29
|
+
...config,
|
|
30
|
+
publisherAllowInvalidStates: config.sequencerPublisherAllowInvalidStates,
|
|
31
|
+
publisherForwarderAddress: config.sequencerPublisherForwarderAddress,
|
|
32
|
+
l1TxFailedStore: config.l1TxFailedStore
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export const proverTxSenderConfigMappings = {
|
|
36
|
+
...l1ReaderConfigMappings,
|
|
37
|
+
proverPublisherPrivateKeys: {
|
|
38
|
+
env: `PROVER_PUBLISHER_PRIVATE_KEYS`,
|
|
39
|
+
description: 'The private keys to be used by the prover publisher.',
|
|
40
|
+
parseEnv: (val)=>val.split(',').map((key)=>new SecretValue(`0x${key.replace('0x', '')}`)),
|
|
41
|
+
defaultValue: [],
|
|
42
|
+
fallback: [
|
|
43
|
+
`PROVER_PUBLISHER_PRIVATE_KEY`
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
proverPublisherAddresses: {
|
|
47
|
+
env: `PROVER_PUBLISHER_ADDRESSES`,
|
|
48
|
+
description: 'The addresses of the publishers to use with remote signers',
|
|
49
|
+
parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
|
|
50
|
+
defaultValue: []
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export const sequencerTxSenderConfigMappings = {
|
|
54
|
+
...l1ReaderConfigMappings,
|
|
55
|
+
sequencerPublisherPrivateKeys: {
|
|
56
|
+
env: `SEQ_PUBLISHER_PRIVATE_KEYS`,
|
|
57
|
+
description: 'The private keys to be used by the sequencer publisher.',
|
|
58
|
+
parseEnv: (val)=>val.split(',').map((key)=>new SecretValue(`0x${key.replace('0x', '')}`)),
|
|
59
|
+
defaultValue: [],
|
|
60
|
+
fallback: [
|
|
61
|
+
`SEQ_PUBLISHER_PRIVATE_KEY`
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
sequencerPublisherAddresses: {
|
|
65
|
+
env: `SEQ_PUBLISHER_ADDRESSES`,
|
|
66
|
+
description: 'The addresses of the publishers to use with remote signers',
|
|
67
|
+
parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
|
|
68
|
+
defaultValue: []
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export const sequencerPublisherConfigMappings = {
|
|
72
|
+
...l1TxUtilsConfigMappings,
|
|
73
|
+
...blobClientConfigMapping,
|
|
74
|
+
sequencerPublisherAllowInvalidStates: {
|
|
75
|
+
env: `SEQ_PUBLISHER_ALLOW_INVALID_STATES`,
|
|
76
|
+
description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
|
|
77
|
+
...booleanConfigHelper(true)
|
|
78
|
+
},
|
|
79
|
+
fishermanMode: {
|
|
80
|
+
env: 'FISHERMAN_MODE',
|
|
81
|
+
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
82
|
+
...booleanConfigHelper(false)
|
|
83
|
+
},
|
|
84
|
+
sequencerPublisherForwarderAddress: {
|
|
85
|
+
env: `SEQ_PUBLISHER_FORWARDER_ADDRESS`,
|
|
86
|
+
description: 'Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only)',
|
|
87
|
+
parseEnv: (val)=>val ? EthAddress.fromString(val) : undefined
|
|
88
|
+
},
|
|
89
|
+
l1TxFailedStore: {
|
|
90
|
+
env: 'L1_TX_FAILED_STORE',
|
|
91
|
+
description: 'Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
export const proverPublisherConfigMappings = {
|
|
95
|
+
...l1TxUtilsConfigMappings,
|
|
96
|
+
...blobClientConfigMapping,
|
|
97
|
+
proverPublisherAllowInvalidStates: {
|
|
98
|
+
env: `PROVER_PUBLISHER_ALLOW_INVALID_STATES`,
|
|
99
|
+
description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
|
|
100
|
+
...booleanConfigHelper(true)
|
|
101
|
+
},
|
|
102
|
+
fishermanMode: {
|
|
103
|
+
env: 'FISHERMAN_MODE',
|
|
104
|
+
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
105
|
+
...booleanConfigHelper(false)
|
|
106
|
+
},
|
|
107
|
+
proverPublisherForwarderAddress: {
|
|
108
|
+
env: `PROVER_PUBLISHER_FORWARDER_ADDRESS`,
|
|
109
|
+
description: 'Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only)',
|
|
110
|
+
parseEnv: (val)=>val ? EthAddress.fromString(val) : undefined
|
|
111
|
+
}
|
|
112
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
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
|
+
export { type FailedL1Tx, type FailedL1TxUri, type L1TxFailedStore } from './l1_tx_failed_store/index.js';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaXNoZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDOUQsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFHN0UsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFHN0UsT0FBTyxFQUFFLEtBQUssVUFBVSxFQUFFLEtBQUssYUFBYSxFQUFFLEtBQUssZUFBZSxFQUFFLE1BQU0sK0JBQStCLENBQUMifQ==
|
|
@@ -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;AAC9D,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;AAG7E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import type { L1TxFailedStore } from './failed_tx_store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an L1TxFailedStore from a config string.
|
|
5
|
+
* Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
|
|
6
|
+
* @param config - Config string (e.g., 'gs://bucket/path', 's3://bucket/path', 'file:///path'). If undefined, returns undefined.
|
|
7
|
+
* @param logger - Optional logger.
|
|
8
|
+
* @returns The store instance, or undefined if config is not provided.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createL1TxFailedStore(config: string | undefined, logger?: Logger): Promise<L1TxFailedStore | undefined>;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3B1Ymxpc2hlci9sMV90eF9mYWlsZWRfc3RvcmUvZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFHbEUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFHNUQ7Ozs7OztHQU1HO0FBQ0gsd0JBQXNCLHFCQUFxQixDQUN6QyxNQUFNLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFDMUIsTUFBTSxHQUFFLE1BQXFELEdBQzVELE9BQU8sQ0FBQyxlQUFlLEdBQUcsU0FBUyxDQUFDLENBZXRDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/publisher/l1_tx_failed_store/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,GAAE,MAAqD,GAC5D,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAetC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { createFileStore } from '@aztec/stdlib/file-store';
|
|
3
|
+
import { FileStoreL1TxFailedStore } from './file_store_failed_tx_store.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates an L1TxFailedStore from a config string.
|
|
6
|
+
* Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
|
|
7
|
+
* @param config - Config string (e.g., 'gs://bucket/path', 's3://bucket/path', 'file:///path'). If undefined, returns undefined.
|
|
8
|
+
* @param logger - Optional logger.
|
|
9
|
+
* @returns The store instance, or undefined if config is not provided.
|
|
10
|
+
*/ export async function createL1TxFailedStore(config, logger = createLogger('sequencer:l1-tx-failed-store')) {
|
|
11
|
+
if (!config) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const fileStore = await createFileStore(config, logger);
|
|
15
|
+
if (!fileStore) {
|
|
16
|
+
throw new Error(`Failed to create file store from config: '${config}'. ` + `Supported formats: 'gs://bucket/path', 's3://bucket/path', 'file:///path'.`);
|
|
17
|
+
}
|
|
18
|
+
logger.info(`Created L1 tx failed store`, {
|
|
19
|
+
config
|
|
20
|
+
});
|
|
21
|
+
return new FileStoreL1TxFailedStore(fileStore, logger);
|
|
22
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
/** URI pointing to a stored failed L1 transaction. */
|
|
3
|
+
export type FailedL1TxUri = string & {
|
|
4
|
+
__brand: 'FailedL1TxUri';
|
|
5
|
+
};
|
|
6
|
+
/** A failed L1 transaction captured for debugging and replay. */
|
|
7
|
+
export type FailedL1Tx = {
|
|
8
|
+
/** Tx hash (for reverts) or keccak256(request.data) (for simulation/send failures). */
|
|
9
|
+
id: Hex;
|
|
10
|
+
/** Unix timestamp (ms) when failure occurred. */
|
|
11
|
+
timestamp: number;
|
|
12
|
+
/** Whether the failure was during simulation or after sending. */
|
|
13
|
+
failureType: 'simulation' | 'revert' | 'send-error';
|
|
14
|
+
/** The actual L1 transaction for replay (multicall-encoded for bundled txs). */
|
|
15
|
+
request: {
|
|
16
|
+
to: Hex;
|
|
17
|
+
data: Hex;
|
|
18
|
+
value?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Raw blob data as hex for replay. */
|
|
21
|
+
blobData?: Hex[];
|
|
22
|
+
/** L1 block number at time of failure (simulation target or receipt block). */
|
|
23
|
+
l1BlockNumber: string;
|
|
24
|
+
/** Receipt info (present only for on-chain reverts). */
|
|
25
|
+
receipt?: {
|
|
26
|
+
transactionHash: Hex;
|
|
27
|
+
blockNumber: string;
|
|
28
|
+
gasUsed: string;
|
|
29
|
+
status: 'reverted';
|
|
30
|
+
};
|
|
31
|
+
/** Error information. */
|
|
32
|
+
error: {
|
|
33
|
+
message: string;
|
|
34
|
+
/** Decoded error name (e.g., 'Rollup__InvalidProposer'). */
|
|
35
|
+
name?: string;
|
|
36
|
+
};
|
|
37
|
+
/** Context metadata. */
|
|
38
|
+
context: {
|
|
39
|
+
/** Actions involved (e.g., ['propose', 'governance-signal']). */
|
|
40
|
+
actions: string[];
|
|
41
|
+
/** Individual request data for each action (metadata, not used for replay). */
|
|
42
|
+
requests?: Array<{
|
|
43
|
+
action: string;
|
|
44
|
+
to: Hex;
|
|
45
|
+
data: Hex;
|
|
46
|
+
}>;
|
|
47
|
+
checkpointNumber?: number;
|
|
48
|
+
slot?: number;
|
|
49
|
+
sender: Hex;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** Store for failed L1 transactions for debugging purposes. */
|
|
53
|
+
export interface L1TxFailedStore {
|
|
54
|
+
/** Saves a failed transaction and returns its URI. */
|
|
55
|
+
saveFailedTx(tx: FailedL1Tx): Promise<FailedL1TxUri>;
|
|
56
|
+
/** Retrieves a failed transaction by its URI. */
|
|
57
|
+
getFailedTx(uri: FailedL1TxUri): Promise<FailedL1Tx>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFpbGVkX3R4X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C,aAAa,CAAC,CAAC;IACrD,iDAAiD;IACjD,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** Store for failed L1 transactions for debugging purposes. */ export { };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import type { FileStore } from '@aztec/stdlib/file-store';
|
|
3
|
+
import type { FailedL1Tx, FailedL1TxUri, L1TxFailedStore } from './failed_tx_store.js';
|
|
4
|
+
/**
|
|
5
|
+
* L1TxFailedStore implementation using the FileStore abstraction.
|
|
6
|
+
* Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
|
|
7
|
+
*/
|
|
8
|
+
export declare class FileStoreL1TxFailedStore implements L1TxFailedStore {
|
|
9
|
+
private readonly fileStore;
|
|
10
|
+
private readonly log;
|
|
11
|
+
constructor(fileStore: FileStore, logger?: Logger);
|
|
12
|
+
saveFailedTx(tx: FailedL1Tx): Promise<FailedL1TxUri>;
|
|
13
|
+
getFailedTx(uri: FailedL1TxUri): Promise<FailedL1Tx>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZV9zdG9yZV9mYWlsZWRfdHhfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaXNoZXIvbDFfdHhfZmFpbGVkX3N0b3JlL2ZpbGVfc3RvcmVfZmFpbGVkX3R4X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNsRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUxRCxPQUFPLE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AAU,CAAC,CAGhE;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
/**
|
|
3
|
+
* L1TxFailedStore implementation using the FileStore abstraction.
|
|
4
|
+
* Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
|
|
5
|
+
*/ export class FileStoreL1TxFailedStore {
|
|
6
|
+
fileStore;
|
|
7
|
+
log;
|
|
8
|
+
constructor(fileStore, logger){
|
|
9
|
+
this.fileStore = fileStore;
|
|
10
|
+
this.log = logger ?? createLogger('sequencer:l1-tx-failed-store');
|
|
11
|
+
}
|
|
12
|
+
async saveFailedTx(tx) {
|
|
13
|
+
const prefix = tx.receipt ? 'tx' : 'data';
|
|
14
|
+
const path = `${tx.failureType}/${prefix}-${tx.id}.json`;
|
|
15
|
+
const json = JSON.stringify(tx, null, 2);
|
|
16
|
+
const uri = await this.fileStore.save(path, Buffer.from(json), {
|
|
17
|
+
metadata: {
|
|
18
|
+
'content-type': 'application/json',
|
|
19
|
+
actions: tx.context.actions.join(','),
|
|
20
|
+
'failure-type': tx.failureType
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
this.log.info(`Saved failed L1 tx to ${uri}`, {
|
|
24
|
+
id: tx.id,
|
|
25
|
+
failureType: tx.failureType,
|
|
26
|
+
actions: tx.context.actions.join(',')
|
|
27
|
+
});
|
|
28
|
+
return uri;
|
|
29
|
+
}
|
|
30
|
+
async getFailedTx(uri) {
|
|
31
|
+
const data = await this.fileStore.read(uri);
|
|
32
|
+
return JSON.parse(data.toString());
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type FailedL1Tx, type FailedL1TxUri, type L1TxFailedStore } from './failed_tx_store.js';
|
|
2
|
+
export { createL1TxFailedStore } from './factory.js';
|
|
3
|
+
export { FileStoreL1TxFailedStore } from './file_store_failed_tx_store.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaXNoZXIvbDFfdHhfZmFpbGVkX3N0b3JlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLFVBQVUsRUFBRSxLQUFLLGFBQWEsRUFBRSxLQUFLLGVBQWUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ2pHLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUNyRCxPQUFPLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/publisher/l1_tx_failed_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|