@aztec/stdlib 4.0.0-nightly.20260112 → 4.0.0-nightly.20260114
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/utils.d.ts +7 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +7 -0
- package/dest/avm/avm.d.ts +300 -300
- package/dest/block/attestation_info.d.ts +5 -5
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -4
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -1
- package/dest/block/checkpointed_l2_block.d.ts +1 -1
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
- package/dest/block/checkpointed_l2_block.js +5 -4
- package/dest/block/l2_block.d.ts +6 -3
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +3 -3
- package/dest/block/l2_block_code_to_purge.d.ts +1 -1
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +1 -1
- package/dest/block/l2_block_header.d.ts +6 -2
- package/dest/block/l2_block_header.d.ts.map +1 -1
- package/dest/block/l2_block_header.js +14 -7
- package/dest/block/l2_block_new.d.ts +1 -2
- package/dest/block/l2_block_new.d.ts.map +1 -1
- package/dest/block/l2_block_new.js +4 -1
- package/dest/block/l2_block_source.d.ts +247 -42
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +23 -5
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +16 -5
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +4 -2
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +102 -30
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +483 -38
- package/dest/block/validate_block_result.d.ts +24 -24
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -17
- package/dest/checkpoint/checkpoint.d.ts +2 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +11 -1
- package/dest/checkpoint/checkpoint_info.d.ts +32 -3
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_info.js +34 -1
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/published_checkpoint.d.ts +1 -1
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +4 -3
- package/dest/contract/index.d.ts +1 -3
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -2
- package/dest/deserialization/index.d.ts +11 -0
- package/dest/deserialization/index.d.ts.map +1 -0
- package/dest/deserialization/index.js +10 -0
- package/dest/interfaces/api_limit.d.ts +2 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +1 -0
- package/dest/interfaces/archiver.d.ts +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +6 -4
- package/dest/interfaces/aztec-node-admin.d.ts +12 -9
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -2
- package/dest/interfaces/aztec-node.d.ts +2 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +8 -3
- package/dest/interfaces/block-builder.d.ts +2 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +6 -1
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/p2p.d.ts +7 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +3 -4
- package/dest/interfaces/validator.d.ts +41 -15
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +3 -2
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -5
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +5 -6
- package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +5 -3
- package/dest/messaging/out_hash.d.ts +41 -4
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +52 -26
- package/dest/note/note_dao.d.ts +8 -5
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +15 -12
- package/dest/p2p/attestation_utils.d.ts +3 -3
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +1 -1
- package/dest/p2p/block_proposal.d.ts +85 -21
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +126 -38
- package/dest/p2p/checkpoint_attestation.d.ts +78 -0
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -0
- package/dest/p2p/{block_attestation.js → checkpoint_attestation.js} +22 -19
- package/dest/p2p/checkpoint_proposal.d.ts +155 -0
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
- package/dest/p2p/checkpoint_proposal.js +222 -0
- package/dest/p2p/consensus_payload.d.ts +5 -2
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -2
- package/dest/p2p/index.d.ts +4 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +3 -1
- package/dest/p2p/signature_utils.d.ts +5 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +3 -1
- package/dest/p2p/signed_txs.d.ts +40 -0
- package/dest/p2p/signed_txs.d.ts.map +1 -0
- package/dest/p2p/signed_txs.js +75 -0
- package/dest/p2p/topic_type.d.ts +3 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +8 -2
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +2 -2
- package/dest/rollup/block_rollup_public_inputs.js +2 -2
- package/dest/rollup/checkpoint_header.d.ts +16 -2
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +25 -5
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +11 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +10 -6
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +14 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +13 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts +5 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +4 -1
- package/dest/tests/factories.d.ts +13 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +53 -3
- package/dest/tests/mocks.d.ts +55 -9
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +84 -35
- package/dest/tx/private_execution_result.d.ts +1 -5
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -20
- package/dest/tx/tx_effect.d.ts +1 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +0 -7
- package/package.json +9 -8
- package/src/abi/utils.ts +17 -0
- package/src/block/attestation_info.ts +9 -6
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +5 -4
- package/src/block/l2_block.ts +4 -3
- package/src/block/l2_block_code_to_purge.ts +1 -0
- package/src/block/l2_block_header.ts +13 -0
- package/src/block/l2_block_new.ts +5 -1
- package/src/block/l2_block_source.ts +69 -17
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +16 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +121 -38
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
- package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
- package/src/block/test/l2_tips_store_test_suite.ts +485 -36
- package/src/block/validate_block_result.ts +40 -35
- package/src/checkpoint/checkpoint.ts +12 -1
- package/src/checkpoint/checkpoint_info.ts +45 -2
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +4 -3
- package/src/contract/index.ts +0 -2
- package/src/deserialization/index.ts +21 -0
- package/src/interfaces/api_limit.ts +1 -0
- package/src/interfaces/archiver.ts +14 -6
- package/src/interfaces/aztec-node-admin.ts +5 -2
- package/src/interfaces/aztec-node.ts +30 -3
- package/src/interfaces/block-builder.ts +1 -0
- package/src/interfaces/configs.ts +5 -0
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/validator.ts +57 -11
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +5 -8
- package/src/messaging/l2_to_l1_membership.ts +5 -3
- package/src/messaging/out_hash.ts +60 -29
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +3 -3
- package/src/p2p/block_proposal.ts +191 -42
- package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +31 -25
- package/src/p2p/checkpoint_proposal.ts +342 -0
- package/src/p2p/consensus_payload.ts +5 -2
- package/src/p2p/index.ts +3 -1
- package/src/p2p/signature_utils.ts +3 -1
- package/src/p2p/signed_txs.ts +88 -0
- package/src/p2p/topic_type.ts +3 -2
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +2 -2
- package/src/rollup/checkpoint_header.ts +33 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +12 -6
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +4 -1
- package/src/tests/factories.ts +46 -2
- package/src/tests/mocks.ts +146 -50
- package/src/tx/private_execution_result.ts +0 -15
- package/src/tx/tx_effect.ts +0 -9
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/dest/p2p/block_attestation.d.ts +0 -77
- package/dest/p2p/block_attestation.d.ts.map +0 -1
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
|
@@ -28,13 +28,17 @@ export class CheckpointRollupPublicInputs {
|
|
|
28
28
|
*/
|
|
29
29
|
public newArchive: AppendOnlyTreeSnapshot,
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
31
|
+
* The out hash tree snapshot immediately before this checkpoint range.
|
|
32
32
|
*/
|
|
33
|
-
public
|
|
33
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
35
|
+
* The out hash tree snapshot after applying this checkpoint range.
|
|
36
36
|
*/
|
|
37
|
-
public
|
|
37
|
+
public newOutHash: AppendOnlyTreeSnapshot,
|
|
38
|
+
/**
|
|
39
|
+
* The hashes of the headers of the constituent checkpoints.
|
|
40
|
+
*/
|
|
41
|
+
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
38
42
|
/**
|
|
39
43
|
* The summed transaction fees and recipients of the constituent checkpoints.
|
|
40
44
|
*/
|
|
@@ -59,7 +63,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
59
63
|
reader.readObject(EpochConstantData),
|
|
60
64
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
61
65
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
62
|
-
reader.
|
|
66
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
63
68
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
64
69
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
|
|
65
70
|
reader.readObject(BlobAccumulator),
|
|
@@ -73,8 +78,9 @@ export class CheckpointRollupPublicInputs {
|
|
|
73
78
|
this.constants,
|
|
74
79
|
this.previousArchive,
|
|
75
80
|
this.newArchive,
|
|
81
|
+
this.previousOutHash,
|
|
82
|
+
this.newOutHash,
|
|
76
83
|
this.checkpointHeaderHashes,
|
|
77
|
-
this.outHashes,
|
|
78
84
|
this.fees,
|
|
79
85
|
this.startBlobAccumulator,
|
|
80
86
|
this.endBlobAccumulator,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
-
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
|
+
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, OUT_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -8,6 +8,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
10
|
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
11
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
12
|
import { BlockHeader } from '../tx/block_header.js';
|
|
12
13
|
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
13
14
|
|
|
@@ -21,6 +22,14 @@ export class CheckpointRootRollupHints {
|
|
|
21
22
|
* Hint for checking the hash of previous_block_header is the last leaf of the previous archive.
|
|
22
23
|
*/
|
|
23
24
|
public previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
25
|
+
/**
|
|
26
|
+
* The out hash tree snapshot immediately before this checkpoint.
|
|
27
|
+
*/
|
|
28
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
29
|
+
/**
|
|
30
|
+
* Hint for inserting the new out hash into the out hash tree.
|
|
31
|
+
*/
|
|
32
|
+
public newOutHashSiblingPath: Tuple<Fr, typeof OUT_HASH_TREE_HEIGHT>,
|
|
24
33
|
/**
|
|
25
34
|
* The current blob accumulation state across the epoch.
|
|
26
35
|
*/
|
|
@@ -54,6 +63,8 @@ export class CheckpointRootRollupHints {
|
|
|
54
63
|
return [
|
|
55
64
|
fields.previousBlockHeader,
|
|
56
65
|
fields.previousArchiveSiblingPath,
|
|
66
|
+
fields.previousOutHash,
|
|
67
|
+
fields.newOutHashSiblingPath,
|
|
57
68
|
fields.startBlobAccumulator,
|
|
58
69
|
fields.finalBlobChallenges,
|
|
59
70
|
fields.blobFields,
|
|
@@ -71,6 +82,8 @@ export class CheckpointRootRollupHints {
|
|
|
71
82
|
return new CheckpointRootRollupHints(
|
|
72
83
|
BlockHeader.fromBuffer(reader),
|
|
73
84
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
85
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
86
|
+
reader.readArray(OUT_HASH_TREE_HEIGHT, Fr),
|
|
74
87
|
reader.readObject(BlobAccumulator),
|
|
75
88
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
76
89
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
@@ -21,7 +21,10 @@ export class RootRollupPublicInputs {
|
|
|
21
21
|
public previousArchiveRoot: Fr,
|
|
22
22
|
/** Root of the archive tree after this rollup is processed */
|
|
23
23
|
public endArchiveRoot: Fr,
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Root of the balanced merkle tree consisting of the out hashes of all checkpoints in this epoch.
|
|
26
|
+
* The out hash of the first checkpoint in the epoch is inserted at index 0, the second at index 1, and so on.
|
|
27
|
+
*/
|
|
25
28
|
public outHash: Fr,
|
|
26
29
|
/** Hashes of checkpoint headers for this rollup. */
|
|
27
30
|
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
package/src/tests/factories.ts
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
VK_TREE_HEIGHT,
|
|
44
44
|
} from '@aztec/constants';
|
|
45
45
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
46
|
-
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
46
|
+
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
47
47
|
import { compact } from '@aztec/foundation/collection';
|
|
48
48
|
import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
|
|
49
49
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
@@ -88,6 +88,7 @@ import { PublicDataRead } from '../avm/public_data_read.js';
|
|
|
88
88
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
89
89
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
90
90
|
import { L2BlockHeader } from '../block/l2_block_header.js';
|
|
91
|
+
import type { L2Tips } from '../block/l2_block_source.js';
|
|
91
92
|
import {
|
|
92
93
|
type ContractClassPublic,
|
|
93
94
|
ContractDeploymentData,
|
|
@@ -849,7 +850,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
849
850
|
makeEpochConstantData(seed),
|
|
850
851
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
851
852
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
852
|
-
|
|
853
|
+
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
854
|
+
makeAppendOnlyTreeSnapshot(seed + 0x350),
|
|
853
855
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x400),
|
|
854
856
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
855
857
|
makeBlobAccumulator(seed + 0x600),
|
|
@@ -919,6 +921,7 @@ export function makeL2BlockHeader(
|
|
|
919
921
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
920
922
|
overrides?.blobsHash ?? fr(seed + 0x200),
|
|
921
923
|
overrides?.inHash ?? fr(seed + 0x300),
|
|
924
|
+
overrides?.epochOutHash ?? fr(seed + 0x400),
|
|
922
925
|
overrides?.state ?? makeStateReference(seed + 0x600),
|
|
923
926
|
makeGlobalVariables((seed += 0x700), {
|
|
924
927
|
...(blockNumber !== undefined ? { blockNumber: BlockNumber(blockNumber) } : {}),
|
|
@@ -937,6 +940,7 @@ export function makeCheckpointHeader(seed = 0) {
|
|
|
937
940
|
blockHeadersHash: fr(seed + 0x150),
|
|
938
941
|
blobsHash: fr(seed + 0x200),
|
|
939
942
|
inHash: fr(seed + 0x210),
|
|
943
|
+
epochOutHash: fr(seed + 0x220),
|
|
940
944
|
slotNumber: SlotNumber(seed + 0x300),
|
|
941
945
|
timestamp: BigInt(seed + 0x400),
|
|
942
946
|
coinbase: makeEthAddress(seed + 0x500),
|
|
@@ -1736,3 +1740,43 @@ export async function randomTxScopedPublicL2Log(opts?: {
|
|
|
1736
1740
|
opts?.firstNullifier ?? Fr.random(),
|
|
1737
1741
|
);
|
|
1738
1742
|
}
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* Creates L2Tips with all tips pointing to the same block number.
|
|
1746
|
+
* Useful for mocking aztecNode.getL2Tips() in tests.
|
|
1747
|
+
* @param blockNumber - The block number to use for all tips.
|
|
1748
|
+
* @param hash - Optional hash for the block (defaults to empty string).
|
|
1749
|
+
* @param checkpointNumber - Optional checkpoint number (defaults to blockNumber).
|
|
1750
|
+
* @param checkpointHash - Optional checkpoint hash (defaults to block hash).
|
|
1751
|
+
* @returns L2Tips object with all tips at the same block.
|
|
1752
|
+
*/
|
|
1753
|
+
export function makeL2Tips(
|
|
1754
|
+
blockNumber: number | BlockNumber,
|
|
1755
|
+
hash = '',
|
|
1756
|
+
checkpointNumber?: number | CheckpointNumber,
|
|
1757
|
+
checkpointHash?: string,
|
|
1758
|
+
): L2Tips {
|
|
1759
|
+
const bn = typeof blockNumber === 'number' ? BlockNumber(blockNumber) : blockNumber;
|
|
1760
|
+
const cpn =
|
|
1761
|
+
checkpointNumber !== undefined
|
|
1762
|
+
? typeof checkpointNumber === 'number'
|
|
1763
|
+
? CheckpointNumber(checkpointNumber)
|
|
1764
|
+
: checkpointNumber
|
|
1765
|
+
: CheckpointNumber(bn);
|
|
1766
|
+
const cph = checkpointHash ?? hash;
|
|
1767
|
+
return {
|
|
1768
|
+
proposed: { number: bn, hash },
|
|
1769
|
+
checkpointed: {
|
|
1770
|
+
block: { number: bn, hash },
|
|
1771
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1772
|
+
},
|
|
1773
|
+
proven: {
|
|
1774
|
+
block: { number: bn, hash },
|
|
1775
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1776
|
+
},
|
|
1777
|
+
finalized: {
|
|
1778
|
+
block: { number: bn, hash },
|
|
1779
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1780
|
+
},
|
|
1781
|
+
};
|
|
1782
|
+
}
|
package/src/tests/mocks.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { padArrayEnd, times } from '@aztec/foundation/collection';
|
|
|
13
13
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
14
14
|
import { Secp256k1Signer } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
15
15
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
16
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
16
17
|
|
|
17
18
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
18
19
|
import { PublicTxEffect } from '../avm/avm.js';
|
|
@@ -46,12 +47,14 @@ import { PrivateToAvmAccumulatedData } from '../kernel/private_to_avm_accumulate
|
|
|
46
47
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
47
48
|
import { PublicCallRequestArrayLengths } from '../kernel/public_call_request.js';
|
|
48
49
|
import { computeInHashFromL1ToL2Messages } from '../messaging/in_hash.js';
|
|
49
|
-
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
50
50
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
51
|
+
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
52
|
+
import { CheckpointProposal } from '../p2p/checkpoint_proposal.js';
|
|
51
53
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
52
54
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
53
55
|
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
54
56
|
import { ProvingRequestType } from '../proofs/proving_request_type.js';
|
|
57
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
55
58
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
56
59
|
import {
|
|
57
60
|
BlockHeader,
|
|
@@ -359,7 +362,6 @@ const emptyPrivateCallExecutionResult = () =>
|
|
|
359
362
|
Buffer.from(''),
|
|
360
363
|
new Map(),
|
|
361
364
|
PrivateCircuitPublicInputs.empty(),
|
|
362
|
-
new Map(),
|
|
363
365
|
[],
|
|
364
366
|
new Map(),
|
|
365
367
|
[],
|
|
@@ -493,6 +495,30 @@ export interface MakeConsensusPayloadOptions {
|
|
|
493
495
|
txs?: Tx[];
|
|
494
496
|
}
|
|
495
497
|
|
|
498
|
+
export interface MakeBlockProposalOptions {
|
|
499
|
+
signer?: Secp256k1Signer;
|
|
500
|
+
blockHeader?: L2BlockHeader;
|
|
501
|
+
indexWithinCheckpoint?: number;
|
|
502
|
+
inHash?: Fr;
|
|
503
|
+
archiveRoot?: Fr;
|
|
504
|
+
txHashes?: TxHash[];
|
|
505
|
+
txs?: Tx[];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface MakeCheckpointProposalOptions {
|
|
509
|
+
signer?: Secp256k1Signer;
|
|
510
|
+
checkpointHeader?: CheckpointHeader;
|
|
511
|
+
archiveRoot?: Fr;
|
|
512
|
+
/** Options for the lastBlock - if undefined, no lastBlock is included */
|
|
513
|
+
lastBlock?: {
|
|
514
|
+
blockHeader?: L2BlockHeader;
|
|
515
|
+
indexWithinCheckpoint?: number;
|
|
516
|
+
txHashes?: TxHash[];
|
|
517
|
+
txs?: Tx[];
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
496
522
|
const makeAndSignConsensusPayload = (
|
|
497
523
|
domainSeparator: SignatureDomainSeparator,
|
|
498
524
|
options?: MakeConsensusPayloadOptions,
|
|
@@ -522,73 +548,137 @@ export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
|
522
548
|
return signer.sign(hash);
|
|
523
549
|
};
|
|
524
550
|
|
|
525
|
-
export const makeBlockProposal = (options?:
|
|
526
|
-
const
|
|
551
|
+
export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<BlockProposal> => {
|
|
552
|
+
const l2BlockHeader = options?.blockHeader ?? makeL2BlockHeader(1);
|
|
553
|
+
const blockHeader = l2BlockHeader.toBlockHeader();
|
|
554
|
+
const indexWithinCheckpoint = options?.indexWithinCheckpoint ?? 0;
|
|
555
|
+
const inHash = options?.inHash ?? Fr.random();
|
|
556
|
+
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
527
557
|
const txHashes = options?.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random());
|
|
528
|
-
|
|
558
|
+
const txs = options?.txs;
|
|
559
|
+
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
560
|
+
|
|
561
|
+
return BlockProposal.createProposalFromSigner(
|
|
562
|
+
blockHeader,
|
|
563
|
+
indexWithinCheckpoint,
|
|
564
|
+
inHash,
|
|
565
|
+
archiveRoot,
|
|
566
|
+
txHashes,
|
|
567
|
+
txs,
|
|
568
|
+
payload => Promise.resolve(signer.signMessage(payload)),
|
|
569
|
+
);
|
|
529
570
|
};
|
|
530
571
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
const
|
|
572
|
+
export const makeCheckpointProposal = (options?: MakeCheckpointProposalOptions): Promise<CheckpointProposal> => {
|
|
573
|
+
const l2BlockHeader = options?.lastBlock?.blockHeader ?? makeL2BlockHeader(1);
|
|
574
|
+
const checkpointHeader = options?.checkpointHeader ?? l2BlockHeader.toCheckpointHeader();
|
|
575
|
+
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
576
|
+
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
577
|
+
|
|
578
|
+
// Build lastBlock info if provided
|
|
579
|
+
const lastBlockInfo = options?.lastBlock
|
|
580
|
+
? {
|
|
581
|
+
blockHeader: l2BlockHeader.toBlockHeader(),
|
|
582
|
+
indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? 4, // Last block in a 5-block checkpoint
|
|
583
|
+
txHashes: options.lastBlock.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random()),
|
|
584
|
+
txs: options.lastBlock.txs,
|
|
585
|
+
}
|
|
586
|
+
: undefined;
|
|
587
|
+
|
|
588
|
+
return CheckpointProposal.createProposalFromSigner(checkpointHeader, archiveRoot, lastBlockInfo, payload =>
|
|
589
|
+
Promise.resolve(signer.signMessage(payload)),
|
|
590
|
+
);
|
|
591
|
+
};
|
|
535
592
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
593
|
+
/**
|
|
594
|
+
* Options for creating a checkpoint attestation
|
|
595
|
+
*/
|
|
596
|
+
export type MakeCheckpointAttestationOptions = {
|
|
597
|
+
header?: CheckpointHeader;
|
|
598
|
+
archive?: Fr;
|
|
599
|
+
attesterSigner?: Secp256k1Signer;
|
|
600
|
+
proposerSigner?: Secp256k1Signer;
|
|
601
|
+
signer?: Secp256k1Signer;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Create a checkpoint attestation for testing
|
|
606
|
+
*/
|
|
607
|
+
export const makeCheckpointAttestation = (options: MakeCheckpointAttestationOptions = {}): CheckpointAttestation => {
|
|
608
|
+
const header = options.header ?? makeL2BlockHeader(1).toCheckpointHeader();
|
|
609
|
+
const archive = options.archive ?? Fr.random();
|
|
610
|
+
const { signer, attesterSigner = signer, proposerSigner = signer } = options;
|
|
611
|
+
|
|
612
|
+
const payload = new ConsensusPayload(header, archive);
|
|
613
|
+
|
|
614
|
+
// Sign as attester
|
|
615
|
+
const attestationHash = getHashedSignaturePayloadEthSignedMessage(
|
|
616
|
+
payload,
|
|
617
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
618
|
+
);
|
|
619
|
+
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
620
|
+
const attestationSignature = attestationSigner.sign(attestationHash);
|
|
621
|
+
|
|
622
|
+
// Sign as proposer - use CheckpointProposal's payload format (serializeToBuffer)
|
|
623
|
+
// This is different from ConsensusPayload's format (ABI encoding)
|
|
624
|
+
const proposalSignerToUse = proposerSigner ?? Secp256k1Signer.random();
|
|
625
|
+
const tempProposal = new CheckpointProposal(header, archive, Signature.empty());
|
|
626
|
+
const proposalHash = getHashedSignaturePayloadEthSignedMessage(
|
|
627
|
+
tempProposal,
|
|
628
|
+
SignatureDomainSeparator.checkpointProposal,
|
|
629
|
+
);
|
|
630
|
+
const proposerSignature = proposalSignerToUse.sign(proposalHash);
|
|
540
631
|
|
|
541
|
-
return
|
|
632
|
+
return new CheckpointAttestation(payload, attestationSignature, proposerSignature);
|
|
542
633
|
};
|
|
543
634
|
|
|
544
|
-
|
|
545
|
-
|
|
635
|
+
/**
|
|
636
|
+
* Create a checkpoint attestation from a checkpoint proposal
|
|
637
|
+
*/
|
|
638
|
+
export const makeCheckpointAttestationFromProposal = (
|
|
639
|
+
proposal: CheckpointProposal,
|
|
546
640
|
attesterSigner?: Secp256k1Signer,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
const header = checkpoint.header;
|
|
550
|
-
const archive = checkpoint.archive.root;
|
|
641
|
+
): CheckpointAttestation => {
|
|
642
|
+
const payload = new ConsensusPayload(proposal.checkpointHeader, proposal.archive);
|
|
551
643
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
644
|
+
// Sign as attester
|
|
645
|
+
const attestationHash = getHashedSignaturePayloadEthSignedMessage(
|
|
646
|
+
payload,
|
|
647
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
648
|
+
);
|
|
649
|
+
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
650
|
+
const attestationSignature = attestationSigner.sign(attestationHash);
|
|
556
651
|
|
|
557
|
-
|
|
652
|
+
// Use the proposal's signature as the proposer signature
|
|
653
|
+
return new CheckpointAttestation(payload, attestationSignature, proposal.signature);
|
|
558
654
|
};
|
|
559
655
|
|
|
560
|
-
|
|
561
|
-
|
|
656
|
+
/**
|
|
657
|
+
* Create a checkpoint attestation from a checkpoint
|
|
658
|
+
*/
|
|
659
|
+
export const makeCheckpointAttestationFromCheckpoint = (
|
|
660
|
+
checkpoint: Checkpoint,
|
|
562
661
|
attesterSigner?: Secp256k1Signer,
|
|
563
662
|
proposerSigner?: Secp256k1Signer,
|
|
564
|
-
):
|
|
565
|
-
const header =
|
|
566
|
-
const archive =
|
|
567
|
-
|
|
568
|
-
const payload = ConsensusPayload.fromFields({
|
|
569
|
-
header: header.toCheckpointHeader(),
|
|
570
|
-
archive,
|
|
571
|
-
});
|
|
663
|
+
): CheckpointAttestation => {
|
|
664
|
+
const header = checkpoint.header;
|
|
665
|
+
const archive = checkpoint.archive.root;
|
|
572
666
|
|
|
573
|
-
return
|
|
667
|
+
return makeCheckpointAttestation({ header, archive, attesterSigner, proposerSigner });
|
|
574
668
|
};
|
|
575
669
|
|
|
576
|
-
|
|
577
|
-
|
|
670
|
+
/**
|
|
671
|
+
* Create a checkpoint attestation from an L2Block
|
|
672
|
+
*/
|
|
673
|
+
export const makeCheckpointAttestationFromBlock = (
|
|
674
|
+
block: L2Block,
|
|
578
675
|
attesterSigner?: Secp256k1Signer,
|
|
579
676
|
proposerSigner?: Secp256k1Signer,
|
|
580
|
-
):
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
584
|
-
const attestationSignature = attestationSigner.sign(attestationHash);
|
|
585
|
-
|
|
586
|
-
// Sign as proposer
|
|
587
|
-
const proposalHash = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockProposal);
|
|
588
|
-
const proposalSignerToUse = proposerSigner ?? Secp256k1Signer.random();
|
|
589
|
-
const proposerSignature = proposalSignerToUse.sign(proposalHash);
|
|
677
|
+
): CheckpointAttestation => {
|
|
678
|
+
const header = block.header.toCheckpointHeader();
|
|
679
|
+
const archive = block.archive.root;
|
|
590
680
|
|
|
591
|
-
return
|
|
681
|
+
return makeCheckpointAttestation({ header, archive, attesterSigner, proposerSigner });
|
|
592
682
|
};
|
|
593
683
|
|
|
594
684
|
export async function randomPublishedL2Block(
|
|
@@ -603,7 +693,13 @@ export async function randomPublishedL2Block(
|
|
|
603
693
|
});
|
|
604
694
|
|
|
605
695
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
606
|
-
const atts =
|
|
696
|
+
const atts = signers.map(signer =>
|
|
697
|
+
makeCheckpointAttestation({
|
|
698
|
+
signer,
|
|
699
|
+
archive: block.archive.root,
|
|
700
|
+
header: block.header.toCheckpointHeader(),
|
|
701
|
+
}),
|
|
702
|
+
);
|
|
607
703
|
const attestations = atts.map(
|
|
608
704
|
(attestation, i) => new CommitteeAttestation(signers[i].address, attestation.signature),
|
|
609
705
|
);
|
|
@@ -129,8 +129,6 @@ export class PrivateCallExecutionResult {
|
|
|
129
129
|
// Needed for the verifier (kernel)
|
|
130
130
|
/** The call stack item. */
|
|
131
131
|
public publicInputs: PrivateCircuitPublicInputs,
|
|
132
|
-
/** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */
|
|
133
|
-
public noteHashLeafIndexMap: Map<bigint, bigint>,
|
|
134
132
|
/** The notes created in the executed function. */
|
|
135
133
|
public newNotes: NoteAndSlot[],
|
|
136
134
|
/** Mapping of note hash counter to the counter of its nullifier. */
|
|
@@ -159,7 +157,6 @@ export class PrivateCallExecutionResult {
|
|
|
159
157
|
vk: schemas.Buffer,
|
|
160
158
|
partialWitness: mapSchema(z.coerce.number(), z.string()),
|
|
161
159
|
publicInputs: PrivateCircuitPublicInputs.schema,
|
|
162
|
-
noteHashLeafIndexMap: mapSchema(schemas.BigInt, schemas.BigInt),
|
|
163
160
|
newNotes: z.array(NoteAndSlot.schema),
|
|
164
161
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
165
162
|
returnValues: z.array(schemas.Fr),
|
|
@@ -177,7 +174,6 @@ export class PrivateCallExecutionResult {
|
|
|
177
174
|
fields.vk,
|
|
178
175
|
fields.partialWitness,
|
|
179
176
|
fields.publicInputs,
|
|
180
|
-
fields.noteHashLeafIndexMap,
|
|
181
177
|
fields.newNotes,
|
|
182
178
|
fields.noteHashNullifierCounterMap,
|
|
183
179
|
fields.returnValues,
|
|
@@ -194,7 +190,6 @@ export class PrivateCallExecutionResult {
|
|
|
194
190
|
randomBytes(4),
|
|
195
191
|
new Map([[1, 'one']]),
|
|
196
192
|
PrivateCircuitPublicInputs.empty(),
|
|
197
|
-
new Map([[1n, 1n]]),
|
|
198
193
|
[NoteAndSlot.random()],
|
|
199
194
|
new Map([[0, 0]]),
|
|
200
195
|
[Fr.random()],
|
|
@@ -210,16 +205,6 @@ export class PrivateCallExecutionResult {
|
|
|
210
205
|
}
|
|
211
206
|
}
|
|
212
207
|
|
|
213
|
-
export function collectNoteHashLeafIndexMap(execResult: PrivateExecutionResult) {
|
|
214
|
-
const accum: Map<bigint, bigint> = new Map();
|
|
215
|
-
const collectNoteHashLeafIndexMapRecursive = (callResult: PrivateCallExecutionResult, accum: Map<bigint, bigint>) => {
|
|
216
|
-
callResult.noteHashLeafIndexMap.forEach((value, key) => accum.set(key, value));
|
|
217
|
-
callResult.nestedExecutionResults.forEach(nested => collectNoteHashLeafIndexMapRecursive(nested, accum));
|
|
218
|
-
};
|
|
219
|
-
collectNoteHashLeafIndexMapRecursive(execResult.entrypoint, accum);
|
|
220
|
-
return accum;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
208
|
export function collectNoteHashNullifierCounterMap(execResult: PrivateExecutionResult) {
|
|
224
209
|
const accum: Map<number, number> = new Map();
|
|
225
210
|
const collectNoteHashNullifierCounterMapRecursive = (
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -28,7 +28,6 @@ import { RevertCode } from '../avm/revert_code.js';
|
|
|
28
28
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
29
29
|
import { PrivateLog } from '../logs/private_log.js';
|
|
30
30
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
31
|
-
import { computeTxOutHash } from '../messaging/out_hash.js';
|
|
32
31
|
import { TxHash } from './tx_hash.js';
|
|
33
32
|
|
|
34
33
|
export class TxEffect {
|
|
@@ -184,14 +183,6 @@ export class TxEffect {
|
|
|
184
183
|
);
|
|
185
184
|
}
|
|
186
185
|
|
|
187
|
-
/**
|
|
188
|
-
* Computes txOutHash of this tx effect.
|
|
189
|
-
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
190
|
-
*/
|
|
191
|
-
txOutHash(): Fr {
|
|
192
|
-
return computeTxOutHash(this.l2ToL1Msgs);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
186
|
static async random({
|
|
196
187
|
numNoteHashes,
|
|
197
188
|
numNullifiers,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ContractArtifact } from '../abi/abi.js';
|
|
2
|
-
import type { ContractClassWithId } from './interfaces/contract_class.js';
|
|
3
|
-
export interface ContractClassMetadata {
|
|
4
|
-
contractClass?: ContractClassWithId | undefined;
|
|
5
|
-
isContractClassPubliclyRegistered: boolean;
|
|
6
|
-
artifact?: ContractArtifact | undefined;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3NfbWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdC9jb250cmFjdF9jbGFzc19tZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN0RCxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRTFFLE1BQU0sV0FBVyxxQkFBcUI7SUFDcEMsYUFBYSxDQUFDLEVBQUUsbUJBQW1CLEdBQUcsU0FBUyxDQUFDO0lBQ2hELGlDQUFpQyxFQUFFLE9BQU8sQ0FBQztJQUMzQyxRQUFRLENBQUMsRUFBRSxnQkFBZ0IsR0FBRyxTQUFTLENBQUM7Q0FDekMifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract_class_metadata.d.ts","sourceRoot":"","sources":["../../src/contract/contract_class_metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD,iCAAiC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContractInstanceWithAddress } from './interfaces/contract_instance.js';
|
|
2
|
-
export interface ContractMetadata {
|
|
3
|
-
contractInstance?: ContractInstanceWithAddress | undefined;
|
|
4
|
-
isContractInitialized: boolean;
|
|
5
|
-
isContractPublished: boolean;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfbWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdC9jb250cmFjdF9tZXRhZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBRXJGLE1BQU0sV0FBVyxnQkFBZ0I7SUFDL0IsZ0JBQWdCLENBQUMsRUFBRSwyQkFBMkIsR0FBRyxTQUFTLENBQUM7SUFDM0QscUJBQXFCLEVBQUUsT0FBTyxDQUFDO0lBQy9CLG1CQUFtQixFQUFFLE9BQU8sQ0FBQztDQUM5QiJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract_metadata.d.ts","sourceRoot":"","sources":["../../src/contract/contract_metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAErF,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAC3D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;CAC9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import { Signature } from '@aztec/foundation/eth-signature';
|
|
6
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
7
|
-
import type { ZodFor } from '../schemas/index.js';
|
|
8
|
-
import { ConsensusPayload } from './consensus_payload.js';
|
|
9
|
-
import { Gossipable } from './gossipable.js';
|
|
10
|
-
import { TopicType } from './topic_type.js';
|
|
11
|
-
export declare class BlockAttestationHash extends Buffer32 {
|
|
12
|
-
constructor(hash: Buffer);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* BlockAttestation
|
|
16
|
-
*
|
|
17
|
-
* A validator that has attested to seeing the contents of a block
|
|
18
|
-
* will produce a block attestation over the header of the block
|
|
19
|
-
*/
|
|
20
|
-
export declare class BlockAttestation extends Gossipable {
|
|
21
|
-
readonly payload: ConsensusPayload;
|
|
22
|
-
readonly signature: Signature;
|
|
23
|
-
readonly proposerSignature: Signature;
|
|
24
|
-
static p2pTopic: TopicType;
|
|
25
|
-
private sender;
|
|
26
|
-
private proposer;
|
|
27
|
-
constructor(
|
|
28
|
-
/** The payload of the message, and what the signature is over */
|
|
29
|
-
payload: ConsensusPayload,
|
|
30
|
-
/** The signature of the block attester */
|
|
31
|
-
signature: Signature,
|
|
32
|
-
/** The signature from the block proposer */
|
|
33
|
-
proposerSignature: Signature);
|
|
34
|
-
static get schema(): ZodFor<BlockAttestation>;
|
|
35
|
-
generateP2PMessageIdentifier(): Promise<Buffer32>;
|
|
36
|
-
get archive(): Fr;
|
|
37
|
-
get slotNumber(): SlotNumber;
|
|
38
|
-
/**
|
|
39
|
-
* Lazily evaluate and cache the signer of the attestation
|
|
40
|
-
* @returns The signer of the attestation, or undefined if signature recovery fails
|
|
41
|
-
*/
|
|
42
|
-
getSender(): EthAddress | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Lazily evaluate and cache the proposer of the block
|
|
45
|
-
* @returns The proposer of the block
|
|
46
|
-
*/
|
|
47
|
-
getProposer(): EthAddress | undefined;
|
|
48
|
-
getPayload(): Buffer;
|
|
49
|
-
toBuffer(): Buffer;
|
|
50
|
-
static fromBuffer(buf: Buffer | BufferReader): BlockAttestation;
|
|
51
|
-
static empty(): BlockAttestation;
|
|
52
|
-
static random(): BlockAttestation;
|
|
53
|
-
getSize(): number;
|
|
54
|
-
toInspect(): {
|
|
55
|
-
payload: {
|
|
56
|
-
header: {
|
|
57
|
-
lastArchive: `0x${string}`;
|
|
58
|
-
blockHeadersHash: `0x${string}`;
|
|
59
|
-
blobsHash: `0x${string}`;
|
|
60
|
-
inHash: `0x${string}`;
|
|
61
|
-
slotNumber: SlotNumber;
|
|
62
|
-
timestamp: bigint;
|
|
63
|
-
coinbase: `0x${string}`;
|
|
64
|
-
feeRecipient: `0x${string}`;
|
|
65
|
-
gasFees: {
|
|
66
|
-
feePerDaGas: bigint;
|
|
67
|
-
feePerL2Gas: bigint;
|
|
68
|
-
};
|
|
69
|
-
totalManaUsed: bigint;
|
|
70
|
-
};
|
|
71
|
-
archive: `0x${string}`;
|
|
72
|
-
};
|
|
73
|
-
signature: `0x${string}`;
|
|
74
|
-
proposerSignature: `0x${string}`;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfYXR0ZXN0YXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvYmxvY2tfYXR0ZXN0YXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUdwRCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzVELE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFJOUUsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDMUQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRTdDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUU1QyxxQkFBYSxvQkFBcUIsU0FBUSxRQUFRO0lBQ2hELFlBQVksSUFBSSxFQUFFLE1BQU0sRUFFdkI7Q0FDRjtBQUVEOzs7OztHQUtHO0FBQ0gscUJBQWEsZ0JBQWlCLFNBQVEsVUFBVTthQVE1QixPQUFPLEVBQUUsZ0JBQWdCO2FBR3pCLFNBQVMsRUFBRSxTQUFTO2FBR3BCLGlCQUFpQixFQUFFLFNBQVM7SUFiOUMsT0FBZ0IsUUFBUSxZQUErQjtJQUV2RCxPQUFPLENBQUMsTUFBTSxDQUF5QjtJQUN2QyxPQUFPLENBQUMsUUFBUSxDQUF5QjtJQUV6QztJQUNFLGlFQUFpRTtJQUNqRCxPQUFPLEVBQUUsZ0JBQWdCO0lBRXpDLDBDQUEwQztJQUMxQixTQUFTLEVBQUUsU0FBUztJQUVwQyw0Q0FBNEM7SUFDNUIsaUJBQWlCLEVBQUUsU0FBUyxFQUc3QztJQUVELE1BQU0sS0FBSyxNQUFNLElBQUksTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBUTVDO0lBRVEsNEJBQTRCLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUV6RDtJQUVELElBQUksT0FBTyxJQUFJLEVBQUUsQ0FFaEI7SUFFRCxJQUFJLFVBQVUsSUFBSSxVQUFVLENBRTNCO0lBRUQ7OztPQUdHO0lBQ0gsU0FBUyxJQUFJLFVBQVUsR0FBRyxTQUFTLENBU2xDO0lBRUQ7OztPQUdHO0lBQ0gsV0FBVyxJQUFJLFVBQVUsR0FBRyxTQUFTLENBU3BDO0lBRUQsVUFBVSxJQUFJLE1BQU0sQ0FFbkI7SUFFRCxRQUFRLElBQUksTUFBTSxDQUVqQjtJQUVELE1BQU0sQ0FBQyxVQUFVLENBQUMsR0FBRyxFQUFFLE1BQU0sR0FBRyxZQUFZLEdBQUcsZ0JBQWdCLENBTzlEO0lBRUQsTUFBTSxDQUFDLEtBQUssSUFBSSxnQkFBZ0IsQ0FFL0I7SUFFRCxNQUFNLENBQUMsTUFBTSxJQUFJLGdCQUFnQixDQUVoQztJQUVELE9BQU8sSUFBSSxNQUFNLENBRWhCO0lBRUQsU0FBUzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O01BTVI7Q0FDRiJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block_attestation.d.ts","sourceRoot":"","sources":["../../src/p2p/block_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,YAAY,IAAI,EAAE,MAAM,EAEvB;CACF;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;aAQ5B,OAAO,EAAE,gBAAgB;aAGzB,SAAS,EAAE,SAAS;aAGpB,iBAAiB,EAAE,SAAS;IAb9C,OAAgB,QAAQ,YAA+B;IAEvD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,QAAQ,CAAyB;IAEzC;IACE,iEAAiE;IACjD,OAAO,EAAE,gBAAgB;IAEzC,0CAA0C;IAC1B,SAAS,EAAE,SAAS;IAEpC,4CAA4C;IAC5B,iBAAiB,EAAE,SAAS,EAG7C;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAQ5C;IAEQ,4BAA4B,IAAI,OAAO,CAAC,QAAQ,CAAC,CAEzD;IAED,IAAI,OAAO,IAAI,EAAE,CAEhB;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;;OAGG;IACH,SAAS,IAAI,UAAU,GAAG,SAAS,CASlC;IAED;;;OAGG;IACH,WAAW,IAAI,UAAU,GAAG,SAAS,CASpC;IAED,UAAU,IAAI,MAAM,CAEnB;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB,CAO9D;IAED,MAAM,CAAC,KAAK,IAAI,gBAAgB,CAE/B;IAED,MAAM,CAAC,MAAM,IAAI,gBAAgB,CAEhC;IAED,OAAO,IAAI,MAAM,CAEhB;IAED,SAAS;;;;;;;;;;;;;;;;;;;;;MAMR;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ContractArtifact } from '../abi/abi.js';
|
|
2
|
-
import type { ContractClassWithId } from './interfaces/contract_class.js';
|
|
3
|
-
|
|
4
|
-
export interface ContractClassMetadata {
|
|
5
|
-
contractClass?: ContractClassWithId | undefined;
|
|
6
|
-
isContractClassPubliclyRegistered: boolean;
|
|
7
|
-
artifact?: ContractArtifact | undefined;
|
|
8
|
-
}
|