@aztec/stdlib 0.87.2 → 0.87.3-nightly.20250529
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 +3 -0
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +38 -0
- package/dest/avm/avm.d.ts +696 -12
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +16 -8
- package/dest/avm/avm_accumulated_data.d.ts +77 -0
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +67 -0
- package/dest/avm/avm_circuit_public_inputs.d.ts +73 -3
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +19 -9
- package/dest/avm/avm_proving_request.d.ts +366 -0
- 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 +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +3 -2
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +10 -5
- package/dest/block/l2_block_source.d.ts +9 -4
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/proposal/committee_attestation.d.ts +34 -0
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -0
- package/dest/block/proposal/committee_attestation.js +59 -0
- package/dest/block/proposal/index.d.ts +2 -0
- package/dest/block/proposal/index.d.ts.map +1 -0
- package/dest/block/proposal/index.js +1 -0
- package/dest/block/published_l2_block.d.ts +99 -69
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +38 -12
- 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/p2p.d.ts +5 -2
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +1 -2
- package/dest/interfaces/prover-agent.d.ts +31 -6
- package/dest/interfaces/prover-agent.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.js +15 -6
- package/dest/interfaces/proving-job.d.ts +370 -4
- 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 +3 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +1 -1
- package/dest/kernel/hints/key_validation_hint.d.ts +2 -6
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_hint.js +5 -7
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +7 -7
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.js +8 -4
- package/dest/kernel/hints/read_request_hints.d.ts +8 -8
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +1 -0
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -0
- package/dest/kernel/padded_side_effects.d.ts +26 -0
- package/dest/kernel/padded_side_effects.d.ts.map +1 -0
- package/dest/kernel/padded_side_effects.js +51 -0
- package/dest/kernel/private_kernel_data.d.ts +6 -25
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +8 -19
- package/dest/kernel/private_kernel_prover_output.d.ts +3 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +7 -4
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.js +10 -6
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +10 -10
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_dimensions.js +29 -29
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +8 -3
- package/dest/kernel/public_call_request.d.ts +54 -0
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +58 -0
- package/dest/logs/contract_class_log.d.ts +0 -4
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +0 -33
- package/dest/logs/log_with_tx_data.d.ts +3 -3
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +9 -13
- package/dest/logs/pending_tagged_log.d.ts +1 -1
- package/dest/logs/pending_tagged_log.js +1 -1
- package/dest/logs/private_log.d.ts +1 -0
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +3 -0
- package/dest/logs/public_log.d.ts +1 -0
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +3 -0
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +1 -0
- package/dest/rollup/avm_proof_data.d.ts +7 -5
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +12 -4
- package/dest/rollup/base_rollup_hints.d.ts +4 -4
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +8 -8
- package/dest/rollup/previous_rollup_block_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.js +8 -13
- package/dest/rollup/previous_rollup_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.js +8 -13
- 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 +9 -10
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +9 -20
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +25 -19
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -3
- package/dest/tx/private_execution_result.d.ts +6 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +2 -5
- package/dest/tx/profiling.d.ts +41 -0
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +4 -1
- package/dest/tx/proven_tx.d.ts +40 -18
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +2 -2
- package/dest/tx/tx.d.ts +10 -25
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +25 -50
- 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 +4 -0
- 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_witness_data.d.ts → vk_data.d.ts} +8 -8
- package/dest/vks/vk_data.d.ts.map +1 -0
- package/dest/vks/{vk_witness_data.js → vk_data.js} +10 -10
- package/package.json +7 -7
- package/src/abi/abi.ts +37 -0
- package/src/avm/avm.ts +14 -0
- package/src/avm/avm_accumulated_data.ts +93 -0
- package/src/avm/avm_circuit_public_inputs.ts +22 -2
- package/src/block/body.ts +7 -2
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +8 -3
- package/src/block/l2_block_source.ts +9 -3
- package/src/block/proposal/committee_attestation.ts +70 -0
- package/src/block/proposal/index.ts +1 -0
- package/src/block/published_l2_block.ts +38 -24
- 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/p2p.ts +8 -3
- package/src/interfaces/prover-agent.ts +9 -10
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +3 -3
- package/src/kernel/hints/key_validation_hint.ts +4 -6
- package/src/kernel/hints/private_kernel_reset_hints.ts +34 -43
- package/src/kernel/hints/read_request_hints.ts +27 -15
- package/src/kernel/index.ts +1 -0
- package/src/kernel/padded_side_effects.ts +73 -0
- package/src/kernel/private_kernel_data.ts +7 -29
- package/src/kernel/private_kernel_prover_output.ts +1 -0
- package/src/kernel/private_kernel_reset_circuit_private_inputs.ts +16 -13
- package/src/kernel/private_kernel_reset_dimensions.ts +27 -27
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +10 -2
- package/src/kernel/public_call_request.ts +66 -0
- package/src/logs/contract_class_log.ts +0 -36
- package/src/logs/log_with_tx_data.ts +7 -11
- package/src/logs/pending_tagged_log.ts +1 -1
- package/src/logs/private_log.ts +4 -0
- package/src/logs/public_log.ts +4 -0
- package/src/logs/tx_scoped_l2_log.ts +1 -0
- package/src/rollup/avm_proof_data.ts +14 -7
- package/src/rollup/base_rollup_hints.ts +4 -4
- package/src/rollup/previous_rollup_block_data.ts +6 -12
- package/src/rollup/previous_rollup_data.ts +6 -12
- package/src/rollup/private_tube_data.ts +4 -4
- package/src/rollup/public_tube_data.ts +4 -4
- package/src/rollup/root_rollup.ts +6 -19
- package/src/tests/factories.ts +36 -32
- package/src/tests/mocks.ts +6 -3
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/processed_tx.ts +4 -5
- package/src/tx/profiling.ts +6 -1
- package/src/tx/proven_tx.ts +2 -2
- package/src/tx/tx.ts +28 -54
- package/src/tx/tx_effect.ts +23 -5
- package/src/validators/types.ts +2 -0
- package/src/vks/index.ts +1 -1
- package/src/vks/{vk_witness_data.ts → vk_data.ts} +6 -6
- package/dest/vks/vk_witness_data.d.ts.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MAX_NOTE_HASHES_PER_TX,
|
|
1
|
+
import { MAX_NOTE_HASHES_PER_TX, PUBLIC_LOG_PLAINTEXT_LEN } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
|
-
// TypeScript representation of the Noir aztec::oracle::message_discovery::
|
|
6
|
-
// response for PXE's custom
|
|
7
|
-
export class
|
|
5
|
+
// TypeScript representation of the Noir aztec::oracle::message_discovery::PublicLogWithTxData struct. This is used as a
|
|
6
|
+
// response for PXE's custom getPublicLogByTag oracle.
|
|
7
|
+
export class PublicLogWithTxData {
|
|
8
8
|
constructor(
|
|
9
9
|
// The emitted fields of a log.
|
|
10
|
-
|
|
11
|
-
public logContent: Fr[],
|
|
10
|
+
public logPlaintext: Fr[],
|
|
12
11
|
public txHash: TxHash,
|
|
13
12
|
public uniqueNoteHashesInTx: Fr[],
|
|
14
13
|
public firstNullifierInTx: Fr,
|
|
@@ -16,10 +15,7 @@ export class LogWithTxData {
|
|
|
16
15
|
|
|
17
16
|
toNoirSerialization(): (Fr | Fr[])[] {
|
|
18
17
|
return [
|
|
19
|
-
|
|
20
|
-
// This is only used for public logs currently, so the maxLength is PUBLIC_LOG_SIZE_IN_FIELDS + 1.
|
|
21
|
-
// TODO(#11639): this could also be used for private logs.
|
|
22
|
-
...toBoundedVecSerialization(this.logContent, PUBLIC_LOG_SIZE_IN_FIELDS + 1),
|
|
18
|
+
...toBoundedVecSerialization(this.logPlaintext, PUBLIC_LOG_PLAINTEXT_LEN),
|
|
23
19
|
this.txHash.hash,
|
|
24
20
|
...toBoundedVecSerialization(this.uniqueNoteHashesInTx, MAX_NOTE_HASHES_PER_TX),
|
|
25
21
|
this.firstNullifierInTx,
|
|
@@ -27,7 +23,7 @@ export class LogWithTxData {
|
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
static noirSerializationOfEmpty(): (Fr | Fr[])[] {
|
|
30
|
-
return new
|
|
26
|
+
return new PublicLogWithTxData([], TxHash.zero(), [], new Fr(0)).toNoirSerialization();
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
29
|
|
|
@@ -5,7 +5,7 @@ import type { AztecAddress } from '../aztec-address/index.js';
|
|
|
5
5
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Represents a pending tagged log as it is stored in the pending tagged log array to which the
|
|
8
|
+
* Represents a pending tagged log as it is stored in the pending tagged log array to which the fetchTaggedLogs oracle
|
|
9
9
|
* inserts found private logs. A TS version of `pending_tagged_log.nr`.
|
|
10
10
|
*/
|
|
11
11
|
export class PendingTaggedLog {
|
package/src/logs/private_log.ts
CHANGED
|
@@ -44,6 +44,10 @@ export class PrivateLog {
|
|
|
44
44
|
return this.fields.slice(0, this.emittedLength);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
getEmittedFieldsWithoutTag() {
|
|
48
|
+
return this.fields.slice(1, this.emittedLength);
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
toBlobFields(): Fr[] {
|
|
48
52
|
return [new Fr(this.emittedLength)].concat(this.getEmittedFields());
|
|
49
53
|
}
|
package/src/logs/public_log.ts
CHANGED
|
@@ -50,6 +50,10 @@ export class PublicLog {
|
|
|
50
50
|
return this.fields.slice(0, this.emittedLength);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
getEmittedFieldsWithoutTag() {
|
|
54
|
+
return this.fields.slice(1, this.emittedLength);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
toBlobFields(): Fr[] {
|
|
54
58
|
return [new Fr(this.emittedLength), this.contractAddress.toField()].concat(this.getEmittedFields());
|
|
55
59
|
}
|
|
@@ -6,6 +6,7 @@ import { TxHash } from '../tx/tx_hash.js';
|
|
|
6
6
|
import { PrivateLog } from './private_log.js';
|
|
7
7
|
import { PublicLog } from './public_log.js';
|
|
8
8
|
|
|
9
|
+
// TODO(#14460): Split to private and public versions instead of having this weird mix.
|
|
9
10
|
export class TxScopedL2Log {
|
|
10
11
|
constructor(
|
|
11
12
|
/*
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
4
|
|
|
4
5
|
import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
5
6
|
import { RecursiveProof, makeEmptyRecursiveProof } from '../proofs/recursive_proof.js';
|
|
6
|
-
import {
|
|
7
|
+
import { VkData } from '../vks/vk_data.js';
|
|
7
8
|
|
|
8
9
|
export class AvmProofData {
|
|
9
10
|
constructor(
|
|
10
11
|
public publicInputs: AvmCircuitPublicInputs,
|
|
11
|
-
public proof: RecursiveProof<typeof
|
|
12
|
-
public vkData:
|
|
12
|
+
public proof: RecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>,
|
|
13
|
+
public vkData: VkData,
|
|
13
14
|
) {}
|
|
14
15
|
|
|
15
16
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
@@ -17,7 +18,7 @@ export class AvmProofData {
|
|
|
17
18
|
return new AvmProofData(
|
|
18
19
|
reader.readObject(AvmCircuitPublicInputs),
|
|
19
20
|
RecursiveProof.fromBuffer(reader),
|
|
20
|
-
reader.readObject(
|
|
21
|
+
reader.readObject(VkData),
|
|
21
22
|
);
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -28,8 +29,14 @@ export class AvmProofData {
|
|
|
28
29
|
static empty() {
|
|
29
30
|
return new AvmProofData(
|
|
30
31
|
AvmCircuitPublicInputs.empty(),
|
|
31
|
-
makeEmptyRecursiveProof(
|
|
32
|
-
|
|
32
|
+
makeEmptyRecursiveProof(AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED),
|
|
33
|
+
VkData.empty(),
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
// TODO(#14234)[Unconditional PIs validation]: remove this function.
|
|
39
|
+
export function enhanceProofWithPiValidationFlag(proof: Fr[], skipPublicInputsValidation: boolean): Fr[] {
|
|
40
|
+
const skipPublicInputsField = skipPublicInputsValidation ? new Fr(1) : new Fr(0);
|
|
41
|
+
return [skipPublicInputsField].concat(proof).slice(0, AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED);
|
|
42
|
+
}
|
|
@@ -39,7 +39,7 @@ export class PrivateBaseRollupHints {
|
|
|
39
39
|
/**
|
|
40
40
|
* Preimages to the kernel's contractClassLogsHashes.
|
|
41
41
|
*/
|
|
42
|
-
public
|
|
42
|
+
public contractClassLogsFields: Tuple<ContractClassLogFields, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>,
|
|
43
43
|
/**
|
|
44
44
|
* Data which is not modified by the base rollup circuit.
|
|
45
45
|
*/
|
|
@@ -57,7 +57,7 @@ export class PrivateBaseRollupHints {
|
|
|
57
57
|
fields.stateDiffHints,
|
|
58
58
|
fields.feePayerFeeJuiceBalanceReadHint,
|
|
59
59
|
fields.archiveRootMembershipWitness,
|
|
60
|
-
fields.
|
|
60
|
+
fields.contractClassLogsFields,
|
|
61
61
|
fields.constants,
|
|
62
62
|
] as const;
|
|
63
63
|
}
|
|
@@ -121,7 +121,7 @@ export class PublicBaseRollupHints {
|
|
|
121
121
|
/**
|
|
122
122
|
* Preimages to the kernel's contractClassLogsHashes.
|
|
123
123
|
*/
|
|
124
|
-
public
|
|
124
|
+
public contractClassLogsFields: Tuple<ContractClassLogFields, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>,
|
|
125
125
|
/**
|
|
126
126
|
* Data which is not modified by the base rollup circuit.
|
|
127
127
|
*/
|
|
@@ -136,7 +136,7 @@ export class PublicBaseRollupHints {
|
|
|
136
136
|
return [
|
|
137
137
|
fields.startSpongeBlob,
|
|
138
138
|
fields.archiveRootMembershipWitness,
|
|
139
|
-
fields.
|
|
139
|
+
fields.contractClassLogsFields,
|
|
140
140
|
fields.constants,
|
|
141
141
|
] as const;
|
|
142
142
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
1
|
+
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
-
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
4
3
|
|
|
5
4
|
import { RecursiveProof } from '../proofs/recursive_proof.js';
|
|
6
|
-
import {
|
|
5
|
+
import { VkData } from '../vks/index.js';
|
|
7
6
|
import { BlockRootOrBlockMergePublicInputs } from './block_root_or_block_merge_public_inputs.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -20,13 +19,9 @@ export class PreviousRollupBlockData {
|
|
|
20
19
|
*/
|
|
21
20
|
public proof: RecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
22
21
|
/**
|
|
23
|
-
* The verification key
|
|
22
|
+
* The verification key and the witness of the vk in the vk tree.
|
|
24
23
|
*/
|
|
25
|
-
public
|
|
26
|
-
/**
|
|
27
|
-
* Sibling path of the rollup circuit's vk in a big tree of rollup circuit vks.
|
|
28
|
-
*/
|
|
29
|
-
public vkWitness: MembershipWitness<typeof VK_TREE_HEIGHT>,
|
|
24
|
+
public vkData: VkData,
|
|
30
25
|
) {}
|
|
31
26
|
|
|
32
27
|
/**
|
|
@@ -34,7 +29,7 @@ export class PreviousRollupBlockData {
|
|
|
34
29
|
* @returns The buffer of the serialized previous rollup data.
|
|
35
30
|
*/
|
|
36
31
|
public toBuffer(): Buffer {
|
|
37
|
-
return serializeToBuffer(this.blockRootOrBlockMergePublicInputs, this.proof, this.
|
|
32
|
+
return serializeToBuffer(this.blockRootOrBlockMergePublicInputs, this.proof, this.vkData);
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
/**
|
|
@@ -47,8 +42,7 @@ export class PreviousRollupBlockData {
|
|
|
47
42
|
return new PreviousRollupBlockData(
|
|
48
43
|
reader.readObject(BlockRootOrBlockMergePublicInputs),
|
|
49
44
|
RecursiveProof.fromBuffer(reader, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
50
|
-
reader.readObject(
|
|
51
|
-
MembershipWitness.fromBuffer(reader, VK_TREE_HEIGHT),
|
|
45
|
+
reader.readObject(VkData),
|
|
52
46
|
);
|
|
53
47
|
}
|
|
54
48
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
1
|
+
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
-
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
4
3
|
|
|
5
4
|
import { RecursiveProof } from '../proofs/recursive_proof.js';
|
|
6
|
-
import {
|
|
5
|
+
import { VkData } from '../vks/index.js';
|
|
7
6
|
import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -20,13 +19,9 @@ export class PreviousRollupData {
|
|
|
20
19
|
*/
|
|
21
20
|
public proof: RecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
22
21
|
/**
|
|
23
|
-
* The verification key of the
|
|
22
|
+
* The verification key and the witness of the vk in the vk tree.
|
|
24
23
|
*/
|
|
25
|
-
public
|
|
26
|
-
/**
|
|
27
|
-
* Sibling path of the rollup circuit's vk in a big tree of rollup circuit vks.
|
|
28
|
-
*/
|
|
29
|
-
public vkWitness: MembershipWitness<typeof VK_TREE_HEIGHT>,
|
|
24
|
+
public vkData: VkData,
|
|
30
25
|
) {}
|
|
31
26
|
|
|
32
27
|
/**
|
|
@@ -34,7 +29,7 @@ export class PreviousRollupData {
|
|
|
34
29
|
* @returns The buffer of the serialized previous rollup data.
|
|
35
30
|
*/
|
|
36
31
|
public toBuffer(): Buffer {
|
|
37
|
-
return serializeToBuffer(this.baseOrMergeRollupPublicInputs, this.proof, this.
|
|
32
|
+
return serializeToBuffer(this.baseOrMergeRollupPublicInputs, this.proof, this.vkData);
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
/**
|
|
@@ -47,8 +42,7 @@ export class PreviousRollupData {
|
|
|
47
42
|
return new PreviousRollupData(
|
|
48
43
|
reader.readObject(BaseOrMergeRollupPublicInputs),
|
|
49
44
|
RecursiveProof.fromBuffer(reader, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
50
|
-
reader.readObject(
|
|
51
|
-
MembershipWitness.fromBuffer(reader, VK_TREE_HEIGHT),
|
|
45
|
+
reader.readObject(VkData),
|
|
52
46
|
);
|
|
53
47
|
}
|
|
54
48
|
}
|
|
@@ -3,20 +3,20 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
3
3
|
|
|
4
4
|
import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js';
|
|
5
5
|
import { RecursiveProof, makeEmptyRecursiveProof } from '../proofs/recursive_proof.js';
|
|
6
|
-
import {
|
|
6
|
+
import { VkData } from '../vks/index.js';
|
|
7
7
|
|
|
8
8
|
export class PrivateTubeData {
|
|
9
9
|
constructor(
|
|
10
10
|
public publicInputs: PrivateToRollupKernelCircuitPublicInputs,
|
|
11
11
|
public proof: RecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
12
|
-
public vkData:
|
|
12
|
+
public vkData: VkData,
|
|
13
13
|
) {}
|
|
14
14
|
|
|
15
15
|
static empty() {
|
|
16
16
|
return new PrivateTubeData(
|
|
17
17
|
PrivateToRollupKernelCircuitPublicInputs.empty(),
|
|
18
18
|
makeEmptyRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
19
|
-
|
|
19
|
+
VkData.empty(),
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ export class PrivateTubeData {
|
|
|
25
25
|
return new PrivateTubeData(
|
|
26
26
|
reader.readObject(PrivateToRollupKernelCircuitPublicInputs),
|
|
27
27
|
RecursiveProof.fromBuffer(reader, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
28
|
-
reader.readObject(
|
|
28
|
+
reader.readObject(VkData),
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -3,20 +3,20 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
3
3
|
|
|
4
4
|
import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
|
|
5
5
|
import { RecursiveProof, makeEmptyRecursiveProof } from '../proofs/recursive_proof.js';
|
|
6
|
-
import {
|
|
6
|
+
import { VkData } from '../vks/index.js';
|
|
7
7
|
|
|
8
8
|
export class PublicTubeData {
|
|
9
9
|
constructor(
|
|
10
10
|
public publicInputs: PrivateToPublicKernelCircuitPublicInputs,
|
|
11
11
|
public proof: RecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
12
|
-
public vkData:
|
|
12
|
+
public vkData: VkData,
|
|
13
13
|
) {}
|
|
14
14
|
|
|
15
15
|
static empty() {
|
|
16
16
|
return new PublicTubeData(
|
|
17
17
|
PrivateToPublicKernelCircuitPublicInputs.empty(),
|
|
18
18
|
makeEmptyRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
19
|
-
|
|
19
|
+
VkData.empty(),
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ export class PublicTubeData {
|
|
|
25
25
|
return new PublicTubeData(
|
|
26
26
|
reader.readObject(PrivateToPublicKernelCircuitPublicInputs),
|
|
27
27
|
RecursiveProof.fromBuffer(reader, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
28
|
-
reader.readObject(
|
|
28
|
+
reader.readObject(VkData),
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -7,7 +7,6 @@ import { BufferReader, type Tuple, serializeToBuffer, serializeToFields } from '
|
|
|
7
7
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
|
-
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
10
|
import { FeeRecipient } from './block_root_or_block_merge_public_inputs.js';
|
|
12
11
|
import { PreviousRollupBlockData } from './previous_rollup_block_data.js';
|
|
13
12
|
|
|
@@ -100,13 +99,10 @@ export class RootRollupInputs {
|
|
|
100
99
|
*/
|
|
101
100
|
export class RootRollupPublicInputs {
|
|
102
101
|
constructor(
|
|
103
|
-
/**
|
|
104
|
-
public
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
public endTimestamp: Fr,
|
|
108
|
-
public endBlockNumber: Fr,
|
|
109
|
-
public outHash: Fr,
|
|
102
|
+
/** Root of the archive tree before this rollup is processed */
|
|
103
|
+
public previousArchiveRoot: Fr,
|
|
104
|
+
/** Root of the archive tree after this rollup is processed */
|
|
105
|
+
public endArchiveRoot: Fr,
|
|
110
106
|
public proposedBlockHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
111
107
|
public fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
112
108
|
public chainId: Fr,
|
|
@@ -119,11 +115,8 @@ export class RootRollupPublicInputs {
|
|
|
119
115
|
|
|
120
116
|
static getFields(fields: FieldsOf<RootRollupPublicInputs>) {
|
|
121
117
|
return [
|
|
122
|
-
fields.
|
|
123
|
-
fields.
|
|
124
|
-
fields.endTimestamp,
|
|
125
|
-
fields.endBlockNumber,
|
|
126
|
-
fields.outHash,
|
|
118
|
+
fields.previousArchiveRoot,
|
|
119
|
+
fields.endArchiveRoot,
|
|
127
120
|
fields.proposedBlockHeaderHashes,
|
|
128
121
|
fields.fees,
|
|
129
122
|
fields.chainId,
|
|
@@ -155,9 +148,6 @@ export class RootRollupPublicInputs {
|
|
|
155
148
|
public static fromBuffer(buffer: Buffer | BufferReader): RootRollupPublicInputs {
|
|
156
149
|
const reader = BufferReader.asReader(buffer);
|
|
157
150
|
return new RootRollupPublicInputs(
|
|
158
|
-
reader.readObject(AppendOnlyTreeSnapshot),
|
|
159
|
-
reader.readObject(AppendOnlyTreeSnapshot),
|
|
160
|
-
Fr.fromBuffer(reader),
|
|
161
151
|
Fr.fromBuffer(reader),
|
|
162
152
|
Fr.fromBuffer(reader),
|
|
163
153
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
@@ -192,9 +182,6 @@ export class RootRollupPublicInputs {
|
|
|
192
182
|
/** Creates a random instance. */
|
|
193
183
|
static random() {
|
|
194
184
|
return new RootRollupPublicInputs(
|
|
195
|
-
AppendOnlyTreeSnapshot.random(),
|
|
196
|
-
AppendOnlyTreeSnapshot.random(),
|
|
197
|
-
Fr.random(),
|
|
198
185
|
Fr.random(),
|
|
199
186
|
Fr.random(),
|
|
200
187
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random),
|
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_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
5
5
|
AZTEC_MAX_EPOCH_DURATION,
|
|
6
6
|
BLOBS_PER_BLOCK,
|
|
7
7
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
@@ -55,6 +55,7 @@ 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,
|
|
58
59
|
AvmAppendLeavesHint,
|
|
59
60
|
AvmBytecodeCommitmentHint,
|
|
60
61
|
AvmCircuitInputs,
|
|
@@ -115,7 +116,11 @@ import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
|
115
116
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
116
117
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
117
118
|
import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js';
|
|
118
|
-
import {
|
|
119
|
+
import {
|
|
120
|
+
CountedPublicCallRequest,
|
|
121
|
+
PublicCallRequest,
|
|
122
|
+
PublicCallRequestArrayLengths,
|
|
123
|
+
} from '../kernel/public_call_request.js';
|
|
119
124
|
import { PublicKeys, computeAddress } from '../keys/index.js';
|
|
120
125
|
import { ContractClassLogFields } from '../logs/index.js';
|
|
121
126
|
import { PrivateLog } from '../logs/private_log.js';
|
|
@@ -168,8 +173,8 @@ import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
|
168
173
|
import { TxContext } from '../tx/tx_context.js';
|
|
169
174
|
import { TxRequest } from '../tx/tx_request.js';
|
|
170
175
|
import { RollupTypes, Vector } from '../types/index.js';
|
|
176
|
+
import { VkData } from '../vks/index.js';
|
|
171
177
|
import { VerificationKey, VerificationKeyAsFields, VerificationKeyData } from '../vks/verification_key.js';
|
|
172
|
-
import { VkWitnessData } from '../vks/vk_witness_data.js';
|
|
173
178
|
import { mockTx } from './mocks.js';
|
|
174
179
|
|
|
175
180
|
/**
|
|
@@ -368,6 +373,10 @@ function makeAvmAccumulatedData(seed = 1) {
|
|
|
368
373
|
);
|
|
369
374
|
}
|
|
370
375
|
|
|
376
|
+
function makeAvmAccumulatedDataArrayLengths(seed = 1) {
|
|
377
|
+
return new AvmAccumulatedDataArrayLengths(seed, seed + 1, seed + 2, seed + 3, seed + 4);
|
|
378
|
+
}
|
|
379
|
+
|
|
371
380
|
export function makeGas(seed = 1) {
|
|
372
381
|
return new Gas(seed, seed + 1);
|
|
373
382
|
}
|
|
@@ -453,6 +462,7 @@ function makeAvmCircuitPublicInputs(seed = 1) {
|
|
|
453
462
|
makeGas(seed + 0x20),
|
|
454
463
|
makeGasSettings(),
|
|
455
464
|
makeAztecAddress(seed + 0x40),
|
|
465
|
+
makePublicCallRequestArrayLengths(seed + 0x40),
|
|
456
466
|
makeTuple(MAX_ENQUEUED_CALLS_PER_TX, makePublicCallRequest, seed + 0x100),
|
|
457
467
|
makeTuple(MAX_ENQUEUED_CALLS_PER_TX, makePublicCallRequest, seed + 0x200),
|
|
458
468
|
makePublicCallRequest(seed + 0x300),
|
|
@@ -462,6 +472,7 @@ function makeAvmCircuitPublicInputs(seed = 1) {
|
|
|
462
472
|
makePrivateToAvmAccumulatedData(seed + 0x600),
|
|
463
473
|
makeTreeSnapshots(seed + 0x700),
|
|
464
474
|
makeGas(seed + 0x750),
|
|
475
|
+
makeAvmAccumulatedDataArrayLengths(seed + 0x800),
|
|
465
476
|
makeAvmAccumulatedData(seed + 0x800),
|
|
466
477
|
fr(seed + 0x900),
|
|
467
478
|
false,
|
|
@@ -533,6 +544,10 @@ export function makePublicCallRequest(seed = 1) {
|
|
|
533
544
|
return new PublicCallRequest(makeAztecAddress(seed), makeAztecAddress(seed + 1), false, fr(seed + 0x3));
|
|
534
545
|
}
|
|
535
546
|
|
|
547
|
+
export function makePublicCallRequestArrayLengths(seed = 1) {
|
|
548
|
+
return new PublicCallRequestArrayLengths(seed, seed + 1, seed % 2 === 0);
|
|
549
|
+
}
|
|
550
|
+
|
|
536
551
|
function makeCountedPublicCallRequest(seed = 1) {
|
|
537
552
|
return new CountedPublicCallRequest(makePublicCallRequest(seed), seed + 0x100);
|
|
538
553
|
}
|
|
@@ -742,8 +757,7 @@ export function makePreviousRollupData(
|
|
|
742
757
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
743
758
|
seed + 0x50,
|
|
744
759
|
),
|
|
745
|
-
|
|
746
|
-
makeMembershipWitness(VK_TREE_HEIGHT, seed + 0x120),
|
|
760
|
+
makeVkData(seed + 0x100),
|
|
747
761
|
);
|
|
748
762
|
}
|
|
749
763
|
|
|
@@ -763,8 +777,7 @@ export function makePreviousRollupBlockData(
|
|
|
763
777
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
764
778
|
seed + 0x50,
|
|
765
779
|
),
|
|
766
|
-
|
|
767
|
-
makeMembershipWitness(VK_TREE_HEIGHT, seed + 0x120),
|
|
780
|
+
makeVkData(seed + 0x100),
|
|
768
781
|
);
|
|
769
782
|
}
|
|
770
783
|
|
|
@@ -881,13 +894,10 @@ export function makeRootParityInputs(seed = 0): RootParityInputs {
|
|
|
881
894
|
*/
|
|
882
895
|
export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
883
896
|
return new RootRollupPublicInputs(
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
fr(seed
|
|
887
|
-
|
|
888
|
-
fr(seed + 0x500),
|
|
889
|
-
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x650),
|
|
890
|
-
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x600),
|
|
897
|
+
fr(seed + 0x100),
|
|
898
|
+
fr(seed + 0x200),
|
|
899
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
900
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
891
901
|
fr(seed + 0x700),
|
|
892
902
|
fr(seed + 0x701),
|
|
893
903
|
fr(seed + 0x702),
|
|
@@ -1070,15 +1080,15 @@ export function makePrivateBaseStateDiffHints(seed = 1): PrivateBaseStateDiffHin
|
|
|
1070
1080
|
);
|
|
1071
1081
|
}
|
|
1072
1082
|
|
|
1073
|
-
function
|
|
1074
|
-
return new
|
|
1083
|
+
function makeVkData(seed = 1) {
|
|
1084
|
+
return new VkData(VerificationKeyData.makeFakeHonk(), seed, makeTuple(VK_TREE_HEIGHT, fr, seed + 0x100));
|
|
1075
1085
|
}
|
|
1076
1086
|
|
|
1077
1087
|
function makePrivateTubeData(seed = 1, kernelPublicInputs?: PrivateToRollupKernelCircuitPublicInputs) {
|
|
1078
1088
|
return new PrivateTubeData(
|
|
1079
1089
|
kernelPublicInputs ?? makePrivateToRollupKernelCircuitPublicInputs(seed, true),
|
|
1080
1090
|
makeRecursiveProof<typeof TUBE_PROOF_LENGTH>(TUBE_PROOF_LENGTH, seed + 0x100),
|
|
1081
|
-
|
|
1091
|
+
makeVkData(seed + 0x200),
|
|
1082
1092
|
);
|
|
1083
1093
|
}
|
|
1084
1094
|
|
|
@@ -1095,11 +1105,7 @@ function makePrivateBaseRollupHints(seed = 1) {
|
|
|
1095
1105
|
|
|
1096
1106
|
const archiveRootMembershipWitness = makeMembershipWitness(ARCHIVE_HEIGHT, seed + 0x9000);
|
|
1097
1107
|
|
|
1098
|
-
const
|
|
1099
|
-
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
1100
|
-
makeContractClassLogFields,
|
|
1101
|
-
seed + 0x800,
|
|
1102
|
-
);
|
|
1108
|
+
const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x800);
|
|
1103
1109
|
|
|
1104
1110
|
const constants = makeConstantRollupData(0x100);
|
|
1105
1111
|
|
|
@@ -1111,7 +1117,7 @@ function makePrivateBaseRollupHints(seed = 1) {
|
|
|
1111
1117
|
stateDiffHints,
|
|
1112
1118
|
feePayerFeeJuiceBalanceReadHint,
|
|
1113
1119
|
archiveRootMembershipWitness,
|
|
1114
|
-
|
|
1120
|
+
contractClassLogsFields,
|
|
1115
1121
|
constants,
|
|
1116
1122
|
});
|
|
1117
1123
|
}
|
|
@@ -1121,18 +1127,14 @@ function makePublicBaseRollupHints(seed = 1) {
|
|
|
1121
1127
|
|
|
1122
1128
|
const archiveRootMembershipWitness = makeMembershipWitness(ARCHIVE_HEIGHT, seed + 0x9000);
|
|
1123
1129
|
|
|
1124
|
-
const
|
|
1125
|
-
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
1126
|
-
makeContractClassLogFields,
|
|
1127
|
-
seed + 0x800,
|
|
1128
|
-
);
|
|
1130
|
+
const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x800);
|
|
1129
1131
|
|
|
1130
1132
|
const constants = makeConstantRollupData(0x100);
|
|
1131
1133
|
|
|
1132
1134
|
return PublicBaseRollupHints.from({
|
|
1133
1135
|
startSpongeBlob,
|
|
1134
1136
|
archiveRootMembershipWitness,
|
|
1135
|
-
|
|
1137
|
+
contractClassLogsFields,
|
|
1136
1138
|
constants,
|
|
1137
1139
|
});
|
|
1138
1140
|
}
|
|
@@ -1151,15 +1153,15 @@ function makePublicTubeData(seed = 1) {
|
|
|
1151
1153
|
return new PublicTubeData(
|
|
1152
1154
|
makePrivateToPublicKernelCircuitPublicInputs(seed),
|
|
1153
1155
|
makeRecursiveProof<typeof TUBE_PROOF_LENGTH>(TUBE_PROOF_LENGTH, seed + 0x100),
|
|
1154
|
-
|
|
1156
|
+
makeVkData(seed + 0x200),
|
|
1155
1157
|
);
|
|
1156
1158
|
}
|
|
1157
1159
|
|
|
1158
1160
|
function makeAvmProofData(seed = 1) {
|
|
1159
1161
|
return new AvmProofData(
|
|
1160
1162
|
makeAvmCircuitPublicInputs(seed),
|
|
1161
|
-
makeRecursiveProof<typeof
|
|
1162
|
-
|
|
1163
|
+
makeRecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>(AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, seed + 0x100),
|
|
1164
|
+
makeVkData(seed + 0x200),
|
|
1163
1165
|
);
|
|
1164
1166
|
}
|
|
1165
1167
|
|
|
@@ -1486,6 +1488,7 @@ export function makeAvmTxHint(seed = 0): AvmTxHint {
|
|
|
1486
1488
|
return new AvmTxHint(
|
|
1487
1489
|
`txhash-${seed}`,
|
|
1488
1490
|
makeGlobalVariables(seed),
|
|
1491
|
+
makeGasSettings(),
|
|
1489
1492
|
{
|
|
1490
1493
|
noteHashes: makeArray((seed % 20) + 4, i => new Fr(i), seed + 0x1000),
|
|
1491
1494
|
nullifiers: makeArray((seed % 20) + 4, i => new Fr(i), seed + 0x2000),
|
|
@@ -1497,6 +1500,7 @@ export function makeAvmTxHint(seed = 0): AvmTxHint {
|
|
|
1497
1500
|
makeArray((seed % 20) + 4, i => makeAvmEnqueuedCallHint(i), seed + 0x5000), // setupEnqueuedCalls
|
|
1498
1501
|
makeArray((seed % 20) + 4, i => makeAvmEnqueuedCallHint(i), seed + 0x6000), // appLogicEnqueuedCalls
|
|
1499
1502
|
makeAvmEnqueuedCallHint(seed + 0x7000), // teardownEnqueuedCall
|
|
1503
|
+
makeGas(seed + 0x8000), // gasUsedByPrivate
|
|
1500
1504
|
);
|
|
1501
1505
|
}
|
|
1502
1506
|
|
package/src/tests/mocks.ts
CHANGED
|
@@ -6,6 +6,7 @@ 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';
|
|
9
10
|
import { L2Block } from '../block/l2_block.js';
|
|
10
11
|
import type { PublishedL2Block } from '../block/published_l2_block.js';
|
|
11
12
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
@@ -299,7 +300,7 @@ export async function randomPublishedL2Block(
|
|
|
299
300
|
};
|
|
300
301
|
|
|
301
302
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
302
|
-
const
|
|
303
|
+
const atts = await Promise.all(
|
|
303
304
|
signers.map(signer =>
|
|
304
305
|
makeBlockAttestation({
|
|
305
306
|
signer,
|
|
@@ -310,6 +311,8 @@ export async function randomPublishedL2Block(
|
|
|
310
311
|
}),
|
|
311
312
|
),
|
|
312
313
|
);
|
|
313
|
-
const
|
|
314
|
-
|
|
314
|
+
const attestations = atts.map(
|
|
315
|
+
(attestation, i) => new CommitteeAttestation(signers[i].address, attestation.signature),
|
|
316
|
+
);
|
|
317
|
+
return { block, l1, attestations };
|
|
315
318
|
}
|
package/src/tx/processed_tx.ts
CHANGED
|
@@ -99,7 +99,7 @@ export async function makeProcessedTxFromPrivateOnlyTx(
|
|
|
99
99
|
[feePaymentPublicDataWrite],
|
|
100
100
|
data.end.privateLogs.filter(l => !l.isEmpty()),
|
|
101
101
|
[],
|
|
102
|
-
|
|
102
|
+
tx.getContractClassLogs(),
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
const gasUsed = {
|
|
@@ -147,10 +147,9 @@ export async function makeProcessedTxFromTxWithPublicCalls(
|
|
|
147
147
|
...(revertCode.isOK() ? tx.data.forPublic!.revertibleAccumulatedData.privateLogs : []),
|
|
148
148
|
].filter(l => !l.isEmpty());
|
|
149
149
|
|
|
150
|
-
const contractClassLogs =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
].filter(l => !l.isEmpty());
|
|
150
|
+
const contractClassLogs = revertCode.isOK()
|
|
151
|
+
? tx.getContractClassLogs()
|
|
152
|
+
: tx.getSplitContractClassLogs(false /* revertible */);
|
|
154
153
|
|
|
155
154
|
const txEffect = new TxEffect(
|
|
156
155
|
revertCode,
|