@aztec/stdlib 0.87.3-nightly.20250528 → 0.87.3
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 +0 -3
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +0 -38
- package/dest/avm/avm.d.ts +12 -696
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +8 -16
- package/dest/avm/avm_accumulated_data.d.ts +0 -77
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +0 -67
- package/dest/avm/avm_circuit_public_inputs.d.ts +3 -73
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +9 -19
- package/dest/avm/avm_proving_request.d.ts +0 -366
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -2
- package/dest/block/index.d.ts +0 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -1
- package/dest/block/l2_block.d.ts +1 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +2 -2
- package/dest/block/l2_block_source.d.ts +4 -9
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +0 -1
- package/dest/block/published_l2_block.d.ts +69 -99
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +12 -38
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/interfaces/archiver.js +2 -2
- package/dest/interfaces/aztec-node.js +2 -2
- package/dest/interfaces/proving-job.d.ts +4 -370
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts +2 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +0 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +0 -1
- package/dest/kernel/private_kernel_data.d.ts +25 -6
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +19 -8
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +2 -5
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.js +5 -9
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +3 -8
- package/dest/kernel/public_call_request.d.ts +0 -54
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +0 -58
- package/dest/rollup/avm_proof_data.d.ts +5 -7
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +4 -12
- package/dest/rollup/previous_rollup_block_data.d.ts +15 -6
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.js +13 -8
- package/dest/rollup/previous_rollup_data.d.ts +15 -6
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.js +13 -8
- package/dest/rollup/private_tube_data.d.ts +3 -3
- package/dest/rollup/private_tube_data.d.ts.map +1 -1
- package/dest/rollup/private_tube_data.js +3 -3
- package/dest/rollup/public_tube_data.d.ts +3 -3
- package/dest/rollup/public_tube_data.d.ts.map +1 -1
- package/dest/rollup/public_tube_data.js +3 -3
- package/dest/rollup/root_rollup.d.ts +10 -9
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +20 -9
- package/dest/tests/factories.d.ts +1 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +15 -21
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -4
- package/dest/tx/tx_effect.d.ts +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -2
- package/dest/validators/types.d.ts +0 -4
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/index.d.ts.map +1 -1
- package/dest/vks/index.js +1 -1
- package/dest/vks/{vk_data.d.ts → vk_witness_data.d.ts} +8 -8
- package/dest/vks/vk_witness_data.d.ts.map +1 -0
- package/dest/vks/{vk_data.js → vk_witness_data.js} +10 -10
- package/package.json +7 -7
- package/src/abi/abi.ts +0 -37
- package/src/avm/avm.ts +0 -14
- package/src/avm/avm_accumulated_data.ts +0 -93
- package/src/avm/avm_circuit_public_inputs.ts +2 -22
- package/src/block/body.ts +2 -7
- package/src/block/index.ts +0 -1
- package/src/block/l2_block.ts +1 -2
- package/src/block/l2_block_source.ts +3 -9
- package/src/block/published_l2_block.ts +24 -38
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/interfaces/archiver.ts +2 -2
- package/src/interfaces/aztec-node.ts +2 -2
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +2 -3
- package/src/kernel/index.ts +0 -1
- package/src/kernel/private_kernel_data.ts +29 -7
- package/src/kernel/private_kernel_reset_circuit_private_inputs.ts +3 -6
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -10
- package/src/kernel/public_call_request.ts +0 -66
- package/src/rollup/avm_proof_data.ts +7 -14
- package/src/rollup/previous_rollup_block_data.ts +12 -6
- package/src/rollup/previous_rollup_data.ts +12 -6
- package/src/rollup/private_tube_data.ts +4 -4
- package/src/rollup/public_tube_data.ts +4 -4
- package/src/rollup/root_rollup.ts +19 -6
- package/src/tests/factories.ts +20 -32
- package/src/tests/mocks.ts +3 -6
- package/src/tx/tx_effect.ts +5 -23
- package/src/validators/types.ts +0 -2
- package/src/vks/index.ts +1 -1
- package/src/vks/{vk_data.ts → vk_witness_data.ts} +6 -6
- package/dest/block/proposal/committee_attestation.d.ts +0 -34
- package/dest/block/proposal/committee_attestation.d.ts.map +0 -1
- package/dest/block/proposal/committee_attestation.js +0 -59
- package/dest/block/proposal/index.d.ts +0 -2
- package/dest/block/proposal/index.d.ts.map +0 -1
- package/dest/block/proposal/index.js +0 -1
- package/dest/kernel/padded_side_effects.d.ts +0 -26
- package/dest/kernel/padded_side_effects.d.ts.map +0 -1
- package/dest/kernel/padded_side_effects.js +0 -51
- package/dest/vks/vk_data.d.ts.map +0 -1
- package/src/block/proposal/committee_attestation.ts +0 -70
- package/src/block/proposal/index.ts +0 -1
- package/src/kernel/padded_side_effects.ts +0 -73
package/src/tests/factories.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeBlockBlobPublicInputs, makeSpongeBlob } from '@aztec/blob-lib/testing';
|
|
2
2
|
import {
|
|
3
3
|
ARCHIVE_HEIGHT,
|
|
4
|
-
|
|
4
|
+
AVM_PROOF_LENGTH_IN_FIELDS,
|
|
5
5
|
AZTEC_MAX_EPOCH_DURATION,
|
|
6
6
|
BLOBS_PER_BLOCK,
|
|
7
7
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
@@ -55,7 +55,6 @@ import { ContractStorageRead } from '../avm/contract_storage_read.js';
|
|
|
55
55
|
import { ContractStorageUpdateRequest } from '../avm/contract_storage_update_request.js';
|
|
56
56
|
import {
|
|
57
57
|
AvmAccumulatedData,
|
|
58
|
-
AvmAccumulatedDataArrayLengths,
|
|
59
58
|
AvmAppendLeavesHint,
|
|
60
59
|
AvmBytecodeCommitmentHint,
|
|
61
60
|
AvmCircuitInputs,
|
|
@@ -116,11 +115,7 @@ import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
|
116
115
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
117
116
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
118
117
|
import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js';
|
|
119
|
-
import {
|
|
120
|
-
CountedPublicCallRequest,
|
|
121
|
-
PublicCallRequest,
|
|
122
|
-
PublicCallRequestArrayLengths,
|
|
123
|
-
} from '../kernel/public_call_request.js';
|
|
118
|
+
import { CountedPublicCallRequest, PublicCallRequest } from '../kernel/public_call_request.js';
|
|
124
119
|
import { PublicKeys, computeAddress } from '../keys/index.js';
|
|
125
120
|
import { ContractClassLogFields } from '../logs/index.js';
|
|
126
121
|
import { PrivateLog } from '../logs/private_log.js';
|
|
@@ -173,8 +168,8 @@ import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
|
173
168
|
import { TxContext } from '../tx/tx_context.js';
|
|
174
169
|
import { TxRequest } from '../tx/tx_request.js';
|
|
175
170
|
import { RollupTypes, Vector } from '../types/index.js';
|
|
176
|
-
import { VkData } from '../vks/index.js';
|
|
177
171
|
import { VerificationKey, VerificationKeyAsFields, VerificationKeyData } from '../vks/verification_key.js';
|
|
172
|
+
import { VkWitnessData } from '../vks/vk_witness_data.js';
|
|
178
173
|
import { mockTx } from './mocks.js';
|
|
179
174
|
|
|
180
175
|
/**
|
|
@@ -373,10 +368,6 @@ function makeAvmAccumulatedData(seed = 1) {
|
|
|
373
368
|
);
|
|
374
369
|
}
|
|
375
370
|
|
|
376
|
-
function makeAvmAccumulatedDataArrayLengths(seed = 1) {
|
|
377
|
-
return new AvmAccumulatedDataArrayLengths(seed, seed + 1, seed + 2, seed + 3, seed + 4);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
371
|
export function makeGas(seed = 1) {
|
|
381
372
|
return new Gas(seed, seed + 1);
|
|
382
373
|
}
|
|
@@ -462,7 +453,6 @@ function makeAvmCircuitPublicInputs(seed = 1) {
|
|
|
462
453
|
makeGas(seed + 0x20),
|
|
463
454
|
makeGasSettings(),
|
|
464
455
|
makeAztecAddress(seed + 0x40),
|
|
465
|
-
makePublicCallRequestArrayLengths(seed + 0x40),
|
|
466
456
|
makeTuple(MAX_ENQUEUED_CALLS_PER_TX, makePublicCallRequest, seed + 0x100),
|
|
467
457
|
makeTuple(MAX_ENQUEUED_CALLS_PER_TX, makePublicCallRequest, seed + 0x200),
|
|
468
458
|
makePublicCallRequest(seed + 0x300),
|
|
@@ -472,7 +462,6 @@ function makeAvmCircuitPublicInputs(seed = 1) {
|
|
|
472
462
|
makePrivateToAvmAccumulatedData(seed + 0x600),
|
|
473
463
|
makeTreeSnapshots(seed + 0x700),
|
|
474
464
|
makeGas(seed + 0x750),
|
|
475
|
-
makeAvmAccumulatedDataArrayLengths(seed + 0x800),
|
|
476
465
|
makeAvmAccumulatedData(seed + 0x800),
|
|
477
466
|
fr(seed + 0x900),
|
|
478
467
|
false,
|
|
@@ -544,10 +533,6 @@ export function makePublicCallRequest(seed = 1) {
|
|
|
544
533
|
return new PublicCallRequest(makeAztecAddress(seed), makeAztecAddress(seed + 1), false, fr(seed + 0x3));
|
|
545
534
|
}
|
|
546
535
|
|
|
547
|
-
export function makePublicCallRequestArrayLengths(seed = 1) {
|
|
548
|
-
return new PublicCallRequestArrayLengths(seed, seed + 1, seed % 2 === 0);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
536
|
function makeCountedPublicCallRequest(seed = 1) {
|
|
552
537
|
return new CountedPublicCallRequest(makePublicCallRequest(seed), seed + 0x100);
|
|
553
538
|
}
|
|
@@ -757,7 +742,8 @@ export function makePreviousRollupData(
|
|
|
757
742
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
758
743
|
seed + 0x50,
|
|
759
744
|
),
|
|
760
|
-
|
|
745
|
+
VerificationKeyAsFields.makeFakeHonk(),
|
|
746
|
+
makeMembershipWitness(VK_TREE_HEIGHT, seed + 0x120),
|
|
761
747
|
);
|
|
762
748
|
}
|
|
763
749
|
|
|
@@ -777,7 +763,8 @@ export function makePreviousRollupBlockData(
|
|
|
777
763
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
778
764
|
seed + 0x50,
|
|
779
765
|
),
|
|
780
|
-
|
|
766
|
+
VerificationKeyAsFields.makeFakeHonk(),
|
|
767
|
+
makeMembershipWitness(VK_TREE_HEIGHT, seed + 0x120),
|
|
781
768
|
);
|
|
782
769
|
}
|
|
783
770
|
|
|
@@ -894,10 +881,13 @@ export function makeRootParityInputs(seed = 0): RootParityInputs {
|
|
|
894
881
|
*/
|
|
895
882
|
export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
896
883
|
return new RootRollupPublicInputs(
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
884
|
+
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
885
|
+
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
886
|
+
fr(seed + 0x300),
|
|
887
|
+
fr(seed + 0x400),
|
|
888
|
+
fr(seed + 0x500),
|
|
889
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x650),
|
|
890
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x600),
|
|
901
891
|
fr(seed + 0x700),
|
|
902
892
|
fr(seed + 0x701),
|
|
903
893
|
fr(seed + 0x702),
|
|
@@ -1080,15 +1070,15 @@ export function makePrivateBaseStateDiffHints(seed = 1): PrivateBaseStateDiffHin
|
|
|
1080
1070
|
);
|
|
1081
1071
|
}
|
|
1082
1072
|
|
|
1083
|
-
function
|
|
1084
|
-
return new
|
|
1073
|
+
function makeVkWitnessData(seed = 1) {
|
|
1074
|
+
return new VkWitnessData(VerificationKeyData.makeFakeHonk(), seed, makeTuple(VK_TREE_HEIGHT, fr, seed + 0x100));
|
|
1085
1075
|
}
|
|
1086
1076
|
|
|
1087
1077
|
function makePrivateTubeData(seed = 1, kernelPublicInputs?: PrivateToRollupKernelCircuitPublicInputs) {
|
|
1088
1078
|
return new PrivateTubeData(
|
|
1089
1079
|
kernelPublicInputs ?? makePrivateToRollupKernelCircuitPublicInputs(seed, true),
|
|
1090
1080
|
makeRecursiveProof<typeof TUBE_PROOF_LENGTH>(TUBE_PROOF_LENGTH, seed + 0x100),
|
|
1091
|
-
|
|
1081
|
+
makeVkWitnessData(seed + 0x200),
|
|
1092
1082
|
);
|
|
1093
1083
|
}
|
|
1094
1084
|
|
|
@@ -1161,15 +1151,15 @@ function makePublicTubeData(seed = 1) {
|
|
|
1161
1151
|
return new PublicTubeData(
|
|
1162
1152
|
makePrivateToPublicKernelCircuitPublicInputs(seed),
|
|
1163
1153
|
makeRecursiveProof<typeof TUBE_PROOF_LENGTH>(TUBE_PROOF_LENGTH, seed + 0x100),
|
|
1164
|
-
|
|
1154
|
+
makeVkWitnessData(seed + 0x200),
|
|
1165
1155
|
);
|
|
1166
1156
|
}
|
|
1167
1157
|
|
|
1168
1158
|
function makeAvmProofData(seed = 1) {
|
|
1169
1159
|
return new AvmProofData(
|
|
1170
1160
|
makeAvmCircuitPublicInputs(seed),
|
|
1171
|
-
makeRecursiveProof<typeof
|
|
1172
|
-
|
|
1161
|
+
makeRecursiveProof<typeof AVM_PROOF_LENGTH_IN_FIELDS>(AVM_PROOF_LENGTH_IN_FIELDS, seed + 0x100),
|
|
1162
|
+
makeVkWitnessData(seed + 0x200),
|
|
1173
1163
|
);
|
|
1174
1164
|
}
|
|
1175
1165
|
|
|
@@ -1496,7 +1486,6 @@ export function makeAvmTxHint(seed = 0): AvmTxHint {
|
|
|
1496
1486
|
return new AvmTxHint(
|
|
1497
1487
|
`txhash-${seed}`,
|
|
1498
1488
|
makeGlobalVariables(seed),
|
|
1499
|
-
makeGasSettings(),
|
|
1500
1489
|
{
|
|
1501
1490
|
noteHashes: makeArray((seed % 20) + 4, i => new Fr(i), seed + 0x1000),
|
|
1502
1491
|
nullifiers: makeArray((seed % 20) + 4, i => new Fr(i), seed + 0x2000),
|
|
@@ -1508,7 +1497,6 @@ export function makeAvmTxHint(seed = 0): AvmTxHint {
|
|
|
1508
1497
|
makeArray((seed % 20) + 4, i => makeAvmEnqueuedCallHint(i), seed + 0x5000), // setupEnqueuedCalls
|
|
1509
1498
|
makeArray((seed % 20) + 4, i => makeAvmEnqueuedCallHint(i), seed + 0x6000), // appLogicEnqueuedCalls
|
|
1510
1499
|
makeAvmEnqueuedCallHint(seed + 0x7000), // teardownEnqueuedCall
|
|
1511
|
-
makeGas(seed + 0x8000), // gasUsedByPrivate
|
|
1512
1500
|
);
|
|
1513
1501
|
}
|
|
1514
1502
|
|
package/src/tests/mocks.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
6
6
|
|
|
7
7
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
|
-
import { CommitteeAttestation } from '../block/index.js';
|
|
10
9
|
import { L2Block } from '../block/l2_block.js';
|
|
11
10
|
import type { PublishedL2Block } from '../block/published_l2_block.js';
|
|
12
11
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
@@ -300,7 +299,7 @@ export async function randomPublishedL2Block(
|
|
|
300
299
|
};
|
|
301
300
|
|
|
302
301
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
303
|
-
const
|
|
302
|
+
const attestations = await Promise.all(
|
|
304
303
|
signers.map(signer =>
|
|
305
304
|
makeBlockAttestation({
|
|
306
305
|
signer,
|
|
@@ -311,8 +310,6 @@ export async function randomPublishedL2Block(
|
|
|
311
310
|
}),
|
|
312
311
|
),
|
|
313
312
|
);
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
);
|
|
317
|
-
return { block, l1, attestations };
|
|
313
|
+
const signatures = attestations.map(attestation => attestation.signature);
|
|
314
|
+
return { block, l1, signatures };
|
|
318
315
|
}
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -232,33 +232,15 @@ export class TxEffect {
|
|
|
232
232
|
return thisLayer[0];
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
static async random(
|
|
236
|
-
numPublicCallsPerTx = 3,
|
|
237
|
-
numPublicLogsPerCall = 1,
|
|
238
|
-
maxEffects: number | undefined = undefined,
|
|
239
|
-
): Promise<TxEffect> {
|
|
235
|
+
static async random(numPublicCallsPerTx = 3, numPublicLogsPerCall = 1): Promise<TxEffect> {
|
|
240
236
|
return new TxEffect(
|
|
241
237
|
RevertCode.random(),
|
|
242
238
|
TxHash.random(),
|
|
243
239
|
new Fr(Math.floor(Math.random() * 100_000)),
|
|
244
|
-
makeTuple(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
),
|
|
248
|
-
makeTuple(
|
|
249
|
-
maxEffects === undefined ? MAX_NULLIFIERS_PER_TX : Math.min(maxEffects, MAX_NULLIFIERS_PER_TX),
|
|
250
|
-
Fr.random,
|
|
251
|
-
),
|
|
252
|
-
makeTuple(
|
|
253
|
-
maxEffects === undefined ? MAX_L2_TO_L1_MSGS_PER_TX : Math.min(maxEffects, MAX_L2_TO_L1_MSGS_PER_TX),
|
|
254
|
-
Fr.random,
|
|
255
|
-
),
|
|
256
|
-
makeTuple(
|
|
257
|
-
maxEffects === undefined
|
|
258
|
-
? MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX
|
|
259
|
-
: Math.min(maxEffects, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX),
|
|
260
|
-
PublicDataWrite.random,
|
|
261
|
-
),
|
|
240
|
+
makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.random),
|
|
241
|
+
makeTuple(MAX_NULLIFIERS_PER_TX, Fr.random),
|
|
242
|
+
makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, Fr.random),
|
|
243
|
+
makeTuple(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PublicDataWrite.random),
|
|
262
244
|
makeTuple(MAX_PRIVATE_LOGS_PER_TX, () => PrivateLog.random()),
|
|
263
245
|
await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, async () => await PublicLog.random()),
|
|
264
246
|
await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random),
|
package/src/validators/types.ts
CHANGED
package/src/vks/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './verification_key.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './vk_witness_data.js';
|
|
@@ -7,26 +7,26 @@ import { bufferToHex } from '@aztec/foundation/string';
|
|
|
7
7
|
import type { UInt32 } from '../types/shared.js';
|
|
8
8
|
import { VerificationKeyData } from './verification_key.js';
|
|
9
9
|
|
|
10
|
-
export class
|
|
10
|
+
export class VkWitnessData {
|
|
11
11
|
constructor(
|
|
12
12
|
public vk: VerificationKeyData,
|
|
13
13
|
/**
|
|
14
14
|
* Index of the vk in the vk tree.
|
|
15
15
|
*/
|
|
16
|
-
public
|
|
16
|
+
public vkIndex: UInt32,
|
|
17
17
|
/**
|
|
18
18
|
* Sibling path of the vk in the vk tree.
|
|
19
19
|
*/
|
|
20
|
-
public
|
|
20
|
+
public vkPath: Tuple<Fr, typeof VK_TREE_HEIGHT>,
|
|
21
21
|
) {}
|
|
22
22
|
|
|
23
23
|
static empty() {
|
|
24
|
-
return new
|
|
24
|
+
return new VkWitnessData(VerificationKeyData.empty(), 0, makeTuple(VK_TREE_HEIGHT, Fr.zero));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
28
28
|
const reader = BufferReader.asReader(buffer);
|
|
29
|
-
return new
|
|
29
|
+
return new VkWitnessData(
|
|
30
30
|
reader.readObject(VerificationKeyData),
|
|
31
31
|
reader.readNumber(),
|
|
32
32
|
reader.readArray(VK_TREE_HEIGHT, Fr),
|
|
@@ -34,7 +34,7 @@ export class VkData {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
toBuffer() {
|
|
37
|
-
return serializeToBuffer(this.vk, this.
|
|
37
|
+
return serializeToBuffer(this.vk, this.vkIndex, this.vkPath);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
toString() {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ViemCommitteeAttestation } from '@aztec/ethereum';
|
|
2
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
export { Signature };
|
|
6
|
-
export { EthAddress };
|
|
7
|
-
export declare class CommitteeAttestation {
|
|
8
|
-
readonly address: EthAddress;
|
|
9
|
-
readonly signature: Signature;
|
|
10
|
-
constructor(address: EthAddress, signature: Signature);
|
|
11
|
-
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
12
|
-
address: z.ZodType<EthAddress, any, string>;
|
|
13
|
-
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, Signature, string>;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
address: EthAddress;
|
|
16
|
-
signature: Signature;
|
|
17
|
-
}, {
|
|
18
|
-
address: string;
|
|
19
|
-
signature: string;
|
|
20
|
-
}>, CommitteeAttestation, {
|
|
21
|
-
address: string;
|
|
22
|
-
signature: string;
|
|
23
|
-
}>;
|
|
24
|
-
static fromAddress(address: EthAddress): CommitteeAttestation;
|
|
25
|
-
static fromAddressAndSignature(address: EthAddress, signature: Signature): CommitteeAttestation;
|
|
26
|
-
static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation;
|
|
27
|
-
static fromBuffer(buffer: Buffer): CommitteeAttestation;
|
|
28
|
-
static random(): CommitteeAttestation;
|
|
29
|
-
static empty(): CommitteeAttestation;
|
|
30
|
-
toBuffer(): Buffer;
|
|
31
|
-
equals(other: CommitteeAttestation): boolean;
|
|
32
|
-
toViem(): ViemCommitteeAttestation;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=committee_attestation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,qBAAa,oBAAoB;aAEb,OAAO,EAAE,UAAU;aACnB,SAAS,EAAE,SAAS;gBADpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,SAAS;IAGtC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAGD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;IAK7D,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB;IAI/F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB;IAIrE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB;IAOvD,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAKrC,MAAM,CAAC,KAAK,IAAI,oBAAoB;IAIpC,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI5C,MAAM,IAAI,wBAAwB;CAMnC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { Signature } from '@aztec/foundation/eth-signature';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
export { Signature };
|
|
6
|
-
export { EthAddress };
|
|
7
|
-
export class CommitteeAttestation {
|
|
8
|
-
address;
|
|
9
|
-
signature;
|
|
10
|
-
constructor(address, signature){
|
|
11
|
-
this.address = address;
|
|
12
|
-
this.signature = signature;
|
|
13
|
-
}
|
|
14
|
-
static get schema() {
|
|
15
|
-
return z.object({
|
|
16
|
-
address: EthAddress.schema,
|
|
17
|
-
signature: Signature.schema
|
|
18
|
-
}).transform(({ address, signature })=>new CommitteeAttestation(address, signature));
|
|
19
|
-
}
|
|
20
|
-
// Create an empty attestation for an address that has not signed
|
|
21
|
-
static fromAddress(address) {
|
|
22
|
-
return new CommitteeAttestation(address, Signature.empty());
|
|
23
|
-
}
|
|
24
|
-
// Create an attestation from an address and a signature
|
|
25
|
-
static fromAddressAndSignature(address, signature) {
|
|
26
|
-
return new CommitteeAttestation(address, signature);
|
|
27
|
-
}
|
|
28
|
-
static fromViem(viem) {
|
|
29
|
-
return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
|
|
30
|
-
}
|
|
31
|
-
static fromBuffer(buffer) {
|
|
32
|
-
const reader = BufferReader.asReader(buffer);
|
|
33
|
-
const address = reader.readObject(EthAddress);
|
|
34
|
-
const signature = reader.readObject(Signature);
|
|
35
|
-
return new CommitteeAttestation(address, signature);
|
|
36
|
-
}
|
|
37
|
-
static random() {
|
|
38
|
-
// note: will be invalid
|
|
39
|
-
return new CommitteeAttestation(EthAddress.random(), Signature.random());
|
|
40
|
-
}
|
|
41
|
-
static empty() {
|
|
42
|
-
return new CommitteeAttestation(EthAddress.ZERO, Signature.empty());
|
|
43
|
-
}
|
|
44
|
-
toBuffer() {
|
|
45
|
-
return serializeToBuffer([
|
|
46
|
-
this.address,
|
|
47
|
-
this.signature
|
|
48
|
-
]);
|
|
49
|
-
}
|
|
50
|
-
equals(other) {
|
|
51
|
-
return this.address.equals(other.address) && this.signature.equals(other.signature);
|
|
52
|
-
}
|
|
53
|
-
toViem() {
|
|
54
|
-
return {
|
|
55
|
-
addr: this.address.toString(),
|
|
56
|
-
signature: this.signature.toViemSignature()
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './committee_attestation.js';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
4
|
-
import { PrivateLog } from '../logs/index.js';
|
|
5
|
-
export declare class PaddedSideEffects {
|
|
6
|
-
noteHashes: Tuple<Fr, typeof MAX_NOTE_HASHES_PER_TX>;
|
|
7
|
-
nullifiers: Tuple<Fr, typeof MAX_NULLIFIERS_PER_TX>;
|
|
8
|
-
privateLogs: Tuple<PrivateLog, typeof MAX_PRIVATE_LOGS_PER_TX>;
|
|
9
|
-
constructor(noteHashes: Tuple<Fr, typeof MAX_NOTE_HASHES_PER_TX>, nullifiers: Tuple<Fr, typeof MAX_NULLIFIERS_PER_TX>, privateLogs: Tuple<PrivateLog, typeof MAX_PRIVATE_LOGS_PER_TX>);
|
|
10
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
11
|
-
static fromBuffer(buffer: Buffer | BufferReader): PaddedSideEffects;
|
|
12
|
-
static empty(): PaddedSideEffects;
|
|
13
|
-
}
|
|
14
|
-
export declare class PaddedSideEffectAmounts {
|
|
15
|
-
nonRevertibleNoteHashes: number;
|
|
16
|
-
revertibleNoteHashes: number;
|
|
17
|
-
nonRevertibleNullifiers: number;
|
|
18
|
-
revertibleNullifiers: number;
|
|
19
|
-
nonRevertiblePrivateLogs: number;
|
|
20
|
-
revertiblePrivateLogs: number;
|
|
21
|
-
constructor(nonRevertibleNoteHashes: number, revertibleNoteHashes: number, nonRevertibleNullifiers: number, revertibleNullifiers: number, nonRevertiblePrivateLogs: number, revertiblePrivateLogs: number);
|
|
22
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
23
|
-
static fromBuffer(buffer: Buffer | BufferReader): PaddedSideEffectAmounts;
|
|
24
|
-
static empty(): PaddedSideEffectAmounts;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=padded_side_effects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"padded_side_effects.d.ts","sourceRoot":"","sources":["../../src/kernel/padded_side_effects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE1G,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,iBAAiB;IAEnB,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,sBAAsB,CAAC;IACpD,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,qBAAqB,CAAC;IACnD,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,uBAAuB,CAAC;gBAF9D,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,sBAAsB,CAAC,EACpD,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,qBAAqB,CAAC,EACnD,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,uBAAuB,CAAC;IAGvE,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAS/C,MAAM,CAAC,KAAK;CAOb;AAED,qBAAa,uBAAuB;IAEzB,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,wBAAwB,EAAE,MAAM;IAChC,qBAAqB,EAAE,MAAM;gBAL7B,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,EAAE,MAAM,EAC5B,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,MAAM,EAChC,qBAAqB,EAAE,MAAM;IAGtC,QAAQ;IAWR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAY/C,MAAM,CAAC,KAAK;CAGb"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import { PrivateLog } from '../logs/index.js';
|
|
6
|
-
export class PaddedSideEffects {
|
|
7
|
-
noteHashes;
|
|
8
|
-
nullifiers;
|
|
9
|
-
privateLogs;
|
|
10
|
-
constructor(noteHashes, nullifiers, privateLogs){
|
|
11
|
-
this.noteHashes = noteHashes;
|
|
12
|
-
this.nullifiers = nullifiers;
|
|
13
|
-
this.privateLogs = privateLogs;
|
|
14
|
-
}
|
|
15
|
-
toBuffer() {
|
|
16
|
-
return serializeToBuffer(this.noteHashes, this.nullifiers, this.privateLogs);
|
|
17
|
-
}
|
|
18
|
-
static fromBuffer(buffer) {
|
|
19
|
-
const reader = BufferReader.asReader(buffer);
|
|
20
|
-
return new PaddedSideEffects(reader.readArray(MAX_NOTE_HASHES_PER_TX, Fr), reader.readArray(MAX_NULLIFIERS_PER_TX, Fr), reader.readArray(MAX_PRIVATE_LOGS_PER_TX, PrivateLog));
|
|
21
|
-
}
|
|
22
|
-
static empty() {
|
|
23
|
-
return new PaddedSideEffects(makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.zero), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero), makeTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog.empty));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class PaddedSideEffectAmounts {
|
|
27
|
-
nonRevertibleNoteHashes;
|
|
28
|
-
revertibleNoteHashes;
|
|
29
|
-
nonRevertibleNullifiers;
|
|
30
|
-
revertibleNullifiers;
|
|
31
|
-
nonRevertiblePrivateLogs;
|
|
32
|
-
revertiblePrivateLogs;
|
|
33
|
-
constructor(nonRevertibleNoteHashes, revertibleNoteHashes, nonRevertibleNullifiers, revertibleNullifiers, nonRevertiblePrivateLogs, revertiblePrivateLogs){
|
|
34
|
-
this.nonRevertibleNoteHashes = nonRevertibleNoteHashes;
|
|
35
|
-
this.revertibleNoteHashes = revertibleNoteHashes;
|
|
36
|
-
this.nonRevertibleNullifiers = nonRevertibleNullifiers;
|
|
37
|
-
this.revertibleNullifiers = revertibleNullifiers;
|
|
38
|
-
this.nonRevertiblePrivateLogs = nonRevertiblePrivateLogs;
|
|
39
|
-
this.revertiblePrivateLogs = revertiblePrivateLogs;
|
|
40
|
-
}
|
|
41
|
-
toBuffer() {
|
|
42
|
-
return serializeToBuffer(this.nonRevertibleNoteHashes, this.revertibleNoteHashes, this.nonRevertibleNullifiers, this.revertibleNullifiers, this.nonRevertiblePrivateLogs, this.revertiblePrivateLogs);
|
|
43
|
-
}
|
|
44
|
-
static fromBuffer(buffer) {
|
|
45
|
-
const reader = BufferReader.asReader(buffer);
|
|
46
|
-
return new PaddedSideEffectAmounts(reader.readNumber(), reader.readNumber(), reader.readNumber(), reader.readNumber(), reader.readNumber(), reader.readNumber());
|
|
47
|
-
}
|
|
48
|
-
static empty() {
|
|
49
|
-
return new PaddedSideEffectAmounts(0, 0, 0, 0, 0, 0);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vk_data.d.ts","sourceRoot":"","sources":["../../src/vks/vk_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,MAAM;IAER,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,SAAS,EAAE,MAAM;IACxB;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;gBAR7C,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,SAAS,EAAE,MAAM;IACxB;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;IAGtD,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAS/C,QAAQ;IAIR,QAAQ;CAGT"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { ViemCommitteeAttestation } from '@aztec/ethereum';
|
|
2
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
|
|
8
|
-
export { Signature };
|
|
9
|
-
export { EthAddress };
|
|
10
|
-
|
|
11
|
-
export class CommitteeAttestation {
|
|
12
|
-
constructor(
|
|
13
|
-
public readonly address: EthAddress,
|
|
14
|
-
public readonly signature: Signature,
|
|
15
|
-
) {}
|
|
16
|
-
|
|
17
|
-
static get schema() {
|
|
18
|
-
return z
|
|
19
|
-
.object({
|
|
20
|
-
address: EthAddress.schema,
|
|
21
|
-
signature: Signature.schema,
|
|
22
|
-
})
|
|
23
|
-
.transform(({ address, signature }) => new CommitteeAttestation(address, signature));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Create an empty attestation for an address that has not signed
|
|
27
|
-
static fromAddress(address: EthAddress): CommitteeAttestation {
|
|
28
|
-
return new CommitteeAttestation(address, Signature.empty());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Create an attestation from an address and a signature
|
|
32
|
-
static fromAddressAndSignature(address: EthAddress, signature: Signature): CommitteeAttestation {
|
|
33
|
-
return new CommitteeAttestation(address, signature);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation {
|
|
37
|
-
return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static fromBuffer(buffer: Buffer): CommitteeAttestation {
|
|
41
|
-
const reader = BufferReader.asReader(buffer);
|
|
42
|
-
const address = reader.readObject(EthAddress);
|
|
43
|
-
const signature = reader.readObject(Signature);
|
|
44
|
-
return new CommitteeAttestation(address, signature);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static random(): CommitteeAttestation {
|
|
48
|
-
// note: will be invalid
|
|
49
|
-
return new CommitteeAttestation(EthAddress.random(), Signature.random());
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
static empty(): CommitteeAttestation {
|
|
53
|
-
return new CommitteeAttestation(EthAddress.ZERO, Signature.empty());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
toBuffer(): Buffer {
|
|
57
|
-
return serializeToBuffer([this.address, this.signature]);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
equals(other: CommitteeAttestation): boolean {
|
|
61
|
-
return this.address.equals(other.address) && this.signature.equals(other.signature);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
toViem(): ViemCommitteeAttestation {
|
|
65
|
-
return {
|
|
66
|
-
addr: this.address.toString(),
|
|
67
|
-
signature: this.signature.toViemSignature(),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './committee_attestation.js';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
|
|
6
|
-
import { PrivateLog } from '../logs/index.js';
|
|
7
|
-
|
|
8
|
-
export class PaddedSideEffects {
|
|
9
|
-
constructor(
|
|
10
|
-
public noteHashes: Tuple<Fr, typeof MAX_NOTE_HASHES_PER_TX>,
|
|
11
|
-
public nullifiers: Tuple<Fr, typeof MAX_NULLIFIERS_PER_TX>,
|
|
12
|
-
public privateLogs: Tuple<PrivateLog, typeof MAX_PRIVATE_LOGS_PER_TX>,
|
|
13
|
-
) {}
|
|
14
|
-
|
|
15
|
-
toBuffer() {
|
|
16
|
-
return serializeToBuffer(this.noteHashes, this.nullifiers, this.privateLogs);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
20
|
-
const reader = BufferReader.asReader(buffer);
|
|
21
|
-
return new PaddedSideEffects(
|
|
22
|
-
reader.readArray(MAX_NOTE_HASHES_PER_TX, Fr),
|
|
23
|
-
reader.readArray(MAX_NULLIFIERS_PER_TX, Fr),
|
|
24
|
-
reader.readArray(MAX_PRIVATE_LOGS_PER_TX, PrivateLog),
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static empty() {
|
|
29
|
-
return new PaddedSideEffects(
|
|
30
|
-
makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.zero),
|
|
31
|
-
makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero),
|
|
32
|
-
makeTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog.empty),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class PaddedSideEffectAmounts {
|
|
38
|
-
constructor(
|
|
39
|
-
public nonRevertibleNoteHashes: number,
|
|
40
|
-
public revertibleNoteHashes: number,
|
|
41
|
-
public nonRevertibleNullifiers: number,
|
|
42
|
-
public revertibleNullifiers: number,
|
|
43
|
-
public nonRevertiblePrivateLogs: number,
|
|
44
|
-
public revertiblePrivateLogs: number,
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
toBuffer() {
|
|
48
|
-
return serializeToBuffer(
|
|
49
|
-
this.nonRevertibleNoteHashes,
|
|
50
|
-
this.revertibleNoteHashes,
|
|
51
|
-
this.nonRevertibleNullifiers,
|
|
52
|
-
this.revertibleNullifiers,
|
|
53
|
-
this.nonRevertiblePrivateLogs,
|
|
54
|
-
this.revertiblePrivateLogs,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
59
|
-
const reader = BufferReader.asReader(buffer);
|
|
60
|
-
return new PaddedSideEffectAmounts(
|
|
61
|
-
reader.readNumber(),
|
|
62
|
-
reader.readNumber(),
|
|
63
|
-
reader.readNumber(),
|
|
64
|
-
reader.readNumber(),
|
|
65
|
-
reader.readNumber(),
|
|
66
|
-
reader.readNumber(),
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static empty() {
|
|
71
|
-
return new PaddedSideEffectAmounts(0, 0, 0, 0, 0, 0);
|
|
72
|
-
}
|
|
73
|
-
}
|