@aztec/sequencer-client 0.0.1-commit.7d4e6cd → 0.0.1-commit.9372f48
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.js +1 -1
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +1 -3
- package/dest/global_variable_builder/global_builder.js +2 -2
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +12 -4
- package/dest/publisher/sequencer-publisher.d.ts +1 -2
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +39 -18
- package/dest/sequencer/checkpoint_proposal_job.d.ts +28 -9
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +134 -31
- package/dest/sequencer/checkpoint_voter.d.ts +3 -2
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_voter.js +34 -10
- package/dest/sequencer/index.d.ts +1 -2
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +0 -1
- package/dest/sequencer/metrics.d.ts +2 -2
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +27 -17
- package/dest/sequencer/sequencer.d.ts +17 -9
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +67 -11
- package/dest/test/mock_checkpoint_builder.d.ts +17 -13
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.js +28 -10
- package/dest/test/utils.d.ts +8 -8
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +7 -7
- package/package.json +30 -28
- package/src/client/sequencer-client.ts +1 -1
- package/src/config.ts +1 -3
- package/src/global_variable_builder/global_builder.ts +2 -2
- package/src/index.ts +1 -6
- package/src/publisher/sequencer-publisher-metrics.ts +7 -3
- package/src/publisher/sequencer-publisher.ts +34 -18
- package/src/sequencer/checkpoint_proposal_job.ts +183 -51
- package/src/sequencer/checkpoint_voter.ts +32 -7
- package/src/sequencer/index.ts +0 -1
- package/src/sequencer/metrics.ts +36 -18
- package/src/sequencer/sequencer.ts +82 -10
- package/src/test/mock_checkpoint_builder.ts +64 -34
- package/src/test/utils.ts +19 -12
- package/dest/sequencer/block_builder.d.ts +0 -26
- package/dest/sequencer/block_builder.d.ts.map +0 -1
- package/dest/sequencer/block_builder.js +0 -129
- package/src/sequencer/block_builder.ts +0 -216
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
2
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
-
import { merge, pick } from '@aztec/foundation/collection';
|
|
4
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
6
|
-
import { bufferToHex } from '@aztec/foundation/string';
|
|
7
|
-
import { Timer, elapsed } from '@aztec/foundation/timer';
|
|
8
|
-
import { getDefaultAllowedSetupFunctions } from '@aztec/p2p/msg_validators';
|
|
9
|
-
import { LightweightBlockFactory } from '@aztec/prover-client/block-factory';
|
|
10
|
-
import { GuardedMerkleTreeOperations, PublicContractsDB, PublicProcessor, createPublicTxSimulatorForBlockBuilding } from '@aztec/simulator/server';
|
|
11
|
-
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
12
|
-
import { Gas } from '@aztec/stdlib/gas';
|
|
13
|
-
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
14
|
-
import { createValidatorForBlockBuilding } from '@aztec/validator-client';
|
|
15
|
-
const log = createLogger('block-builder');
|
|
16
|
-
/** Builds a block out of pending txs */ async function buildBlock(pendingTxs, l1ToL2Messages, newGlobalVariables, opts = {}, worldStateFork, processor, validator, l1Constants, dateProvider, telemetryClient = getTelemetryClient()) {
|
|
17
|
-
const blockBuildingTimer = new Timer();
|
|
18
|
-
const blockNumber = newGlobalVariables.blockNumber;
|
|
19
|
-
const slot = newGlobalVariables.slotNumber;
|
|
20
|
-
const msgCount = l1ToL2Messages.length;
|
|
21
|
-
const stateReference = await worldStateFork.getStateReference();
|
|
22
|
-
const archiveTree = await worldStateFork.getTreeInfo(MerkleTreeId.ARCHIVE);
|
|
23
|
-
log.verbose(`Building block ${blockNumber} for slot ${slot}`, {
|
|
24
|
-
slot,
|
|
25
|
-
slotStart: new Date(Number(getTimestampForSlot(slot, l1Constants)) * 1000),
|
|
26
|
-
now: new Date(dateProvider.now()),
|
|
27
|
-
blockNumber,
|
|
28
|
-
msgCount,
|
|
29
|
-
initialStateReference: stateReference.toInspect(),
|
|
30
|
-
initialArchiveRoot: bufferToHex(archiveTree.root),
|
|
31
|
-
opts
|
|
32
|
-
});
|
|
33
|
-
const blockFactory = new LightweightBlockFactory(worldStateFork, telemetryClient);
|
|
34
|
-
await blockFactory.startNewBlock(newGlobalVariables, l1ToL2Messages);
|
|
35
|
-
const [publicProcessorDuration, [processedTxs, failedTxs, usedTxs]] = await elapsed(()=>processor.process(pendingTxs, opts, validator));
|
|
36
|
-
// All real transactions have been added, set the block as full and pad if needed
|
|
37
|
-
await blockFactory.addTxs(processedTxs);
|
|
38
|
-
const block = await blockFactory.setBlockCompleted();
|
|
39
|
-
// How much public gas was processed
|
|
40
|
-
const publicGas = processedTxs.reduce((acc, tx)=>acc.add(tx.gasUsed.publicGas), Gas.empty());
|
|
41
|
-
const res = {
|
|
42
|
-
block,
|
|
43
|
-
publicGas,
|
|
44
|
-
publicProcessorDuration,
|
|
45
|
-
numMsgs: l1ToL2Messages.length,
|
|
46
|
-
numTxs: processedTxs.length,
|
|
47
|
-
failedTxs: failedTxs,
|
|
48
|
-
blockBuildingTimer,
|
|
49
|
-
usedTxs
|
|
50
|
-
};
|
|
51
|
-
log.trace('Built block', res.block.header);
|
|
52
|
-
return res;
|
|
53
|
-
}
|
|
54
|
-
const FullNodeBlockBuilderConfigKeys = [
|
|
55
|
-
'l1GenesisTime',
|
|
56
|
-
'slotDuration',
|
|
57
|
-
'l1ChainId',
|
|
58
|
-
'rollupVersion',
|
|
59
|
-
'txPublicSetupAllowList',
|
|
60
|
-
'fakeProcessingDelayPerTxMs',
|
|
61
|
-
'fakeThrowAfterProcessingTxCount'
|
|
62
|
-
];
|
|
63
|
-
// TODO(palla/mbps): Try killing this in favor of the CheckpointsBuilder
|
|
64
|
-
export class FullNodeBlockBuilder {
|
|
65
|
-
config;
|
|
66
|
-
worldState;
|
|
67
|
-
contractDataSource;
|
|
68
|
-
dateProvider;
|
|
69
|
-
telemetryClient;
|
|
70
|
-
constructor(config, worldState, contractDataSource, dateProvider, telemetryClient = getTelemetryClient()){
|
|
71
|
-
this.config = config;
|
|
72
|
-
this.worldState = worldState;
|
|
73
|
-
this.contractDataSource = contractDataSource;
|
|
74
|
-
this.dateProvider = dateProvider;
|
|
75
|
-
this.telemetryClient = telemetryClient;
|
|
76
|
-
}
|
|
77
|
-
getConfig() {
|
|
78
|
-
return pick(this.config, ...FullNodeBlockBuilderConfigKeys);
|
|
79
|
-
}
|
|
80
|
-
updateConfig(config) {
|
|
81
|
-
this.config = merge(this.config, pick(config, ...FullNodeBlockBuilderConfigKeys));
|
|
82
|
-
}
|
|
83
|
-
async makeBlockBuilderDeps(globalVariables, fork) {
|
|
84
|
-
const txPublicSetupAllowList = this.config.txPublicSetupAllowList ?? await getDefaultAllowedSetupFunctions();
|
|
85
|
-
const contractsDB = new PublicContractsDB(this.contractDataSource);
|
|
86
|
-
const guardedFork = new GuardedMerkleTreeOperations(fork);
|
|
87
|
-
const publicTxSimulator = createPublicTxSimulatorForBlockBuilding(guardedFork, contractsDB, globalVariables, this.telemetryClient);
|
|
88
|
-
const processor = new PublicProcessor(globalVariables, guardedFork, contractsDB, publicTxSimulator, this.dateProvider, this.telemetryClient, undefined, this.config);
|
|
89
|
-
const validator = createValidatorForBlockBuilding(fork, this.contractDataSource, globalVariables, txPublicSetupAllowList);
|
|
90
|
-
return {
|
|
91
|
-
processor,
|
|
92
|
-
validator
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
async syncToPreviousBlock(parentBlockNumber, timeout) {
|
|
96
|
-
await retryUntil(()=>this.worldState.syncImmediate(parentBlockNumber, true).then((syncedTo)=>syncedTo >= parentBlockNumber), 'sync to previous block', timeout, 0.1);
|
|
97
|
-
log.debug(`Synced to previous block ${parentBlockNumber}`);
|
|
98
|
-
}
|
|
99
|
-
async buildBlock(pendingTxs, l1ToL2Messages, globalVariables, opts, suppliedFork) {
|
|
100
|
-
const parentBlockNumber = BlockNumber(globalVariables.blockNumber - 1);
|
|
101
|
-
const syncTimeout = opts.deadline ? (opts.deadline.getTime() - this.dateProvider.now()) / 1000 : undefined;
|
|
102
|
-
await this.syncToPreviousBlock(parentBlockNumber, syncTimeout);
|
|
103
|
-
const fork = suppliedFork ?? await this.worldState.fork(parentBlockNumber);
|
|
104
|
-
try {
|
|
105
|
-
const { processor, validator } = await this.makeBlockBuilderDeps(globalVariables, fork);
|
|
106
|
-
const res = await buildBlock(pendingTxs, l1ToL2Messages, globalVariables, opts, fork, processor, validator, this.config, this.dateProvider, this.telemetryClient);
|
|
107
|
-
return res;
|
|
108
|
-
} finally{
|
|
109
|
-
// If the fork was supplied, we don't close it.
|
|
110
|
-
// Otherwise, we wait a bit to close the fork we just created,
|
|
111
|
-
// since the processor may still be working on a dangling tx
|
|
112
|
-
// which was interrupted due to the processingDeadline being hit.
|
|
113
|
-
if (!suppliedFork) {
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
115
|
-
setTimeout(async ()=>{
|
|
116
|
-
try {
|
|
117
|
-
await fork.close();
|
|
118
|
-
} catch (err) {
|
|
119
|
-
// This can happen if the sequencer is stopped before we hit this timeout.
|
|
120
|
-
log.warn(`Error closing forks for block processing`, err);
|
|
121
|
-
}
|
|
122
|
-
}, 5000);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
getFork(blockNumber) {
|
|
127
|
-
return this.worldState.fork(blockNumber);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
2
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
-
import { merge, pick } from '@aztec/foundation/collection';
|
|
4
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
7
|
-
import { bufferToHex } from '@aztec/foundation/string';
|
|
8
|
-
import { DateProvider, Timer, elapsed } from '@aztec/foundation/timer';
|
|
9
|
-
import { getDefaultAllowedSetupFunctions } from '@aztec/p2p/msg_validators';
|
|
10
|
-
import { LightweightBlockFactory } from '@aztec/prover-client/block-factory';
|
|
11
|
-
import {
|
|
12
|
-
GuardedMerkleTreeOperations,
|
|
13
|
-
PublicContractsDB,
|
|
14
|
-
PublicProcessor,
|
|
15
|
-
createPublicTxSimulatorForBlockBuilding,
|
|
16
|
-
} from '@aztec/simulator/server';
|
|
17
|
-
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
18
|
-
import { type L1RollupConstants, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
19
|
-
import { Gas } from '@aztec/stdlib/gas';
|
|
20
|
-
import type {
|
|
21
|
-
BuildBlockResult,
|
|
22
|
-
FullNodeBlockBuilderConfig,
|
|
23
|
-
IFullNodeBlockBuilder,
|
|
24
|
-
MerkleTreeWriteOperations,
|
|
25
|
-
PublicProcessorLimits,
|
|
26
|
-
PublicProcessorValidator,
|
|
27
|
-
WorldStateSynchronizer,
|
|
28
|
-
} from '@aztec/stdlib/interfaces/server';
|
|
29
|
-
import { GlobalVariables, Tx } from '@aztec/stdlib/tx';
|
|
30
|
-
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
31
|
-
import { createValidatorForBlockBuilding } from '@aztec/validator-client';
|
|
32
|
-
|
|
33
|
-
const log = createLogger('block-builder');
|
|
34
|
-
|
|
35
|
-
/** Builds a block out of pending txs */
|
|
36
|
-
async function buildBlock(
|
|
37
|
-
pendingTxs: Iterable<Tx> | AsyncIterable<Tx>,
|
|
38
|
-
l1ToL2Messages: Fr[],
|
|
39
|
-
newGlobalVariables: GlobalVariables,
|
|
40
|
-
opts: PublicProcessorLimits = {},
|
|
41
|
-
worldStateFork: MerkleTreeWriteOperations,
|
|
42
|
-
processor: PublicProcessor,
|
|
43
|
-
validator: PublicProcessorValidator,
|
|
44
|
-
l1Constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'>,
|
|
45
|
-
dateProvider: DateProvider,
|
|
46
|
-
telemetryClient: TelemetryClient = getTelemetryClient(),
|
|
47
|
-
): Promise<BuildBlockResult> {
|
|
48
|
-
const blockBuildingTimer = new Timer();
|
|
49
|
-
const blockNumber = newGlobalVariables.blockNumber;
|
|
50
|
-
const slot = newGlobalVariables.slotNumber;
|
|
51
|
-
const msgCount = l1ToL2Messages.length;
|
|
52
|
-
const stateReference = await worldStateFork.getStateReference();
|
|
53
|
-
const archiveTree = await worldStateFork.getTreeInfo(MerkleTreeId.ARCHIVE);
|
|
54
|
-
|
|
55
|
-
log.verbose(`Building block ${blockNumber} for slot ${slot}`, {
|
|
56
|
-
slot,
|
|
57
|
-
slotStart: new Date(Number(getTimestampForSlot(slot, l1Constants)) * 1000),
|
|
58
|
-
now: new Date(dateProvider.now()),
|
|
59
|
-
blockNumber,
|
|
60
|
-
msgCount,
|
|
61
|
-
initialStateReference: stateReference.toInspect(),
|
|
62
|
-
initialArchiveRoot: bufferToHex(archiveTree.root),
|
|
63
|
-
opts,
|
|
64
|
-
});
|
|
65
|
-
const blockFactory = new LightweightBlockFactory(worldStateFork, telemetryClient);
|
|
66
|
-
await blockFactory.startNewBlock(newGlobalVariables, l1ToL2Messages);
|
|
67
|
-
|
|
68
|
-
const [publicProcessorDuration, [processedTxs, failedTxs, usedTxs]] = await elapsed(() =>
|
|
69
|
-
processor.process(pendingTxs, opts, validator),
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
// All real transactions have been added, set the block as full and pad if needed
|
|
73
|
-
await blockFactory.addTxs(processedTxs);
|
|
74
|
-
const block = await blockFactory.setBlockCompleted();
|
|
75
|
-
|
|
76
|
-
// How much public gas was processed
|
|
77
|
-
const publicGas = processedTxs.reduce((acc, tx) => acc.add(tx.gasUsed.publicGas), Gas.empty());
|
|
78
|
-
|
|
79
|
-
const res = {
|
|
80
|
-
block,
|
|
81
|
-
publicGas,
|
|
82
|
-
publicProcessorDuration,
|
|
83
|
-
numMsgs: l1ToL2Messages.length,
|
|
84
|
-
numTxs: processedTxs.length,
|
|
85
|
-
failedTxs: failedTxs,
|
|
86
|
-
blockBuildingTimer,
|
|
87
|
-
usedTxs,
|
|
88
|
-
};
|
|
89
|
-
log.trace('Built block', res.block.header);
|
|
90
|
-
return res;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const FullNodeBlockBuilderConfigKeys = [
|
|
94
|
-
'l1GenesisTime',
|
|
95
|
-
'slotDuration',
|
|
96
|
-
'l1ChainId',
|
|
97
|
-
'rollupVersion',
|
|
98
|
-
'txPublicSetupAllowList',
|
|
99
|
-
'fakeProcessingDelayPerTxMs',
|
|
100
|
-
'fakeThrowAfterProcessingTxCount',
|
|
101
|
-
] as const;
|
|
102
|
-
|
|
103
|
-
// TODO(palla/mbps): Try killing this in favor of the CheckpointsBuilder
|
|
104
|
-
export class FullNodeBlockBuilder implements IFullNodeBlockBuilder {
|
|
105
|
-
constructor(
|
|
106
|
-
private config: FullNodeBlockBuilderConfig,
|
|
107
|
-
private worldState: WorldStateSynchronizer,
|
|
108
|
-
private contractDataSource: ContractDataSource,
|
|
109
|
-
private dateProvider: DateProvider,
|
|
110
|
-
private telemetryClient: TelemetryClient = getTelemetryClient(),
|
|
111
|
-
) {}
|
|
112
|
-
|
|
113
|
-
public getConfig(): FullNodeBlockBuilderConfig {
|
|
114
|
-
return pick(this.config, ...FullNodeBlockBuilderConfigKeys);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public updateConfig(config: Partial<FullNodeBlockBuilderConfig>) {
|
|
118
|
-
this.config = merge(this.config, pick(config, ...FullNodeBlockBuilderConfigKeys));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public async makeBlockBuilderDeps(globalVariables: GlobalVariables, fork: MerkleTreeWriteOperations) {
|
|
122
|
-
const txPublicSetupAllowList = this.config.txPublicSetupAllowList ?? (await getDefaultAllowedSetupFunctions());
|
|
123
|
-
const contractsDB = new PublicContractsDB(this.contractDataSource);
|
|
124
|
-
const guardedFork = new GuardedMerkleTreeOperations(fork);
|
|
125
|
-
|
|
126
|
-
const publicTxSimulator = createPublicTxSimulatorForBlockBuilding(
|
|
127
|
-
guardedFork,
|
|
128
|
-
contractsDB,
|
|
129
|
-
globalVariables,
|
|
130
|
-
this.telemetryClient,
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const processor = new PublicProcessor(
|
|
134
|
-
globalVariables,
|
|
135
|
-
guardedFork,
|
|
136
|
-
contractsDB,
|
|
137
|
-
publicTxSimulator,
|
|
138
|
-
this.dateProvider,
|
|
139
|
-
this.telemetryClient,
|
|
140
|
-
undefined,
|
|
141
|
-
this.config,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
const validator = createValidatorForBlockBuilding(
|
|
145
|
-
fork,
|
|
146
|
-
this.contractDataSource,
|
|
147
|
-
globalVariables,
|
|
148
|
-
txPublicSetupAllowList,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
return {
|
|
152
|
-
processor,
|
|
153
|
-
validator,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
private async syncToPreviousBlock(parentBlockNumber: BlockNumber, timeout: number | undefined) {
|
|
158
|
-
await retryUntil(
|
|
159
|
-
() => this.worldState.syncImmediate(parentBlockNumber, true).then(syncedTo => syncedTo >= parentBlockNumber),
|
|
160
|
-
'sync to previous block',
|
|
161
|
-
timeout,
|
|
162
|
-
0.1,
|
|
163
|
-
);
|
|
164
|
-
log.debug(`Synced to previous block ${parentBlockNumber}`);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async buildBlock(
|
|
168
|
-
pendingTxs: Iterable<Tx> | AsyncIterable<Tx>,
|
|
169
|
-
l1ToL2Messages: Fr[],
|
|
170
|
-
globalVariables: GlobalVariables,
|
|
171
|
-
opts: PublicProcessorLimits,
|
|
172
|
-
suppliedFork?: MerkleTreeWriteOperations,
|
|
173
|
-
): Promise<BuildBlockResult> {
|
|
174
|
-
const parentBlockNumber = BlockNumber(globalVariables.blockNumber - 1);
|
|
175
|
-
const syncTimeout = opts.deadline ? (opts.deadline.getTime() - this.dateProvider.now()) / 1000 : undefined;
|
|
176
|
-
await this.syncToPreviousBlock(parentBlockNumber, syncTimeout);
|
|
177
|
-
const fork = suppliedFork ?? (await this.worldState.fork(parentBlockNumber));
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
const { processor, validator } = await this.makeBlockBuilderDeps(globalVariables, fork);
|
|
181
|
-
const res = await buildBlock(
|
|
182
|
-
pendingTxs,
|
|
183
|
-
l1ToL2Messages,
|
|
184
|
-
globalVariables,
|
|
185
|
-
opts,
|
|
186
|
-
fork,
|
|
187
|
-
processor,
|
|
188
|
-
validator,
|
|
189
|
-
this.config,
|
|
190
|
-
this.dateProvider,
|
|
191
|
-
this.telemetryClient,
|
|
192
|
-
);
|
|
193
|
-
return res;
|
|
194
|
-
} finally {
|
|
195
|
-
// If the fork was supplied, we don't close it.
|
|
196
|
-
// Otherwise, we wait a bit to close the fork we just created,
|
|
197
|
-
// since the processor may still be working on a dangling tx
|
|
198
|
-
// which was interrupted due to the processingDeadline being hit.
|
|
199
|
-
if (!suppliedFork) {
|
|
200
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
201
|
-
setTimeout(async () => {
|
|
202
|
-
try {
|
|
203
|
-
await fork.close();
|
|
204
|
-
} catch (err) {
|
|
205
|
-
// This can happen if the sequencer is stopped before we hit this timeout.
|
|
206
|
-
log.warn(`Error closing forks for block processing`, err);
|
|
207
|
-
}
|
|
208
|
-
}, 5000);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
getFork(blockNumber: BlockNumber): Promise<MerkleTreeWriteOperations> {
|
|
214
|
-
return this.worldState.fork(blockNumber);
|
|
215
|
-
}
|
|
216
|
-
}
|