@aztec/stdlib 0.84.0-alpha-testnet.0 → 0.84.0-nightly.20250405
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/avm/avm.d.ts +1272 -22
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +71 -3
- package/dest/avm/avm_proving_request.d.ts +585 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/epoch-helpers/index.d.ts +9 -0
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +15 -2
- package/dest/interfaces/proving-job.d.ts +585 -0
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts +3 -2
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +3 -2
- package/dest/logs/pending_tagged_log.d.ts +3 -2
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +1 -1
- package/dest/messaging/l1_to_l2_message_source.d.ts +5 -0
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +4 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +14 -2
- package/dest/tx/index.d.ts +1 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/validator/error_texts.d.ts +19 -0
- package/dest/tx/validator/error_texts.d.ts.map +1 -0
- package/dest/tx/validator/error_texts.js +26 -0
- package/package.json +6 -6
- package/src/avm/avm.ts +99 -1
- package/src/epoch-helpers/index.ts +19 -0
- package/src/logs/log_with_tx_data.ts +4 -3
- package/src/logs/pending_tagged_log.ts +3 -2
- package/src/messaging/l1_to_l2_message_source.ts +7 -0
- package/src/tests/factories.ts +35 -0
- package/src/tx/index.ts +1 -0
- package/src/tx/validator/error_texts.ts +33 -0
package/src/tests/factories.ts
CHANGED
|
@@ -58,8 +58,10 @@ import {
|
|
|
58
58
|
AvmBytecodeCommitmentHint,
|
|
59
59
|
AvmCircuitInputs,
|
|
60
60
|
AvmCircuitPublicInputs,
|
|
61
|
+
AvmCommitCheckpointHint,
|
|
61
62
|
AvmContractClassHint,
|
|
62
63
|
AvmContractInstanceHint,
|
|
64
|
+
AvmCreateCheckpointHint,
|
|
63
65
|
AvmEnqueuedCallHint,
|
|
64
66
|
AvmExecutionHints,
|
|
65
67
|
AvmGetLeafPreimageHintNullifierTree,
|
|
@@ -67,6 +69,7 @@ import {
|
|
|
67
69
|
AvmGetLeafValueHint,
|
|
68
70
|
AvmGetPreviousValueIndexHint,
|
|
69
71
|
AvmGetSiblingPathHint,
|
|
72
|
+
AvmRevertCheckpointHint,
|
|
70
73
|
AvmSequentialInsertHintNullifierTree,
|
|
71
74
|
AvmSequentialInsertHintPublicDataTree,
|
|
72
75
|
AvmTxHint,
|
|
@@ -1382,6 +1385,32 @@ export function makeAvmSequentialInsertHintNullifierTree(seed = 0): AvmSequentia
|
|
|
1382
1385
|
);
|
|
1383
1386
|
}
|
|
1384
1387
|
|
|
1388
|
+
export function makeAvmCheckpointActionCreateCheckpointHint(seed = 0): AvmCreateCheckpointHint {
|
|
1389
|
+
return new AvmCreateCheckpointHint(
|
|
1390
|
+
/*actionCounter=*/ seed,
|
|
1391
|
+
/*oldCheckpointId=*/ seed + 1,
|
|
1392
|
+
/*newCheckpointId=*/ seed + 2,
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
export function makeAvmCheckpointActionCommitCheckpointHint(seed = 0): AvmCommitCheckpointHint {
|
|
1397
|
+
return new AvmCommitCheckpointHint(
|
|
1398
|
+
/*actionCounter=*/ seed,
|
|
1399
|
+
/*oldCheckpointId=*/ seed + 1,
|
|
1400
|
+
/*newCheckpointId=*/ seed + 2,
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
export function makeAvmCheckpointActionRevertCheckpointHint(seed = 0): AvmRevertCheckpointHint {
|
|
1405
|
+
return new AvmRevertCheckpointHint(
|
|
1406
|
+
/*actionCounter=*/ seed,
|
|
1407
|
+
/*oldCheckpointId=*/ seed + 1,
|
|
1408
|
+
/*newCheckpointId=*/ seed + 2,
|
|
1409
|
+
/*beforeState=*/ makeTreeSnapshots(seed + 3),
|
|
1410
|
+
/*afterState=*/ makeTreeSnapshots(seed + 7),
|
|
1411
|
+
);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1385
1414
|
/**
|
|
1386
1415
|
* Makes arbitrary AvmContractInstanceHint.
|
|
1387
1416
|
* @param seed - The seed to use for generating the state reference.
|
|
@@ -1481,6 +1510,9 @@ export async function makeAvmExecutionHints(
|
|
|
1481
1510
|
makeAvmSequentialInsertHintNullifierTree,
|
|
1482
1511
|
seed + 0x5700,
|
|
1483
1512
|
),
|
|
1513
|
+
createCheckpointHints: makeArray(baseLength + 5, makeAvmCheckpointActionCreateCheckpointHint, seed + 0x5900),
|
|
1514
|
+
commitCheckpointHints: makeArray(baseLength + 5, makeAvmCheckpointActionCommitCheckpointHint, seed + 0x5b00),
|
|
1515
|
+
revertCheckpointHints: makeArray(baseLength + 5, makeAvmCheckpointActionRevertCheckpointHint, seed + 0x5d00),
|
|
1484
1516
|
...overrides,
|
|
1485
1517
|
};
|
|
1486
1518
|
|
|
@@ -1496,6 +1528,9 @@ export async function makeAvmExecutionHints(
|
|
|
1496
1528
|
fields.getLeafValueHints,
|
|
1497
1529
|
fields.sequentialInsertHintsPublicDataTree,
|
|
1498
1530
|
fields.sequentialInsertHintsNullifierTree,
|
|
1531
|
+
fields.createCheckpointHints,
|
|
1532
|
+
fields.commitCheckpointHints,
|
|
1533
|
+
fields.revertCheckpointHints,
|
|
1499
1534
|
);
|
|
1500
1535
|
}
|
|
1501
1536
|
|
package/src/tx/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from './public_simulation_output.js';
|
|
|
24
24
|
export * from './tx_execution_request.js';
|
|
25
25
|
export * from './validator/tx_validator.js';
|
|
26
26
|
export * from './validator/empty_validator.js';
|
|
27
|
+
export * from './validator/error_texts.js';
|
|
27
28
|
export * from './capsule.js';
|
|
28
29
|
export * from './global_variable_builder.js';
|
|
29
30
|
export * from './hashed_values.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Gas and fees
|
|
2
|
+
export const TX_ERROR_INSUFFICIENT_FEE_PER_GAS = 'Insufficient fee per gas';
|
|
3
|
+
export const TX_ERROR_INSUFFICIENT_FEE_PAYER_BALANCE = 'Insufficient fee payer balance';
|
|
4
|
+
|
|
5
|
+
// Phases
|
|
6
|
+
export const TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED = 'Setup function not on allow list';
|
|
7
|
+
|
|
8
|
+
// Nullifiers
|
|
9
|
+
export const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = 'Duplicate nullifier in tx';
|
|
10
|
+
export const TX_ERROR_EXISTING_NULLIFIER = 'Existing nullifier';
|
|
11
|
+
|
|
12
|
+
// Metadata
|
|
13
|
+
export const TX_ERROR_INVALID_BLOCK_NUMBER = 'Invalid block number';
|
|
14
|
+
export const TX_ERROR_INCORRECT_CHAIN_ID = 'Incorrect chain id';
|
|
15
|
+
export const TX_ERROR_INCORRECT_ROLLUP_VERSION = 'Incorrect rollup version';
|
|
16
|
+
|
|
17
|
+
// Proof
|
|
18
|
+
export const TX_ERROR_INVALID_PROOF = 'Invalid proof';
|
|
19
|
+
|
|
20
|
+
//Data
|
|
21
|
+
export const TX_ERROR_INCORRECT_CALLDATA = 'Incorrect calldata for public call';
|
|
22
|
+
export const TX_ERROR_CALLDATA_COUNT_MISMATCH = 'Wrong number of calldata for public calls';
|
|
23
|
+
export const TX_ERROR_CALLDATA_COUNT_TOO_LARGE = 'Total calldata too large for enqueued public calls';
|
|
24
|
+
export const TX_ERROR_CONTRACT_CLASS_LOG_COUNT = 'Mismatched number of contract class logs';
|
|
25
|
+
export const TX_ERROR_CONTRACT_CLASS_LOG_LENGTH = 'Mismatched contract class logs length';
|
|
26
|
+
export const TX_ERROR_CONTRACT_CLASS_LOGS = 'Mismatched contract class logs';
|
|
27
|
+
export const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = 'Incorrectly sorted contract class logs';
|
|
28
|
+
|
|
29
|
+
// Block header
|
|
30
|
+
export const TX_ERROR_BLOCK_HEADER = 'Block header not found';
|
|
31
|
+
|
|
32
|
+
// General
|
|
33
|
+
export const TX_ERROR_DURING_VALIDATION = 'Unexpected error during validation';
|