@aztec/stdlib 0.0.1-commit.cd76b27 → 0.0.1-commit.d0fcfb7f
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/abi/decoder.d.ts +2 -2
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +7 -5
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +37 -6
- package/dest/abi/event_metadata_definition.d.ts +3 -1
- package/dest/abi/event_metadata_definition.d.ts.map +1 -1
- package/dest/abi/event_metadata_definition.js +1 -1
- package/dest/abi/utils.d.ts +14 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +15 -0
- package/dest/avm/avm.d.ts +300 -300
- package/dest/avm/avm_proving_request.d.ts +166 -166
- package/dest/avm/revert_code.d.ts +16 -1
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +15 -5
- package/dest/block/l2_block.d.ts +9 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +12 -2
- package/dest/block/l2_block_source.d.ts +12 -5
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +10 -0
- package/dest/checkpoint/checkpoint.d.ts +2 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +9 -4
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/validate.d.ts +36 -0
- package/dest/checkpoint/validate.d.ts.map +1 -0
- package/dest/checkpoint/validate.js +120 -0
- package/dest/config/sequencer-config.d.ts +2 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +5 -0
- package/dest/contract/contract_class.d.ts +2 -3
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/epoch-helpers/index.d.ts +5 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +4 -2
- package/dest/interfaces/allowed_element.d.ts +26 -20
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +8 -8
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +3 -2
- package/dest/interfaces/aztec-node-admin.d.ts +61 -27
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +11 -6
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +5 -2
- package/dest/interfaces/block-builder.d.ts +17 -9
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +13 -6
- package/dest/interfaces/configs.d.ts +57 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +5 -2
- package/dest/interfaces/merkle_tree_operations.d.ts +9 -19
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +3 -8
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +6 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -1
- package/dest/interfaces/validator.d.ts +67 -25
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +6 -2
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +13 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +13 -10
- package/dest/kernel/hints/build_transient_data_hints.d.ts +5 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -3
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +2 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +4 -0
- package/dest/logs/debug_log_store.d.ts +30 -0
- package/dest/logs/debug_log_store.d.ts.map +1 -0
- package/dest/logs/debug_log_store.js +30 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +23 -15
- package/dest/logs/index.d.ts +3 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/log_filter.d.ts +4 -1
- package/dest/logs/log_filter.d.ts.map +1 -1
- package/dest/logs/log_filter.js +2 -1
- package/dest/logs/pre_tag.d.ts +16 -11
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/public_log.d.ts +4 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +2 -1
- package/dest/logs/siloed_tag.d.ts +5 -3
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +6 -1
- package/dest/logs/tag.js +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +32 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +69 -26
- package/dest/p2p/attestation_utils.d.ts +11 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +45 -0
- package/dest/p2p/checkpoint_proposal.d.ts +1 -6
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +0 -12
- package/dest/p2p/client_type.d.ts +2 -5
- package/dest/p2p/client_type.d.ts.map +1 -1
- package/dest/p2p/client_type.js +0 -7
- package/dest/p2p/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -1
- package/dest/p2p/peer_error.d.ts +3 -1
- package/dest/p2p/peer_error.d.ts.map +1 -1
- package/dest/p2p/peer_error.js +5 -0
- package/dest/p2p/topic_type.d.ts +3 -4
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +7 -24
- package/dest/slashing/tally.d.ts +7 -2
- package/dest/slashing/tally.d.ts.map +1 -1
- package/dest/slashing/tally.js +30 -2
- package/dest/tests/factories.d.ts +3 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +8 -0
- package/dest/tests/mocks.d.ts +5 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +18 -13
- package/dest/tx/block_header.d.ts +3 -1
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +4 -0
- package/dest/tx/public_simulation_output.d.ts +4 -2
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +7 -3
- package/dest/tx/simulated_tx.d.ts +5 -2
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +4 -1
- package/dest/tx/tx.d.ts +6 -5
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -6
- package/dest/tx/tx_receipt.d.ts +22 -3
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +15 -4
- package/dest/tx/validator/error_texts.d.ts +5 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +4 -0
- package/dest/update-checker/index.d.ts +3 -2
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +2 -1
- package/dest/update-checker/package_version.d.ts +3 -0
- package/dest/update-checker/package_version.d.ts.map +1 -0
- package/dest/update-checker/package_version.js +24 -0
- package/dest/update-checker/version_checker.d.ts +25 -0
- package/dest/update-checker/version_checker.d.ts.map +1 -0
- package/dest/update-checker/version_checker.js +50 -0
- package/dest/validators/errors.d.ts +6 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +7 -0
- package/dest/versioning/versioning.d.ts +4 -2
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +4 -1
- package/package.json +10 -10
- package/src/abi/decoder.ts +15 -6
- package/src/abi/encoder.ts +49 -6
- package/src/abi/event_metadata_definition.ts +2 -0
- package/src/abi/utils.ts +25 -0
- package/src/avm/revert_code.ts +15 -0
- package/src/block/l2_block.ts +13 -1
- package/src/block/l2_block_source.ts +12 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +21 -0
- package/src/checkpoint/checkpoint.ts +12 -3
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/validate.ts +230 -0
- package/src/config/sequencer-config.ts +6 -1
- package/src/contract/contract_class.ts +3 -3
- package/src/epoch-helpers/index.ts +3 -0
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +3 -2
- package/src/interfaces/aztec-node.ts +23 -5
- package/src/interfaces/block-builder.ts +34 -12
- package/src/interfaces/configs.ts +22 -8
- package/src/interfaces/merkle_tree_operations.ts +8 -18
- package/src/interfaces/p2p.ts +2 -13
- package/src/interfaces/prover-client.ts +8 -0
- package/src/interfaces/validator.ts +18 -2
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +14 -18
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +15 -18
- package/src/kernel/hints/build_transient_data_hints.ts +17 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +9 -0
- package/src/logs/debug_log_store.ts +54 -0
- package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +24 -16
- package/src/logs/index.ts +2 -1
- package/src/logs/log_filter.ts +5 -0
- package/src/logs/pre_tag.ts +5 -5
- package/src/logs/public_log.ts +4 -2
- package/src/logs/siloed_tag.ts +8 -2
- package/src/logs/tag.ts +1 -1
- package/src/messaging/l2_to_l1_membership.ts +98 -33
- package/src/p2p/attestation_utils.ts +56 -0
- package/src/p2p/checkpoint_proposal.ts +0 -17
- package/src/p2p/client_type.ts +0 -6
- package/src/p2p/index.ts +0 -1
- package/src/p2p/peer_error.ts +7 -0
- package/src/p2p/topic_type.ts +8 -15
- package/src/slashing/tally.ts +34 -1
- package/src/tests/factories.ts +9 -0
- package/src/tests/mocks.ts +25 -10
- package/src/tx/block_header.ts +6 -0
- package/src/tx/public_simulation_output.ts +4 -0
- package/src/tx/simulated_tx.ts +8 -1
- package/src/tx/tx.ts +20 -11
- package/src/tx/tx_receipt.ts +16 -1
- package/src/tx/validator/error_texts.ts +4 -0
- package/src/update-checker/index.ts +2 -1
- package/src/update-checker/package_version.ts +30 -0
- package/src/update-checker/version_checker.ts +65 -0
- package/src/validators/errors.ts +9 -0
- package/src/versioning/versioning.ts +4 -1
- package/dest/logs/directional_app_tagging_secret.d.ts +0 -40
- package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
- package/dest/update-checker/update-checker.d.ts +0 -49
- package/dest/update-checker/update-checker.d.ts.map +0 -1
- package/dest/update-checker/update-checker.js +0 -130
- package/src/update-checker/update-checker.ts +0 -166
package/src/tests/mocks.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
FIXED_DA_GAS,
|
|
3
|
-
FIXED_L2_GAS,
|
|
4
2
|
MAX_ENQUEUED_CALLS_PER_TX,
|
|
5
3
|
MAX_NULLIFIERS_PER_TX,
|
|
6
4
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
7
5
|
MAX_TX_LIFETIME,
|
|
6
|
+
PRIVATE_TX_L2_GAS_OVERHEAD,
|
|
7
|
+
PUBLIC_TX_L2_GAS_OVERHEAD,
|
|
8
|
+
TX_DA_GAS_OVERHEAD,
|
|
8
9
|
} from '@aztec/constants';
|
|
9
10
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
10
11
|
import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
|
|
@@ -97,6 +98,7 @@ export const mockTx = async (
|
|
|
97
98
|
publicCalldataSize = 2,
|
|
98
99
|
feePayer,
|
|
99
100
|
chonkProof = ChonkProof.random(),
|
|
101
|
+
gasLimits,
|
|
100
102
|
maxFeesPerGas = new GasFees(10, 10),
|
|
101
103
|
maxPriorityFeesPerGas,
|
|
102
104
|
gasUsed = Gas.empty(),
|
|
@@ -113,6 +115,7 @@ export const mockTx = async (
|
|
|
113
115
|
publicCalldataSize?: number;
|
|
114
116
|
feePayer?: AztecAddress;
|
|
115
117
|
chonkProof?: ChonkProof;
|
|
118
|
+
gasLimits?: Gas;
|
|
116
119
|
maxFeesPerGas?: GasFees;
|
|
117
120
|
maxPriorityFeesPerGas?: GasFees;
|
|
118
121
|
gasUsed?: Gas;
|
|
@@ -131,7 +134,7 @@ export const mockTx = async (
|
|
|
131
134
|
const data = PrivateKernelTailCircuitPublicInputs.empty();
|
|
132
135
|
const firstNullifier = new Nullifier(new Fr(seed + 1), Fr.ZERO, 0);
|
|
133
136
|
data.constants.anchorBlockHeader = anchorBlockHeader;
|
|
134
|
-
data.constants.txContext.gasSettings = GasSettings.default({ maxFeesPerGas, maxPriorityFeesPerGas });
|
|
137
|
+
data.constants.txContext.gasSettings = GasSettings.default({ gasLimits, maxFeesPerGas, maxPriorityFeesPerGas });
|
|
135
138
|
data.feePayer = feePayer ?? (await AztecAddress.random());
|
|
136
139
|
data.gasUsed = gasUsed;
|
|
137
140
|
data.constants.txContext.chainId = chainId;
|
|
@@ -205,8 +208,11 @@ export async function mockProcessedTx({
|
|
|
205
208
|
feePayer,
|
|
206
209
|
feePaymentPublicDataWrite,
|
|
207
210
|
// The default gasUsed is the tx overhead.
|
|
208
|
-
gasUsed = Gas.from({ daGas: FIXED_DA_GAS, l2Gas: FIXED_L2_GAS }),
|
|
209
211
|
privateOnly = false,
|
|
212
|
+
gasUsed = Gas.from({
|
|
213
|
+
daGas: TX_DA_GAS_OVERHEAD,
|
|
214
|
+
l2Gas: privateOnly ? PRIVATE_TX_L2_GAS_OVERHEAD : PUBLIC_TX_L2_GAS_OVERHEAD,
|
|
215
|
+
}),
|
|
210
216
|
avmAccumulatedData,
|
|
211
217
|
...mockTxOpts
|
|
212
218
|
}: {
|
|
@@ -421,10 +427,13 @@ export async function mockCheckpointAndMessages(
|
|
|
421
427
|
Partial<Parameters<typeof L2Block.random>[1]> = {},
|
|
422
428
|
) {
|
|
423
429
|
const slotNumber = options.slotNumber ?? SlotNumber(Number(checkpointNumber) * 10);
|
|
430
|
+
const globals = GlobalVariables.random({ slotNumber, ...options });
|
|
424
431
|
const blocksAndMessages = [];
|
|
432
|
+
|
|
425
433
|
// Track the previous block's archive to ensure consecutive blocks have consistent archive roots.
|
|
426
434
|
// The current block's header.lastArchive must equal the previous block's archive.
|
|
427
435
|
let lastArchive: AppendOnlyTreeSnapshot | undefined = previousArchive;
|
|
436
|
+
|
|
428
437
|
// Pass maxEffects via txOptions so it reaches TxEffect.random
|
|
429
438
|
const txOptions = maxEffects !== undefined ? { maxEffects } : {};
|
|
430
439
|
for (let i = 0; i < (blocks?.length ?? numBlocks); i++) {
|
|
@@ -433,11 +442,11 @@ export async function mockCheckpointAndMessages(
|
|
|
433
442
|
block:
|
|
434
443
|
blocks?.[i] ??
|
|
435
444
|
(await L2Block.random(blockNumber, {
|
|
445
|
+
...globals,
|
|
436
446
|
checkpointNumber,
|
|
437
447
|
indexWithinCheckpoint: IndexWithinCheckpoint(i),
|
|
438
448
|
txsPerBlock: numTxsPerBlock,
|
|
439
449
|
txOptions,
|
|
440
|
-
slotNumber,
|
|
441
450
|
...options,
|
|
442
451
|
...makeBlockOptions(blockNumber),
|
|
443
452
|
...(lastArchive ? { lastArchive } : {}),
|
|
@@ -451,12 +460,18 @@ export async function mockCheckpointAndMessages(
|
|
|
451
460
|
|
|
452
461
|
const messages = blocksAndMessages[0].messages;
|
|
453
462
|
const inHash = computeInHashFromL1ToL2Messages(messages);
|
|
454
|
-
const
|
|
463
|
+
const firstBlockLastArchive = blocksAndMessages[0].block.header.lastArchive;
|
|
464
|
+
const checkpoint = await Checkpoint.random(checkpointNumber, {
|
|
465
|
+
numBlocks: 0,
|
|
466
|
+
inHash,
|
|
467
|
+
...options,
|
|
468
|
+
...globals,
|
|
469
|
+
lastArchive: firstBlockLastArchive,
|
|
470
|
+
lastArchiveRoot: firstBlockLastArchive.root,
|
|
471
|
+
archive: lastArchive,
|
|
472
|
+
});
|
|
473
|
+
|
|
455
474
|
checkpoint.blocks = blocksAndMessages.map(({ block }) => block);
|
|
456
|
-
// Set the checkpoint's archive to match the last block's archive for proper chaining.
|
|
457
|
-
// When the archiver reconstructs checkpoints from L1, it uses the checkpoint's archive root
|
|
458
|
-
// from the L1 event to set the last block's archive. Without this, the archive chain breaks.
|
|
459
|
-
checkpoint.archive = lastArchive!;
|
|
460
475
|
|
|
461
476
|
// Return lastArchive so callers can chain it across multiple checkpoints
|
|
462
477
|
return { checkpoint, messages, lastArchive };
|
package/src/tx/block_header.ts
CHANGED
|
@@ -176,6 +176,12 @@ export class BlockHeader {
|
|
|
176
176
|
this._cachedHash = Promise.resolve(new BlockHash(hashed));
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
/** Recomputes the cached hash. Used for testing when header fields are mutated via unfreeze. */
|
|
180
|
+
recomputeHash(): Promise<BlockHash> {
|
|
181
|
+
this._cachedHash = undefined;
|
|
182
|
+
return this.hash();
|
|
183
|
+
}
|
|
184
|
+
|
|
179
185
|
static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
|
|
180
186
|
return BlockHeader.from({
|
|
181
187
|
lastArchive: AppendOnlyTreeSnapshot.random(),
|
|
@@ -7,6 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
import { SimulationError } from '../errors/simulation_error.js';
|
|
8
8
|
import { Gas } from '../gas/gas.js';
|
|
9
9
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
10
|
+
import { DebugLog } from '../logs/debug_log.js';
|
|
10
11
|
import { NullishToUndefined } from '../schemas/schemas.js';
|
|
11
12
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
12
13
|
import { GlobalVariables } from './global_variables.js';
|
|
@@ -71,6 +72,7 @@ export class PublicSimulationOutput {
|
|
|
71
72
|
public txEffect: TxEffect,
|
|
72
73
|
public publicReturnValues: NestedProcessReturnValues[],
|
|
73
74
|
public gasUsed: GasUsed,
|
|
75
|
+
public debugLogs: DebugLog[] = [],
|
|
74
76
|
) {}
|
|
75
77
|
|
|
76
78
|
static get schema(): ZodFor<PublicSimulationOutput> {
|
|
@@ -86,6 +88,7 @@ export class PublicSimulationOutput {
|
|
|
86
88
|
publicGas: Gas.schema,
|
|
87
89
|
billedGas: Gas.schema,
|
|
88
90
|
}),
|
|
91
|
+
debugLogs: z.array(DebugLog.schema).default([]),
|
|
89
92
|
})
|
|
90
93
|
.transform(
|
|
91
94
|
fields =>
|
|
@@ -95,6 +98,7 @@ export class PublicSimulationOutput {
|
|
|
95
98
|
fields.txEffect,
|
|
96
99
|
fields.publicReturnValues,
|
|
97
100
|
fields.gasUsed,
|
|
101
|
+
fields.debugLogs,
|
|
98
102
|
),
|
|
99
103
|
);
|
|
100
104
|
}
|
package/src/tx/simulated_tx.ts
CHANGED
|
@@ -12,9 +12,11 @@ import { Gas } from '../gas/gas.js';
|
|
|
12
12
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
13
13
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
14
14
|
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
15
|
+
import type { OffchainEffect } from './offchain_effect.js';
|
|
15
16
|
import {
|
|
16
17
|
PrivateCallExecutionResult,
|
|
17
18
|
PrivateExecutionResult,
|
|
19
|
+
collectOffchainEffects,
|
|
18
20
|
collectSortedContractClassLogs,
|
|
19
21
|
} from './private_execution_result.js';
|
|
20
22
|
import { type SimulationStats, SimulationStatsSchema } from './profiling.js';
|
|
@@ -84,6 +86,11 @@ export class TxSimulationResult {
|
|
|
84
86
|
public stats?: SimulationStats,
|
|
85
87
|
) {}
|
|
86
88
|
|
|
89
|
+
/** Returns offchain effects collected from private execution. */
|
|
90
|
+
get offchainEffects(): OffchainEffect[] {
|
|
91
|
+
return collectOffchainEffects(this.privateExecutionResult);
|
|
92
|
+
}
|
|
93
|
+
|
|
87
94
|
get gasUsed(): GasUsed {
|
|
88
95
|
return (
|
|
89
96
|
this.publicOutput?.gasUsed ?? {
|
|
@@ -106,7 +113,7 @@ export class TxSimulationResult {
|
|
|
106
113
|
.transform(TxSimulationResult.from);
|
|
107
114
|
}
|
|
108
115
|
|
|
109
|
-
static from(fields: Omit<FieldsOf<TxSimulationResult>, 'gasUsed'>) {
|
|
116
|
+
static from(fields: Omit<FieldsOf<TxSimulationResult>, 'gasUsed' | 'offchainEffects'>) {
|
|
110
117
|
return new TxSimulationResult(
|
|
111
118
|
fields.privateExecutionResult,
|
|
112
119
|
fields.publicInputs,
|
package/src/tx/tx.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { DA_GAS_PER_FIELD, TX_DA_GAS_OVERHEAD } from '@aztec/constants';
|
|
1
2
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
4
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
4
5
|
import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import type
|
|
6
|
+
import { type FieldsOf, unfreeze } from '@aztec/foundation/types';
|
|
6
7
|
|
|
7
8
|
import { z } from 'zod';
|
|
8
9
|
|
|
@@ -264,16 +265,24 @@ export class Tx extends Gossipable {
|
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
268
|
+
* Returns the number of fields this tx's effects will occupy in the blob,
|
|
269
|
+
* based on its private side effects only. Accurate for txs without public calls.
|
|
270
|
+
* For txs with public calls, the actual size will be larger due to public execution outputs.
|
|
269
271
|
*/
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
);
|
|
272
|
+
getPrivateTxEffectsSizeInFields(): number {
|
|
273
|
+
// 3 fields overhead: tx_start_marker, tx_hash, tx_fee.
|
|
274
|
+
// TX_DA_GAS_OVERHEAD is defined as N * DA_GAS_PER_FIELD, so this division is always exact.
|
|
275
|
+
const overheadFields = TX_DA_GAS_OVERHEAD / DA_GAS_PER_FIELD;
|
|
276
|
+
const noteHashes = this.data.getNonEmptyNoteHashes().length;
|
|
277
|
+
const nullifiers = this.data.getNonEmptyNullifiers().length;
|
|
278
|
+
const l2ToL1Msgs = this.data.getNonEmptyL2ToL1Msgs().length;
|
|
279
|
+
// Each private log occupies (emittedLength + 1) fields: content + length field
|
|
280
|
+
const privateLogFields = this.data.getNonEmptyPrivateLogs().reduce((acc, log) => acc + log.emittedLength + 1, 0);
|
|
281
|
+
// Each contract class log occupies (length + 1) fields: content + contract address
|
|
282
|
+
const contractClassLogFields = this.data
|
|
283
|
+
.getNonEmptyContractClassLogsHashes()
|
|
284
|
+
.reduce((acc, log) => acc + log.logHash.length + 1, 0);
|
|
285
|
+
return overheadFields + noteHashes + nullifiers + l2ToL1Msgs + privateLogFields + contractClassLogFields;
|
|
277
286
|
}
|
|
278
287
|
|
|
279
288
|
/**
|
|
@@ -309,7 +318,7 @@ export class Tx extends Gossipable {
|
|
|
309
318
|
|
|
310
319
|
/** Recomputes the tx hash. Used for testing purposes only when a property of the tx was mutated. */
|
|
311
320
|
public async recomputeHash(): Promise<TxHash> {
|
|
312
|
-
(this
|
|
321
|
+
unfreeze(this).txHash = await Tx.computeTxHash(this);
|
|
313
322
|
return this.txHash;
|
|
314
323
|
}
|
|
315
324
|
|
package/src/tx/tx_receipt.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
1
|
+
import { BlockNumber, BlockNumberSchema, EpochNumber, EpochNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
import { RevertCode } from '../avm/revert_code.js';
|
|
6
6
|
import { BlockHash } from '../block/block_hash.js';
|
|
7
|
+
import { DebugLog } from '../logs/debug_log.js';
|
|
7
8
|
import { type ZodFor, schemas } from '../schemas/schemas.js';
|
|
8
9
|
import { TxHash } from './tx_hash.js';
|
|
9
10
|
|
|
@@ -57,6 +58,14 @@ export class TxReceipt {
|
|
|
57
58
|
public blockHash?: BlockHash,
|
|
58
59
|
/** The block number in which the transaction was included. */
|
|
59
60
|
public blockNumber?: BlockNumber,
|
|
61
|
+
/** The epoch number in which the transaction was included. */
|
|
62
|
+
public epochNumber?: EpochNumber,
|
|
63
|
+
/**
|
|
64
|
+
* Debug logs collected during public function execution. Served only when the node is in test mode and placed on
|
|
65
|
+
* the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined
|
|
66
|
+
* tx receipt is obtained).
|
|
67
|
+
*/
|
|
68
|
+
public debugLogs?: DebugLog[],
|
|
60
69
|
) {}
|
|
61
70
|
|
|
62
71
|
/** Returns true if the transaction was executed successfully. */
|
|
@@ -102,7 +111,9 @@ export class TxReceipt {
|
|
|
102
111
|
error: z.string().optional(),
|
|
103
112
|
blockHash: BlockHash.schema.optional(),
|
|
104
113
|
blockNumber: BlockNumberSchema.optional(),
|
|
114
|
+
epochNumber: EpochNumberSchema.optional(),
|
|
105
115
|
transactionFee: schemas.BigInt.optional(),
|
|
116
|
+
debugLogs: z.array(DebugLog.schema).optional(),
|
|
106
117
|
})
|
|
107
118
|
.transform(fields => TxReceipt.from(fields));
|
|
108
119
|
}
|
|
@@ -115,6 +126,8 @@ export class TxReceipt {
|
|
|
115
126
|
transactionFee?: bigint;
|
|
116
127
|
blockHash?: BlockHash;
|
|
117
128
|
blockNumber?: BlockNumber;
|
|
129
|
+
epochNumber?: EpochNumber;
|
|
130
|
+
debugLogs?: DebugLog[];
|
|
118
131
|
}) {
|
|
119
132
|
return new TxReceipt(
|
|
120
133
|
fields.txHash,
|
|
@@ -124,6 +137,8 @@ export class TxReceipt {
|
|
|
124
137
|
fields.transactionFee,
|
|
125
138
|
fields.blockHash,
|
|
126
139
|
fields.blockNumber,
|
|
140
|
+
fields.epochNumber,
|
|
141
|
+
fields.debugLogs,
|
|
127
142
|
);
|
|
128
143
|
}
|
|
129
144
|
|
|
@@ -6,6 +6,10 @@ export const TX_ERROR_GAS_LIMIT_TOO_HIGH = 'Gas limit is higher than the amount
|
|
|
6
6
|
|
|
7
7
|
// Phases
|
|
8
8
|
export const TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED = 'Setup function not on allow list';
|
|
9
|
+
export const TX_ERROR_SETUP_FUNCTION_UNKNOWN_CONTRACT = 'Setup function targets unknown contract';
|
|
10
|
+
export const TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER = 'Setup only_self function called with incorrect msg_sender';
|
|
11
|
+
export const TX_ERROR_SETUP_NULL_MSG_SENDER = 'Setup function called with null msg sender';
|
|
12
|
+
export const TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH = 'Setup function called with wrong calldata length';
|
|
9
13
|
|
|
10
14
|
// Nullifiers
|
|
11
15
|
export const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = 'Duplicate nullifier in tx';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './package_version.js';
|
|
2
|
+
export * from './version_checker.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { dirname, resolve } from 'path';
|
|
5
|
+
|
|
6
|
+
/** Returns the package version from the release-please manifest or the package.json, or undefined if not found. */
|
|
7
|
+
export function getPackageVersion(): string | undefined {
|
|
8
|
+
const dir = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
|
|
10
|
+
// Try the release-please manifest first (works in dev/repo checkout).
|
|
11
|
+
try {
|
|
12
|
+
const releasePleaseManifestPath = resolve(dir, '../../../../.release-please-manifest.json');
|
|
13
|
+
return JSON.parse(readFileSync(releasePleaseManifestPath).toString())['.'];
|
|
14
|
+
} catch {
|
|
15
|
+
// Not in a repo checkout, fall through.
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Fall back to the stdlib package.json version (works in npm-installed packages).
|
|
19
|
+
try {
|
|
20
|
+
const packageJsonPath = resolve(dir, '../../package.json');
|
|
21
|
+
const version = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
22
|
+
if (version && version !== '0.1.0') {
|
|
23
|
+
return version;
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
// No package.json found either.
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { RunningPromise } from '@aztec/foundation/promise';
|
|
3
|
+
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
|
+
|
|
6
|
+
export type EventMap = {
|
|
7
|
+
newVersion: [{ name: string; currentVersion: string; latestVersion: string }];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type VersionCheck = {
|
|
11
|
+
name: string;
|
|
12
|
+
currentVersion: string;
|
|
13
|
+
getLatestVersion: () => Promise<string | undefined>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export class VersionChecker extends EventEmitter<EventMap> {
|
|
17
|
+
private runningPromise: RunningPromise;
|
|
18
|
+
constructor(
|
|
19
|
+
private checks: Array<VersionCheck>,
|
|
20
|
+
intervalCheckMs = 60_000,
|
|
21
|
+
private logger = createLogger('version_checker'),
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
this.runningPromise = new RunningPromise(this.run, logger, intervalCheckMs);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public start(): void {
|
|
28
|
+
if (this.runningPromise.isRunning()) {
|
|
29
|
+
this.logger.warn('VersionChecker is already running');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
this.runningPromise.start();
|
|
34
|
+
this.logger.info('Version check started');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public trigger(): Promise<void> {
|
|
38
|
+
return this.runningPromise.trigger();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async stop(): Promise<void> {
|
|
42
|
+
if (!this.runningPromise.isRunning()) {
|
|
43
|
+
this.logger.warn('VersionChecker is not running');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
await this.runningPromise.stop();
|
|
48
|
+
this.logger.info('Version checker stopped');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private run = async () => {
|
|
52
|
+
await Promise.allSettled(this.checks.map(check => this.checkVersion(check)));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
private async checkVersion({ name, currentVersion, getLatestVersion }: VersionCheck): Promise<void> {
|
|
56
|
+
try {
|
|
57
|
+
const latestVersion = await getLatestVersion();
|
|
58
|
+
if (latestVersion && latestVersion !== currentVersion) {
|
|
59
|
+
this.emit('newVersion', { name, latestVersion, currentVersion });
|
|
60
|
+
}
|
|
61
|
+
} catch (err) {
|
|
62
|
+
this.logger.warn(`Error checking for new ${name} versions: ${err}`, { err });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
package/src/validators/errors.ts
CHANGED
|
@@ -36,6 +36,15 @@ export class FailedToReExecuteTransactionsError extends ValidatorError {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export class ReExInitialStateMismatchError extends ValidatorError {
|
|
40
|
+
constructor(
|
|
41
|
+
public readonly expectedArchiveRoot: Fr,
|
|
42
|
+
public readonly actualArchiveRoot: Fr,
|
|
43
|
+
) {
|
|
44
|
+
super('Re-execution initial state mismatch');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
export class ReExStateMismatchError extends ValidatorError {
|
|
40
49
|
constructor(
|
|
41
50
|
public readonly expectedArchiveRoot: Fr,
|
|
@@ -115,7 +115,7 @@ export function validatePartialComponentVersionsMatch(
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
/** Returns a Koa middleware that injects the versioning info as headers. */
|
|
118
|
-
export function getVersioningMiddleware(versions: Partial<ComponentsVersions
|
|
118
|
+
export function getVersioningMiddleware(versions: Partial<ComponentsVersions>, opts?: { packageVersion?: string }) {
|
|
119
119
|
return async (ctx: Koa.Context, next: () => Promise<void>) => {
|
|
120
120
|
try {
|
|
121
121
|
await next();
|
|
@@ -128,6 +128,9 @@ export function getVersioningMiddleware(versions: Partial<ComponentsVersions>) {
|
|
|
128
128
|
ctx.set(`x-aztec-${key}`, value.toString());
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
+
if (opts?.packageVersion) {
|
|
132
|
+
ctx.set('x-aztec-packageVersion', opts.packageVersion);
|
|
133
|
+
}
|
|
131
134
|
}
|
|
132
135
|
};
|
|
133
136
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
|
-
import type { CompleteAddress } from '../contract/complete_address.js';
|
|
5
|
-
/**
|
|
6
|
-
* Directional application tagging secret used for log tagging.
|
|
7
|
-
*
|
|
8
|
-
* "Directional" because the derived secret is bound to the recipient
|
|
9
|
-
* address: A→B differs from B→A even with the same participants and app.
|
|
10
|
-
*
|
|
11
|
-
* Note: It's a bit unfortunate that this type resides in `stdlib` as the rest of the tagging functionality resides
|
|
12
|
-
* in `pxe/src/tagging`. We need to use this type in `PreTag` that in turn is used by other types
|
|
13
|
-
* in stdlib hence there doesn't seem to be a good way around this.
|
|
14
|
-
*/
|
|
15
|
-
export declare class DirectionalAppTaggingSecret {
|
|
16
|
-
readonly value: Fr;
|
|
17
|
-
private constructor();
|
|
18
|
-
/**
|
|
19
|
-
* Derives shared tagging secret and from that, the app address and recipient derives the directional app tagging
|
|
20
|
-
* secret.
|
|
21
|
-
*
|
|
22
|
-
* @param localAddress - The complete address of entity A in the shared tagging secret derivation scheme
|
|
23
|
-
* @param localIvsk - The incoming viewing secret key of entity A
|
|
24
|
-
* @param externalAddress - The address of entity B in the shared tagging secret derivation scheme
|
|
25
|
-
* @param app - Contract address to silo the secret to
|
|
26
|
-
* @param recipient - Recipient of the log. Defines the "direction of the secret".
|
|
27
|
-
* @returns The secret that can be used along with an index to compute a tag to be included in a log.
|
|
28
|
-
*/
|
|
29
|
-
static compute(localAddress: CompleteAddress, localIvsk: Fq, externalAddress: AztecAddress, app: AztecAddress, recipient: AztecAddress): Promise<DirectionalAppTaggingSecret>;
|
|
30
|
-
toString(): string;
|
|
31
|
-
static fromString(str: string): DirectionalAppTaggingSecret;
|
|
32
|
-
}
|
|
33
|
-
export declare const DirectionalAppTaggingSecretSchema: z.ZodObject<{
|
|
34
|
-
value: z.ZodType<Fr, any, string>;
|
|
35
|
-
}, "strip", z.ZodTypeAny, {
|
|
36
|
-
value: Fr;
|
|
37
|
-
}, {
|
|
38
|
-
value: string;
|
|
39
|
-
}>;
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,e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","sources":["../../src/logs/directional_app_tagging_secret.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE;;;;;;;;;GASG;AACH,qBAAa,2BAA2B;aACF,KAAK,EAAE,EAAE;IAA7C,OAAO,eAA0C;IAEjD;;;;;;;;;;OAUG;IACH,OAAa,OAAO,CAClB,YAAY,EAAE,eAAe,EAC7B,SAAS,EAAE,EAAE,EACb,eAAe,EAAE,YAAY,EAC7B,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,2BAA2B,CAAC,CAMtC;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,CAE1D;CACF;AAoBD,eAAO,MAAM,iCAAiC;;;;;;EAE5C,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ViemClient } from '@aztec/ethereum/types';
|
|
2
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
export type EventMap = {
|
|
5
|
-
newRollupVersion: [{
|
|
6
|
-
currentVersion: bigint;
|
|
7
|
-
latestVersion: bigint;
|
|
8
|
-
}];
|
|
9
|
-
newNodeVersion: [{
|
|
10
|
-
currentVersion: string;
|
|
11
|
-
latestVersion: string;
|
|
12
|
-
}];
|
|
13
|
-
updateNodeConfig: [object];
|
|
14
|
-
updatePublicTelemetryConfig: [object];
|
|
15
|
-
};
|
|
16
|
-
type Config = {
|
|
17
|
-
baseURL: URL;
|
|
18
|
-
nodeVersion?: string;
|
|
19
|
-
checkIntervalMs?: number;
|
|
20
|
-
registryContractAddress: EthAddress;
|
|
21
|
-
publicClient: ViemClient;
|
|
22
|
-
fetch?: typeof fetch;
|
|
23
|
-
};
|
|
24
|
-
export declare class UpdateChecker extends EventEmitter<EventMap> {
|
|
25
|
-
private updatesUrl;
|
|
26
|
-
private nodeVersion;
|
|
27
|
-
private rollupVersion;
|
|
28
|
-
private fetch;
|
|
29
|
-
private getLatestRollupVersion;
|
|
30
|
-
private checkIntervalMs;
|
|
31
|
-
private log;
|
|
32
|
-
private runningPromise;
|
|
33
|
-
private lastPatchedConfig;
|
|
34
|
-
private lastPatchedPublicTelemetryConfig;
|
|
35
|
-
constructor(updatesUrl: URL, nodeVersion: string | undefined, rollupVersion: bigint, fetch: typeof globalThis.fetch, getLatestRollupVersion: () => Promise<bigint>, checkIntervalMs?: number, log?: import("@aztec/foundation/log").Logger);
|
|
36
|
-
static new(config: Config): Promise<UpdateChecker>;
|
|
37
|
-
start(): void;
|
|
38
|
-
stop(): Promise<void>;
|
|
39
|
-
trigger(): Promise<void>;
|
|
40
|
-
private runChecks;
|
|
41
|
-
private checkRollupVersion;
|
|
42
|
-
private checkConfig;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Returns package version.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getPackageVersion(): string | undefined;
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBkYXRlLWNoZWNrZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cGRhdGUtY2hlY2tlci91cGRhdGUtY2hlY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFLM0QsT0FBT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