diff --git a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts index aa7b25af1d08..7b9129c38a2c 100644 --- a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts @@ -14,7 +14,7 @@ import { MAX_READ_REQUESTS_PER_TX, NUM_FIELDS_PER_SHA256, } from '../../cbind/constants.gen.js'; -import { assertMemberLength, makeTuple } from '../../index.js'; +import { makeTuple } from '../../index.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { AggregationObject, AztecAddress, EthAddress, Fr, FunctionData } from '../index.js'; @@ -347,19 +347,6 @@ export class CombinedAccumulatedData { */ public publicDataReads: Tuple, ) { - assertMemberLength(this, 'readRequests', MAX_READ_REQUESTS_PER_TX); - assertMemberLength(this, 'newCommitments', MAX_NEW_COMMITMENTS_PER_TX); - assertMemberLength(this, 'newNullifiers', MAX_NEW_NULLIFIERS_PER_TX); - assertMemberLength(this, 'nullifiedCommitments', MAX_NEW_NULLIFIERS_PER_TX); - assertMemberLength(this, 'privateCallStack', MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX); - assertMemberLength(this, 'publicCallStack', MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX); - assertMemberLength(this, 'newL2ToL1Msgs', MAX_NEW_L2_TO_L1_MSGS_PER_TX); - assertMemberLength(this, 'encryptedLogsHash', NUM_FIELDS_PER_SHA256); - assertMemberLength(this, 'unencryptedLogsHash', NUM_FIELDS_PER_SHA256); - assertMemberLength(this, 'newContracts', MAX_NEW_CONTRACTS_PER_TX); - assertMemberLength(this, 'optionallyRevealedData', MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX); - assertMemberLength(this, 'publicDataUpdateRequests', MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX); - assertMemberLength(this, 'publicDataReads', MAX_PUBLIC_DATA_READS_PER_TX); } toBuffer() { @@ -527,18 +514,7 @@ export class FinalAccumulatedData { * All the optionally revealed data in this transaction. */ public optionallyRevealedData: Tuple, - ) { - assertMemberLength(this, 'newCommitments', MAX_NEW_COMMITMENTS_PER_TX); - assertMemberLength(this, 'newNullifiers', MAX_NEW_NULLIFIERS_PER_TX); - assertMemberLength(this, 'nullifiedCommitments', MAX_NEW_NULLIFIERS_PER_TX); - assertMemberLength(this, 'privateCallStack', MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX); - assertMemberLength(this, 'publicCallStack', MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX); - assertMemberLength(this, 'newL2ToL1Msgs', MAX_NEW_L2_TO_L1_MSGS_PER_TX); - assertMemberLength(this, 'encryptedLogsHash', NUM_FIELDS_PER_SHA256); - assertMemberLength(this, 'unencryptedLogsHash', NUM_FIELDS_PER_SHA256); - assertMemberLength(this, 'newContracts', MAX_NEW_CONTRACTS_PER_TX); - assertMemberLength(this, 'optionallyRevealedData', MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX); - } + ) { } toBuffer() { return serializeToBuffer( diff --git a/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts b/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts index 0b9628c7bb27..fdc4d05054ff 100644 --- a/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts @@ -1,7 +1,7 @@ import { BufferReader, Tuple } from '@aztec/foundation/serialize'; import { privateKernelDummyPreviousKernel } from '../../cbind/circuits.gen.js'; -import { CircuitsWasm, VK_TREE_HEIGHT, assertMemberLength, makeTuple } from '../../index.js'; +import { CircuitsWasm, VK_TREE_HEIGHT, makeTuple } from '../../index.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { Fr } from '../index.js'; import { Proof, makeEmptyProof } from '../proof.js'; @@ -35,7 +35,6 @@ export class PreviousKernelData { */ public vkPath: Tuple, ) { - assertMemberLength(this, 'vkPath', VK_TREE_HEIGHT); } /** diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts index d75b2bca6d1d..c1c91a7f4e3c 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts @@ -8,7 +8,7 @@ import { MAX_READ_REQUESTS_PER_CALL, MAX_READ_REQUESTS_PER_TX, } from '../../cbind/constants.gen.js'; -import { FieldsOf, assertMemberLength } from '../../utils/jsUtils.js'; +import { FieldsOf } from '../../utils/jsUtils.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { PrivateCallStackItem } from '../call_stack_item.js'; import { Fr } from '../index.js'; @@ -63,8 +63,6 @@ export class PrivateCallData { */ public acirHash: Fr, ) { - assertMemberLength(this, 'privateCallStackPreimages', MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL); - assertMemberLength(this, 'readRequestMembershipWitnesses', MAX_READ_REQUESTS_PER_CALL); } /** diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index b3e79a07b6fc..c89729ee4185 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts @@ -11,7 +11,7 @@ import { NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH, } from '../cbind/constants.gen.js'; -import { FieldsOf, assertMemberLength, makeTuple } from '../utils/jsUtils.js'; +import { FieldsOf, makeTuple } from '../utils/jsUtils.js'; import { serializeToBuffer } from '../utils/serialize.js'; import { CallContext } from './call_context.js'; import { HistoricBlockData } from './index.js'; @@ -99,18 +99,7 @@ export class PrivateCircuitPublicInputs { * Version of the instance. */ public version: Fr, - ) { - assertMemberLength(this, 'returnValues', RETURN_VALUES_LENGTH); - assertMemberLength(this, 'readRequests', MAX_READ_REQUESTS_PER_CALL); - assertMemberLength(this, 'newCommitments', MAX_NEW_COMMITMENTS_PER_CALL); - assertMemberLength(this, 'newNullifiers', MAX_NEW_NULLIFIERS_PER_CALL); - assertMemberLength(this, 'nullifiedCommitments', MAX_NEW_NULLIFIERS_PER_CALL); - assertMemberLength(this, 'privateCallStack', MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL); - assertMemberLength(this, 'publicCallStack', MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL); - assertMemberLength(this, 'newL2ToL1Msgs', MAX_NEW_L2_TO_L1_MSGS_PER_CALL); - assertMemberLength(this, 'encryptedLogsHash', NUM_FIELDS_PER_SHA256); - assertMemberLength(this, 'unencryptedLogsHash', NUM_FIELDS_PER_SHA256); - } + ) {} /** * Create PrivateCircuitPublicInputs from a fields dictionary. * @param fields - The dictionary. diff --git a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts index 523b9c225267..42feb6d697e8 100644 --- a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts @@ -10,10 +10,9 @@ import { MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, - NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH, } from '../cbind/constants.gen.js'; -import { FieldsOf, assertMemberLength, makeTuple } from '../utils/jsUtils.js'; +import { FieldsOf, makeTuple } from '../utils/jsUtils.js'; import { serializeToBuffer } from '../utils/serialize.js'; import { CallContext } from './call_context.js'; import { HistoricBlockData } from './index.js'; @@ -207,14 +206,6 @@ export class PublicCircuitPublicInputs { */ public proverAddress: AztecAddress, ) { - assertMemberLength(this, 'returnValues', RETURN_VALUES_LENGTH); - assertMemberLength(this, 'publicCallStack', MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL); - assertMemberLength(this, 'newCommitments', MAX_NEW_COMMITMENTS_PER_CALL); - assertMemberLength(this, 'newNullifiers', MAX_NEW_NULLIFIERS_PER_CALL); - assertMemberLength(this, 'newL2ToL1Msgs', MAX_NEW_L2_TO_L1_MSGS_PER_CALL); - assertMemberLength(this, 'contractStorageUpdateRequests', MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL); - assertMemberLength(this, 'contractStorageReads', MAX_PUBLIC_DATA_READS_PER_CALL); - assertMemberLength(this, 'unencryptedLogsHash', NUM_FIELDS_PER_SHA256); } /** diff --git a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts b/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts index f0af8311d592..4735559598f1 100644 --- a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts +++ b/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts @@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader, Tuple } from '@aztec/foundation/serialize'; import { MAX_NEW_COMMITMENTS_PER_CALL, PRIVATE_DATA_TREE_HEIGHT } from '../cbind/constants.gen.js'; -import { assertMemberLength, makeTuple, range } from '../utils/jsUtils.js'; +import { makeTuple, range } from '../utils/jsUtils.js'; import { serializeToBuffer } from '../utils/serialize.js'; import { MembershipWitness } from './membership_witness.js'; @@ -33,7 +33,6 @@ export class ReadRequestMembershipWitness { */ public hintToCommitment: Fr, ) { - assertMemberLength(this, 'siblingPath', PRIVATE_DATA_TREE_HEIGHT); if (hintToCommitment.value > MAX_NEW_COMMITMENTS_PER_CALL) { throw new Error( `Expected ReadRequestMembershipWitness' hintToCommitment(${hintToCommitment}) to be <= NEW_COMMITMENTS_LENGTH(${MAX_NEW_COMMITMENTS_PER_CALL})`,