@aztec/stdlib 3.0.0-nightly.20251221 → 3.0.0-nightly.20251223
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/checkpoint/checkpoint.d.ts +15 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +26 -0
- package/dest/checkpoint/checkpoint_info.d.ts +9 -0
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_info.js +1 -0
- package/dest/interfaces/aztec-node-admin.d.ts +19 -7
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/block-builder.d.ts +3 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +9 -1
- package/dest/interfaces/configs.d.ts +35 -13
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +7 -3
- package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +166 -166
- package/dest/interfaces/world_state.d.ts +10 -3
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +8 -2
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +13 -5
- package/dest/messaging/l1_to_l2_message.d.ts +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +2 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +1 -0
- package/dest/rollup/checkpoint_header.d.ts +5 -1
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +4 -1
- package/dest/schemas/schemas.d.ts +3 -1
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +1 -0
- package/dest/stats/stats.d.ts +10 -6
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +4 -2
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +6 -1
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/checkpoint/checkpoint.ts +32 -0
- package/src/checkpoint/checkpoint_info.ts +9 -0
- package/src/interfaces/block-builder.ts +11 -1
- package/src/interfaces/configs.ts +36 -8
- package/src/interfaces/merkle_tree_operations.ts +4 -1
- package/src/interfaces/world_state.ts +7 -2
- package/src/logs/tx_scoped_l2_log.ts +15 -5
- package/src/messaging/l1_to_l2_message.ts +1 -0
- package/src/rollup/checkpoint_constant_data.ts +1 -0
- package/src/rollup/checkpoint_header.ts +4 -0
- package/src/schemas/schemas.ts +3 -0
- package/src/stats/stats.ts +10 -5
- package/src/tx/global_variable_builder.ts +8 -1
- package/src/tx/global_variables.ts +6 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { encodeCheckpointBlobDataFromBlocks } from '@aztec/blob-lib/encoding';
|
|
2
2
|
import { BlockNumber, CheckpointNumber, CheckpointNumberSchema } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { sum } from '@aztec/foundation/collection';
|
|
3
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
5
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
@@ -9,6 +10,7 @@ import { z } from 'zod';
|
|
|
9
10
|
import { L2BlockNew } from '../block/l2_block_new.js';
|
|
10
11
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
11
12
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
13
|
+
import type { CheckpointInfo } from './checkpoint_info.js';
|
|
12
14
|
|
|
13
15
|
export class Checkpoint {
|
|
14
16
|
constructor(
|
|
@@ -68,6 +70,36 @@ export class Checkpoint {
|
|
|
68
70
|
return this.blocks.at(-1)!.header.state;
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
public toCheckpointInfo(): CheckpointInfo {
|
|
74
|
+
return {
|
|
75
|
+
archive: this.archive.root,
|
|
76
|
+
slotNumber: this.header.slotNumber,
|
|
77
|
+
checkpointNumber: this.number,
|
|
78
|
+
timestamp: this.header.timestamp,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Returns stats used for logging */
|
|
83
|
+
public getStats() {
|
|
84
|
+
const txEffects = this.blocks.flatMap(block => block.body.txEffects);
|
|
85
|
+
|
|
86
|
+
const logsStats = {
|
|
87
|
+
privateLogCount: sum(txEffects.map(tx => tx.privateLogs.length)),
|
|
88
|
+
publicLogCount: sum(txEffects.map(tx => tx.publicLogs.length)),
|
|
89
|
+
contractClassLogCount: sum(txEffects.map(tx => tx.contractClassLogs.length)),
|
|
90
|
+
contractClassLogSize: sum(txEffects.map(tx => sum(tx.contractClassLogs.map(log => log.emittedLength)))),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
txCount: txEffects.length,
|
|
95
|
+
blockCount: this.blocks.length,
|
|
96
|
+
slotNumber: this.header.slotNumber,
|
|
97
|
+
checkpointNumber: this.number,
|
|
98
|
+
timestamp: this.header.timestamp,
|
|
99
|
+
...logsStats,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
71
103
|
static async random(
|
|
72
104
|
checkpointNumber = CheckpointNumber(1),
|
|
73
105
|
{
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { Fr, SlotNumber } from '@aztec/foundation/schemas';
|
|
3
|
+
|
|
4
|
+
export type CheckpointInfo = {
|
|
5
|
+
archive: Fr;
|
|
6
|
+
slotNumber: SlotNumber;
|
|
7
|
+
checkpointNumber: CheckpointNumber;
|
|
8
|
+
timestamp: bigint;
|
|
9
|
+
};
|
|
@@ -60,7 +60,17 @@ export interface BuildBlockResult {
|
|
|
60
60
|
|
|
61
61
|
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'> &
|
|
62
62
|
Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
|
|
63
|
-
Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs'>;
|
|
63
|
+
Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs' | 'fakeThrowAfterProcessingTxCount'>;
|
|
64
|
+
|
|
65
|
+
export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[] = [
|
|
66
|
+
'l1GenesisTime',
|
|
67
|
+
'slotDuration',
|
|
68
|
+
'l1ChainId',
|
|
69
|
+
'rollupVersion',
|
|
70
|
+
'txPublicSetupAllowList',
|
|
71
|
+
'fakeProcessingDelayPerTxMs',
|
|
72
|
+
'fakeThrowAfterProcessingTxCount',
|
|
73
|
+
] as const;
|
|
64
74
|
|
|
65
75
|
export interface IFullNodeBlockBuilder {
|
|
66
76
|
getConfig(): FullNodeBlockBuilderConfig;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { Prettify } from '@aztec/foundation/types';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
@@ -6,16 +7,16 @@ import type { AztecAddress } from '../aztec-address/index.js';
|
|
|
6
7
|
import { schemas, zodFor } from '../schemas/index.js';
|
|
7
8
|
import { type AllowedElement, AllowedElementSchema } from './allowed_element.js';
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* The sequencer configuration.
|
|
11
|
-
*/
|
|
10
|
+
/** Sequencer configuration */
|
|
12
11
|
export interface SequencerConfig {
|
|
13
12
|
/** The number of ms to wait between polling for pending txs. */
|
|
14
|
-
|
|
13
|
+
sequencerPollingIntervalMS?: number;
|
|
15
14
|
/** The maximum number of txs to include in a block. */
|
|
16
15
|
maxTxsPerBlock?: number;
|
|
17
16
|
/** The minimum number of txs to include in a block. */
|
|
18
17
|
minTxsPerBlock?: number;
|
|
18
|
+
/** The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock. */
|
|
19
|
+
minValidTxsPerBlock?: number;
|
|
19
20
|
/** Whether to publish txs with the block proposals */
|
|
20
21
|
publishTxsWithProposals?: boolean;
|
|
21
22
|
/** The maximum L2 block gas. */
|
|
@@ -38,10 +39,12 @@ export interface SequencerConfig {
|
|
|
38
39
|
governanceProposerPayload?: EthAddress;
|
|
39
40
|
/** Whether to enforce the time table when building blocks */
|
|
40
41
|
enforceTimeTable?: boolean;
|
|
41
|
-
/** How
|
|
42
|
-
|
|
42
|
+
/** How much time (in seconds) we allow in the slot for publishing the L1 tx. */
|
|
43
|
+
l1PublishingTime?: number;
|
|
43
44
|
/** Used for testing to introduce a fake delay after processing each tx */
|
|
44
45
|
fakeProcessingDelayPerTxMs?: number;
|
|
46
|
+
/** Used for testing to throw an error after processing N txs */
|
|
47
|
+
fakeThrowAfterProcessingTxCount?: number;
|
|
45
48
|
/** How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way) */
|
|
46
49
|
attestationPropagationTime?: number;
|
|
47
50
|
/** How many seconds before invalidating a block as a committee member (zero to never invalidate) */
|
|
@@ -60,12 +63,17 @@ export interface SequencerConfig {
|
|
|
60
63
|
fishermanMode?: boolean;
|
|
61
64
|
/** Shuffle attestation ordering to create invalid ordering (for testing only) */
|
|
62
65
|
shuffleAttestationOrdering?: boolean;
|
|
66
|
+
/** Duration per block in milliseconds when building multiple blocks per slot (default: undefined = single block per slot) */
|
|
67
|
+
blockDurationMs?: number;
|
|
68
|
+
/** Have sequencer build and publish an empty checkpoint if there are no txs */
|
|
69
|
+
buildCheckpointIfEmpty?: boolean;
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
66
73
|
z.object({
|
|
67
|
-
|
|
74
|
+
sequencerPollingIntervalMS: z.number().optional(),
|
|
68
75
|
maxTxsPerBlock: z.number().optional(),
|
|
76
|
+
minValidTxsPerBlock: z.number().optional(),
|
|
69
77
|
minTxsPerBlock: z.number().optional(),
|
|
70
78
|
maxL2BlockGas: z.number().optional(),
|
|
71
79
|
publishTxsWithProposals: z.boolean().optional(),
|
|
@@ -77,9 +85,10 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
77
85
|
txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
|
|
78
86
|
maxBlockSizeInBytes: z.number().optional(),
|
|
79
87
|
governanceProposerPayload: schemas.EthAddress.optional(),
|
|
80
|
-
|
|
88
|
+
l1PublishingTime: z.number().optional(),
|
|
81
89
|
enforceTimeTable: z.boolean().optional(),
|
|
82
90
|
fakeProcessingDelayPerTxMs: z.number().optional(),
|
|
91
|
+
fakeThrowAfterProcessingTxCount: z.number().optional(),
|
|
83
92
|
attestationPropagationTime: z.number().optional(),
|
|
84
93
|
skipCollectingAttestations: z.boolean().optional(),
|
|
85
94
|
skipInvalidateBlockAsProposer: z.boolean().optional(),
|
|
@@ -89,5 +98,24 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
89
98
|
injectFakeAttestation: z.boolean().optional(),
|
|
90
99
|
fishermanMode: z.boolean().optional(),
|
|
91
100
|
shuffleAttestationOrdering: z.boolean().optional(),
|
|
101
|
+
blockDurationMs: z.number().positive().optional(),
|
|
102
|
+
buildCheckpointIfEmpty: z.boolean().optional(),
|
|
92
103
|
}),
|
|
93
104
|
);
|
|
105
|
+
|
|
106
|
+
type SequencerConfigOptionalKeys =
|
|
107
|
+
| 'governanceProposerPayload'
|
|
108
|
+
| 'blockDurationMs'
|
|
109
|
+
| 'coinbase'
|
|
110
|
+
| 'feeRecipient'
|
|
111
|
+
| 'acvmWorkingDirectory'
|
|
112
|
+
| 'acvmBinaryPath'
|
|
113
|
+
| 'fakeProcessingDelayPerTxMs'
|
|
114
|
+
| 'fakeThrowAfterProcessingTxCount'
|
|
115
|
+
| 'l1PublishingTime'
|
|
116
|
+
| 'txPublicSetupAllowList'
|
|
117
|
+
| 'minValidTxsPerBlock';
|
|
118
|
+
|
|
119
|
+
export type ResolvedSequencerConfig = Prettify<
|
|
120
|
+
Required<Omit<SequencerConfig, SequencerConfigOptionalKeys>> & Pick<SequencerConfig, SequencerConfigOptionalKeys>
|
|
121
|
+
>;
|
|
@@ -251,7 +251,10 @@ export interface MerkleTreeCheckpointOperations {
|
|
|
251
251
|
revertAllCheckpoints(): Promise<void>;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
export interface MerkleTreeWriteOperations
|
|
254
|
+
export interface MerkleTreeWriteOperations
|
|
255
|
+
extends MerkleTreeReadOperations,
|
|
256
|
+
MerkleTreeCheckpointOperations,
|
|
257
|
+
Disposable {
|
|
255
258
|
/**
|
|
256
259
|
* Appends leaves to a given tree.
|
|
257
260
|
* @param treeId - The tree to be updated.
|
|
@@ -42,8 +42,13 @@ export interface WorldStateSynchronizerStatus {
|
|
|
42
42
|
|
|
43
43
|
/** Provides writeable forks of the world state at a given block number. */
|
|
44
44
|
export interface ForkMerkleTreeOperations {
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Forks the world state at the given block number, defaulting to the latest one.
|
|
47
|
+
* @param block - The block number to fork at.
|
|
48
|
+
* @param opts - Optional parameters:
|
|
49
|
+
* - closeDelayMs: number of milliseconds to wait before closing the fork on dispose.
|
|
50
|
+
*/
|
|
51
|
+
fork(block?: BlockNumber, opts?: { closeDelayMs?: number }): Promise<MerkleTreeWriteOperations>;
|
|
47
52
|
|
|
48
53
|
/** Gets a handle that allows reading the state as it was at the given block number. */
|
|
49
54
|
getSnapshot(blockNumber: BlockNumber): MerkleTreeReadOperations;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { BufferReader, boolToBuffer, numToUInt32BE } from '@aztec/foundation/serialize';
|
|
2
|
+
import { BufferReader, bigintToUInt64BE, boolToBuffer, numToUInt32BE } from '@aztec/foundation/serialize';
|
|
3
3
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
import { L2BlockHash } from '../block/block_hash.js';
|
|
7
|
+
import { schemas } from '../schemas/schemas.js';
|
|
7
8
|
import { TxHash } from '../tx/tx_hash.js';
|
|
9
|
+
import type { UInt64 } from '../types/shared.js';
|
|
8
10
|
import { PrivateLog } from './private_log.js';
|
|
9
11
|
import { PublicLog } from './public_log.js';
|
|
10
12
|
|
|
@@ -33,6 +35,10 @@ export class TxScopedL2Log {
|
|
|
33
35
|
* The block this log is included in
|
|
34
36
|
*/
|
|
35
37
|
public blockHash: L2BlockHash,
|
|
38
|
+
/*
|
|
39
|
+
* The timestamp of the block this log is included in
|
|
40
|
+
*/
|
|
41
|
+
public blockTimestamp: UInt64,
|
|
36
42
|
/*
|
|
37
43
|
* The log data as either a PrivateLog or PublicLog
|
|
38
44
|
*/
|
|
@@ -51,11 +57,12 @@ export class TxScopedL2Log {
|
|
|
51
57
|
logIndexInTx: z.number(),
|
|
52
58
|
blockNumber: BlockNumberSchema,
|
|
53
59
|
blockHash: L2BlockHash.schema,
|
|
60
|
+
blockTimestamp: schemas.UInt64,
|
|
54
61
|
log: z.union([PrivateLog.schema, PublicLog.schema]),
|
|
55
62
|
})
|
|
56
63
|
.transform(
|
|
57
|
-
({ txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, log }) =>
|
|
58
|
-
new TxScopedL2Log(txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, log),
|
|
64
|
+
({ txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, blockTimestamp, log }) =>
|
|
65
|
+
new TxScopedL2Log(txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, blockTimestamp, log),
|
|
59
66
|
);
|
|
60
67
|
}
|
|
61
68
|
|
|
@@ -66,6 +73,7 @@ export class TxScopedL2Log {
|
|
|
66
73
|
numToUInt32BE(this.logIndexInTx),
|
|
67
74
|
numToUInt32BE(this.blockNumber),
|
|
68
75
|
this.blockHash.toBuffer(),
|
|
76
|
+
bigintToUInt64BE(this.blockTimestamp),
|
|
69
77
|
boolToBuffer(this.isFromPublic),
|
|
70
78
|
this.log.toBuffer(),
|
|
71
79
|
]);
|
|
@@ -78,15 +86,16 @@ export class TxScopedL2Log {
|
|
|
78
86
|
const logIndexInTx = reader.readNumber();
|
|
79
87
|
const blockNumber = BlockNumber(reader.readNumber());
|
|
80
88
|
const blockHash = reader.readObject(L2BlockHash);
|
|
89
|
+
const blockTimestamp = reader.readUInt64();
|
|
81
90
|
const isFromPublic = reader.readBoolean();
|
|
82
91
|
const log = isFromPublic ? PublicLog.fromBuffer(reader) : PrivateLog.fromBuffer(reader);
|
|
83
92
|
|
|
84
|
-
return new TxScopedL2Log(txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, log);
|
|
93
|
+
return new TxScopedL2Log(txHash, dataStartIndexForTx, logIndexInTx, blockNumber, blockHash, blockTimestamp, log);
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
static async random(isFromPublic = Math.random() < 0.5) {
|
|
88
97
|
const log = isFromPublic ? await PublicLog.random() : PrivateLog.random();
|
|
89
|
-
return new TxScopedL2Log(TxHash.random(), 1, 1, BlockNumber(1), L2BlockHash.random(), log);
|
|
98
|
+
return new TxScopedL2Log(TxHash.random(), 1, 1, BlockNumber(1), L2BlockHash.random(), BigInt(1), log);
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
equals(other: TxScopedL2Log) {
|
|
@@ -96,6 +105,7 @@ export class TxScopedL2Log {
|
|
|
96
105
|
this.logIndexInTx === other.logIndexInTx &&
|
|
97
106
|
this.blockNumber === other.blockNumber &&
|
|
98
107
|
this.blockHash.equals(other.blockHash) &&
|
|
108
|
+
this.blockTimestamp === other.blockTimestamp &&
|
|
99
109
|
((this.log instanceof PublicLog && other.log instanceof PublicLog) ||
|
|
100
110
|
(this.log instanceof PrivateLog && other.log instanceof PrivateLog)) &&
|
|
101
111
|
this.log.equals(other.log as any)
|
|
@@ -84,6 +84,7 @@ export async function getNonNullifiedL1ToL2MessageWitness(
|
|
|
84
84
|
if (!response) {
|
|
85
85
|
throw new Error(`No L1 to L2 message found for message hash ${messageHash.toString()}`);
|
|
86
86
|
}
|
|
87
|
+
|
|
87
88
|
const [messageIndex, siblingPath] = response;
|
|
88
89
|
|
|
89
90
|
const messageNullifier = await computeL1ToL2MessageNullifier(contractAddress, messageHash, secret);
|
|
@@ -17,6 +17,10 @@ import { schemas } from '../schemas/index.js';
|
|
|
17
17
|
import { ContentCommitment } from '../tx/content_commitment.js';
|
|
18
18
|
import type { UInt64 } from '../types/shared.js';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Header of a checkpoint. A checkpoint is a collection of blocks submitted to L1 all within the same slot.
|
|
22
|
+
* TODO(palla/mbps): Should this include chainId and version as well? Is this used just in circuits?
|
|
23
|
+
*/
|
|
20
24
|
export class CheckpointHeader {
|
|
21
25
|
constructor(
|
|
22
26
|
/** Root of the archive tree before this block is added. */
|
package/src/schemas/schemas.ts
CHANGED
|
@@ -40,6 +40,9 @@ export const schemas = {
|
|
|
40
40
|
/** Coerces input to UInt32. */
|
|
41
41
|
UInt32: foundationSchemas.UInt32,
|
|
42
42
|
|
|
43
|
+
/** Coerces input to UInt64. */
|
|
44
|
+
UInt64: foundationSchemas.UInt64,
|
|
45
|
+
|
|
43
46
|
/** Accepts a hex string as a Buffer32 type. */
|
|
44
47
|
Buffer32: foundationSchemas.Buffer32 as ZodFor<Buffer32>,
|
|
45
48
|
|
package/src/stats/stats.ts
CHANGED
|
@@ -20,6 +20,13 @@ export type L2BlockStats = {
|
|
|
20
20
|
publicLogCount?: number;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export type CheckpointStats = {
|
|
24
|
+
/** Number of transactions in the checkpoint */
|
|
25
|
+
txCount: number;
|
|
26
|
+
/** Number of blocks in the checkpoint */
|
|
27
|
+
blockCount: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
23
30
|
/** Stats logged for each L1 publish tx.*/
|
|
24
31
|
export type L1PublishStats = {
|
|
25
32
|
/** Address of the sender. */
|
|
@@ -45,11 +52,11 @@ export type L1PublishStats = {
|
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
/** Stats logged for each L1 rollup publish tx.*/
|
|
48
|
-
export type
|
|
55
|
+
export type L1PublishCheckpointStats = {
|
|
49
56
|
/** Name of the event for metrics purposes */
|
|
50
57
|
eventName: 'rollup-published-to-l1';
|
|
51
58
|
} & L1PublishStats &
|
|
52
|
-
|
|
59
|
+
CheckpointStats;
|
|
53
60
|
|
|
54
61
|
/** Stats logged for each L1 rollup publish tx.*/
|
|
55
62
|
export type L1PublishProofStats = {
|
|
@@ -189,8 +196,6 @@ export type CircuitVerificationStats = {
|
|
|
189
196
|
|
|
190
197
|
/** Stats for an L2 block built by a sequencer. */
|
|
191
198
|
export type L2BlockBuiltStats = {
|
|
192
|
-
/** The creator of the block */
|
|
193
|
-
creator: string;
|
|
194
199
|
/** Name of the event. */
|
|
195
200
|
eventName: 'l2-block-built';
|
|
196
201
|
/** Total duration in ms. */
|
|
@@ -272,7 +277,7 @@ export type Stats =
|
|
|
272
277
|
| CircuitSimulationStats
|
|
273
278
|
| CircuitWitnessGenerationStats
|
|
274
279
|
| PublicDBAccessStats
|
|
275
|
-
|
|
|
280
|
+
| L1PublishCheckpointStats
|
|
276
281
|
| L1PublishProofStats
|
|
277
282
|
| L2BlockBuiltStats
|
|
278
283
|
| L2BlockHandledStats
|
|
@@ -4,7 +4,7 @@ import type { SlotNumber } from '@aztec/foundation/schemas';
|
|
|
4
4
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
import type { GasFees } from '../gas/gas_fees.js';
|
|
6
6
|
import type { UInt32 } from '../types/index.js';
|
|
7
|
-
import type { GlobalVariables } from './global_variables.js';
|
|
7
|
+
import type { CheckpointGlobalVariables, GlobalVariables } from './global_variables.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Interface for building global variables for Aztec blocks.
|
|
@@ -26,4 +26,11 @@ export interface GlobalVariableBuilder {
|
|
|
26
26
|
feeRecipient: AztecAddress,
|
|
27
27
|
slotNumber?: SlotNumber,
|
|
28
28
|
): Promise<GlobalVariables>;
|
|
29
|
+
|
|
30
|
+
/** Builds global variables that are constant throughout a checkpoint. */
|
|
31
|
+
buildCheckpointGlobalVariables(
|
|
32
|
+
coinbase: EthAddress,
|
|
33
|
+
feeRecipient: AztecAddress,
|
|
34
|
+
slotNumber: SlotNumber,
|
|
35
|
+
): Promise<CheckpointGlobalVariables>;
|
|
29
36
|
}
|
|
@@ -21,6 +21,12 @@ import { GasFees } from '../gas/gas_fees.js';
|
|
|
21
21
|
import { schemas } from '../schemas/index.js';
|
|
22
22
|
import type { UInt64 } from '../types/index.js';
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Global variables that are constant across the entire slot.
|
|
26
|
+
* TODO(palla/mbps): Should timestamp be included here as well?
|
|
27
|
+
*/
|
|
28
|
+
export type CheckpointGlobalVariables = Omit<FieldsOf<GlobalVariables>, 'blockNumber' | 'timestamp'>;
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* Global variables of the L2 block.
|
|
26
32
|
*/
|