@aztec/stdlib 0.0.1-commit.cf93bcc56 → 0.0.1-commit.d117d021b
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 +6 -1
- 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 +4 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +12 -0
- package/dest/contract/contract_class.d.ts +2 -3
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/gas/gas_fees.d.ts +1 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +4 -1
- package/dest/ha-signing/config.d.ts +136 -0
- package/dest/ha-signing/config.d.ts.map +1 -0
- package/dest/ha-signing/config.js +97 -0
- package/dest/ha-signing/index.d.ts +4 -0
- package/dest/ha-signing/index.d.ts.map +1 -0
- package/dest/ha-signing/index.js +3 -0
- package/dest/ha-signing/local_config.d.ts +63 -0
- package/dest/ha-signing/local_config.d.ts.map +1 -0
- package/dest/ha-signing/local_config.js +24 -0
- package/dest/ha-signing/types.d.ts +85 -0
- package/dest/ha-signing/types.d.ts.map +1 -0
- package/dest/ha-signing/types.js +32 -0
- 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 +1 -0
- package/dest/interfaces/aztec-node-admin.d.ts +73 -30
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +10 -5
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +3 -2
- package/dest/interfaces/block-builder.d.ts +11 -5
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +7 -2
- package/dest/interfaces/configs.d.ts +62 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +6 -2
- package/dest/interfaces/p2p.d.ts +3 -8
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +103 -41
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +8 -4
- 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/kv-store/config.d.ts +17 -0
- package/dest/kv-store/config.d.ts.map +1 -0
- package/dest/kv-store/config.js +26 -0
- package/dest/kv-store/index.d.ts +2 -0
- package/dest/kv-store/index.d.ts.map +1 -0
- package/dest/kv-store/index.js +1 -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/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/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/block_proposal.d.ts +2 -2
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts +2 -7
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +1 -13
- 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/profiling.d.ts +4 -4
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +3 -3
- 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 +16 -2
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +11 -3
- 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 +11 -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/package.json +12 -11
- 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 +6 -0
- 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 +19 -1
- package/src/contract/contract_class.ts +3 -3
- package/src/gas/gas_fees.ts +7 -1
- package/src/ha-signing/config.ts +156 -0
- package/src/ha-signing/index.ts +27 -0
- package/src/ha-signing/local_config.ts +46 -0
- package/src/ha-signing/types.ts +112 -0
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +1 -0
- package/src/interfaces/aztec-node.ts +14 -4
- package/src/interfaces/block-builder.ts +25 -5
- package/src/interfaces/configs.ts +26 -8
- package/src/interfaces/p2p.ts +2 -13
- package/src/interfaces/validator.ts +50 -28
- 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/kv-store/config.ts +36 -0
- package/src/kv-store/index.ts +1 -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/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/p2p/attestation_utils.ts +56 -0
- package/src/p2p/block_proposal.ts +1 -1
- package/src/p2p/checkpoint_proposal.ts +1 -18
- 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/profiling.ts +5 -5
- 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 +10 -0
- package/src/tx/validator/error_texts.ts +4 -0
- package/src/update-checker/index.ts +2 -1
- package/src/update-checker/package_version.ts +17 -0
- package/src/update-checker/version_checker.ts +65 -0
- 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/dest/tx/tx_receipt.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { RevertCode } from '../avm/revert_code.js';
|
|
3
3
|
import { BlockHash } from '../block/block_hash.js';
|
|
4
|
+
import { DebugLog } from '../logs/debug_log.js';
|
|
4
5
|
import { type ZodFor } from '../schemas/schemas.js';
|
|
5
6
|
import { TxHash } from './tx_hash.js';
|
|
6
7
|
/** Block inclusion/finalization status. */
|
|
@@ -42,6 +43,12 @@ export declare class TxReceipt {
|
|
|
42
43
|
blockHash?: BlockHash | undefined;
|
|
43
44
|
/** The block number in which the transaction was included. */
|
|
44
45
|
blockNumber?: BlockNumber | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Debug logs collected during public function execution. Served only when the node is in test mode and placed on
|
|
48
|
+
* the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined
|
|
49
|
+
* tx receipt is obtained).
|
|
50
|
+
*/
|
|
51
|
+
debugLogs?: DebugLog[] | undefined;
|
|
45
52
|
constructor(
|
|
46
53
|
/** A unique identifier for a transaction. */
|
|
47
54
|
txHash: TxHash,
|
|
@@ -56,7 +63,13 @@ export declare class TxReceipt {
|
|
|
56
63
|
/** The hash of the block containing the transaction. */
|
|
57
64
|
blockHash?: BlockHash | undefined,
|
|
58
65
|
/** The block number in which the transaction was included. */
|
|
59
|
-
blockNumber?: BlockNumber | undefined
|
|
66
|
+
blockNumber?: BlockNumber | undefined,
|
|
67
|
+
/**
|
|
68
|
+
* Debug logs collected during public function execution. Served only when the node is in test mode and placed on
|
|
69
|
+
* the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined
|
|
70
|
+
* tx receipt is obtained).
|
|
71
|
+
*/
|
|
72
|
+
debugLogs?: DebugLog[] | undefined);
|
|
60
73
|
/** Returns true if the transaction was executed successfully. */
|
|
61
74
|
hasExecutionSucceeded(): boolean;
|
|
62
75
|
/** Returns true if the transaction execution reverted. */
|
|
@@ -77,7 +90,8 @@ export declare class TxReceipt {
|
|
|
77
90
|
transactionFee?: bigint;
|
|
78
91
|
blockHash?: BlockHash;
|
|
79
92
|
blockNumber?: BlockNumber;
|
|
93
|
+
debugLogs?: DebugLog[];
|
|
80
94
|
}): TxReceipt;
|
|
81
95
|
static executionResultFromRevertCode(revertCode: RevertCode): TxExecutionResult;
|
|
82
96
|
}
|
|
83
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfcmVjZWlwdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R4L3R4X3JlY2VpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBcUIsTUFBTSxpQ0FBaUMsQ0FBQztBQUlqRixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ25ELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNoRCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQVcsTUFBTSx1QkFBdUIsQ0FBQztBQUM3RCxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRXRDLDJDQUEyQztBQUMzQyxvQkFBWSxRQUFRO0lBQ2xCLE9BQU8sWUFBWTtJQUNuQixPQUFPLFlBQVk7SUFDbkIsUUFBUSxhQUFhO0lBQ3JCLFlBQVksaUJBQWlCO0lBQzdCLE1BQU0sV0FBVztJQUNqQixTQUFTLGNBQWM7Q0FDeEI7QUFFRCxpREFBaUQ7QUFDakQsZUFBTyxNQUFNLGdCQUFnQixFQUFFLFFBQVEsRUFPdEMsQ0FBQztBQUVGLHlEQUF5RDtBQUN6RCxvQkFBWSxpQkFBaUI7SUFDM0IsT0FBTyxZQUFZO0lBQ25CLGtCQUFrQix1QkFBdUI7SUFDekMs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AC;QACjB,eAAe,CAAC,EAAE,iBAAiB,CAAC;QACpC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;KACxB,aAWA;IAED,OAAc,6BAA6B,CAAC,UAAU,EAAE,UAAU,GAAG,iBAAiB,CAYrF;CACF"}
|
package/dest/tx/tx_receipt.js
CHANGED
|
@@ -2,6 +2,7 @@ import { BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { RevertCode } from '../avm/revert_code.js';
|
|
4
4
|
import { BlockHash } from '../block/block_hash.js';
|
|
5
|
+
import { DebugLog } from '../logs/debug_log.js';
|
|
5
6
|
import { schemas } from '../schemas/schemas.js';
|
|
6
7
|
import { TxHash } from './tx_hash.js';
|
|
7
8
|
/** Block inclusion/finalization status. */ export var TxStatus = /*#__PURE__*/ function(TxStatus) {
|
|
@@ -41,7 +42,12 @@ import { TxHash } from './tx_hash.js';
|
|
|
41
42
|
transactionFee;
|
|
42
43
|
blockHash;
|
|
43
44
|
blockNumber;
|
|
44
|
-
|
|
45
|
+
debugLogs;
|
|
46
|
+
constructor(/** A unique identifier for a transaction. */ txHash, /** The transaction's block finalization status. */ status, /** The execution result of the transaction, only set when tx is in a block. */ executionResult, /** Description of transaction error, if any. */ error, /** The transaction fee paid for the transaction. */ transactionFee, /** The hash of the block containing the transaction. */ blockHash, /** The block number in which the transaction was included. */ blockNumber, /**
|
|
47
|
+
* Debug logs collected during public function execution. Served only when the node is in test mode and placed on
|
|
48
|
+
* the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined
|
|
49
|
+
* tx receipt is obtained).
|
|
50
|
+
*/ debugLogs){
|
|
45
51
|
this.txHash = txHash;
|
|
46
52
|
this.status = status;
|
|
47
53
|
this.executionResult = executionResult;
|
|
@@ -49,6 +55,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
49
55
|
this.transactionFee = transactionFee;
|
|
50
56
|
this.blockHash = blockHash;
|
|
51
57
|
this.blockNumber = blockNumber;
|
|
58
|
+
this.debugLogs = debugLogs;
|
|
52
59
|
}
|
|
53
60
|
/** Returns true if the transaction was executed successfully. */ hasExecutionSucceeded() {
|
|
54
61
|
return this.executionResult === "success";
|
|
@@ -76,11 +83,12 @@ import { TxHash } from './tx_hash.js';
|
|
|
76
83
|
error: z.string().optional(),
|
|
77
84
|
blockHash: BlockHash.schema.optional(),
|
|
78
85
|
blockNumber: BlockNumberSchema.optional(),
|
|
79
|
-
transactionFee: schemas.BigInt.optional()
|
|
86
|
+
transactionFee: schemas.BigInt.optional(),
|
|
87
|
+
debugLogs: z.array(DebugLog.schema).optional()
|
|
80
88
|
}).transform((fields)=>TxReceipt.from(fields));
|
|
81
89
|
}
|
|
82
90
|
static from(fields) {
|
|
83
|
-
return new TxReceipt(fields.txHash, fields.status, fields.executionResult, fields.error, fields.transactionFee, fields.blockHash, fields.blockNumber);
|
|
91
|
+
return new TxReceipt(fields.txHash, fields.status, fields.executionResult, fields.error, fields.transactionFee, fields.blockHash, fields.blockNumber, fields.debugLogs);
|
|
84
92
|
}
|
|
85
93
|
static executionResultFromRevertCode(revertCode) {
|
|
86
94
|
if (revertCode.equals(RevertCode.OK)) {
|
|
@@ -3,6 +3,10 @@ export declare const TX_ERROR_INSUFFICIENT_FEE_PAYER_BALANCE = "Insufficient fee
|
|
|
3
3
|
export declare const TX_ERROR_INSUFFICIENT_GAS_LIMIT = "Gas limit is below the minimum fixed cost";
|
|
4
4
|
export declare const TX_ERROR_GAS_LIMIT_TOO_HIGH = "Gas limit is higher than the amount of gas that the AVM can process";
|
|
5
5
|
export declare const TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED = "Setup function not on allow list";
|
|
6
|
+
export declare const TX_ERROR_SETUP_FUNCTION_UNKNOWN_CONTRACT = "Setup function targets unknown contract";
|
|
7
|
+
export declare const TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER = "Setup only_self function called with incorrect msg_sender";
|
|
8
|
+
export declare const TX_ERROR_SETUP_NULL_MSG_SENDER = "Setup function called with null msg sender";
|
|
9
|
+
export declare const TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH = "Setup function called with wrong calldata length";
|
|
6
10
|
export declare const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = "Duplicate nullifier in tx";
|
|
7
11
|
export declare const TX_ERROR_EXISTING_NULLIFIER = "Existing nullifier";
|
|
8
12
|
export declare const TX_ERROR_INVALID_EXPIRATION_TIMESTAMP = "Invalid expiration timestamp";
|
|
@@ -22,4 +26,4 @@ export declare const TX_ERROR_INCORRECT_HASH = "Incorrect tx hash";
|
|
|
22
26
|
export declare const TX_ERROR_SIZE_ABOVE_LIMIT = "Transaction size above size limit";
|
|
23
27
|
export declare const TX_ERROR_BLOCK_HEADER = "Block header not found";
|
|
24
28
|
export declare const TX_ERROR_DURING_VALIDATION = "Unexpected error during validation";
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JfdGV4dHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90eC92YWxpZGF0b3IvZXJyb3JfdGV4dHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsZUFBTyxNQUFNLGlDQUFpQyw2QkFBNkIsQ0FBQztBQUM1RSxlQUFPLE1BQU0sdUNBQXVDLG1DQUFtQyxDQUFDO0FBQ3hGLGVBQU8sTUFBTSwrQkFBK0IsOENBQThDLENBQUM7QUFDM0YsZUFBTyxNQUFNLDJCQUEyQix3RUFBd0UsQ0FBQztBQUdqSCxlQUFPLE1BQU0sbUNBQW1DLHFDQUFxQyxDQUFDO0FB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FNLDBCQUEwQix1Q0FBdUMsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_texts.d.ts","sourceRoot":"","sources":["../../../src/tx/validator/error_texts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,+BAA+B,8CAA8C,CAAC;AAC3F,eAAO,MAAM,2BAA2B,wEAAwE,CAAC;AAGjH,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"error_texts.d.ts","sourceRoot":"","sources":["../../../src/tx/validator/error_texts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,+BAA+B,8CAA8C,CAAC;AAC3F,eAAO,MAAM,2BAA2B,wEAAwE,CAAC;AAGjH,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AACtF,eAAO,MAAM,wCAAwC,4CAA4C,CAAC;AAClG,eAAO,MAAM,qCAAqC,8DAA8D,CAAC;AACjH,eAAO,MAAM,8BAA8B,+CAA+C,CAAC;AAC3F,eAAO,MAAM,oCAAoC,qDAAqD,CAAC;AAGvG,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAGhE,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AACpF,eAAO,MAAM,8BAA8B,0BAA0B,CAAC;AACtE,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,+BAA+B,0CAA0C,CAAC;AACvF,eAAO,MAAM,0CAA0C,sCAAsC,CAAC;AAG9F,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAGtD,eAAO,MAAM,2BAA2B,uCAAuC,CAAC;AAChF,eAAO,MAAM,gCAAgC,8CAA8C,CAAC;AAC5F,eAAO,MAAM,iCAAiC,uDAAuD,CAAC;AACtG,eAAO,MAAM,iCAAiC,6CAA6C,CAAC;AAC5F,eAAO,MAAM,kCAAkC,yCAAyC,CAAC;AACzF,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAC7E,eAAO,MAAM,mCAAmC,2CAA2C,CAAC;AAC5F,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAG3D,eAAO,MAAM,yBAAyB,sCAAsC,CAAC;AAG7E,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAG9D,eAAO,MAAM,0BAA0B,uCAAuC,CAAC"}
|
|
@@ -5,6 +5,10 @@ export const TX_ERROR_INSUFFICIENT_GAS_LIMIT = 'Gas limit is below the minimum f
|
|
|
5
5
|
export const TX_ERROR_GAS_LIMIT_TOO_HIGH = 'Gas limit is higher than the amount of gas that the AVM can process';
|
|
6
6
|
// Phases
|
|
7
7
|
export const TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED = 'Setup function not on allow list';
|
|
8
|
+
export const TX_ERROR_SETUP_FUNCTION_UNKNOWN_CONTRACT = 'Setup function targets unknown contract';
|
|
9
|
+
export const TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER = 'Setup only_self function called with incorrect msg_sender';
|
|
10
|
+
export const TX_ERROR_SETUP_NULL_MSG_SENDER = 'Setup function called with null msg sender';
|
|
11
|
+
export const TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH = 'Setup function called with wrong calldata length';
|
|
8
12
|
// Nullifiers
|
|
9
13
|
export const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = 'Duplicate nullifier in tx';
|
|
10
14
|
export const TX_ERROR_EXISTING_NULLIFIER = 'Existing nullifier';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export * from './package_version.js';
|
|
2
|
+
export * from './version_checker.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cGRhdGUtY2hlY2tlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsc0JBQXNCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/update-checker/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/update-checker/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './package_version.js';
|
|
2
|
+
export * from './version_checker.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Returns the package version from the release-please manifest, or undefined if not found. */
|
|
2
|
+
export declare function getPackageVersion(): string | undefined;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZV92ZXJzaW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXBkYXRlLWNoZWNrZXIvcGFja2FnZV92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLCtGQUErRjtBQUMvRix3QkFBZ0IsaUJBQWlCLElBQUksTUFBTSxHQUFHLFNBQVMsQ0FVdEQifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package_version.d.ts","sourceRoot":"","sources":["../../src/update-checker/package_version.ts"],"names":[],"mappings":"AAKA,+FAA+F;AAC/F,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAUtD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { dirname, resolve } from 'path';
|
|
4
|
+
/** Returns the package version from the release-please manifest, or undefined if not found. */ export function getPackageVersion() {
|
|
5
|
+
try {
|
|
6
|
+
const releasePleaseManifestPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../.release-please-manifest.json');
|
|
7
|
+
return JSON.parse(readFileSync(releasePleaseManifestPath).toString())['.'];
|
|
8
|
+
} catch {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
export type EventMap = {
|
|
3
|
+
newVersion: [{
|
|
4
|
+
name: string;
|
|
5
|
+
currentVersion: string;
|
|
6
|
+
latestVersion: string;
|
|
7
|
+
}];
|
|
8
|
+
};
|
|
9
|
+
export type VersionCheck = {
|
|
10
|
+
name: string;
|
|
11
|
+
currentVersion: string;
|
|
12
|
+
getLatestVersion: () => Promise<string | undefined>;
|
|
13
|
+
};
|
|
14
|
+
export declare class VersionChecker extends EventEmitter<EventMap> {
|
|
15
|
+
private checks;
|
|
16
|
+
private logger;
|
|
17
|
+
private runningPromise;
|
|
18
|
+
constructor(checks: Array<VersionCheck>, intervalCheckMs?: number, logger?: import("@aztec/foundation/log").Logger);
|
|
19
|
+
start(): void;
|
|
20
|
+
trigger(): Promise<void>;
|
|
21
|
+
stop(): Promise<void>;
|
|
22
|
+
private run;
|
|
23
|
+
private checkVersion;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbl9jaGVja2VyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXBkYXRlLWNoZWNrZXIvdmVyc2lvbl9jaGVja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOi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AAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD,CAAC;AAEF,qBAAa,cAAe,SAAQ,YAAY,CAAC,QAAQ,CAAC;IAGtD,OAAO,CAAC,MAAM;IAEd,OAAO,CAAC,MAAM;IAJhB,OAAO,CAAC,cAAc,CAAiB;IACvC,YACU,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,EACnC,eAAe,SAAS,EAChB,MAAM,yCAAkC,EAIjD;IAEM,KAAK,IAAI,IAAI,CAQnB;IAEM,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9B;IAEY,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAQjC;IAED,OAAO,CAAC,GAAG,CAET;YAEY,YAAY;CAU3B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { RunningPromise } from '@aztec/foundation/promise';
|
|
3
|
+
import { EventEmitter } from 'node:events';
|
|
4
|
+
export class VersionChecker extends EventEmitter {
|
|
5
|
+
checks;
|
|
6
|
+
logger;
|
|
7
|
+
runningPromise;
|
|
8
|
+
constructor(checks, intervalCheckMs = 60_000, logger = createLogger('version_checker')){
|
|
9
|
+
super(), this.checks = checks, this.logger = logger, this.run = async ()=>{
|
|
10
|
+
await Promise.allSettled(this.checks.map((check)=>this.checkVersion(check)));
|
|
11
|
+
};
|
|
12
|
+
this.runningPromise = new RunningPromise(this.run, logger, intervalCheckMs);
|
|
13
|
+
}
|
|
14
|
+
start() {
|
|
15
|
+
if (this.runningPromise.isRunning()) {
|
|
16
|
+
this.logger.warn('VersionChecker is already running');
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.runningPromise.start();
|
|
20
|
+
this.logger.info('Version check started');
|
|
21
|
+
}
|
|
22
|
+
trigger() {
|
|
23
|
+
return this.runningPromise.trigger();
|
|
24
|
+
}
|
|
25
|
+
async stop() {
|
|
26
|
+
if (!this.runningPromise.isRunning()) {
|
|
27
|
+
this.logger.warn('VersionChecker is not running');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await this.runningPromise.stop();
|
|
31
|
+
this.logger.info('Version checker stopped');
|
|
32
|
+
}
|
|
33
|
+
run;
|
|
34
|
+
async checkVersion({ name, currentVersion, getLatestVersion }) {
|
|
35
|
+
try {
|
|
36
|
+
const latestVersion = await getLatestVersion();
|
|
37
|
+
if (latestVersion && latestVersion !== currentVersion) {
|
|
38
|
+
this.emit('newVersion', {
|
|
39
|
+
name,
|
|
40
|
+
latestVersion,
|
|
41
|
+
currentVersion
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
this.logger.warn(`Error checking for new ${name} versions: ${err}`, {
|
|
46
|
+
err
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.d117d021b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"./database-version/version": "./dest/database-version/database_version.js",
|
|
56
56
|
"./database-version/manager": "./dest/database-version/version_manager.js",
|
|
57
57
|
"./validators": "./dest/validators/index.js",
|
|
58
|
+
"./ha-signing": "./dest/ha-signing/index.js",
|
|
58
59
|
"./file-store": "./dest/file-store/index.js",
|
|
59
60
|
"./snapshots": "./dest/snapshots/index.js",
|
|
60
61
|
"./update-checker": "./dest/update-checker/index.js",
|
|
@@ -62,7 +63,8 @@
|
|
|
62
63
|
"./slashing": "./dest/slashing/index.js",
|
|
63
64
|
"./l1-contracts": "./dest/l1-contracts/index.js",
|
|
64
65
|
"./world-state": "./dest/world-state/index.js",
|
|
65
|
-
"./timetable": "./dest/timetable/index.js"
|
|
66
|
+
"./timetable": "./dest/timetable/index.js",
|
|
67
|
+
"./kv-store": "./dest/kv-store/index.js"
|
|
66
68
|
},
|
|
67
69
|
"typedocOptions": {
|
|
68
70
|
"entryPoints": [
|
|
@@ -90,16 +92,15 @@
|
|
|
90
92
|
},
|
|
91
93
|
"dependencies": {
|
|
92
94
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
93
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
94
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
95
|
-
"@aztec/constants": "0.0.1-commit.
|
|
96
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
97
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
98
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
99
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
100
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.cf93bcc56",
|
|
95
|
+
"@aztec/bb.js": "0.0.1-commit.d117d021b",
|
|
96
|
+
"@aztec/blob-lib": "0.0.1-commit.d117d021b",
|
|
97
|
+
"@aztec/constants": "0.0.1-commit.d117d021b",
|
|
98
|
+
"@aztec/ethereum": "0.0.1-commit.d117d021b",
|
|
99
|
+
"@aztec/foundation": "0.0.1-commit.d117d021b",
|
|
100
|
+
"@aztec/l1-artifacts": "0.0.1-commit.d117d021b",
|
|
101
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.d117d021b",
|
|
101
102
|
"@google-cloud/storage": "^7.15.0",
|
|
102
|
-
"axios": "^1.
|
|
103
|
+
"axios": "^1.13.5",
|
|
103
104
|
"json-stringify-deterministic": "1.0.12",
|
|
104
105
|
"lodash.chunk": "^4.2.0",
|
|
105
106
|
"lodash.isequal": "^4.5.0",
|
package/src/abi/decoder.ts
CHANGED
|
@@ -2,12 +2,19 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
|
|
3
3
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
4
4
|
import type { ABIParameter, ABIVariable, AbiType } from './abi.js';
|
|
5
|
-
import { isAztecAddressStruct, parseSignedInt } from './utils.js';
|
|
5
|
+
import { isAztecAddressStruct, isOptionStruct, parseSignedInt } from './utils.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The type of our decoded ABI.
|
|
9
9
|
*/
|
|
10
|
-
export type AbiDecoded =
|
|
10
|
+
export type AbiDecoded =
|
|
11
|
+
| bigint
|
|
12
|
+
| boolean
|
|
13
|
+
| string
|
|
14
|
+
| AztecAddress
|
|
15
|
+
| AbiDecoded[]
|
|
16
|
+
| { [key: string]: AbiDecoded }
|
|
17
|
+
| undefined;
|
|
11
18
|
|
|
12
19
|
/**
|
|
13
20
|
* Decodes values using a provided ABI.
|
|
@@ -51,6 +58,11 @@ class AbiDecoder {
|
|
|
51
58
|
if (isAztecAddressStruct(abiType)) {
|
|
52
59
|
return new AztecAddress(this.getNextField().toBuffer());
|
|
53
60
|
}
|
|
61
|
+
if (isOptionStruct(abiType)) {
|
|
62
|
+
const isSome = this.decodeNext(abiType.fields[0].type);
|
|
63
|
+
const value = this.decodeNext(abiType.fields[1].type);
|
|
64
|
+
return isSome ? value : undefined;
|
|
65
|
+
}
|
|
54
66
|
|
|
55
67
|
for (const field of abiType.fields) {
|
|
56
68
|
struct[field.name] = this.decodeNext(field.type);
|
|
@@ -135,10 +147,7 @@ export class FunctionSignatureDecoder {
|
|
|
135
147
|
case 'field':
|
|
136
148
|
return 'Field';
|
|
137
149
|
case 'integer':
|
|
138
|
-
|
|
139
|
-
throw new Error('Unsupported type: signed integer');
|
|
140
|
-
}
|
|
141
|
-
return `u${param.width}`;
|
|
150
|
+
return param.sign === 'signed' ? `i${param.width}` : `u${param.width}`;
|
|
142
151
|
case 'boolean':
|
|
143
152
|
return 'bool';
|
|
144
153
|
case 'array':
|
package/src/abi/encoder.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
|
|
3
3
|
import type { AbiType, FunctionAbi } from './abi.js';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
isAddressStruct,
|
|
6
|
+
isBoundedVecStruct,
|
|
7
|
+
isFunctionSelectorStruct,
|
|
8
|
+
isOptionStruct,
|
|
9
|
+
isWrappedFieldStruct,
|
|
10
|
+
} from './utils.js';
|
|
5
11
|
|
|
6
12
|
/**
|
|
7
13
|
* Encodes arguments for a function call.
|
|
@@ -43,6 +49,32 @@ class ArgumentEncoder {
|
|
|
43
49
|
* @param name - Name.
|
|
44
50
|
*/
|
|
45
51
|
private encodeArgument(abiType: AbiType, arg: any, name?: string) {
|
|
52
|
+
if (isOptionStruct(abiType)) {
|
|
53
|
+
const optionType = abiType as Extract<AbiType, { kind: 'struct' }>;
|
|
54
|
+
const [isSomeField, valueField] = optionType.fields;
|
|
55
|
+
|
|
56
|
+
if (arg === undefined || arg === null) {
|
|
57
|
+
this.encodeArgument(isSomeField.type, false, `${name}._is_some`);
|
|
58
|
+
this.#encodeDefaultValue(valueField.type);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (typeof arg === 'object' && '_is_some' in arg) {
|
|
63
|
+
this.encodeArgument(isSomeField.type, arg._is_some, `${name}._is_some`);
|
|
64
|
+
|
|
65
|
+
if (arg._is_some) {
|
|
66
|
+
this.encodeArgument(valueField.type, arg._value, `${name}._value`);
|
|
67
|
+
} else {
|
|
68
|
+
this.#encodeDefaultValue(valueField.type);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
this.encodeArgument(isSomeField.type, true, `${name}._is_some`);
|
|
74
|
+
this.encodeArgument(valueField.type, arg, `${name}._value`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
46
78
|
if (arg === undefined || arg == null) {
|
|
47
79
|
throw new Error(`Undefined argument ${name ?? 'unnamed'} of type ${abiType.kind}`);
|
|
48
80
|
}
|
|
@@ -123,14 +155,17 @@ class ArgumentEncoder {
|
|
|
123
155
|
}
|
|
124
156
|
break;
|
|
125
157
|
}
|
|
126
|
-
case 'integer':
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
158
|
+
case 'integer': {
|
|
159
|
+
const value = BigInt(arg);
|
|
160
|
+
if (abiType.sign === 'signed' && value < 0n) {
|
|
161
|
+
// Convert negative values to two's complement representation
|
|
162
|
+
const twosComplement = value + (1n << BigInt(abiType.width));
|
|
163
|
+
this.flattened.push(new Fr(twosComplement));
|
|
130
164
|
} else {
|
|
131
|
-
this.flattened.push(new Fr(
|
|
165
|
+
this.flattened.push(new Fr(value));
|
|
132
166
|
}
|
|
133
167
|
break;
|
|
168
|
+
}
|
|
134
169
|
default:
|
|
135
170
|
throw new Error(`Unsupported type: ${abiType.kind}`);
|
|
136
171
|
}
|
|
@@ -224,6 +259,14 @@ class ArgumentEncoder {
|
|
|
224
259
|
this.encodeArgument(lenField.type, arg.length, 'len');
|
|
225
260
|
}
|
|
226
261
|
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Appends the flattened zero value for an ABI type.
|
|
265
|
+
* Option::None still serializes the wrapped value, so we need to zero-fill its footprint.
|
|
266
|
+
*/
|
|
267
|
+
#encodeDefaultValue(abiType: AbiType) {
|
|
268
|
+
this.flattened.push(...new Array(ArgumentEncoder.typeSize(abiType)).fill(Fr.ZERO));
|
|
269
|
+
}
|
|
227
270
|
}
|
|
228
271
|
|
|
229
272
|
/**
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AbiType } from './abi.js';
|
|
2
2
|
import type { EventSelector } from './event_selector.js';
|
|
3
3
|
|
|
4
|
+
/** Metadata for a contract event, used to decode emitted event logs back into structured data. */
|
|
4
5
|
export type EventMetadataDefinition = {
|
|
5
6
|
eventSelector: EventSelector;
|
|
6
7
|
abiType: AbiType;
|
|
8
|
+
/** Names of the event's struct members (not serialized Noir Field elements). */
|
|
7
9
|
fieldNames: string[];
|
|
8
10
|
};
|
package/src/abi/utils.ts
CHANGED
|
@@ -81,6 +81,31 @@ export function isBoundedVecStruct(abiType: AbiType) {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Returns whether the ABI type is Noir's std::option::Option lowered to a struct.
|
|
86
|
+
* @param abiType - Type to check.
|
|
87
|
+
* @returns A boolean indicating whether the ABI type is an Option struct.
|
|
88
|
+
*/
|
|
89
|
+
export function isOptionStruct(abiType: AbiType) {
|
|
90
|
+
return (
|
|
91
|
+
abiType.kind === 'struct' &&
|
|
92
|
+
abiType.path === 'std::option::Option' &&
|
|
93
|
+
abiType.fields.length === 2 &&
|
|
94
|
+
abiType.fields[0].name === '_is_some' &&
|
|
95
|
+
abiType.fields[1].name === '_value'
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Returns whether `null` or `undefined` can be mapped to a valid ABI value for this type.
|
|
101
|
+
*
|
|
102
|
+
* @param abiType - Type to check.
|
|
103
|
+
* @returns A boolean indicating whether nullish values are valid shorthand for this ABI type.
|
|
104
|
+
*/
|
|
105
|
+
export function canBeMappedFromNullOrUndefined(abiType: AbiType) {
|
|
106
|
+
return isOptionStruct(abiType);
|
|
107
|
+
}
|
|
108
|
+
|
|
84
109
|
/**
|
|
85
110
|
* Returns a bigint by parsing a serialized 2's complement signed int.
|
|
86
111
|
* @param b - The signed int as a buffer
|
package/src/avm/revert_code.ts
CHANGED
|
@@ -5,10 +5,25 @@ import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
|
5
5
|
import { inspect } from 'util';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Tracks which revertible phases of a transaction's public execution reverted.
|
|
10
|
+
*
|
|
11
|
+
* A transaction executes in three sequential phases:
|
|
12
|
+
* 1. SETUP – non-revertible; if this fails the entire transaction is rejected.
|
|
13
|
+
* 2. APP_LOGIC – revertible; its state changes are rolled back on failure.
|
|
14
|
+
* 3. TEARDOWN – revertible; always runs (even after app-logic revert) so the fee-payment contract can clean up.
|
|
15
|
+
*
|
|
16
|
+
* Only APP_LOGIC and TEARDOWN can produce a revert code. SETUP failures throw instead and discard the transaction
|
|
17
|
+
* entirely.
|
|
18
|
+
*/
|
|
8
19
|
export enum RevertCodeEnum {
|
|
20
|
+
/** All phases completed successfully; no state was rolled back. */
|
|
9
21
|
OK = 0,
|
|
22
|
+
/** APP_LOGIC reverted; its state changes were discarded. If present, TEARDOWN still ran and succeeded. */
|
|
10
23
|
APP_LOGIC_REVERTED = 1,
|
|
24
|
+
/** TEARDOWN reverted; its state changes were discarded. APP_LOGIC succeeded. */
|
|
11
25
|
TEARDOWN_REVERTED = 2,
|
|
26
|
+
/** Both APP_LOGIC and TEARDOWN reverted; only SETUP effects are kept. */
|
|
12
27
|
BOTH_REVERTED = 3,
|
|
13
28
|
}
|
|
14
29
|
|
package/src/block/l2_block.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BlockBlobData, encodeBlockBlobData } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { DA_GAS_PER_FIELD } from '@aztec/constants';
|
|
2
3
|
import {
|
|
3
4
|
BlockNumber,
|
|
4
5
|
CheckpointNumber,
|
|
@@ -175,7 +176,7 @@ export class L2Block {
|
|
|
175
176
|
} & Partial<Parameters<typeof BlockHeader.random>[0]> = {},
|
|
176
177
|
): Promise<L2Block> {
|
|
177
178
|
const archive = new AppendOnlyTreeSnapshot(Fr.random(), blockNumber + 1);
|
|
178
|
-
const header = BlockHeader.random({
|
|
179
|
+
const header = BlockHeader.random({ ...blockHeaderOverrides, blockNumber });
|
|
179
180
|
const body = await Body.random({ txsPerBlock, makeTxOptions, ...txOptions });
|
|
180
181
|
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
181
182
|
}
|
|
@@ -221,4 +222,15 @@ export class L2Block {
|
|
|
221
222
|
timestamp: this.header.globalVariables.timestamp,
|
|
222
223
|
};
|
|
223
224
|
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Compute how much DA gas this block uses.
|
|
228
|
+
*
|
|
229
|
+
* @remarks This assumes DA gas is computed solely based on the number of blob fields in transactions.
|
|
230
|
+
* This may change in the future, but we cannot access the actual DA gas used in a block since it's not exposed
|
|
231
|
+
* in the L2BlockHeader, so we have to rely on recomputing it.
|
|
232
|
+
*/
|
|
233
|
+
computeDAGasUsed(): number {
|
|
234
|
+
return this.body.txEffects.reduce((total, txEffect) => total + txEffect.getNumBlobFields(), 0) * DA_GAS_PER_FIELD;
|
|
235
|
+
}
|
|
224
236
|
}
|
|
@@ -49,6 +49,12 @@ export interface L2BlockSource {
|
|
|
49
49
|
*/
|
|
50
50
|
getBlockNumber(): Promise<BlockNumber>;
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Gets the number of the latest L2 checkpoint processed by the block source implementation.
|
|
54
|
+
* @returns The number of the latest L2 checkpoint processed by the block source implementation.
|
|
55
|
+
*/
|
|
56
|
+
getCheckpointNumber(): Promise<CheckpointNumber>;
|
|
57
|
+
|
|
52
58
|
/**
|
|
53
59
|
* Gets the number of the latest L2 block proven seen by the block source implementation.
|
|
54
60
|
* @returns The number of the latest L2 block proven seen by the block source implementation.
|
|
@@ -109,6 +109,27 @@ export class L2BlockStream {
|
|
|
109
109
|
|
|
110
110
|
let nextBlockNumber = latestBlockNumber + 1;
|
|
111
111
|
let nextCheckpointToEmit = CheckpointNumber(localTips.checkpointed.checkpoint.number + 1);
|
|
112
|
+
|
|
113
|
+
// When startingBlock is set, also skip ahead for checkpoints.
|
|
114
|
+
if (
|
|
115
|
+
this.opts.startingBlock !== undefined &&
|
|
116
|
+
this.opts.startingBlock >= 1 &&
|
|
117
|
+
nextCheckpointToEmit <= sourceTips.checkpointed.checkpoint.number
|
|
118
|
+
) {
|
|
119
|
+
const startingBlockCheckpoints = await this.l2BlockSource.getCheckpointedBlocks(
|
|
120
|
+
BlockNumber(this.opts.startingBlock),
|
|
121
|
+
1,
|
|
122
|
+
);
|
|
123
|
+
if (startingBlockCheckpoints.length > 0) {
|
|
124
|
+
nextCheckpointToEmit = CheckpointNumber(
|
|
125
|
+
Math.max(nextCheckpointToEmit, startingBlockCheckpoints[0].checkpointNumber),
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
// startingBlock is past all checkpointed blocks; skip Loop 1 entirely.
|
|
129
|
+
nextCheckpointToEmit = CheckpointNumber(sourceTips.checkpointed.checkpoint.number + 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
112
133
|
if (this.opts.skipFinalized) {
|
|
113
134
|
// When skipping finalized blocks we need to provide reliable reorg detection while fetching as few blocks as
|
|
114
135
|
// possible. Finalized blocks cannot be reorged by definition, so we can skip most of them. We do need the very
|