@aztec/stdlib 0.0.1-commit.9ef841308 → 0.0.1-commit.a89ec08
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/abi.d.ts +26 -191
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +45 -4
- package/dest/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/avm/avm.d.ts +300 -300
- package/dest/avm/avm_accumulated_data.js +2 -2
- package/dest/avm/avm_circuit_public_inputs.js +2 -2
- package/dest/avm/revert_code.d.ts +8 -18
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +15 -30
- package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/config/index.d.ts +1 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +0 -1
- package/dest/config/sequencer-config.d.ts +1 -3
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +0 -1
- package/dest/contract/contract_address.d.ts +3 -3
- package/dest/contract/contract_address.js +3 -3
- package/dest/contract/contract_class_id.d.ts +2 -2
- package/dest/contract/contract_class_id.js +2 -2
- package/dest/contract/index.d.ts +3 -1
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +2 -0
- package/dest/contract/interfaces/contract_class.d.ts +156 -3
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +28 -1
- package/dest/contract/private_function_membership_proof.d.ts +32 -0
- package/dest/contract/private_function_membership_proof.d.ts.map +1 -0
- package/dest/contract/private_function_membership_proof.js +124 -0
- package/dest/contract/utility_function_membership_proof.d.ts +27 -0
- package/dest/contract/utility_function_membership_proof.d.ts.map +1 -0
- package/dest/contract/utility_function_membership_proof.js +87 -0
- package/dest/file-store/factory.d.ts +3 -4
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +2 -2
- package/dest/file-store/http.d.ts +2 -9
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +9 -20
- package/dest/file-store/index.d.ts +1 -2
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/gas/gas_settings.d.ts +40 -3
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +50 -6
- package/dest/interfaces/aztec-node-admin.d.ts +7 -13
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-debug.d.ts +21 -0
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-debug.js +18 -0
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/l2_logs_source.d.ts +3 -5
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +200 -200
- package/dest/interfaces/validator.d.ts +26 -38
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +3 -2
- package/dest/kernel/claimed_length_array.js +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/padded_side_effects.js +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +2 -2
- package/dest/kernel/private_to_public_accumulated_data.js +2 -2
- package/dest/kernel/private_to_rollup_accumulated_data.js +1 -1
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +4 -4
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/extended_directional_app_tagging_secret.js +12 -5
- package/dest/logs/private_log.js +1 -1
- package/dest/logs/public_log.d.ts +1 -1
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +7 -1
- package/dest/messaging/l1_to_l2_message_source.d.ts +2 -4
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- 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 -2
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +1 -1
- package/dest/parity/parity_base_private_inputs.js +1 -1
- package/dest/proofs/chonk_proof.d.ts +2 -46
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +15 -84
- package/dest/rollup/base_rollup_hints.js +2 -2
- package/dest/rollup/block_root_rollup_private_inputs.js +5 -5
- package/dest/rollup/checkpoint_rollup_public_inputs.js +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +3 -3
- package/dest/rollup/root_rollup_public_inputs.js +1 -1
- package/dest/rollup/tree_snapshot_diff_hints.js +2 -2
- package/dest/tests/factories.d.ts +4 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +28 -1
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +2 -2
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/simulated_tx.d.ts +29 -154
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +3 -3
- package/dest/tx/tx_receipt.d.ts +8 -4
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +8 -15
- package/dest/vks/vk_data.js +1 -1
- package/package.json +10 -11
- package/src/abi/abi.ts +67 -14
- package/src/abi/selector.ts +1 -1
- package/src/avm/avm_accumulated_data.ts +6 -6
- package/src/avm/avm_circuit_public_inputs.ts +4 -4
- package/src/avm/revert_code.ts +25 -39
- package/src/block/l2_block_stream/interfaces.ts +6 -2
- package/src/config/index.ts +0 -1
- package/src/config/sequencer-config.ts +0 -3
- package/src/contract/contract_address.ts +3 -3
- package/src/contract/contract_class_id.ts +2 -2
- package/src/contract/index.ts +2 -0
- package/src/contract/interfaces/contract_class.ts +82 -2
- package/src/contract/private_function_membership_proof.ts +167 -0
- package/src/contract/utility_function_membership_proof.ts +118 -0
- package/src/file-store/factory.ts +4 -13
- package/src/file-store/http.ts +10 -29
- package/src/file-store/index.ts +0 -1
- package/src/gas/gas_settings.ts +65 -12
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/l2_logs_source.ts +1 -4
- package/src/interfaces/validator.ts +36 -38
- package/src/kernel/claimed_length_array.ts +2 -2
- package/src/kernel/hints/private_kernel_reset_hints.ts +5 -2
- package/src/kernel/hints/read_request_hints.ts +3 -3
- package/src/kernel/padded_side_effects.ts +3 -3
- package/src/kernel/private_to_avm_accumulated_data.ts +4 -4
- package/src/kernel/private_to_public_accumulated_data.ts +10 -10
- package/src/kernel/private_to_rollup_accumulated_data.ts +5 -5
- package/src/logs/extended_directional_app_tagging_secret.ts +19 -8
- package/src/logs/private_log.ts +1 -1
- package/src/logs/public_log.ts +11 -1
- package/src/messaging/l1_to_l2_message_source.ts +1 -3
- package/src/p2p/block_proposal.ts +1 -1
- package/src/p2p/checkpoint_proposal.ts +1 -1
- package/src/parity/parity_base_private_inputs.ts +1 -1
- package/src/proofs/chonk_proof.ts +12 -90
- package/src/rollup/base_rollup_hints.ts +2 -2
- package/src/rollup/block_root_rollup_private_inputs.ts +8 -8
- package/src/rollup/checkpoint_rollup_public_inputs.ts +2 -2
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +4 -4
- package/src/rollup/root_rollup_public_inputs.ts +2 -2
- package/src/rollup/tree_snapshot_diff_hints.ts +5 -5
- package/src/tests/factories.ts +34 -1
- package/src/tests/mocks.ts +2 -2
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/simulated_tx.ts +6 -2
- package/src/tx/tx_receipt.ts +11 -14
- package/src/vks/vk_data.ts +1 -1
- package/dest/config/pipelining-config.d.ts +0 -19
- package/dest/config/pipelining-config.d.ts.map +0 -1
- package/dest/config/pipelining-config.js +0 -18
- package/dest/ha-signing/config.d.ts +0 -136
- package/dest/ha-signing/config.d.ts.map +0 -1
- package/dest/ha-signing/config.js +0 -97
- package/dest/ha-signing/index.d.ts +0 -4
- package/dest/ha-signing/index.d.ts.map +0 -1
- package/dest/ha-signing/index.js +0 -3
- package/dest/ha-signing/local_config.d.ts +0 -63
- package/dest/ha-signing/local_config.d.ts.map +0 -1
- package/dest/ha-signing/local_config.js +0 -24
- package/dest/ha-signing/types.d.ts +0 -85
- package/dest/ha-signing/types.d.ts.map +0 -1
- package/dest/ha-signing/types.js +0 -32
- package/dest/kv-store/config.d.ts +0 -17
- package/dest/kv-store/config.d.ts.map +0 -1
- package/dest/kv-store/config.js +0 -26
- package/dest/kv-store/index.d.ts +0 -2
- package/dest/kv-store/index.d.ts.map +0 -1
- package/dest/kv-store/index.js +0 -1
- package/src/config/pipelining-config.ts +0 -31
- package/src/ha-signing/config.ts +0 -156
- package/src/ha-signing/index.ts +0 -27
- package/src/ha-signing/local_config.ts +0 -46
- package/src/ha-signing/types.ts +0 -112
- package/src/kv-store/config.ts +0 -36
- package/src/kv-store/index.ts +0 -1
|
@@ -23,14 +23,14 @@ import { computeAddressSecret, computePreaddress } from '../keys/derivation.js';
|
|
|
23
23
|
* doesn't seem to be a good way around this.
|
|
24
24
|
*/
|
|
25
25
|
export class ExtendedDirectionalAppTaggingSecret {
|
|
26
|
-
|
|
26
|
+
constructor(
|
|
27
27
|
public readonly secret: Fr,
|
|
28
28
|
public readonly app: AztecAddress,
|
|
29
29
|
) {}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Derives shared tagging secret and from that, the app address and recipient derives the directional app tagging
|
|
33
|
-
* secret.
|
|
33
|
+
* secret. Returns undefined if `externalAddress` is an invalid address.
|
|
34
34
|
*
|
|
35
35
|
* @param localAddress - The complete address of entity A in the shared tagging secret derivation scheme
|
|
36
36
|
* @param localIvsk - The incoming viewing secret key of entity A
|
|
@@ -45,8 +45,12 @@ export class ExtendedDirectionalAppTaggingSecret {
|
|
|
45
45
|
externalAddress: AztecAddress,
|
|
46
46
|
app: AztecAddress,
|
|
47
47
|
recipient: AztecAddress,
|
|
48
|
-
): Promise<ExtendedDirectionalAppTaggingSecret> {
|
|
48
|
+
): Promise<ExtendedDirectionalAppTaggingSecret | undefined> {
|
|
49
49
|
const taggingSecretPoint = await computeSharedTaggingSecret(localAddress, localIvsk, externalAddress);
|
|
50
|
+
if (!taggingSecretPoint) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
const appTaggingSecret = await poseidon2Hash([taggingSecretPoint.x, taggingSecretPoint.y, app]);
|
|
51
55
|
const directionalAppTaggingSecret = await poseidon2Hash([appTaggingSecret, recipient]);
|
|
52
56
|
|
|
@@ -63,18 +67,25 @@ export class ExtendedDirectionalAppTaggingSecret {
|
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
// Returns shared tagging secret computed with Diffie-Hellman key exchange
|
|
70
|
+
// Returns shared tagging secret computed with Diffie-Hellman key exchange, or undefined if `externalAddress` is an
|
|
71
|
+
// invalid address.
|
|
67
72
|
async function computeSharedTaggingSecret(
|
|
68
73
|
localAddress: CompleteAddress,
|
|
69
74
|
localIvsk: Fq,
|
|
70
75
|
externalAddress: AztecAddress,
|
|
71
|
-
): Promise<Point> {
|
|
72
|
-
const knownPreaddress = await computePreaddress(await localAddress.publicKeys.hash(), localAddress.partialAddress);
|
|
73
|
-
// TODO: #8970 - Computation of address point from x coordinate might fail
|
|
74
|
-
const externalAddressPoint = await externalAddress.toAddressPoint();
|
|
76
|
+
): Promise<Point | undefined> {
|
|
75
77
|
// Given A (local complete address) -> B (external address) and h == preaddress
|
|
76
78
|
// Compute shared secret as S = (h_A + local_ivsk_A) * Addr_Point_B
|
|
77
79
|
|
|
80
|
+
const knownPreaddress = await computePreaddress(await localAddress.publicKeys.hash(), localAddress.partialAddress);
|
|
81
|
+
|
|
82
|
+
// An invalid address has no corresponding address point
|
|
83
|
+
if (!(await externalAddress.isValid())) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const externalAddressPoint = await externalAddress.toAddressPoint();
|
|
88
|
+
|
|
78
89
|
// Beware! h_a + local_ivsk_a (also known as the address secret) can lead to an address point with a negative
|
|
79
90
|
// y-coordinate, since there's two possible candidates computeAddressSecret takes care of selecting the one that
|
|
80
91
|
// leads to a positive y-coordinate, which is the only valid address point
|
package/src/logs/private_log.ts
CHANGED
|
@@ -73,7 +73,7 @@ export class PrivateLog {
|
|
|
73
73
|
|
|
74
74
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
75
75
|
const reader = BufferReader.asReader(buffer);
|
|
76
|
-
return new PrivateLog(reader.
|
|
76
|
+
return new PrivateLog(reader.readTuple(PRIVATE_LOG_SIZE_IN_FIELDS, Fr), reader.readNumber());
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
static random(tag = Fr.random()) {
|
package/src/logs/public_log.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH,
|
|
3
|
+
MAX_PUBLIC_LOG_SIZE_IN_FIELDS,
|
|
4
|
+
PUBLIC_LOG_HEADER_LENGTH,
|
|
5
|
+
} from '@aztec/constants';
|
|
2
6
|
import type { FieldsOf } from '@aztec/foundation/array';
|
|
3
7
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
8
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
@@ -76,6 +80,9 @@ export class FlatPublicLogs {
|
|
|
76
80
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
77
81
|
const reader = BufferReader.asReader(buffer);
|
|
78
82
|
const length = reader.readNumber();
|
|
83
|
+
if (length > FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH) {
|
|
84
|
+
throw new Error(`FlatPublicLogs length ${length} exceeds maximum ${FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH}`);
|
|
85
|
+
}
|
|
79
86
|
return this.fromUnpaddedPayload(reader.readArray(length, Fr));
|
|
80
87
|
}
|
|
81
88
|
|
|
@@ -171,6 +178,9 @@ export class PublicLog {
|
|
|
171
178
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
172
179
|
const reader = BufferReader.asReader(buffer);
|
|
173
180
|
const fieldsLength = reader.readNumber();
|
|
181
|
+
if (fieldsLength > MAX_PUBLIC_LOG_SIZE_IN_FIELDS) {
|
|
182
|
+
throw new Error(`PublicLog fields length ${fieldsLength} exceeds maximum ${MAX_PUBLIC_LOG_SIZE_IN_FIELDS}`);
|
|
183
|
+
}
|
|
174
184
|
return new PublicLog(reader.readObject(AztecAddress), reader.readArray(fieldsLength, Fr));
|
|
175
185
|
}
|
|
176
186
|
|
|
@@ -10,9 +10,7 @@ export interface L1ToL2MessageSource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Gets new L1 to L2 message (to be) included in a given checkpoint.
|
|
12
12
|
* @param checkpointNumber - Checkpoint number to get messages for.
|
|
13
|
-
* @returns The L1 to L2 messages/leaves of the messages subtree.
|
|
14
|
-
* @throws If the message tree for the given checkpoint has not yet been sealed on L1
|
|
15
|
-
* (i.e., checkpointNumber >= inbox treeInProgress).
|
|
13
|
+
* @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
|
|
16
14
|
*/
|
|
17
15
|
getL1ToL2Messages(checkpointNumber: CheckpointNumber): Promise<Fr[]>;
|
|
18
16
|
|
|
@@ -6,11 +6,11 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
6
6
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
7
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
8
8
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
9
|
+
import { DutyType, type SigningContext } from '@aztec/validator-ha-signer/types';
|
|
9
10
|
|
|
10
11
|
import type { L2Block } from '../block/l2_block.js';
|
|
11
12
|
import type { L2BlockInfo } from '../block/l2_block_info.js';
|
|
12
13
|
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
13
|
-
import { DutyType, type SigningContext } from '../ha-signing/index.js';
|
|
14
14
|
import { BlockHeader } from '../tx/block_header.js';
|
|
15
15
|
import { TxHash } from '../tx/index.js';
|
|
16
16
|
import type { Tx } from '../tx/tx.js';
|
|
@@ -6,10 +6,10 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
6
6
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
7
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
8
8
|
import { BufferReader, serializeSignedBigInt, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
9
|
+
import { DutyType, type SigningContext } from '@aztec/validator-ha-signer/types';
|
|
9
10
|
|
|
10
11
|
import type { L2BlockInfo } from '../block/l2_block_info.js';
|
|
11
12
|
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
12
|
-
import { DutyType, type SigningContext } from '../ha-signing/index.js';
|
|
13
13
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
14
14
|
import { BlockHeader } from '../tx/block_header.js';
|
|
15
15
|
import { TxHash } from '../tx/index.js';
|
|
@@ -41,7 +41,7 @@ export class ParityBasePrivateInputs {
|
|
|
41
41
|
*/
|
|
42
42
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
43
43
|
const reader = BufferReader.asReader(buffer);
|
|
44
|
-
return new ParityBasePrivateInputs(reader.
|
|
44
|
+
return new ParityBasePrivateInputs(reader.readTuple(NUM_MSGS_PER_BASE_PARITY, Fr), Fr.fromBuffer(reader));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
import { BarretenbergSync, flattenChonkProofFields } from '@aztec/bb.js';
|
|
2
1
|
import { CHONK_PROOF_LENGTH } from '@aztec/constants';
|
|
3
2
|
import { times } from '@aztec/foundation/collection';
|
|
4
3
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
5
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
7
|
-
import { BufferReader,
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serialization format detection for ChonkProof is size-based:
|
|
11
|
-
* - UNCOMPRESSED (legacy): [field_count=1632: uint32] [fields...] → total ≈ 52KB (>= 40KB)
|
|
12
|
-
* - COMPRESSED: [byte_count: uint32] [compressed_bytes] → total ≈ 35KB (< 40KB)
|
|
13
|
-
*
|
|
14
|
-
* Detection: if the first uint32 equals CHONK_PROOF_LENGTH (1632), it's legacy format
|
|
15
|
-
* (field count). Otherwise, it's compressed format (byte count). The old uncompressed
|
|
16
|
-
* format is never smaller than 40KB; compressed proofs are always smaller than 40KB.
|
|
17
|
-
*/
|
|
6
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
18
7
|
|
|
19
8
|
// CHONK: "Client Honk" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.
|
|
20
9
|
export class ChonkProof {
|
|
21
|
-
/**
|
|
22
|
-
* Optional compressed proof bytes from chonk compression (point compression + u256 encoding).
|
|
23
|
-
* When set, toBuffer() will serialize in compressed format (~1.7x smaller).
|
|
24
|
-
* When reading from compressed format, this is populated and fields are decompressed on demand.
|
|
25
|
-
*/
|
|
26
|
-
public compressedProof?: Buffer;
|
|
27
|
-
|
|
28
10
|
constructor(
|
|
29
11
|
// The proof fields.
|
|
30
12
|
// For native verification, attach public inputs via `attachPublicInputs(publicInputs)`.
|
|
31
13
|
// Not using Tuple here due to the length being too high.
|
|
32
14
|
public fields: Fr[],
|
|
33
|
-
compressedProof?: Buffer,
|
|
34
15
|
) {
|
|
35
16
|
if (fields.length !== CHONK_PROOF_LENGTH) {
|
|
36
17
|
throw new Error(`Invalid ChonkProof length: ${fields.length}`);
|
|
37
18
|
}
|
|
38
|
-
this.compressedProof = compressedProof;
|
|
39
19
|
}
|
|
40
20
|
|
|
41
21
|
public attachPublicInputs(publicInputs: Fr[]) {
|
|
@@ -73,84 +53,22 @@ export class ChonkProof {
|
|
|
73
53
|
return this.toBuffer();
|
|
74
54
|
}
|
|
75
55
|
|
|
76
|
-
/**
|
|
77
|
-
* Deserialize a ChonkProof from a buffer.
|
|
78
|
-
* Supports both legacy (field elements) and compressed (chonk compression) formats.
|
|
79
|
-
*
|
|
80
|
-
* Size-based format detection:
|
|
81
|
-
* - First uint32 == CHONK_PROOF_LENGTH (1632): legacy format, read field elements
|
|
82
|
-
* Total proof data ≈ 52KB (always >= 40KB)
|
|
83
|
-
* - Otherwise: compressed format, first uint32 is byte count of compressed data
|
|
84
|
-
* Total proof data ≈ 35KB (always < 40KB)
|
|
85
|
-
*/
|
|
86
56
|
static fromBuffer(buffer: Buffer | BufferReader): ChonkProof {
|
|
87
57
|
const reader = BufferReader.asReader(buffer);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// Legacy format: firstUint32 is the field count (1632)
|
|
92
|
-
// Widen to `number` to prevent TS from narrowing to literal 1632,
|
|
93
|
-
// which would cause Tuple<Fr, 1632> to exceed the recursion limit.
|
|
94
|
-
const fieldCount: number = firstUint32;
|
|
95
|
-
const proof = reader.readArray(fieldCount, Fr);
|
|
96
|
-
return new ChonkProof(proof);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Compressed format: firstUint32 is the compressed byte count
|
|
100
|
-
const compressedBytes = reader.readBytes(firstUint32);
|
|
101
|
-
return ChonkProof.fromCompressedBytes(Buffer.from(compressedBytes));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Create a ChonkProof from compressed bytes by decompressing via the BarretenbergSync API.
|
|
106
|
-
* The compressed format uses point compression and u256 encoding (from PR #20645).
|
|
107
|
-
*
|
|
108
|
-
* @param compressed - Compressed proof bytes from chonk compression
|
|
109
|
-
* @returns ChonkProof with both fields and compressed bytes populated
|
|
110
|
-
*/
|
|
111
|
-
static fromCompressedBytes(compressed: Buffer): ChonkProof {
|
|
112
|
-
const api = BarretenbergSync.getSingleton();
|
|
113
|
-
const result = api.chonkDecompressProof({ compressedProof: new Uint8Array(compressed) });
|
|
114
|
-
|
|
115
|
-
// Flatten the structured bb.js ChonkProof into flat Fr[] field elements
|
|
116
|
-
const flatFields = flattenChonkProofFields(result.proof);
|
|
117
|
-
const fields = flatFields.map(f => Fr.fromBuffer(Buffer.from(f)));
|
|
118
|
-
|
|
119
|
-
// The decompressed proof includes public inputs in hidingOinkProof.
|
|
120
|
-
// Since ChonkProof stores fields WITHOUT public inputs, strip them.
|
|
121
|
-
// The number of public inputs = total fields - CHONK_PROOF_LENGTH
|
|
122
|
-
if (fields.length > CHONK_PROOF_LENGTH) {
|
|
123
|
-
const numPubInputs = fields.length - CHONK_PROOF_LENGTH;
|
|
124
|
-
const proofFields = fields.slice(numPubInputs);
|
|
125
|
-
return new ChonkProof(proofFields, compressed);
|
|
58
|
+
const proofLength = reader.readNumber();
|
|
59
|
+
if (proofLength !== CHONK_PROOF_LENGTH) {
|
|
60
|
+
throw new Error(`Invalid ChonkProof length from buffer: ${proofLength}, expected ${CHONK_PROOF_LENGTH}`);
|
|
126
61
|
}
|
|
127
|
-
|
|
128
|
-
return new ChonkProof(
|
|
62
|
+
const proof = reader.readArray(CHONK_PROOF_LENGTH, Fr);
|
|
63
|
+
return new ChonkProof(proof);
|
|
129
64
|
}
|
|
130
65
|
|
|
131
|
-
/**
|
|
132
|
-
* Serialize the proof to a buffer.
|
|
133
|
-
* If compressed bytes are available, uses the compressed format (~1.7x smaller).
|
|
134
|
-
* Otherwise falls back to legacy field element format.
|
|
135
|
-
*/
|
|
136
66
|
public toBuffer() {
|
|
137
|
-
if (this.compressedProof) {
|
|
138
|
-
// Compressed format: [compressed_byte_count: uint32] [compressed_bytes]
|
|
139
|
-
return Buffer.concat([numToUInt32BE(this.compressedProof.length), this.compressedProof]);
|
|
140
|
-
}
|
|
141
|
-
// Legacy format: [field_count=1632: uint32] [fields...]
|
|
142
67
|
return serializeToBuffer(this.fields.length, this.fields);
|
|
143
68
|
}
|
|
144
69
|
}
|
|
145
70
|
|
|
146
71
|
export class ChonkProofWithPublicInputs {
|
|
147
|
-
/**
|
|
148
|
-
* Optional compressed proof bytes (covers the full proof WITH public inputs).
|
|
149
|
-
* Set by the prover when using chonk compression. Flows through to ChonkProof
|
|
150
|
-
* via removePublicInputs() so the Tx can serialize in compressed format.
|
|
151
|
-
*/
|
|
152
|
-
public compressedProof?: Buffer;
|
|
153
|
-
|
|
154
72
|
constructor(
|
|
155
73
|
// The proof fields with public inputs.
|
|
156
74
|
// For recursive verification, use without public inputs via `removePublicInputs()`.
|
|
@@ -168,8 +86,7 @@ export class ChonkProofWithPublicInputs {
|
|
|
168
86
|
|
|
169
87
|
public removePublicInputs() {
|
|
170
88
|
const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
|
|
171
|
-
|
|
172
|
-
return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs), this.compressedProof);
|
|
89
|
+
return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs));
|
|
173
90
|
}
|
|
174
91
|
|
|
175
92
|
public isEmpty() {
|
|
@@ -192,6 +109,11 @@ export class ChonkProofWithPublicInputs {
|
|
|
192
109
|
static fromBuffer(buffer: Buffer | BufferReader): ChonkProofWithPublicInputs {
|
|
193
110
|
const reader = BufferReader.asReader(buffer);
|
|
194
111
|
const proofLength = reader.readNumber();
|
|
112
|
+
if (proofLength < CHONK_PROOF_LENGTH) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
`Invalid ChonkProofWithPublicInputs length from buffer: ${proofLength}, expected at least ${CHONK_PROOF_LENGTH}`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
195
117
|
const proof = reader.readArray(proofLength, Fr);
|
|
196
118
|
return new ChonkProofWithPublicInputs(proof);
|
|
197
119
|
}
|
|
@@ -86,7 +86,7 @@ export class PrivateBaseRollupHints {
|
|
|
86
86
|
reader.readObject(SpongeBlob),
|
|
87
87
|
reader.readObject(TreeSnapshotDiffHints),
|
|
88
88
|
reader.readObject(PublicDataTreeLeafPreimage),
|
|
89
|
-
reader.
|
|
89
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
90
90
|
makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, () => reader.readObject(ContractClassLogFields)),
|
|
91
91
|
reader.readObject(BlockConstantData),
|
|
92
92
|
);
|
|
@@ -163,7 +163,7 @@ export class PublicBaseRollupHints {
|
|
|
163
163
|
return new PublicBaseRollupHints(
|
|
164
164
|
reader.readObject(SpongeBlob),
|
|
165
165
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
166
|
-
reader.
|
|
166
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
167
167
|
makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, () => reader.readObject(ContractClassLogFields)),
|
|
168
168
|
);
|
|
169
169
|
}
|
|
@@ -60,8 +60,8 @@ export class BlockRootFirstRollupPrivateInputs {
|
|
|
60
60
|
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
61
61
|
[ProofData.fromBuffer(reader, TxRollupPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs)],
|
|
62
62
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
63
|
-
reader.
|
|
64
|
-
reader.
|
|
63
|
+
reader.readTuple(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
64
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -124,8 +124,8 @@ export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
124
124
|
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
125
125
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
126
126
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
127
|
-
reader.
|
|
128
|
-
reader.
|
|
127
|
+
reader.readTuple(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
128
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -206,8 +206,8 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
206
206
|
StateReference.fromBuffer(reader),
|
|
207
207
|
CheckpointConstantData.fromBuffer(reader),
|
|
208
208
|
reader.readUInt64(),
|
|
209
|
-
reader.
|
|
210
|
-
reader.
|
|
209
|
+
reader.readTuple(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
210
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
|
|
@@ -248,7 +248,7 @@ export class BlockRootRollupPrivateInputs {
|
|
|
248
248
|
const reader = BufferReader.asReader(buffer);
|
|
249
249
|
return new BlockRootRollupPrivateInputs(
|
|
250
250
|
[ProofData.fromBuffer(reader, TxRollupPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs)],
|
|
251
|
-
reader.
|
|
251
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -289,7 +289,7 @@ export class BlockRootSingleTxRollupPrivateInputs {
|
|
|
289
289
|
const reader = BufferReader.asReader(buffer);
|
|
290
290
|
return new BlockRootSingleTxRollupPrivateInputs(
|
|
291
291
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
292
|
-
reader.
|
|
292
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
295
|
|
|
@@ -65,8 +65,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
65
65
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
66
66
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
67
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
68
|
-
reader.
|
|
69
|
-
reader.
|
|
68
|
+
reader.readTuple(MAX_CHECKPOINTS_PER_EPOCH, Fr),
|
|
69
|
+
reader.readTuple(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient),
|
|
70
70
|
reader.readObject(BlobAccumulator),
|
|
71
71
|
reader.readObject(BlobAccumulator),
|
|
72
72
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
@@ -81,15 +81,15 @@ export class CheckpointRootRollupHints {
|
|
|
81
81
|
const reader = BufferReader.asReader(buffer);
|
|
82
82
|
return new CheckpointRootRollupHints(
|
|
83
83
|
BlockHeader.fromBuffer(reader),
|
|
84
|
-
reader.
|
|
84
|
+
reader.readTuple(ARCHIVE_HEIGHT, Fr),
|
|
85
85
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
86
|
-
reader.
|
|
86
|
+
reader.readTuple(OUT_HASH_TREE_HEIGHT, Fr),
|
|
87
87
|
reader.readObject(BlobAccumulator),
|
|
88
88
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
89
89
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
90
|
-
// reader.
|
|
90
|
+
// reader.readTuple(FIELDS_PER_BLOB, Fr),
|
|
91
91
|
Array.from({ length: FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT }, () => Fr.fromBuffer(reader)),
|
|
92
|
-
reader.
|
|
92
|
+
reader.readTuple(BLOBS_PER_CHECKPOINT, BLS12Point),
|
|
93
93
|
Fr.fromBuffer(reader),
|
|
94
94
|
);
|
|
95
95
|
}
|
|
@@ -68,8 +68,8 @@ export class RootRollupPublicInputs {
|
|
|
68
68
|
Fr.fromBuffer(reader),
|
|
69
69
|
Fr.fromBuffer(reader),
|
|
70
70
|
Fr.fromBuffer(reader),
|
|
71
|
-
reader.
|
|
72
|
-
reader.
|
|
71
|
+
reader.readTuple(MAX_CHECKPOINTS_PER_EPOCH, Fr),
|
|
72
|
+
reader.readTuple(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient),
|
|
73
73
|
EpochConstantData.fromBuffer(reader),
|
|
74
74
|
reader.readObject(FinalBlobAccumulator),
|
|
75
75
|
);
|
|
@@ -85,14 +85,14 @@ export class TreeSnapshotDiffHints {
|
|
|
85
85
|
static fromBuffer(buffer: Buffer | BufferReader): TreeSnapshotDiffHints {
|
|
86
86
|
const reader = BufferReader.asReader(buffer);
|
|
87
87
|
return new TreeSnapshotDiffHints(
|
|
88
|
-
reader.
|
|
89
|
-
reader.
|
|
90
|
-
reader.
|
|
88
|
+
reader.readTuple(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
89
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage),
|
|
90
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, {
|
|
91
91
|
fromBuffer: buffer => MembershipWitness.fromBuffer(buffer, NULLIFIER_TREE_HEIGHT),
|
|
92
92
|
}),
|
|
93
|
-
reader.
|
|
93
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, Fr),
|
|
94
94
|
reader.readNumbers(MAX_NULLIFIERS_PER_TX),
|
|
95
|
-
reader.
|
|
95
|
+
reader.readTuple(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
96
96
|
MembershipWitness.fromBuffer(reader, PUBLIC_DATA_TREE_HEIGHT),
|
|
97
97
|
);
|
|
98
98
|
}
|
package/src/tests/factories.ts
CHANGED
|
@@ -92,8 +92,10 @@ import {
|
|
|
92
92
|
type ContractClassPublic,
|
|
93
93
|
ContractDeploymentData,
|
|
94
94
|
type ContractInstanceWithAddress,
|
|
95
|
+
type ExecutablePrivateFunctionWithMembershipProof,
|
|
95
96
|
type PrivateFunction,
|
|
96
97
|
SerializableContractInstance,
|
|
98
|
+
type UtilityFunctionWithMembershipProof,
|
|
97
99
|
computeContractClassId,
|
|
98
100
|
computePublicBytecodeCommitment,
|
|
99
101
|
} from '../contract/index.js';
|
|
@@ -232,7 +234,7 @@ export function makeTxContext(seed: number = 1): TxContext {
|
|
|
232
234
|
* Creates a default instance of gas settings. No seed value is used to ensure we allocate a sensible amount of gas for testing.
|
|
233
235
|
*/
|
|
234
236
|
export function makeGasSettings() {
|
|
235
|
-
return GasSettings.
|
|
237
|
+
return GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) });
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
/**
|
|
@@ -1181,6 +1183,35 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
|
|
|
1181
1183
|
});
|
|
1182
1184
|
}
|
|
1183
1185
|
|
|
1186
|
+
export function makeExecutablePrivateFunctionWithMembershipProof(
|
|
1187
|
+
seed = 0,
|
|
1188
|
+
): ExecutablePrivateFunctionWithMembershipProof {
|
|
1189
|
+
return {
|
|
1190
|
+
selector: makeSelector(seed),
|
|
1191
|
+
bytecode: makeBytes(100, seed + 1),
|
|
1192
|
+
artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
|
|
1193
|
+
artifactTreeLeafIndex: seed + 2,
|
|
1194
|
+
privateFunctionTreeSiblingPath: makeTuple(3, fr, seed + 3),
|
|
1195
|
+
privateFunctionTreeLeafIndex: seed + 3,
|
|
1196
|
+
artifactMetadataHash: fr(seed + 4),
|
|
1197
|
+
functionMetadataHash: fr(seed + 5),
|
|
1198
|
+
utilityFunctionsTreeRoot: fr(seed + 6),
|
|
1199
|
+
vkHash: fr(seed + 7),
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export function makeUtilityFunctionWithMembershipProof(seed = 0): UtilityFunctionWithMembershipProof {
|
|
1204
|
+
return {
|
|
1205
|
+
selector: makeSelector(seed),
|
|
1206
|
+
bytecode: makeBytes(100, seed + 1),
|
|
1207
|
+
artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
|
|
1208
|
+
artifactTreeLeafIndex: seed + 2,
|
|
1209
|
+
artifactMetadataHash: fr(seed + 4),
|
|
1210
|
+
functionMetadataHash: fr(seed + 5),
|
|
1211
|
+
privateFunctionsArtifactTreeRoot: fr(seed + 6),
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1184
1215
|
export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer): Promise<ContractClassPublic> {
|
|
1185
1216
|
const artifactHash = fr(seed + 1);
|
|
1186
1217
|
const privateFunctionsRoot = fr(seed + 3);
|
|
@@ -1192,6 +1223,8 @@ export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer)
|
|
|
1192
1223
|
artifactHash,
|
|
1193
1224
|
packedBytecode,
|
|
1194
1225
|
privateFunctionsRoot,
|
|
1226
|
+
privateFunctions: [],
|
|
1227
|
+
utilityFunctions: [],
|
|
1195
1228
|
version: 1,
|
|
1196
1229
|
};
|
|
1197
1230
|
}
|
package/src/tests/mocks.ts
CHANGED
|
@@ -134,7 +134,7 @@ export const mockTx = async (
|
|
|
134
134
|
const data = PrivateKernelTailCircuitPublicInputs.empty();
|
|
135
135
|
const firstNullifier = new Nullifier(new Fr(seed + 1), Fr.ZERO, 0);
|
|
136
136
|
data.constants.anchorBlockHeader = anchorBlockHeader;
|
|
137
|
-
data.constants.txContext.gasSettings = GasSettings.
|
|
137
|
+
data.constants.txContext.gasSettings = GasSettings.fallback({ gasLimits, maxFeesPerGas, maxPriorityFeesPerGas });
|
|
138
138
|
data.feePayer = feePayer ?? (await AztecAddress.random());
|
|
139
139
|
data.gasUsed = gasUsed;
|
|
140
140
|
data.constants.txContext.chainId = chainId;
|
|
@@ -200,7 +200,7 @@ export async function mockProcessedTx({
|
|
|
200
200
|
db,
|
|
201
201
|
chainId = Fr.ZERO,
|
|
202
202
|
version = Fr.ZERO,
|
|
203
|
-
gasSettings = GasSettings.
|
|
203
|
+
gasSettings = GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) }),
|
|
204
204
|
vkTreeRoot = Fr.ZERO,
|
|
205
205
|
protocolContracts = makeProtocolContracts(seed + 0x100),
|
|
206
206
|
globalVariables = GlobalVariables.empty(),
|
|
@@ -30,7 +30,7 @@ export class ProtocolContracts {
|
|
|
30
30
|
|
|
31
31
|
static fromFields(fields: Fr[] | FieldReader): ProtocolContracts {
|
|
32
32
|
const reader = FieldReader.asReader(fields);
|
|
33
|
-
return new ProtocolContracts(reader.
|
|
33
|
+
return new ProtocolContracts(reader.readTuple(MAX_PROTOCOL_CONTRACTS, AztecAddress));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
toFields(): Fr[] {
|
|
@@ -39,7 +39,7 @@ export class ProtocolContracts {
|
|
|
39
39
|
|
|
40
40
|
static fromBuffer(buffer: Buffer | BufferReader): ProtocolContracts {
|
|
41
41
|
const reader = BufferReader.asReader(buffer);
|
|
42
|
-
return new ProtocolContracts(reader.
|
|
42
|
+
return new ProtocolContracts(reader.readTuple(MAX_PROTOCOL_CONTRACTS, AztecAddress));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
toBuffer() {
|
package/src/tx/simulated_tx.ts
CHANGED
|
@@ -38,7 +38,11 @@ export type ContractOverrides = Record<
|
|
|
38
38
|
* set, it *must* be run without the kernel circuits, or validations will fail
|
|
39
39
|
*/
|
|
40
40
|
export class SimulationOverrides {
|
|
41
|
-
|
|
41
|
+
public contracts?: ContractOverrides;
|
|
42
|
+
|
|
43
|
+
constructor(contracts: ContractOverrides = {}) {
|
|
44
|
+
this.contracts = Object.keys(contracts).length > 0 ? contracts : undefined;
|
|
45
|
+
}
|
|
42
46
|
|
|
43
47
|
static get schema() {
|
|
44
48
|
return z
|
|
@@ -157,7 +161,7 @@ export class TxSimulationResult {
|
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
/**
|
|
160
|
-
* Recursively
|
|
164
|
+
* Recursively accumulate the return values of a call result and its nested executions,
|
|
161
165
|
* so they can be retrieved in order.
|
|
162
166
|
* @param executionResult
|
|
163
167
|
* @returns
|
package/src/tx/tx_receipt.ts
CHANGED
|
@@ -31,9 +31,16 @@ export const SortedTxStatuses: TxStatus[] = [
|
|
|
31
31
|
/** Execution result - only set when tx is in a block. */
|
|
32
32
|
export enum TxExecutionResult {
|
|
33
33
|
SUCCESS = 'success',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
REVERTED = 'reverted',
|
|
35
|
+
/** @deprecated Use REVERTED instead. */
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
37
|
+
APP_LOGIC_REVERTED = 'reverted',
|
|
38
|
+
/** @deprecated Use REVERTED instead. */
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
40
|
+
TEARDOWN_REVERTED = 'reverted',
|
|
41
|
+
/** @deprecated Use REVERTED instead. */
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
43
|
+
BOTH_REVERTED = 'reverted',
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
/**
|
|
@@ -143,16 +150,6 @@ export class TxReceipt {
|
|
|
143
150
|
}
|
|
144
151
|
|
|
145
152
|
public static executionResultFromRevertCode(revertCode: RevertCode): TxExecutionResult {
|
|
146
|
-
|
|
147
|
-
return TxExecutionResult.SUCCESS;
|
|
148
|
-
} else if (revertCode.equals(RevertCode.APP_LOGIC_REVERTED)) {
|
|
149
|
-
return TxExecutionResult.APP_LOGIC_REVERTED;
|
|
150
|
-
} else if (revertCode.equals(RevertCode.TEARDOWN_REVERTED)) {
|
|
151
|
-
return TxExecutionResult.TEARDOWN_REVERTED;
|
|
152
|
-
} else if (revertCode.equals(RevertCode.BOTH_REVERTED)) {
|
|
153
|
-
return TxExecutionResult.BOTH_REVERTED;
|
|
154
|
-
} else {
|
|
155
|
-
throw new Error(`Unknown revert code: ${revertCode.getCode()}`);
|
|
156
|
-
}
|
|
153
|
+
return revertCode.isOK() ? TxExecutionResult.SUCCESS : TxExecutionResult.REVERTED;
|
|
157
154
|
}
|
|
158
155
|
}
|
package/src/vks/vk_data.ts
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export type PipelineConfig = {
|
|
4
|
-
/** Whether to enable build-ahead proposer pipelining. */
|
|
5
|
-
enableProposerPipelining: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Pipelining config mappings for fields that need to be shared across packages.
|
|
9
|
-
*/
|
|
10
|
-
export declare const pipelineConfigMappings: ConfigMappingsType<PipelineConfig>;
|
|
11
|
-
export declare const PipelineConfigSchema: z.ZodObject<{
|
|
12
|
-
enableProposerPipelining: z.ZodBoolean;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
enableProposerPipelining: boolean;
|
|
15
|
-
}, {
|
|
16
|
-
enableProposerPipelining: boolean;
|
|
17
|
-
}>;
|
|
18
|
-
export declare function getPipelineConfigEnvVars(): PipelineConfig;
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZWxpbmluZy1jb25maWcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvcGlwZWxpbmluZy1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQThDLE1BQU0sMEJBQTBCLENBQUM7QUFFL0csT0FBTyxFQUFFLENBQUMsRUFBRSxNQUFNLEtBQUssQ0FBQztBQUl4QixNQUFNLE1BQU0sY0FBYyxHQUFHO0lBQzNCLHlEQUF5RDtJQUN6RCx3QkFBd0IsRUFBRSxPQUFPLENBQUM7Q0FDbkMsQ0FBQztBQUVGOztHQUVHO0FBQ0gsZUFBTyxNQUFNLHNCQUFzQixFQUFFLGtCQUFrQixDQUFDLGNBQWMsQ0FNckUsQ0FBQztBQUVGLGVBQU8sTUFBTSxvQkFBb0I7Ozs7OztFQUloQyxDQUFDO0FBRUYsd0JBQWdCLHdCQUF3QixJQUFJLGNBQWMsQ0FFekQifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipelining-config.d.ts","sourceRoot":"","sources":["../../src/config/pipelining-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8C,MAAM,0BAA0B,CAAC;AAE/G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CAMrE,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;EAIhC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD"}
|