@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
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
3
|
+
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
6
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
7
|
+
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
8
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
9
|
+
import { BlockHeader } from '../tx/block_header.js';
|
|
10
|
+
import { TxHash } from '../tx/index.js';
|
|
11
|
+
import { BlockProposal } from './block_proposal.js';
|
|
12
|
+
import { Gossipable } from './gossipable.js';
|
|
13
|
+
import { SignatureDomainSeparator, getHashedSignaturePayload, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
|
|
14
|
+
import { SignedTxs } from './signed_txs.js';
|
|
15
|
+
import { TopicType } from './topic_type.js';
|
|
16
|
+
// REFACTOR(palla): Use a branded type instead of a subclass of Buffer32
|
|
17
|
+
export class CheckpointProposalHash extends Buffer32 {
|
|
18
|
+
constructor(hash){
|
|
19
|
+
super(hash);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A checkpoint proposal is created by the leader of the chain for the last block in a checkpoint.
|
|
24
|
+
* It includes the aggregated checkpoint header that validators will attest to, plus optionally
|
|
25
|
+
* the last block's info for nodes to re-execute. This marks the completion of a slot's worth of blocks.
|
|
26
|
+
*/ export class CheckpointProposal extends Gossipable {
|
|
27
|
+
checkpointHeader;
|
|
28
|
+
archive;
|
|
29
|
+
signature;
|
|
30
|
+
lastBlock;
|
|
31
|
+
static p2pTopic = TopicType.checkpoint_proposal;
|
|
32
|
+
sender;
|
|
33
|
+
constructor(/** The aggregated checkpoint header for consensus */ checkpointHeader, /** Archive root after this checkpoint is applied */ archive, /** The proposer's signature over the checkpoint payload (checkpointHeader + archive) */ signature, /** Optional last block info, including its own signature for BlockProposal extraction */ lastBlock){
|
|
34
|
+
super(), this.checkpointHeader = checkpointHeader, this.archive = archive, this.signature = signature, this.lastBlock = lastBlock;
|
|
35
|
+
}
|
|
36
|
+
generateP2PMessageIdentifier() {
|
|
37
|
+
return Promise.resolve(new CheckpointProposalHash(keccak256(this.signature.toBuffer())));
|
|
38
|
+
}
|
|
39
|
+
get slotNumber() {
|
|
40
|
+
return this.checkpointHeader.slotNumber;
|
|
41
|
+
}
|
|
42
|
+
get blockNumber() {
|
|
43
|
+
if (!this.lastBlock) {
|
|
44
|
+
throw new Error('Cannot get blockNumber without lastBlock');
|
|
45
|
+
}
|
|
46
|
+
return this.lastBlock.blockHeader.getBlockNumber();
|
|
47
|
+
}
|
|
48
|
+
/** Convenience getter for txHashes from lastBlock */ get txHashes() {
|
|
49
|
+
return this.lastBlock?.txHashes ?? [];
|
|
50
|
+
}
|
|
51
|
+
/** Convenience getter for txs from lastBlock */ get txs() {
|
|
52
|
+
return this.lastBlock?.signedTxs?.txs;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Extract a BlockProposal from the last block info.
|
|
56
|
+
* Uses inHash from checkpointHeader.contentCommitment.inHash
|
|
57
|
+
*/ getBlockProposal() {
|
|
58
|
+
if (!this.lastBlock) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return new BlockProposal(this.lastBlock.blockHeader, this.lastBlock.indexWithinCheckpoint, this.checkpointHeader.inHash, this.archive, this.lastBlock.txHashes, this.lastBlock.signature, this.lastBlock.signedTxs);
|
|
62
|
+
}
|
|
63
|
+
toBlockInfo() {
|
|
64
|
+
if (!this.lastBlock) {
|
|
65
|
+
throw new Error('Cannot get blockInfo without lastBlock');
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
slotNumber: this.slotNumber,
|
|
69
|
+
lastArchive: this.lastBlock.blockHeader.lastArchive.root,
|
|
70
|
+
timestamp: this.lastBlock.blockHeader.globalVariables.timestamp,
|
|
71
|
+
archive: this.archive,
|
|
72
|
+
txCount: this.lastBlock.txHashes.length
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the payload to sign for this checkpoint proposal.
|
|
77
|
+
* The signature is over the checkpoint header + archive root (for consensus).
|
|
78
|
+
*/ getPayloadToSign(domainSeparator) {
|
|
79
|
+
return serializeToBuffer([
|
|
80
|
+
domainSeparator,
|
|
81
|
+
this.checkpointHeader,
|
|
82
|
+
this.archive
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
static async createProposalFromSigner(checkpointHeader, archiveRoot, lastBlockInfo, payloadSigner) {
|
|
86
|
+
// Sign the checkpoint payload
|
|
87
|
+
const tempProposal = new CheckpointProposal(checkpointHeader, archiveRoot, Signature.empty(), undefined);
|
|
88
|
+
const checkpointHash = getHashedSignaturePayload(tempProposal, SignatureDomainSeparator.checkpointProposal);
|
|
89
|
+
const checkpointSignature = await payloadSigner(checkpointHash);
|
|
90
|
+
if (!lastBlockInfo) {
|
|
91
|
+
return new CheckpointProposal(checkpointHeader, archiveRoot, checkpointSignature);
|
|
92
|
+
}
|
|
93
|
+
const lastBlockProposal = await BlockProposal.createProposalFromSigner(lastBlockInfo.blockHeader, lastBlockInfo.indexWithinCheckpoint, checkpointHeader.inHash, archiveRoot, lastBlockInfo.txHashes, lastBlockInfo.txs, payloadSigner);
|
|
94
|
+
return new CheckpointProposal(checkpointHeader, archiveRoot, checkpointSignature, {
|
|
95
|
+
blockHeader: lastBlockInfo.blockHeader,
|
|
96
|
+
indexWithinCheckpoint: lastBlockInfo.indexWithinCheckpoint,
|
|
97
|
+
txHashes: lastBlockInfo.txHashes,
|
|
98
|
+
signature: lastBlockProposal.signature,
|
|
99
|
+
signedTxs: lastBlockProposal.signedTxs
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Lazily evaluate the sender of the proposal; result is cached.
|
|
104
|
+
* If there's a lastBlock, also verifies the block proposal sender matches the checkpoint sender.
|
|
105
|
+
* @returns The sender address, or undefined if signature recovery fails or senders don't match
|
|
106
|
+
*/ getSender() {
|
|
107
|
+
if (!this.sender) {
|
|
108
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.checkpointProposal);
|
|
109
|
+
const checkpointSender = tryRecoverAddress(hashed, this.signature);
|
|
110
|
+
// If there's a lastBlock, verify the block proposal sender matches
|
|
111
|
+
if (checkpointSender && this.lastBlock) {
|
|
112
|
+
const blockProposal = this.getBlockProposal();
|
|
113
|
+
const blockSender = blockProposal?.getSender();
|
|
114
|
+
if (!blockSender || !blockSender.equals(checkpointSender)) {
|
|
115
|
+
return undefined; // Sender mismatch - fail
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Cache the sender for later use
|
|
119
|
+
this.sender = checkpointSender;
|
|
120
|
+
}
|
|
121
|
+
return this.sender;
|
|
122
|
+
}
|
|
123
|
+
getPayload() {
|
|
124
|
+
return this.getPayloadToSign(SignatureDomainSeparator.checkpointProposal);
|
|
125
|
+
}
|
|
126
|
+
toBuffer() {
|
|
127
|
+
const buffer = [
|
|
128
|
+
this.checkpointHeader,
|
|
129
|
+
this.archive,
|
|
130
|
+
this.signature
|
|
131
|
+
];
|
|
132
|
+
if (this.lastBlock) {
|
|
133
|
+
buffer.push(1); // hasLastBlock = true
|
|
134
|
+
buffer.push(this.lastBlock.blockHeader);
|
|
135
|
+
buffer.push(this.lastBlock.indexWithinCheckpoint);
|
|
136
|
+
buffer.push(this.lastBlock.signature);
|
|
137
|
+
buffer.push(this.lastBlock.txHashes.length);
|
|
138
|
+
buffer.push(this.lastBlock.txHashes);
|
|
139
|
+
if (this.lastBlock.signedTxs) {
|
|
140
|
+
buffer.push(1); // hasSignedTxs = true
|
|
141
|
+
buffer.push(this.lastBlock.signedTxs.toBuffer());
|
|
142
|
+
} else {
|
|
143
|
+
buffer.push(0); // hasSignedTxs = false
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
buffer.push(0); // hasLastBlock = false
|
|
147
|
+
}
|
|
148
|
+
return serializeToBuffer(buffer);
|
|
149
|
+
}
|
|
150
|
+
static fromBuffer(buf) {
|
|
151
|
+
const reader = BufferReader.asReader(buf);
|
|
152
|
+
const checkpointHeader = reader.readObject(CheckpointHeader);
|
|
153
|
+
const archive = reader.readObject(Fr);
|
|
154
|
+
const signature = reader.readObject(Signature);
|
|
155
|
+
const hasLastBlock = reader.readNumber();
|
|
156
|
+
if (hasLastBlock) {
|
|
157
|
+
const blockHeader = reader.readObject(BlockHeader);
|
|
158
|
+
const indexWithinCheckpoint = reader.readNumber();
|
|
159
|
+
const blockSignature = reader.readObject(Signature);
|
|
160
|
+
const txHashCount = reader.readNumber();
|
|
161
|
+
if (txHashCount > MAX_TXS_PER_BLOCK) {
|
|
162
|
+
throw new Error(`txHashes count ${txHashCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
|
|
163
|
+
}
|
|
164
|
+
const txHashes = reader.readArray(txHashCount, TxHash);
|
|
165
|
+
let signedTxs;
|
|
166
|
+
if (!reader.isEmpty()) {
|
|
167
|
+
const hasSignedTxs = reader.readNumber();
|
|
168
|
+
if (hasSignedTxs) {
|
|
169
|
+
signedTxs = SignedTxs.fromBuffer(reader);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return new CheckpointProposal(checkpointHeader, archive, signature, {
|
|
173
|
+
blockHeader,
|
|
174
|
+
indexWithinCheckpoint,
|
|
175
|
+
txHashes,
|
|
176
|
+
signature: blockSignature,
|
|
177
|
+
signedTxs
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return new CheckpointProposal(checkpointHeader, archive, signature);
|
|
181
|
+
}
|
|
182
|
+
getSize() {
|
|
183
|
+
let size = this.checkpointHeader.toBuffer().length + this.archive.size + this.signature.getSize() + 4; /* hasLastBlock flag */
|
|
184
|
+
if (this.lastBlock) {
|
|
185
|
+
size += this.lastBlock.blockHeader.getSize() + 4 /* indexWithinCheckpoint */ + this.lastBlock.signature.getSize() + 4 /* txHashes.length */ + this.lastBlock.txHashes.length * TxHash.SIZE + 4 /* hasSignedTxs flag */ + (this.lastBlock.signedTxs ? this.lastBlock.signedTxs.getSize() : 0);
|
|
186
|
+
}
|
|
187
|
+
return size;
|
|
188
|
+
}
|
|
189
|
+
static empty() {
|
|
190
|
+
return new CheckpointProposal(CheckpointHeader.empty(), Fr.ZERO, Signature.empty());
|
|
191
|
+
}
|
|
192
|
+
static random() {
|
|
193
|
+
return new CheckpointProposal(CheckpointHeader.random(), Fr.random(), Signature.random(), {
|
|
194
|
+
blockHeader: BlockHeader.random(),
|
|
195
|
+
indexWithinCheckpoint: Math.floor(Math.random() * 5),
|
|
196
|
+
txHashes: [
|
|
197
|
+
TxHash.random(),
|
|
198
|
+
TxHash.random()
|
|
199
|
+
],
|
|
200
|
+
signature: Signature.random()
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
toInspect() {
|
|
204
|
+
return {
|
|
205
|
+
checkpointHeader: this.checkpointHeader.toInspect(),
|
|
206
|
+
archive: this.archive.toString(),
|
|
207
|
+
signature: this.signature.toString(),
|
|
208
|
+
lastBlock: this.lastBlock ? {
|
|
209
|
+
blockHeader: this.lastBlock.blockHeader.toInspect(),
|
|
210
|
+
indexWithinCheckpoint: this.lastBlock.indexWithinCheckpoint,
|
|
211
|
+
txHashes: this.lastBlock.txHashes.map((h)=>h.toString()),
|
|
212
|
+
signature: this.lastBlock.signature.toString()
|
|
213
|
+
} : undefined
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Returns a copy of this proposal without lastBlock info, as a CheckpointProposalCore.
|
|
218
|
+
* Used when the lastBlock has been extracted and stored separately.
|
|
219
|
+
*/ toCore() {
|
|
220
|
+
return new CheckpointProposal(this.checkpointHeader, this.archive, this.signature);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -5,7 +5,9 @@ import { z } from 'zod';
|
|
|
5
5
|
import type { L2Block } from '../block/l2_block.js';
|
|
6
6
|
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
7
7
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
8
|
+
import type { CheckpointProposal, CheckpointProposalCore } from './checkpoint_proposal.js';
|
|
8
9
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
10
|
+
/** Checkpoint consensus payload as signed by validators and verified on L1. */
|
|
9
11
|
export declare class ConsensusPayload implements Signable {
|
|
10
12
|
readonly header: CheckpointHeader;
|
|
11
13
|
readonly archive: Fr;
|
|
@@ -31,7 +33,7 @@ export declare class ConsensusPayload implements Signable {
|
|
|
31
33
|
static getFields(fields: FieldsOf<ConsensusPayload>): readonly [CheckpointHeader, Fr];
|
|
32
34
|
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer;
|
|
33
35
|
toBuffer(): Buffer;
|
|
34
|
-
equals(other: ConsensusPayload): boolean;
|
|
36
|
+
equals(other: ConsensusPayload | CheckpointProposal | CheckpointProposalCore): boolean;
|
|
35
37
|
static fromBuffer(buf: Buffer | BufferReader): ConsensusPayload;
|
|
36
38
|
static fromFields(fields: FieldsOf<ConsensusPayload>): ConsensusPayload;
|
|
37
39
|
static fromBlock(block: L2Block): ConsensusPayload;
|
|
@@ -49,6 +51,7 @@ export declare class ConsensusPayload implements Signable {
|
|
|
49
51
|
blockHeadersHash: `0x${string}`;
|
|
50
52
|
blobsHash: `0x${string}`;
|
|
51
53
|
inHash: `0x${string}`;
|
|
54
|
+
epochOutHash: `0x${string}`;
|
|
52
55
|
slotNumber: import("@aztec/foundation/schemas").SlotNumber;
|
|
53
56
|
timestamp: bigint;
|
|
54
57
|
coinbase: `0x${string}`;
|
|
@@ -63,4 +66,4 @@ export declare class ConsensusPayload implements Signable {
|
|
|
63
66
|
};
|
|
64
67
|
toString(): string;
|
|
65
68
|
}
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc2Vuc3VzX3BheWxvYWQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvY29uc2Vuc3VzX3BheWxvYWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0F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AwB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,+EAA+E;AAC/E,qBAAa,gBAAiB,YAAW,QAAQ;aAK7B,MAAM,EAAE,gBAAgB;aAExB,OAAO,EAAE,EAAE;IAN7B,OAAO,CAAC,IAAI,CAAqB;IAEjC;IACE,6DAA6D;IAC7C,MAAM,EAAE,gBAAgB;IACxC,gDAAgD;IAChC,OAAO,EAAE,EAAE,EACzB;IAEJ,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAED,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,mCAElD;IAED,gBAAgB,CAAC,eAAe,EAAE,wBAAwB,GAAG,MAAM,CAkBlE;IAED,QAAQ,IAAI,MAAM,CAEjB;IAEM,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,sBAAsB,GAAG,OAAO,CAG5F;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB,CAI9D;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAEtE;IAED,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEjD;IAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAE9D;IAED,MAAM,CAAC,KAAK,IAAI,gBAAgB,CAE/B;IAED,MAAM,CAAC,MAAM,IAAI,gBAAgB,CAEhC;IAED;;;OAGG;IACH,OAAO,IAAI,MAAM,CAOhB;IAED,SAAS;;;;;;;;;;;;;;;;;;MAKR;IAED,QAAQ,WAEP;CACF"}
|
|
@@ -5,7 +5,7 @@ import { hexToBuffer } from '@aztec/foundation/string';
|
|
|
5
5
|
import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
8
|
-
export class ConsensusPayload {
|
|
8
|
+
/** Checkpoint consensus payload as signed by validators and verified on L1. */ export class ConsensusPayload {
|
|
9
9
|
header;
|
|
10
10
|
archive;
|
|
11
11
|
size;
|
|
@@ -52,7 +52,8 @@ export class ConsensusPayload {
|
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
54
|
equals(other) {
|
|
55
|
-
|
|
55
|
+
const otherHeader = 'checkpointHeader' in other ? other.checkpointHeader : other.header;
|
|
56
|
+
return this.header.equals(otherHeader) && this.archive.equals(other.archive);
|
|
56
57
|
}
|
|
57
58
|
static fromBuffer(buf) {
|
|
58
59
|
const reader = BufferReader.asReader(buf);
|
package/dest/p2p/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export * from './attestation_utils.js';
|
|
2
|
-
export * from './block_attestation.js';
|
|
3
2
|
export * from './block_proposal.js';
|
|
3
|
+
export * from './checkpoint_attestation.js';
|
|
4
|
+
export * from './checkpoint_proposal.js';
|
|
4
5
|
export * from './consensus_payload.js';
|
|
5
6
|
export * from './gossipable.js';
|
|
6
7
|
export * from './interface.js';
|
|
7
8
|
export * from './signature_utils.js';
|
|
9
|
+
export * from './signed_txs.js';
|
|
8
10
|
export * from './topic_type.js';
|
|
9
11
|
export * from './client_type.js';
|
|
10
12
|
export * from './message_validator.js';
|
|
11
13
|
export * from './peer_error.js';
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxpQkFBaUIsQ0FBQyJ9
|
package/dest/p2p/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/p2p/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/p2p/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC"}
|
package/dest/p2p/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './attestation_utils.js';
|
|
2
|
-
export * from './block_attestation.js';
|
|
3
2
|
export * from './block_proposal.js';
|
|
3
|
+
export * from './checkpoint_attestation.js';
|
|
4
|
+
export * from './checkpoint_proposal.js';
|
|
4
5
|
export * from './consensus_payload.js';
|
|
5
6
|
export * from './gossipable.js';
|
|
6
7
|
export * from './interface.js';
|
|
7
8
|
export * from './signature_utils.js';
|
|
9
|
+
export * from './signed_txs.js';
|
|
8
10
|
export * from './topic_type.js';
|
|
9
11
|
export * from './client_type.js';
|
|
10
12
|
export * from './message_validator.js';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
export declare enum SignatureDomainSeparator {
|
|
3
3
|
blockProposal = 0,
|
|
4
|
-
|
|
5
|
-
attestationsAndSigners = 2
|
|
4
|
+
checkpointAttestation = 1,
|
|
5
|
+
attestationsAndSigners = 2,
|
|
6
|
+
checkpointProposal = 3,
|
|
7
|
+
signedTxs = 4
|
|
6
8
|
}
|
|
7
9
|
export interface Signable {
|
|
8
10
|
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer;
|
|
@@ -19,4 +21,4 @@ export declare function getHashedSignaturePayload(s: Signable, domainSeparator:
|
|
|
19
21
|
* @returns The hashed payload for the signature of the `Signable` as an Ethereum signed message
|
|
20
22
|
*/
|
|
21
23
|
export declare function getHashedSignaturePayloadEthSignedMessage(s: Signable, domainSeparator: SignatureDomainSeparator): Buffer32;
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmF0dXJlX3V0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcDJwL3NpZ25hdHVyZV91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFJcEQsb0JBQVksd0JBQXdCO0lBQ2xDLGFBQWEsSUFBSTtJQUNqQixxQkFBcUIsSUFBSTtJQUN6QixzQkFBc0IsSUFBSTtJQUMxQixrQkFBa0IsSUFBSTtJQUN0QixTQUFTLElBQUk7Q0FDZDtBQUVELE1BQU0sV0FBVyxRQUFRO0lBQ3ZCLGdCQUFnQixDQUFDLGVBQWUsRUFBRSx3QkFBd0IsR0FBRyxNQUFNLENBQUM7Q0FDckU7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLHlCQUF5QixDQUFDLENBQUMsRUFBRSxRQUFRLEVBQUUsZUFBZSxFQUFFLHdCQUF3QixHQUFHLFFBQVEsQ0FFMUc7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLHlDQUF5QyxDQUN2RCxDQUFDLEVBQUUsUUFBUSxFQUNYLGVBQWUsRUFBRSx3QkFBd0IsR0FDeEMsUUFBUSxDQUdWIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature_utils.d.ts","sourceRoot":"","sources":["../../src/p2p/signature_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,oBAAY,wBAAwB;IAClC,aAAa,IAAI;IACjB,
|
|
1
|
+
{"version":3,"file":"signature_utils.d.ts","sourceRoot":"","sources":["../../src/p2p/signature_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,oBAAY,wBAAwB;IAClC,aAAa,IAAI;IACjB,qBAAqB,IAAI;IACzB,sBAAsB,IAAI;IAC1B,kBAAkB,IAAI;IACtB,SAAS,IAAI;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,gBAAgB,CAAC,eAAe,EAAE,wBAAwB,GAAG,MAAM,CAAC;CACrE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,GAAG,QAAQ,CAE1G;AAED;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,CAAC,EAAE,QAAQ,EACX,eAAe,EAAE,wBAAwB,GACxC,QAAQ,CAGV"}
|
|
@@ -3,8 +3,10 @@ import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
|
3
3
|
import { makeEthSignDigest } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
4
4
|
export var SignatureDomainSeparator = /*#__PURE__*/ function(SignatureDomainSeparator) {
|
|
5
5
|
SignatureDomainSeparator[SignatureDomainSeparator["blockProposal"] = 0] = "blockProposal";
|
|
6
|
-
SignatureDomainSeparator[SignatureDomainSeparator["
|
|
6
|
+
SignatureDomainSeparator[SignatureDomainSeparator["checkpointAttestation"] = 1] = "checkpointAttestation";
|
|
7
7
|
SignatureDomainSeparator[SignatureDomainSeparator["attestationsAndSigners"] = 2] = "attestationsAndSigners";
|
|
8
|
+
SignatureDomainSeparator[SignatureDomainSeparator["checkpointProposal"] = 3] = "checkpointProposal";
|
|
9
|
+
SignatureDomainSeparator[SignatureDomainSeparator["signedTxs"] = 4] = "signedTxs";
|
|
8
10
|
return SignatureDomainSeparator;
|
|
9
11
|
}({});
|
|
10
12
|
/**
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
|
+
import { Tx } from '../tx/tx.js';
|
|
6
|
+
import { SignatureDomainSeparator } from './signature_utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* A signed collection of transactions.
|
|
9
|
+
* The signature is over the transaction objects themselves, providing
|
|
10
|
+
* data availability guarantees beyond just the transaction hashes.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SignedTxs {
|
|
13
|
+
readonly txs: Tx[];
|
|
14
|
+
readonly signature: Signature;
|
|
15
|
+
private sender;
|
|
16
|
+
constructor(
|
|
17
|
+
/** The transactions */
|
|
18
|
+
txs: Tx[],
|
|
19
|
+
/** The proposer's signature over the transactions */
|
|
20
|
+
signature: Signature);
|
|
21
|
+
/**
|
|
22
|
+
* Get the payload to sign for this signed txs.
|
|
23
|
+
*/
|
|
24
|
+
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer;
|
|
25
|
+
/**
|
|
26
|
+
* Lazily evaluate the sender of the signed txs; result is cached
|
|
27
|
+
* @returns The sender address, or undefined if signature recovery fails
|
|
28
|
+
*/
|
|
29
|
+
getSender(): EthAddress | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Create SignedTxs from a signer function
|
|
32
|
+
*/
|
|
33
|
+
static createFromSigner(txs: Tx[], payloadSigner: (payload: Buffer32) => Promise<Signature>): Promise<SignedTxs>;
|
|
34
|
+
toBuffer(): Buffer;
|
|
35
|
+
static fromBuffer(buf: Buffer | BufferReader): SignedTxs;
|
|
36
|
+
getSize(): number;
|
|
37
|
+
static empty(): SignedTxs;
|
|
38
|
+
static random(): SignedTxs;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmVkX3R4cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3AycC9zaWduZWRfdHhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUVwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNoRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDNUQsT0FBTyxFQUFFLFlBQVksRUFBcUIsTUFBTSw2QkFBNkIsQ0FBQztBQUc5RSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ2pDLE9BQU8sRUFDTCx3QkFBd0IsRUFHekIsTUFBTSxzQkFBc0IsQ0FBQztBQUU5Qjs7OztHQUlHO0FBQ0gscUJBQWEsU0FBUzthQUtGLEdBQUcsRUFBRSxFQUFFLEVBQUU7YUF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B,CAAC;AAG9E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,wBAAwB,EAGzB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,qBAAa,SAAS;aAKF,GAAG,EAAE,EAAE,EAAE;aAET,SAAS,EAAE,SAAS;IANtC,OAAO,CAAC,MAAM,CAAyB;IAEvC;IACE,uBAAuB;IACP,GAAG,EAAE,EAAE,EAAE;IACzB,qDAAqD;IACrC,SAAS,EAAE,SAAS,EAClC;IAEJ;;OAEG;IACH,gBAAgB,CAAC,eAAe,EAAE,wBAAwB,GAAG,MAAM,CAElE;IAED;;;OAGG;IACH,SAAS,IAAI,UAAU,GAAG,SAAS,CAMlC;IAED;;OAEG;IACH,OAAa,gBAAgB,CAC3B,GAAG,EAAE,EAAE,EAAE,EACT,aAAa,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,SAAS,CAAC,GACvD,OAAO,CAAC,SAAS,CAAC,CAKpB;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CASvD;IAED,OAAO,IAAI,MAAM,CAEhB;IAED,MAAM,CAAC,KAAK,IAAI,SAAS,CAExB;IAED,MAAM,CAAC,MAAM,IAAI,SAAS,CAEzB;CACF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
2
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
5
|
+
import { Tx } from '../tx/tx.js';
|
|
6
|
+
import { SignatureDomainSeparator, getHashedSignaturePayload, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* A signed collection of transactions.
|
|
9
|
+
* The signature is over the transaction objects themselves, providing
|
|
10
|
+
* data availability guarantees beyond just the transaction hashes.
|
|
11
|
+
*/ export class SignedTxs {
|
|
12
|
+
txs;
|
|
13
|
+
signature;
|
|
14
|
+
sender;
|
|
15
|
+
constructor(/** The transactions */ txs, /** The proposer's signature over the transactions */ signature){
|
|
16
|
+
this.txs = txs;
|
|
17
|
+
this.signature = signature;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the payload to sign for this signed txs.
|
|
21
|
+
*/ getPayloadToSign(domainSeparator) {
|
|
22
|
+
return serializeToBuffer([
|
|
23
|
+
domainSeparator,
|
|
24
|
+
this.txs.length,
|
|
25
|
+
this.txs
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Lazily evaluate the sender of the signed txs; result is cached
|
|
30
|
+
* @returns The sender address, or undefined if signature recovery fails
|
|
31
|
+
*/ getSender() {
|
|
32
|
+
if (!this.sender) {
|
|
33
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.signedTxs);
|
|
34
|
+
this.sender = tryRecoverAddress(hashed, this.signature);
|
|
35
|
+
}
|
|
36
|
+
return this.sender;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create SignedTxs from a signer function
|
|
40
|
+
*/ static async createFromSigner(txs, payloadSigner) {
|
|
41
|
+
const tempSignedTxs = new SignedTxs(txs, Signature.empty());
|
|
42
|
+
const hashed = getHashedSignaturePayload(tempSignedTxs, SignatureDomainSeparator.signedTxs);
|
|
43
|
+
const signature = await payloadSigner(hashed);
|
|
44
|
+
return new SignedTxs(txs, signature);
|
|
45
|
+
}
|
|
46
|
+
toBuffer() {
|
|
47
|
+
return serializeToBuffer([
|
|
48
|
+
this.txs.length,
|
|
49
|
+
this.txs,
|
|
50
|
+
this.signature
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
static fromBuffer(buf) {
|
|
54
|
+
const reader = BufferReader.asReader(buf);
|
|
55
|
+
const txCount = reader.readNumber();
|
|
56
|
+
if (txCount > MAX_TXS_PER_BLOCK) {
|
|
57
|
+
throw new Error(`txs count ${txCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
|
|
58
|
+
}
|
|
59
|
+
const txs = reader.readArray(txCount, Tx);
|
|
60
|
+
const signature = reader.readObject(Signature);
|
|
61
|
+
return new SignedTxs(txs, signature);
|
|
62
|
+
}
|
|
63
|
+
getSize() {
|
|
64
|
+
return 4 /* txs.length */ + this.txs.reduce((acc, tx)=>acc + tx.getSize(), 0) + this.signature.getSize();
|
|
65
|
+
}
|
|
66
|
+
static empty() {
|
|
67
|
+
return new SignedTxs([], Signature.empty());
|
|
68
|
+
}
|
|
69
|
+
static random() {
|
|
70
|
+
return new SignedTxs([
|
|
71
|
+
Tx.random(),
|
|
72
|
+
Tx.random()
|
|
73
|
+
], Signature.random());
|
|
74
|
+
}
|
|
75
|
+
}
|
package/dest/p2p/topic_type.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ export declare function getTopicFromString(topicStr: string): TopicType | undefi
|
|
|
8
8
|
export declare enum TopicType {
|
|
9
9
|
tx = "tx",
|
|
10
10
|
block_proposal = "block_proposal",
|
|
11
|
-
|
|
11
|
+
checkpoint_proposal = "checkpoint_proposal",
|
|
12
|
+
checkpoint_attestation = "checkpoint_attestation"
|
|
12
13
|
}
|
|
13
14
|
export declare function getTopicTypeForClientType(clientType: P2PClientType): TopicType[];
|
|
14
15
|
export declare function getTopicsForClientAndConfig(clientType: P2PClientType, disableTransactions: boolean): TopicType[];
|
|
@@ -22,4 +23,4 @@ export declare function getTopicsForClientAndConfig(clientType: P2PClientType, d
|
|
|
22
23
|
* }
|
|
23
24
|
*/
|
|
24
25
|
export declare function metricsTopicStrToLabels(protocolVersion: string): Map<string, string>;
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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,SAAS,CAU1E;AAED,oBAAY,SAAS;IACnB,EAAE,OAAO;IACT,cAAc,mBAAmB;IACjC,
|
|
1
|
+
{"version":3,"file":"topic_type.d.ts","sourceRoot":"","sources":["../../src/p2p/topic_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAE9E;AAED,kDAAkD;AAClD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAU1E;AAED,oBAAY,SAAS;IACnB,EAAE,OAAO;IACT,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;CAClD;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,aAAa,eASlE;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,OAAO,eAMlG;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,uBAO9D"}
|
package/dest/p2p/topic_type.js
CHANGED
|
@@ -18,12 +18,18 @@ import { P2PClientType } from './client_type.js';
|
|
|
18
18
|
export var TopicType = /*#__PURE__*/ function(TopicType) {
|
|
19
19
|
TopicType["tx"] = "tx";
|
|
20
20
|
TopicType["block_proposal"] = "block_proposal";
|
|
21
|
-
TopicType["
|
|
21
|
+
TopicType["checkpoint_proposal"] = "checkpoint_proposal";
|
|
22
|
+
TopicType["checkpoint_attestation"] = "checkpoint_attestation";
|
|
22
23
|
return TopicType;
|
|
23
24
|
}({});
|
|
24
25
|
export function getTopicTypeForClientType(clientType) {
|
|
25
26
|
if (clientType === P2PClientType.Full) {
|
|
26
|
-
return
|
|
27
|
+
return [
|
|
28
|
+
"tx",
|
|
29
|
+
"block_proposal",
|
|
30
|
+
"checkpoint_proposal",
|
|
31
|
+
"checkpoint_attestation"
|
|
32
|
+
];
|
|
27
33
|
} else if (clientType === P2PClientType.Prover) {
|
|
28
34
|
return [
|
|
29
35
|
"tx",
|
|
@@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { computeUnbalancedPoseidonRoot } from '@aztec/foundation/trees';
|
|
3
3
|
export async function computeBlockHeadersHash(blockHeaders) {
|
|
4
4
|
const blockHeaderHashes = await Promise.all(blockHeaders.map((header)=>header.hash()));
|
|
5
|
-
// Must match the implementation in merge_block_rollups.nr, with the **
|
|
5
|
+
// Must match the implementation in merge_block_rollups.nr, with the **unbalanced** rollup structure
|
|
6
6
|
// (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
|
|
7
7
|
const blockHeadersHash = await computeUnbalancedPoseidonRoot(blockHeaderHashes.map((hash)=>hash.toBuffer()));
|
|
8
8
|
return Fr.fromBuffer(blockHeadersHash);
|
|
@@ -57,8 +57,8 @@ export declare class BlockRollupPublicInputs {
|
|
|
57
57
|
timestamp: UInt64,
|
|
58
58
|
/**
|
|
59
59
|
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
60
|
-
* other blocks in the same checkpoint to form
|
|
61
|
-
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
60
|
+
* other blocks in the same checkpoint to form an unbalanced tree. The root of that tree becomes the final hash
|
|
61
|
+
* stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
62
62
|
*/
|
|
63
63
|
blockHeadersHash: Fr,
|
|
64
64
|
/**
|
|
@@ -40,8 +40,8 @@ import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
|
40
40
|
* Timestamp of the blocks in this block range.
|
|
41
41
|
*/ timestamp, /**
|
|
42
42
|
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
43
|
-
* other blocks in the same checkpoint to form
|
|
44
|
-
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
43
|
+
* other blocks in the same checkpoint to form an unbalanced tree. The root of that tree becomes the final hash
|
|
44
|
+
* stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
45
45
|
*/ blockHeadersHash, /**
|
|
46
46
|
* SHA256 hash of l1 to l2 messages.
|
|
47
47
|
*/ inHash, /**
|