@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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { computeRootFromSiblingPath } from '@aztec/foundation/trees';
|
|
4
|
+
|
|
5
|
+
import { type ContractArtifact, FunctionSelector, FunctionType } from '../abi/index.js';
|
|
6
|
+
import {
|
|
7
|
+
computeArtifactFunctionTree,
|
|
8
|
+
computeArtifactHash,
|
|
9
|
+
computeArtifactHashPreimage,
|
|
10
|
+
computeFunctionArtifactHash,
|
|
11
|
+
computeFunctionMetadataHash,
|
|
12
|
+
getArtifactMerkleTreeHasher,
|
|
13
|
+
} from './artifact_hash.js';
|
|
14
|
+
import type {
|
|
15
|
+
ContractClassPublic,
|
|
16
|
+
UtilityFunctionMembershipProof,
|
|
17
|
+
UtilityFunctionWithMembershipProof,
|
|
18
|
+
} from './interfaces/index.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates a membership proof for a utility function in a contract class, to be verified via `isValidUtilityFunctionMembershipProof`.
|
|
22
|
+
* @param selector - Selector of the function to create the proof for.
|
|
23
|
+
* @param artifact - Artifact of the contract class where the function is defined.
|
|
24
|
+
*/
|
|
25
|
+
export async function createUtilityFunctionMembershipProof(
|
|
26
|
+
selector: FunctionSelector,
|
|
27
|
+
artifact: ContractArtifact,
|
|
28
|
+
): Promise<UtilityFunctionMembershipProof> {
|
|
29
|
+
const log = createLogger('circuits:function_membership_proof');
|
|
30
|
+
|
|
31
|
+
// Locate function artifact
|
|
32
|
+
const utilityFunctions = artifact.functions.filter(fn => fn.functionType === FunctionType.UTILITY);
|
|
33
|
+
const utilityFunctionsAndSelectors = await Promise.all(
|
|
34
|
+
utilityFunctions.map(async fn => ({ fn, selector: await FunctionSelector.fromNameAndParameters(fn) })),
|
|
35
|
+
);
|
|
36
|
+
const fn = utilityFunctionsAndSelectors.find(fnAndSelector => selector.equals(fnAndSelector.selector))?.fn;
|
|
37
|
+
if (!fn) {
|
|
38
|
+
throw new Error(`Utility function with selector ${selector.toString()} not found`);
|
|
39
|
+
}
|
|
40
|
+
// Compute preimage for the artifact hash
|
|
41
|
+
const { privateFunctionRoot: privateFunctionsArtifactTreeRoot, metadataHash: artifactMetadataHash } =
|
|
42
|
+
await computeArtifactHashPreimage(artifact);
|
|
43
|
+
|
|
44
|
+
// Compute the sibling path for the "artifact tree"
|
|
45
|
+
const functionMetadataHash = computeFunctionMetadataHash(fn);
|
|
46
|
+
const functionArtifactHash = await computeFunctionArtifactHash({ ...fn, functionMetadataHash });
|
|
47
|
+
const artifactTree = (await computeArtifactFunctionTree(artifact, FunctionType.UTILITY))!;
|
|
48
|
+
const artifactTreeLeafIndex = artifactTree.getIndex(functionArtifactHash.toBuffer());
|
|
49
|
+
const artifactTreeSiblingPath = artifactTree.getSiblingPath(artifactTreeLeafIndex).map(Fr.fromBuffer);
|
|
50
|
+
|
|
51
|
+
log.debug(`Computed proof for utility function with selector ${selector.toString()}`, {
|
|
52
|
+
functionArtifactHash,
|
|
53
|
+
functionMetadataHash,
|
|
54
|
+
artifactMetadataHash,
|
|
55
|
+
artifactFunctionTreeSiblingPath: artifactTreeSiblingPath.map(fr => fr.toString()).join(','),
|
|
56
|
+
privateFunctionsArtifactTreeRoot,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
artifactTreeSiblingPath,
|
|
61
|
+
artifactTreeLeafIndex,
|
|
62
|
+
artifactMetadataHash,
|
|
63
|
+
functionMetadataHash,
|
|
64
|
+
privateFunctionsArtifactTreeRoot,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Verifies that a utility function with a membership proof as emitted by the ClassRegistry contract is valid,
|
|
70
|
+
* as defined in the protocol specs at contract-deployment/classes:
|
|
71
|
+
*
|
|
72
|
+
* ```
|
|
73
|
+
* // Load contract class from local db
|
|
74
|
+
* contract_class = db.get_contract_class(contract_class_id)
|
|
75
|
+
*
|
|
76
|
+
* // Compute artifact leaf and assert it belongs to the artifact
|
|
77
|
+
* artifact_function_leaf = sha256(selector, metadata_hash, sha256(bytecode))
|
|
78
|
+
* computed_artifact_utility_function_tree_root = compute_root(artifact_function_leaf, artifact_function_tree_sibling_path, artifact_function_tree_leaf_index)
|
|
79
|
+
* computed_artifact_hash = sha256(private_functions_artifact_tree_root, computed_artifact_utility_function_tree_root, artifact_metadata_hash)
|
|
80
|
+
* assert computed_artifact_hash == contract_class.artifact_hash
|
|
81
|
+
* ```
|
|
82
|
+
* @param fn - Function to check membership proof for.
|
|
83
|
+
* @param contractClass - In which contract class the function is expected to be.
|
|
84
|
+
*/
|
|
85
|
+
export async function isValidUtilityFunctionMembershipProof(
|
|
86
|
+
fn: UtilityFunctionWithMembershipProof,
|
|
87
|
+
contractClass: Pick<ContractClassPublic, 'artifactHash'>,
|
|
88
|
+
) {
|
|
89
|
+
const log = createLogger('circuits:function_membership_proof');
|
|
90
|
+
|
|
91
|
+
const functionArtifactHash = await computeFunctionArtifactHash(fn);
|
|
92
|
+
const computedArtifactFunctionTreeRootBuffer = await computeRootFromSiblingPath(
|
|
93
|
+
functionArtifactHash.toBuffer(),
|
|
94
|
+
fn.artifactTreeSiblingPath.map(fr => fr.toBuffer()),
|
|
95
|
+
fn.artifactTreeLeafIndex,
|
|
96
|
+
getArtifactMerkleTreeHasher(),
|
|
97
|
+
);
|
|
98
|
+
const computedArtifactFunctionTreeRoot = Fr.fromBuffer(computedArtifactFunctionTreeRootBuffer);
|
|
99
|
+
const computedArtifactHash = await computeArtifactHash({
|
|
100
|
+
privateFunctionRoot: fn.privateFunctionsArtifactTreeRoot,
|
|
101
|
+
utilityFunctionRoot: computedArtifactFunctionTreeRoot,
|
|
102
|
+
metadataHash: fn.artifactMetadataHash,
|
|
103
|
+
});
|
|
104
|
+
if (!contractClass.artifactHash.equals(computedArtifactHash)) {
|
|
105
|
+
log.debug(`Artifact hash mismatch`, {
|
|
106
|
+
expected: contractClass.artifactHash,
|
|
107
|
+
computedArtifactHash,
|
|
108
|
+
computedFunctionArtifactHash: functionArtifactHash,
|
|
109
|
+
computedArtifactFunctionTreeRoot,
|
|
110
|
+
privateFunctionsArtifactTreeRoot: fn.privateFunctionsArtifactTreeRoot,
|
|
111
|
+
metadataHash: fn.artifactMetadataHash,
|
|
112
|
+
artifactFunctionTreeSiblingPath: fn.artifactTreeSiblingPath.map(fr => fr.toString()).join(','),
|
|
113
|
+
});
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import { GoogleCloudFileStore } from './gcs.js';
|
|
4
|
-
import { HttpFileStore
|
|
4
|
+
import { HttpFileStore } from './http.js';
|
|
5
5
|
import type { FileStore, ReadOnlyFileStore } from './interface.js';
|
|
6
6
|
import { LocalFileStore } from './local.js';
|
|
7
7
|
import { S3FileStore } from './s3.js';
|
|
@@ -59,26 +59,17 @@ export async function createFileStore(
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export async function createReadOnlyFileStore(
|
|
63
|
-
|
|
64
|
-
logger?: Logger,
|
|
65
|
-
options?: HttpFileStoreOptions,
|
|
66
|
-
): Promise<ReadOnlyFileStore>;
|
|
67
|
-
export async function createReadOnlyFileStore(
|
|
68
|
-
config: undefined,
|
|
69
|
-
logger?: Logger,
|
|
70
|
-
options?: HttpFileStoreOptions,
|
|
71
|
-
): Promise<undefined>;
|
|
62
|
+
export async function createReadOnlyFileStore(config: string, logger?: Logger): Promise<ReadOnlyFileStore>;
|
|
63
|
+
export async function createReadOnlyFileStore(config: undefined, logger?: Logger): Promise<undefined>;
|
|
72
64
|
export async function createReadOnlyFileStore(
|
|
73
65
|
config: string | undefined,
|
|
74
66
|
logger = createLogger('stdlib:file-store'),
|
|
75
|
-
options?: HttpFileStoreOptions,
|
|
76
67
|
): Promise<ReadOnlyFileStore | undefined> {
|
|
77
68
|
if (config === undefined) {
|
|
78
69
|
return undefined;
|
|
79
70
|
} else if (config.startsWith('http://') || config.startsWith('https://')) {
|
|
80
71
|
logger.info(`Creating read-only HTTP file store at ${config}`);
|
|
81
|
-
return new HttpFileStore(config, logger
|
|
72
|
+
return new HttpFileStore(config, logger);
|
|
82
73
|
} else {
|
|
83
74
|
return await createFileStore(config, logger);
|
|
84
75
|
}
|
package/src/file-store/http.ts
CHANGED
|
@@ -10,14 +10,6 @@ import { pipeline } from 'stream/promises';
|
|
|
10
10
|
|
|
11
11
|
import type { ReadOnlyFileStore } from './interface.js';
|
|
12
12
|
|
|
13
|
-
/** Options for configuring HttpFileStore behavior. */
|
|
14
|
-
export interface HttpFileStoreOptions {
|
|
15
|
-
/** Retry backoff intervals in seconds. Empty array disables retries. Default: [1, 1, 3]. */
|
|
16
|
-
retryBackoff?: number[];
|
|
17
|
-
/** Request timeout in milliseconds. Default: no timeout (axios default). */
|
|
18
|
-
timeoutMs?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
13
|
export class HttpFileStore implements ReadOnlyFileStore {
|
|
22
14
|
private readonly axiosInstance: AxiosInstance;
|
|
23
15
|
private readonly fetch: <T>(config: AxiosRequestConfig) => Promise<AxiosResponse<T>>;
|
|
@@ -25,28 +17,17 @@ export class HttpFileStore implements ReadOnlyFileStore {
|
|
|
25
17
|
constructor(
|
|
26
18
|
private readonly baseUrl: string,
|
|
27
19
|
private readonly log: Logger = createLogger('stdlib:http-file-store'),
|
|
28
|
-
options?: HttpFileStoreOptions,
|
|
29
20
|
) {
|
|
30
|
-
this.axiosInstance = axios.create(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
makeBackoff(retryBackoff),
|
|
41
|
-
this.log,
|
|
42
|
-
/*failSilently=*/ true,
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
} else {
|
|
46
|
-
this.fetch = async <T>(config: AxiosRequestConfig) => {
|
|
47
|
-
return await this.axiosInstance.request<T>(config);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
21
|
+
this.axiosInstance = axios.create();
|
|
22
|
+
this.fetch = async <T>(config: AxiosRequestConfig) => {
|
|
23
|
+
return await retry(
|
|
24
|
+
() => this.axiosInstance.request<T>(config),
|
|
25
|
+
`Fetching ${config.url}`,
|
|
26
|
+
makeBackoff([1, 1, 3]),
|
|
27
|
+
this.log,
|
|
28
|
+
/*failSilently=*/ true,
|
|
29
|
+
);
|
|
30
|
+
};
|
|
50
31
|
}
|
|
51
32
|
|
|
52
33
|
public async read(pathOrUrl: string): Promise<Buffer> {
|
package/src/file-store/index.ts
CHANGED
package/src/gas/gas_settings.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_DA_GAS_LIMIT,
|
|
3
|
-
DEFAULT_L2_GAS_LIMIT,
|
|
4
|
-
DEFAULT_TEARDOWN_DA_GAS_LIMIT,
|
|
5
|
-
DEFAULT_TEARDOWN_L2_GAS_LIMIT,
|
|
6
|
-
GAS_SETTINGS_LENGTH,
|
|
7
|
-
} from '@aztec/constants';
|
|
1
|
+
import { GAS_SETTINGS_LENGTH, MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS } from '@aztec/constants';
|
|
8
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
9
3
|
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
10
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
@@ -14,6 +8,21 @@ import { z } from 'zod';
|
|
|
14
8
|
import { Gas, GasDimensions } from './gas.js';
|
|
15
9
|
import { GasFees } from './gas_fees.js';
|
|
16
10
|
|
|
11
|
+
/** Approximate max DA gas limit. Arbitrary, assuming 4 blocks per checkpoint — users should use gas estimation. */
|
|
12
|
+
export const APPROXIMATE_MAX_DA_GAS_PER_BLOCK = Math.floor(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT / 4);
|
|
13
|
+
/** Fallback teardown L2 gas limit. Arbitrary — users should use gas estimation. */
|
|
14
|
+
export const FALLBACK_TEARDOWN_L2_GAS_LIMIT = Math.floor(MAX_PROCESSABLE_L2_GAS / 8);
|
|
15
|
+
/** Fallback teardown DA gas limit. Arbitrary — users should use gas estimation. */
|
|
16
|
+
export const FALLBACK_TEARDOWN_DA_GAS_LIMIT = Math.floor(APPROXIMATE_MAX_DA_GAS_PER_BLOCK / 2);
|
|
17
|
+
|
|
18
|
+
// For gas estimation, we use intentionally high limits above what the network can process,
|
|
19
|
+
// so the simulation runs without hitting gas caps. Since teardown gas is counted towards total,
|
|
20
|
+
// the total estimation limit is teardown + max processable.
|
|
21
|
+
export const GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT = MAX_PROCESSABLE_L2_GAS;
|
|
22
|
+
export const GAS_ESTIMATION_L2_GAS_LIMIT = GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT + MAX_PROCESSABLE_L2_GAS;
|
|
23
|
+
export const GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
24
|
+
export const GAS_ESTIMATION_DA_GAS_LIMIT = GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT + MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
25
|
+
|
|
17
26
|
// docs:start:gas_settings_vars
|
|
18
27
|
/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */
|
|
19
28
|
export class GasSettings {
|
|
@@ -95,18 +104,62 @@ export class GasSettings {
|
|
|
95
104
|
return new GasSettings(Gas.empty(), Gas.empty(), GasFees.empty(), GasFees.empty());
|
|
96
105
|
}
|
|
97
106
|
|
|
98
|
-
/**
|
|
99
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Fills in gas limits high enough for transactions to be included in most cases.
|
|
109
|
+
* gasLimits is set to the maximum the protocol allows; since teardown gas is reserved
|
|
110
|
+
* from gasLimits during private execution (see gas_meter.nr), the effective gas available
|
|
111
|
+
* for app logic will be gasLimits - teardownGasLimits - privateOverhead.
|
|
112
|
+
* The DA gas limit is set to an approximate max per block assuming 4 blocks per checkpoint,
|
|
113
|
+
* since using the maximum per checkpoint would cause nodes to reject transactions.
|
|
114
|
+
* These values won't work if:
|
|
115
|
+
* - Teardown consumes more than the arbitrarily assigned fallback limits
|
|
116
|
+
* - The rest of the transaction consumes more than the remaining gas after teardown
|
|
117
|
+
* - The DA gas limit is too low for the transaction, while still within the checkpoint limit
|
|
118
|
+
*/
|
|
119
|
+
static fallback(overrides: {
|
|
120
|
+
gasLimits?: Gas;
|
|
121
|
+
teardownGasLimits?: Gas;
|
|
122
|
+
maxFeesPerGas: GasFees;
|
|
123
|
+
maxPriorityFeesPerGas?: GasFees;
|
|
124
|
+
}) {
|
|
125
|
+
return GasSettings.from({
|
|
126
|
+
gasLimits: overrides.gasLimits ?? {
|
|
127
|
+
l2Gas: MAX_PROCESSABLE_L2_GAS,
|
|
128
|
+
daGas: APPROXIMATE_MAX_DA_GAS_PER_BLOCK,
|
|
129
|
+
},
|
|
130
|
+
teardownGasLimits: overrides.teardownGasLimits ?? {
|
|
131
|
+
l2Gas: FALLBACK_TEARDOWN_L2_GAS_LIMIT,
|
|
132
|
+
daGas: FALLBACK_TEARDOWN_DA_GAS_LIMIT,
|
|
133
|
+
},
|
|
134
|
+
maxFeesPerGas: overrides.maxFeesPerGas,
|
|
135
|
+
maxPriorityFeesPerGas: overrides.maxPriorityFeesPerGas ?? GasFees.empty(),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gas settings for simulation/estimation only.
|
|
141
|
+
* Since teardown gas is reserved upfront from gasLimits during private execution (see gas_meter.nr),
|
|
142
|
+
* the effective gas available for app logic is gasLimits - teardownGasLimits - privateOverhead.
|
|
143
|
+
* To ensure estimation never hits gas caps, we set both limits above what the protocol allows:
|
|
144
|
+
* teardown gets MAX_PROCESSABLE and gasLimits gets teardown + MAX_PROCESSABLE, so the full
|
|
145
|
+
* processable amount remains available for each phase independently. To be used in conjunction
|
|
146
|
+
* with skipTxValidation: true during public simulation, or the node would reject the transaction
|
|
147
|
+
* outright due to gas limits being above protocol max.
|
|
148
|
+
*/
|
|
149
|
+
static forEstimation(overrides: {
|
|
100
150
|
gasLimits?: Gas;
|
|
101
151
|
teardownGasLimits?: Gas;
|
|
102
152
|
maxFeesPerGas: GasFees;
|
|
103
153
|
maxPriorityFeesPerGas?: GasFees;
|
|
104
154
|
}) {
|
|
105
155
|
return GasSettings.from({
|
|
106
|
-
gasLimits: overrides.gasLimits ?? {
|
|
156
|
+
gasLimits: overrides.gasLimits ?? {
|
|
157
|
+
l2Gas: GAS_ESTIMATION_L2_GAS_LIMIT,
|
|
158
|
+
daGas: GAS_ESTIMATION_DA_GAS_LIMIT,
|
|
159
|
+
},
|
|
107
160
|
teardownGasLimits: overrides.teardownGasLimits ?? {
|
|
108
|
-
l2Gas:
|
|
109
|
-
daGas:
|
|
161
|
+
l2Gas: GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT,
|
|
162
|
+
daGas: GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT,
|
|
110
163
|
},
|
|
111
164
|
maxFeesPerGas: overrides.maxFeesPerGas,
|
|
112
165
|
maxPriorityFeesPerGas: overrides.maxPriorityFeesPerGas ?? GasFees.empty(),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import type { ApiSchemaFor } from '../schemas/schemas.js';
|
|
6
|
+
import { type ComponentsVersions, getVersioningResponseHandler } from '../versioning/index.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Debug interface for Aztec node available in sandbox/local-network mode.
|
|
10
|
+
*/
|
|
11
|
+
export interface AztecNodeDebug {
|
|
12
|
+
/**
|
|
13
|
+
* Triggers the sequencer to produce an L2 block and waits for it to appear.
|
|
14
|
+
*
|
|
15
|
+
* **Precondition**: The current L2 slot must not already contain a block. Callers must ensure L1 time has been
|
|
16
|
+
* advanced to a slot with no existing block before calling this method (e.g. via `EthCheatCodes.warp()`).
|
|
17
|
+
* If the slot is already taken, the sequencer will fail to propose and this call will time out.
|
|
18
|
+
*
|
|
19
|
+
* @throws If no sequencer is running.
|
|
20
|
+
*/
|
|
21
|
+
mineBlock(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const AztecNodeDebugApiSchema: ApiSchemaFor<AztecNodeDebug> = {
|
|
25
|
+
mineBlock: z.function().returns(z.void()),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function createAztecNodeDebugClient(
|
|
29
|
+
url: string,
|
|
30
|
+
versions: Partial<ComponentsVersions> = {},
|
|
31
|
+
fetch = defaultFetch,
|
|
32
|
+
apiKey?: string,
|
|
33
|
+
): AztecNodeDebug {
|
|
34
|
+
return createSafeJsonRpcClient<AztecNodeDebug>(url, AztecNodeDebugApiSchema, {
|
|
35
|
+
namespaceMethods: 'nodeDebug',
|
|
36
|
+
fetch,
|
|
37
|
+
onResponse: getVersioningResponseHandler(versions),
|
|
38
|
+
...(apiKey ? { extraHeaders: { 'x-api-key': apiKey } } : {}),
|
|
39
|
+
});
|
|
40
|
+
}
|
package/src/interfaces/client.ts
CHANGED
|
@@ -16,11 +16,10 @@ export interface L2LogsSource {
|
|
|
16
16
|
* array implies no logs match that tag.
|
|
17
17
|
* @param tags - The tags to search for.
|
|
18
18
|
* @param page - The page number (0-indexed) for pagination.
|
|
19
|
-
* @param upToBlockNumber - If set, only return logs from blocks up to and including this block number.
|
|
20
19
|
* @returns An array of log arrays, one per tag. Returns at most 10 logs per tag per page. If 10 logs are returned
|
|
21
20
|
* for a tag, the caller should fetch the next page to check for more logs.
|
|
22
21
|
*/
|
|
23
|
-
getPrivateLogsByTags(tags: SiloedTag[], page?: number
|
|
22
|
+
getPrivateLogsByTags(tags: SiloedTag[], page?: number): Promise<TxScopedL2Log[][]>;
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* Gets public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
@@ -28,7 +27,6 @@ export interface L2LogsSource {
|
|
|
28
27
|
* @param contractAddress - The contract address to search logs for.
|
|
29
28
|
* @param tags - The tags to search for.
|
|
30
29
|
* @param page - The page number (0-indexed) for pagination.
|
|
31
|
-
* @param upToBlockNumber - If set, only return logs from blocks up to and including this block number.
|
|
32
30
|
* @returns An array of log arrays, one per tag. Returns at most 10 logs per tag per page. If 10 logs are returned
|
|
33
31
|
* for a tag, the caller should fetch the next page to check for more logs.
|
|
34
32
|
*/
|
|
@@ -36,7 +34,6 @@ export interface L2LogsSource {
|
|
|
36
34
|
contractAddress: AztecAddress,
|
|
37
35
|
tags: Tag[],
|
|
38
36
|
page?: number,
|
|
39
|
-
upToBlockNumber?: BlockNumber,
|
|
40
37
|
): Promise<TxScopedL2Log[][]>;
|
|
41
38
|
|
|
42
39
|
/**
|
|
@@ -15,66 +15,63 @@ import type {
|
|
|
15
15
|
} from '@aztec/stdlib/p2p';
|
|
16
16
|
import type { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
17
17
|
import type { BlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
18
|
+
import { type ValidatorHASignerConfig, ValidatorHASignerConfigSchema } from '@aztec/validator-ha-signer/config';
|
|
18
19
|
|
|
19
20
|
import type { PeerId } from '@libp2p/interface';
|
|
20
21
|
import { z } from 'zod';
|
|
21
22
|
|
|
22
23
|
import type { CommitteeAttestationsAndSigners } from '../block/index.js';
|
|
23
|
-
import {
|
|
24
|
-
type LocalSignerConfig,
|
|
25
|
-
LocalSignerConfigSchema,
|
|
26
|
-
type ValidatorHASignerConfig,
|
|
27
|
-
ValidatorHASignerConfigSchema,
|
|
28
|
-
} from '../ha-signing/index.js';
|
|
29
24
|
import { AllowedElementSchema } from './allowed_element.js';
|
|
30
25
|
|
|
31
26
|
/**
|
|
32
27
|
* Validator client configuration
|
|
33
28
|
*/
|
|
34
|
-
export type ValidatorClientConfig = ValidatorHASignerConfig &
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
|
|
29
|
+
export type ValidatorClientConfig = ValidatorHASignerConfig & {
|
|
30
|
+
/** The private keys of the validators participating in attestation duties */
|
|
31
|
+
validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
/** The addresses of the validators to use with remote signers */
|
|
34
|
+
validatorAddresses?: EthAddress[];
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
/** Do not run the validator */
|
|
37
|
+
disableValidator: boolean;
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
/** Temporarily disable these specific validator addresses */
|
|
40
|
+
disabledValidators: EthAddress[];
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
/** Interval between polling for new attestations from peers */
|
|
43
|
+
attestationPollingIntervalMs: number;
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
/** Whether to re-execute transactions in a block proposal before attesting */
|
|
46
|
+
validatorReexecute: boolean;
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
/** Whether to always reexecute block proposals, even for non-validator nodes or when out of the currnet committee */
|
|
49
|
+
alwaysReexecuteBlockProposals?: boolean;
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
/** Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus */
|
|
52
|
+
fishermanMode?: boolean;
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
/** Skip checkpoint proposal validation and always attest (default: false) */
|
|
55
|
+
skipCheckpointProposalValidation?: boolean;
|
|
62
56
|
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
/** Skip pushing re-executed blocks to archiver (default: false) */
|
|
58
|
+
skipPushProposedBlocksToArchiver?: boolean;
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
/** Agree to attest to equivocated checkpoint proposals (for testing purposes only) */
|
|
61
|
+
attestToEquivocatedProposals?: boolean;
|
|
68
62
|
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
/** Maximum L2 gas per block for validation. Proposals exceeding this limit are rejected. */
|
|
64
|
+
validateMaxL2BlockGas?: number;
|
|
71
65
|
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
/** Maximum DA gas per block for validation. Proposals exceeding this limit are rejected. */
|
|
67
|
+
validateMaxDABlockGas?: number;
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
/** Maximum transactions per block for validation. Proposals exceeding this limit are rejected. */
|
|
70
|
+
validateMaxTxsPerBlock?: number;
|
|
71
|
+
|
|
72
|
+
/** Maximum transactions per checkpoint for validation. Proposals exceeding this limit are rejected. */
|
|
73
|
+
validateMaxTxsPerCheckpoint?: number;
|
|
74
|
+
};
|
|
78
75
|
|
|
79
76
|
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
80
77
|
Pick<SequencerConfig, 'txPublicSetupAllowListExtend' | 'broadcastInvalidBlockProposal'> &
|
|
@@ -90,11 +87,12 @@ export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
|
90
87
|
};
|
|
91
88
|
|
|
92
89
|
export const ValidatorClientConfigSchema = zodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>()(
|
|
93
|
-
ValidatorHASignerConfigSchema.
|
|
90
|
+
ValidatorHASignerConfigSchema.extend({
|
|
94
91
|
validatorAddresses: z.array(schemas.EthAddress).optional(),
|
|
95
92
|
disableValidator: z.boolean(),
|
|
96
93
|
disabledValidators: z.array(schemas.EthAddress),
|
|
97
94
|
attestationPollingIntervalMs: z.number().min(0),
|
|
95
|
+
validatorReexecute: z.boolean(),
|
|
98
96
|
alwaysReexecuteBlockProposals: z.boolean().optional(),
|
|
99
97
|
fishermanMode: z.boolean().optional(),
|
|
100
98
|
skipCheckpointProposalValidation: z.boolean().optional(),
|
|
@@ -25,7 +25,7 @@ export class ClaimedLengthArray<T extends Serializable, N extends number> {
|
|
|
25
25
|
arrayLength: N,
|
|
26
26
|
): ClaimedLengthArray<T, N> {
|
|
27
27
|
const reader = BufferReader.asReader(buffer);
|
|
28
|
-
const array = reader.readArray(arrayLength, deserializer)
|
|
28
|
+
const array = reader.readArray(arrayLength, deserializer) as Tuple<T, N>;
|
|
29
29
|
const claimedLength = reader.readNumber();
|
|
30
30
|
return new ClaimedLengthArray(array, claimedLength);
|
|
31
31
|
}
|
|
@@ -42,7 +42,7 @@ export class ClaimedLengthArray<T extends Serializable, N extends number> {
|
|
|
42
42
|
arrayLength: N,
|
|
43
43
|
): ClaimedLengthArray<T, N> {
|
|
44
44
|
const reader = FieldReader.asReader(fields);
|
|
45
|
-
const array = reader.
|
|
45
|
+
const array = reader.readTuple(arrayLength, deserializer);
|
|
46
46
|
const claimedLength = reader.readU32();
|
|
47
47
|
return new ClaimedLengthArray(array, claimedLength);
|
|
48
48
|
}
|
|
@@ -105,8 +105,11 @@ export class PrivateKernelResetHints<
|
|
|
105
105
|
fromBuffer: buf =>
|
|
106
106
|
nullifierReadRequestHintsFromBuffer(buf, numNullifierReadRequestPending, numNullifierReadRequestSettled),
|
|
107
107
|
}),
|
|
108
|
-
reader.readArray(numKeyValidationHints, KeyValidationHint),
|
|
109
|
-
reader.readArray(numTransientDataSquashingHints, TransientDataSquashingHint)
|
|
108
|
+
reader.readArray(numKeyValidationHints, KeyValidationHint) as Tuple<KeyValidationHint, KEY_VALIDATION_HINTS_LEN>,
|
|
109
|
+
reader.readArray(numTransientDataSquashingHints, TransientDataSquashingHint) as Tuple<
|
|
110
|
+
TransientDataSquashingHint,
|
|
111
|
+
TRANSIENT_DATA_HINTS_LEN
|
|
112
|
+
>,
|
|
110
113
|
);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
@@ -158,11 +158,11 @@ export class ReadRequestResetHints<
|
|
|
158
158
|
> {
|
|
159
159
|
const reader = BufferReader.asReader(buffer);
|
|
160
160
|
return new ReadRequestResetHints(
|
|
161
|
-
reader.readArray(readRequestLen, ReadRequestAction),
|
|
162
|
-
reader.readArray(numPendingReads, PendingReadHint),
|
|
161
|
+
reader.readArray(readRequestLen, ReadRequestAction) as Tuple<ReadRequestAction, READ_REQUEST_LEN>,
|
|
162
|
+
reader.readArray(numPendingReads, PendingReadHint) as Tuple<PendingReadHint, PENDING_READ_HINTS_LEN>,
|
|
163
163
|
reader.readArray(numSettledReads, {
|
|
164
164
|
fromBuffer: r => SettledReadHint.fromBuffer(r, treeHeight, leafPreimageFromBuffer),
|
|
165
|
-
}),
|
|
165
|
+
}) as Tuple<SettledReadHint<TREE_HEIGHT, LEAF_PREIMAGE>, SETTLED_READ_HINTS_LEN>,
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -19,9 +19,9 @@ export class PaddedSideEffects {
|
|
|
19
19
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
20
20
|
const reader = BufferReader.asReader(buffer);
|
|
21
21
|
return new PaddedSideEffects(
|
|
22
|
-
reader.
|
|
23
|
-
reader.
|
|
24
|
-
reader.
|
|
22
|
+
reader.readTuple(MAX_NOTE_HASHES_PER_TX, Fr),
|
|
23
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, Fr),
|
|
24
|
+
reader.readTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog),
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -73,7 +73,7 @@ export class PrivateToAvmAccumulatedData {
|
|
|
73
73
|
return new this(
|
|
74
74
|
reader.readFieldArray(MAX_NOTE_HASHES_PER_TX),
|
|
75
75
|
reader.readFieldArray(MAX_NULLIFIERS_PER_TX),
|
|
76
|
-
reader.
|
|
76
|
+
reader.readTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message),
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -94,9 +94,9 @@ export class PrivateToAvmAccumulatedData {
|
|
|
94
94
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
95
95
|
const reader = BufferReader.asReader(buffer);
|
|
96
96
|
return new PrivateToAvmAccumulatedData(
|
|
97
|
-
reader.
|
|
98
|
-
reader.
|
|
99
|
-
reader.
|
|
97
|
+
reader.readTuple(MAX_NOTE_HASHES_PER_TX, Fr),
|
|
98
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, Fr),
|
|
99
|
+
reader.readTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message),
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -62,10 +62,10 @@ export class PrivateToPublicAccumulatedData {
|
|
|
62
62
|
return new this(
|
|
63
63
|
reader.readFieldArray(MAX_NOTE_HASHES_PER_TX),
|
|
64
64
|
reader.readFieldArray(MAX_NULLIFIERS_PER_TX),
|
|
65
|
-
reader.
|
|
66
|
-
reader.
|
|
67
|
-
reader.
|
|
68
|
-
reader.
|
|
65
|
+
reader.readTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message),
|
|
66
|
+
reader.readTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog),
|
|
67
|
+
reader.readTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedLogHash),
|
|
68
|
+
reader.readTuple(MAX_ENQUEUED_CALLS_PER_TX, PublicCallRequest),
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -76,12 +76,12 @@ export class PrivateToPublicAccumulatedData {
|
|
|
76
76
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
77
77
|
const reader = BufferReader.asReader(buffer);
|
|
78
78
|
return new PrivateToPublicAccumulatedData(
|
|
79
|
-
reader.
|
|
80
|
-
reader.
|
|
81
|
-
reader.
|
|
82
|
-
reader.
|
|
83
|
-
reader.
|
|
84
|
-
reader.
|
|
79
|
+
reader.readTuple(MAX_NOTE_HASHES_PER_TX, Fr),
|
|
80
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, Fr),
|
|
81
|
+
reader.readTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message),
|
|
82
|
+
reader.readTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog),
|
|
83
|
+
reader.readTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedLogHash),
|
|
84
|
+
reader.readTuple(MAX_ENQUEUED_CALLS_PER_TX, PublicCallRequest),
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -95,11 +95,11 @@ export class PrivateToRollupAccumulatedData {
|
|
|
95
95
|
static fromBuffer(buffer: Buffer | BufferReader): PrivateToRollupAccumulatedData {
|
|
96
96
|
const reader = BufferReader.asReader(buffer);
|
|
97
97
|
return new PrivateToRollupAccumulatedData(
|
|
98
|
-
reader.
|
|
99
|
-
reader.
|
|
100
|
-
reader.
|
|
101
|
-
reader.
|
|
102
|
-
reader.
|
|
98
|
+
reader.readTuple(MAX_NOTE_HASHES_PER_TX, Fr),
|
|
99
|
+
reader.readTuple(MAX_NULLIFIERS_PER_TX, Fr),
|
|
100
|
+
reader.readTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message),
|
|
101
|
+
reader.readTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog),
|
|
102
|
+
reader.readTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedLogHash),
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|