@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
package/dest/tx/tx_effect.d.ts
CHANGED
|
@@ -71,11 +71,6 @@ export declare class TxEffect {
|
|
|
71
71
|
* @returns An instance of TxEffect.
|
|
72
72
|
*/
|
|
73
73
|
static fromBuffer(buffer: Buffer | BufferReader): TxEffect;
|
|
74
|
-
/**
|
|
75
|
-
* Computes txOutHash of this tx effect.
|
|
76
|
-
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
77
|
-
*/
|
|
78
|
-
txOutHash(): Fr;
|
|
79
74
|
static random({ numNoteHashes, numNullifiers, numL2ToL1Msgs, numPublicDataWrites, numPrivateLogs, numPublicCallsPerTx, numPublicLogsPerCall, numContractClassLogs, maxEffects }?: {
|
|
80
75
|
numNoteHashes?: number;
|
|
81
76
|
numNullifiers?: number;
|
|
@@ -109,4 +104,4 @@ export declare class TxEffect {
|
|
|
109
104
|
*/
|
|
110
105
|
static fromString(str: string): TxEffect;
|
|
111
106
|
}
|
|
112
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
107
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfZWZmZWN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHgvdHhfZWZmZWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLFVBQVUsRUFDZixLQUFLLGFBQWEsRUFJbkIsTUFBTSwwQkFBMEIsQ0FBQztBQVNsQyxPQUFPLEVBQUUsS0FBSyxRQUFRLEVBQTZCLE1BQU0seUJBQXlCLENBQUM7QUFFbkYsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBVyxNQUFNLDJCQUEyQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSxZQUFZLEVBQXlELE1BQU0sNkJBQTZCLENBQUM7QUFHbEgsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUcvQixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDOUQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTS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BQVksSUFBSSxVQUFVLENBYXpCO0lBRUQ7O09BRUc7SUFDSCxNQUFNLENBQUMsY0FBYyxDQUFDLFVBQVUsRUFBRSxVQUFVLFlBNEIzQztJQUVELE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLFFBQVEsQ0FBQyxRQUFRLENBQUMsWUFhckM7SUFFRCxNQUFNLEtBQUssTUFBTSxJQUFJLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FlcEM7SUFFRCxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsV0FvQmY7SUFFRDs7OztPQUlHO0lBQ0gsTUFBTSxDQUFDLFVBQVUsQ0FBQyxHQUFHLEVBQUUsTUFBTSxZQUU1QjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,KAAK,QAAQ,EAA6B,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAyD,MAAM,6BAA6B,CAAC;AAGlH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAkB,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx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B3C;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,YAarC;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAepC;IAED,CAAC,OAAO,CAAC,MAAM,CAAC,WAoBf;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,YAE5B;CACF"}
|
package/dest/tx/tx_effect.js
CHANGED
|
@@ -14,7 +14,6 @@ import { RevertCode } from '../avm/revert_code.js';
|
|
|
14
14
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
15
15
|
import { PrivateLog } from '../logs/private_log.js';
|
|
16
16
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
17
|
-
import { computeTxOutHash } from '../messaging/out_hash.js';
|
|
18
17
|
import { TxHash } from './tx_hash.js';
|
|
19
18
|
_computedKey = inspect.custom;
|
|
20
19
|
export class TxEffect {
|
|
@@ -128,12 +127,6 @@ export class TxEffect {
|
|
|
128
127
|
const reader = BufferReader.asReader(buffer);
|
|
129
128
|
return new TxEffect(RevertCode.fromBuffer(reader), TxHash.fromBuffer(reader), Fr.fromBuffer(reader), reader.readVectorUint8Prefix(Fr), reader.readVectorUint8Prefix(Fr), reader.readVectorUint8Prefix(Fr), reader.readVectorUint8Prefix(PublicDataWrite), reader.readVectorUint8Prefix(PrivateLog), reader.readVector(PublicLog), reader.readVectorUint8Prefix(ContractClassLog));
|
|
130
129
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Computes txOutHash of this tx effect.
|
|
133
|
-
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
134
|
-
*/ txOutHash() {
|
|
135
|
-
return computeTxOutHash(this.l2ToL1Msgs);
|
|
136
|
-
}
|
|
137
130
|
static async random({ numNoteHashes, numNullifiers, numL2ToL1Msgs, numPublicDataWrites, numPrivateLogs, numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, numContractClassLogs, maxEffects } = {}) {
|
|
138
131
|
const count = (max, num)=>num ?? Math.min(maxEffects ?? randomInt(max), max);
|
|
139
132
|
// Every tx effect must have at least 1 nullifier (the first nullifier is used for log indexing)
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "4.0.0-nightly.
|
|
3
|
+
"version": "4.0.0-nightly.20260114",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
7
7
|
"./package.local.json"
|
|
8
8
|
],
|
|
9
9
|
"exports": {
|
|
10
|
+
"./deserialization": "./dest/deserialization/index.js",
|
|
10
11
|
"./aztec-address": "./dest/aztec-address/index.js",
|
|
11
12
|
"./abi": "./dest/abi/index.js",
|
|
12
13
|
"./abi/function-selector": "./dest/abi/function_selector.js",
|
|
@@ -77,13 +78,13 @@
|
|
|
77
78
|
},
|
|
78
79
|
"dependencies": {
|
|
79
80
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
80
|
-
"@aztec/bb.js": "4.0.0-nightly.
|
|
81
|
-
"@aztec/blob-lib": "4.0.0-nightly.
|
|
82
|
-
"@aztec/constants": "4.0.0-nightly.
|
|
83
|
-
"@aztec/ethereum": "4.0.0-nightly.
|
|
84
|
-
"@aztec/foundation": "4.0.0-nightly.
|
|
85
|
-
"@aztec/l1-artifacts": "4.0.0-nightly.
|
|
86
|
-
"@aztec/noir-noirc_abi": "4.0.0-nightly.
|
|
81
|
+
"@aztec/bb.js": "4.0.0-nightly.20260114",
|
|
82
|
+
"@aztec/blob-lib": "4.0.0-nightly.20260114",
|
|
83
|
+
"@aztec/constants": "4.0.0-nightly.20260114",
|
|
84
|
+
"@aztec/ethereum": "4.0.0-nightly.20260114",
|
|
85
|
+
"@aztec/foundation": "4.0.0-nightly.20260114",
|
|
86
|
+
"@aztec/l1-artifacts": "4.0.0-nightly.20260114",
|
|
87
|
+
"@aztec/noir-noirc_abi": "4.0.0-nightly.20260114",
|
|
87
88
|
"@google-cloud/storage": "^7.15.0",
|
|
88
89
|
"axios": "^1.12.0",
|
|
89
90
|
"json-stringify-deterministic": "1.0.12",
|
package/src/abi/utils.ts
CHANGED
|
@@ -49,6 +49,23 @@ export function isWrappedFieldStruct(abiType: AbiType) {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Returns whether the ABI type is a PublicKeys struct from Aztec.nr.
|
|
54
|
+
* @param abiType - Type to check.
|
|
55
|
+
* @returns A boolean indicating whether the ABI type is a PublicKeys struct.
|
|
56
|
+
*/
|
|
57
|
+
export function isPublicKeysStruct(abiType: AbiType) {
|
|
58
|
+
return (
|
|
59
|
+
abiType.kind === 'struct' &&
|
|
60
|
+
abiType.path === 'aztec::protocol_types::public_keys::PublicKeys' &&
|
|
61
|
+
abiType.fields.length === 4 &&
|
|
62
|
+
abiType.fields[0].name === 'npk_m' &&
|
|
63
|
+
abiType.fields[1].name === 'ivpk_m' &&
|
|
64
|
+
abiType.fields[2].name === 'ovpk_m' &&
|
|
65
|
+
abiType.fields[3].name === 'tpk_m'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
52
69
|
/**
|
|
53
70
|
* Returns whether the ABI type is a BoundedVec struct from Noir's std::collections::bounded_vec.
|
|
54
71
|
* @param abiType - Type to check.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { recoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
|
|
4
|
+
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
4
5
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
5
6
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
6
|
-
import type { L2Block } from './l2_block.js';
|
|
7
7
|
import type { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -29,14 +29,14 @@ export type AttestationInfo =
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Extracts attestation information from a published
|
|
32
|
+
* Extracts attestation information from a published checkpoint.
|
|
33
33
|
* Returns info for each attestation, preserving array indices.
|
|
34
34
|
*/
|
|
35
|
-
export function
|
|
35
|
+
export function getAttestationInfoFromPublishedCheckpoint(block: {
|
|
36
36
|
attestations: CommitteeAttestation[];
|
|
37
|
-
|
|
37
|
+
checkpoint: Checkpoint;
|
|
38
38
|
}): AttestationInfo[] {
|
|
39
|
-
const payload = ConsensusPayload.
|
|
39
|
+
const payload = ConsensusPayload.fromCheckpoint(block.checkpoint);
|
|
40
40
|
return getAttestationInfoFromPayload(payload, block.attestations);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -44,7 +44,10 @@ export function getAttestationInfoFromPayload(
|
|
|
44
44
|
payload: ConsensusPayload,
|
|
45
45
|
attestations: CommitteeAttestation[],
|
|
46
46
|
): AttestationInfo[] {
|
|
47
|
-
const hashedPayload = getHashedSignaturePayloadEthSignedMessage(
|
|
47
|
+
const hashedPayload = getHashedSignaturePayloadEthSignedMessage(
|
|
48
|
+
payload,
|
|
49
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
50
|
+
);
|
|
48
51
|
|
|
49
52
|
return attestations.map(attestation => {
|
|
50
53
|
// If signature is empty, check if we have an address directly
|
package/src/block/body.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
5
5
|
import { inspect } from 'util';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
+
import { MAX_TX_EFFECTS_PER_BODY } from '../deserialization/index.js';
|
|
8
9
|
import type { ZodFor } from '../schemas/index.js';
|
|
9
10
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
10
11
|
|
|
@@ -40,7 +41,7 @@ export class Body {
|
|
|
40
41
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
41
42
|
const reader = BufferReader.asReader(buf);
|
|
42
43
|
|
|
43
|
-
return new this(reader.readVector(TxEffect));
|
|
44
|
+
return new this(reader.readVector(TxEffect, MAX_TX_EFFECTS_PER_BODY));
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -6,6 +6,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
import { L1PublishedData, PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
9
|
+
import { MAX_BLOCK_HASH_STRING_LENGTH, MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
9
10
|
import { L2Block } from './l2_block.js';
|
|
10
11
|
import { L2BlockNew } from './l2_block_new.js';
|
|
11
12
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
@@ -36,9 +37,9 @@ export class CheckpointedL2Block {
|
|
|
36
37
|
const checkpointNumber = reader.readNumber();
|
|
37
38
|
const block = reader.readObject(L2BlockNew);
|
|
38
39
|
const l1BlockNumber = reader.readBigInt();
|
|
39
|
-
const l1BlockHash = reader.readString();
|
|
40
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
40
41
|
const l1Timestamp = reader.readBigInt();
|
|
41
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
42
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
42
43
|
return new CheckpointedL2Block(
|
|
43
44
|
CheckpointNumber(checkpointNumber),
|
|
44
45
|
block,
|
|
@@ -89,9 +90,9 @@ export class PublishedL2Block {
|
|
|
89
90
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
90
91
|
const block = reader.readObject(L2Block);
|
|
91
92
|
const l1BlockNumber = reader.readBigInt();
|
|
92
|
-
const l1BlockHash = reader.readString();
|
|
93
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
93
94
|
const l1Timestamp = reader.readBigInt();
|
|
94
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
95
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
95
96
|
return new PublishedL2Block(block, new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash), attestations);
|
|
96
97
|
}
|
|
97
98
|
|
package/src/block/l2_block.ts
CHANGED
|
@@ -151,13 +151,13 @@ export class L2Block {
|
|
|
151
151
|
return this.header.toBlockHeader();
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
public toL2Block() {
|
|
154
|
+
public toL2Block(args: { checkpointNumber?: CheckpointNumber; indexWithinCheckpoint?: number } = {}): L2BlockNew {
|
|
155
155
|
return new L2BlockNew(
|
|
156
156
|
this.archive,
|
|
157
157
|
this.getBlockHeader(),
|
|
158
158
|
this.body,
|
|
159
|
-
CheckpointNumber.fromBlockNumber(this.number),
|
|
160
|
-
0,
|
|
159
|
+
args?.checkpointNumber ?? CheckpointNumber.fromBlockNumber(this.number),
|
|
160
|
+
args?.indexWithinCheckpoint ?? 0,
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -177,6 +177,7 @@ export class L2Block {
|
|
|
177
177
|
new AppendOnlyTreeSnapshot(checkpointHeader.lastArchiveRoot, block.number),
|
|
178
178
|
checkpointHeader.blobsHash,
|
|
179
179
|
checkpointHeader.inHash,
|
|
180
|
+
checkpointHeader.epochOutHash,
|
|
180
181
|
block.header.state,
|
|
181
182
|
block.header.globalVariables,
|
|
182
183
|
block.header.totalFees,
|
|
@@ -22,6 +22,7 @@ export function makeL2BlockHeader(
|
|
|
22
22
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
23
23
|
overrides.blobsHash ?? new Fr(seed + 0x200),
|
|
24
24
|
overrides.inHash ?? new Fr(seed + 0x300),
|
|
25
|
+
overrides.epochOutHash ?? new Fr(seed + 0x400),
|
|
25
26
|
overrides.state ?? makeStateReference(seed + 0x600),
|
|
26
27
|
makeGlobalVariables((seed += 0x700), {
|
|
27
28
|
...(blockNumber ? { blockNumber: BlockNumber(blockNumber) } : {}),
|
|
@@ -27,6 +27,8 @@ export class L2BlockHeader {
|
|
|
27
27
|
public lastArchive: AppendOnlyTreeSnapshot,
|
|
28
28
|
public blobsHash: Fr,
|
|
29
29
|
public inHash: Fr,
|
|
30
|
+
/** Root of the epoch out hash tree. Leaves are the out hashes of this block and all previous blocks in the epoch. */
|
|
31
|
+
public epochOutHash: Fr,
|
|
30
32
|
/** State reference. */
|
|
31
33
|
public state: StateReference,
|
|
32
34
|
/** Global variables of an L2 block. */
|
|
@@ -47,6 +49,7 @@ export class L2BlockHeader {
|
|
|
47
49
|
lastArchive: AppendOnlyTreeSnapshot.schema,
|
|
48
50
|
blobsHash: schemas.Fr,
|
|
49
51
|
inHash: schemas.Fr,
|
|
52
|
+
epochOutHash: schemas.Fr,
|
|
50
53
|
state: StateReference.schema,
|
|
51
54
|
globalVariables: GlobalVariables.schema,
|
|
52
55
|
totalFees: schemas.Fr,
|
|
@@ -62,6 +65,7 @@ export class L2BlockHeader {
|
|
|
62
65
|
fields.lastArchive,
|
|
63
66
|
fields.blobsHash,
|
|
64
67
|
fields.inHash,
|
|
68
|
+
fields.epochOutHash,
|
|
65
69
|
fields.state,
|
|
66
70
|
fields.globalVariables,
|
|
67
71
|
fields.totalFees,
|
|
@@ -88,6 +92,7 @@ export class L2BlockHeader {
|
|
|
88
92
|
this.lastArchive.getSize() +
|
|
89
93
|
this.blobsHash.size +
|
|
90
94
|
this.inHash.size +
|
|
95
|
+
this.epochOutHash.size +
|
|
91
96
|
this.state.getSize() +
|
|
92
97
|
this.globalVariables.getSize() +
|
|
93
98
|
this.totalFees.size +
|
|
@@ -116,6 +121,7 @@ export class L2BlockHeader {
|
|
|
116
121
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
117
122
|
reader.readObject(Fr),
|
|
118
123
|
reader.readObject(Fr),
|
|
124
|
+
reader.readObject(Fr),
|
|
119
125
|
reader.readObject(StateReference),
|
|
120
126
|
reader.readObject(GlobalVariables),
|
|
121
127
|
reader.readObject(Fr),
|
|
@@ -132,6 +138,7 @@ export class L2BlockHeader {
|
|
|
132
138
|
AppendOnlyTreeSnapshot.fromFields(reader),
|
|
133
139
|
reader.readField(),
|
|
134
140
|
reader.readField(),
|
|
141
|
+
reader.readField(),
|
|
135
142
|
StateReference.fromFields(reader),
|
|
136
143
|
GlobalVariables.fromFields(reader),
|
|
137
144
|
reader.readField(),
|
|
@@ -146,6 +153,7 @@ export class L2BlockHeader {
|
|
|
146
153
|
lastArchive: AppendOnlyTreeSnapshot.empty(),
|
|
147
154
|
blobsHash: Fr.ZERO,
|
|
148
155
|
inHash: Fr.ZERO,
|
|
156
|
+
epochOutHash: Fr.ZERO,
|
|
149
157
|
state: StateReference.empty(),
|
|
150
158
|
globalVariables: GlobalVariables.empty(),
|
|
151
159
|
totalFees: Fr.ZERO,
|
|
@@ -161,6 +169,7 @@ export class L2BlockHeader {
|
|
|
161
169
|
this.lastArchive.isEmpty() &&
|
|
162
170
|
this.blobsHash.isZero() &&
|
|
163
171
|
this.inHash.isZero() &&
|
|
172
|
+
this.epochOutHash.isZero() &&
|
|
164
173
|
this.state.isEmpty() &&
|
|
165
174
|
this.globalVariables.isEmpty() &&
|
|
166
175
|
this.totalFees.isZero() &&
|
|
@@ -188,6 +197,7 @@ export class L2BlockHeader {
|
|
|
188
197
|
this.blockHeadersHash,
|
|
189
198
|
this.blobsHash,
|
|
190
199
|
this.inHash,
|
|
200
|
+
this.epochOutHash,
|
|
191
201
|
this.globalVariables.slotNumber,
|
|
192
202
|
this.globalVariables.timestamp,
|
|
193
203
|
this.globalVariables.coinbase,
|
|
@@ -213,6 +223,7 @@ export class L2BlockHeader {
|
|
|
213
223
|
lastArchive: this.lastArchive.root.toString(),
|
|
214
224
|
blobsHash: this.blobsHash.toString(),
|
|
215
225
|
inHash: this.inHash.toString(),
|
|
226
|
+
epochOutHash: this.epochOutHash.toString(),
|
|
216
227
|
state: this.state.toInspect(),
|
|
217
228
|
globalVariables: this.globalVariables.toInspect(),
|
|
218
229
|
totalFees: this.totalFees.toBigInt(),
|
|
@@ -227,6 +238,7 @@ export class L2BlockHeader {
|
|
|
227
238
|
lastArchive: ${inspect(this.lastArchive)},
|
|
228
239
|
blobsHash: ${inspect(this.blobsHash)},
|
|
229
240
|
inHash: ${inspect(this.inHash)},
|
|
241
|
+
epochOutHash: ${inspect(this.epochOutHash)},
|
|
230
242
|
state.l1ToL2MessageTree: ${inspect(this.state.l1ToL2MessageTree)},
|
|
231
243
|
state.noteHashTree: ${inspect(this.state.partial.noteHashTree)},
|
|
232
244
|
state.nullifierTree: ${inspect(this.state.partial.nullifierTree)},
|
|
@@ -244,6 +256,7 @@ export class L2BlockHeader {
|
|
|
244
256
|
this.lastArchive.equals(other.lastArchive) &&
|
|
245
257
|
this.blobsHash.equals(other.blobsHash) &&
|
|
246
258
|
this.inHash.equals(other.inHash) &&
|
|
259
|
+
this.epochOutHash.equals(other.epochOutHash) &&
|
|
247
260
|
this.state.equals(other.state) &&
|
|
248
261
|
this.globalVariables.equals(other.globalVariables) &&
|
|
249
262
|
this.totalFees.equals(other.totalFees) &&
|
|
@@ -11,9 +11,13 @@ import { BlockHeader } from '../tx/block_header.js';
|
|
|
11
11
|
import { Body } from './body.js';
|
|
12
12
|
import type { L2BlockInfo } from './l2_block_info.js';
|
|
13
13
|
|
|
14
|
+
// TODO(palla/mbps): Delete the existing `L2Block` class and rename this to `L2Block`.
|
|
15
|
+
// TODO(palla/mbps): Consider moving the checkpointNumber and indexWithinCheckpoint to the header:
|
|
16
|
+
// if the blockNumber is there, why not these as well? Consider whether they should be part of the
|
|
17
|
+
// circuits structs though.
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* An L2 block with a header and a body.
|
|
16
|
-
* TODO: Delete the existing `L2Block` class and rename this to `L2Block`.
|
|
17
21
|
*/
|
|
18
22
|
export class L2BlockNew {
|
|
19
23
|
constructor(
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
BlockNumber,
|
|
3
3
|
BlockNumberSchema,
|
|
4
4
|
CheckpointNumber,
|
|
5
|
+
CheckpointNumberSchema,
|
|
5
6
|
type EpochNumber,
|
|
6
7
|
type SlotNumber,
|
|
7
8
|
} from '@aztec/foundation/branded-types';
|
|
@@ -14,6 +15,7 @@ import { z } from 'zod';
|
|
|
14
15
|
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
15
16
|
import type { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
16
17
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
18
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
17
19
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
18
20
|
import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
|
|
19
21
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
@@ -21,7 +23,7 @@ import type { TxReceipt } from '../tx/tx_receipt.js';
|
|
|
21
23
|
import { type CheckpointedL2Block, PublishedL2Block } from './checkpointed_l2_block.js';
|
|
22
24
|
import type { L2Block } from './l2_block.js';
|
|
23
25
|
import type { L2BlockNew } from './l2_block_new.js';
|
|
24
|
-
import type {
|
|
26
|
+
import type { ValidateCheckpointNegativeResult, ValidateCheckpointResult } from './validate_block_result.js';
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Interface of classes allowing for the retrieval of L2 blocks.
|
|
@@ -66,6 +68,8 @@ export interface L2BlockSource {
|
|
|
66
68
|
*/
|
|
67
69
|
getCheckpointedBlock(number: BlockNumber): Promise<CheckpointedL2Block | undefined>;
|
|
68
70
|
|
|
71
|
+
getCheckpointedBlocks(from: BlockNumber, limit: number, proven?: boolean): Promise<CheckpointedL2Block[]>;
|
|
72
|
+
|
|
69
73
|
/**
|
|
70
74
|
* Retrieves a collection of published checkpoints
|
|
71
75
|
* @param checkpointNumber The first checkpoint to be retrieved
|
|
@@ -161,10 +165,10 @@ export interface L2BlockSource {
|
|
|
161
165
|
isPendingChainInvalid(): Promise<boolean>;
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
|
-
* Returns the status of the pending chain validation. If the chain is invalid, reports the earliest consecutive
|
|
165
|
-
* that is invalid, along with the reason for being invalid, which can be used to trigger an invalidation.
|
|
168
|
+
* Returns the status of the pending chain validation. If the chain is invalid, reports the earliest consecutive
|
|
169
|
+
* checkpoint that is invalid, along with the reason for being invalid, which can be used to trigger an invalidation.
|
|
166
170
|
*/
|
|
167
|
-
getPendingChainValidationStatus(): Promise<
|
|
171
|
+
getPendingChainValidationStatus(): Promise<ValidateCheckpointResult>;
|
|
168
172
|
|
|
169
173
|
/** Force a sync. */
|
|
170
174
|
syncImmediate(): Promise<void>;
|
|
@@ -179,6 +183,10 @@ export interface L2BlockSource {
|
|
|
179
183
|
*/
|
|
180
184
|
getBlock(number: BlockNumber): Promise<L2Block | undefined>;
|
|
181
185
|
|
|
186
|
+
getL2BlockNew(number: BlockNumber): Promise<L2BlockNew | undefined>;
|
|
187
|
+
|
|
188
|
+
getL2BlocksNew(from: BlockNumber, limit: number, proven?: boolean): Promise<L2BlockNew[]>;
|
|
189
|
+
|
|
182
190
|
/**
|
|
183
191
|
* Returns all blocks for a given epoch.
|
|
184
192
|
* @dev Use this method only with recent epochs, since it walks the block list backwards.
|
|
@@ -232,24 +240,46 @@ export interface L2BlockSink {
|
|
|
232
240
|
export type ArchiverEmitter = TypedEventEmitter<{
|
|
233
241
|
[L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockPruneEvent) => void;
|
|
234
242
|
[L2BlockSourceEvents.L2BlockProven]: (args: L2BlockProvenEvent) => void;
|
|
235
|
-
[L2BlockSourceEvents.
|
|
243
|
+
[L2BlockSourceEvents.InvalidAttestationsCheckpointDetected]: (args: InvalidCheckpointDetectedEvent) => void;
|
|
244
|
+
[L2BlockSourceEvents.L2BlocksCheckpointed]: (args: L2CheckpointEvent) => void;
|
|
236
245
|
}>;
|
|
237
|
-
export interface L2BlockSourceEventEmitter extends L2BlockSource
|
|
246
|
+
export interface L2BlockSourceEventEmitter extends L2BlockSource {
|
|
247
|
+
events: ArchiverEmitter;
|
|
248
|
+
}
|
|
238
249
|
|
|
239
250
|
/**
|
|
240
251
|
* Identifier for L2 block tags.
|
|
241
|
-
* -
|
|
252
|
+
* - proposed: Latest block proposed on L2.
|
|
253
|
+
* - checkpointed: Checkpointed block on L1.
|
|
242
254
|
* - proven: Proven block on L1.
|
|
243
255
|
* - finalized: Proven block on a finalized L1 block (not implemented, set to proven for now).
|
|
244
256
|
*/
|
|
245
|
-
export type L2BlockTag = '
|
|
257
|
+
export type L2BlockTag = 'proposed' | 'checkpointed' | 'proven' | 'finalized';
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Reason for L2 block prune.
|
|
261
|
+
* - uncheckpointed: L2 blocks were pruned due to a failure to checkpoint.
|
|
262
|
+
* - unproven: L2 blocks were pruned due to a failure to prove.
|
|
263
|
+
*/
|
|
264
|
+
export type L2BlockPruneReason = 'uncheckpointed' | 'unproven';
|
|
246
265
|
|
|
247
266
|
/** Tips of the L2 chain. */
|
|
248
|
-
export type L2Tips =
|
|
267
|
+
export type L2Tips = {
|
|
268
|
+
proposed: L2BlockId;
|
|
269
|
+
checkpointed: L2TipId;
|
|
270
|
+
proven: L2TipId;
|
|
271
|
+
finalized: L2TipId;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export const GENESIS_CHECKPOINT_HEADER_HASH = CheckpointHeader.empty().hash();
|
|
249
275
|
|
|
250
276
|
/** Identifies a block by number and hash. */
|
|
251
277
|
export type L2BlockId = { number: BlockNumber; hash: string };
|
|
252
278
|
|
|
279
|
+
export type CheckpointId = { number: CheckpointNumber; hash: string };
|
|
280
|
+
|
|
281
|
+
export type L2TipId = { block: L2BlockId; checkpoint: CheckpointId };
|
|
282
|
+
|
|
253
283
|
/** Creates an L2 block id */
|
|
254
284
|
export function makeL2BlockId(number: BlockNumber, hash?: string): L2BlockId {
|
|
255
285
|
if (number !== 0 && !hash) {
|
|
@@ -258,21 +288,38 @@ export function makeL2BlockId(number: BlockNumber, hash?: string): L2BlockId {
|
|
|
258
288
|
return { number, hash: hash! };
|
|
259
289
|
}
|
|
260
290
|
|
|
291
|
+
/** Creates an L2 checkpoint id */
|
|
292
|
+
export function makeL2CheckpointId(number: CheckpointNumber, hash: string): CheckpointId {
|
|
293
|
+
return { number, hash };
|
|
294
|
+
}
|
|
295
|
+
|
|
261
296
|
const L2BlockIdSchema = z.object({
|
|
262
297
|
number: BlockNumberSchema,
|
|
263
298
|
hash: z.string(),
|
|
264
299
|
});
|
|
265
300
|
|
|
301
|
+
const L2CheckpointIdSchema = z.object({
|
|
302
|
+
number: CheckpointNumberSchema,
|
|
303
|
+
hash: z.string(),
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
const L2TipIdSchema = z.object({
|
|
307
|
+
block: L2BlockIdSchema,
|
|
308
|
+
checkpoint: L2CheckpointIdSchema,
|
|
309
|
+
});
|
|
310
|
+
|
|
266
311
|
export const L2TipsSchema = z.object({
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
312
|
+
proposed: L2BlockIdSchema,
|
|
313
|
+
checkpointed: L2TipIdSchema,
|
|
314
|
+
proven: L2TipIdSchema,
|
|
315
|
+
finalized: L2TipIdSchema,
|
|
270
316
|
});
|
|
271
317
|
|
|
272
318
|
export enum L2BlockSourceEvents {
|
|
273
319
|
L2PruneDetected = 'l2PruneDetected',
|
|
274
320
|
L2BlockProven = 'l2BlockProven',
|
|
275
|
-
|
|
321
|
+
L2BlocksCheckpointed = 'l2BlocksCheckpointed',
|
|
322
|
+
InvalidAttestationsCheckpointDetected = 'invalidCheckpointDetected',
|
|
276
323
|
}
|
|
277
324
|
|
|
278
325
|
export type L2BlockProvenEvent = {
|
|
@@ -285,10 +332,15 @@ export type L2BlockProvenEvent = {
|
|
|
285
332
|
export type L2BlockPruneEvent = {
|
|
286
333
|
type: 'l2PruneDetected';
|
|
287
334
|
epochNumber: EpochNumber;
|
|
288
|
-
blocks:
|
|
335
|
+
blocks: L2BlockNew[];
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export type L2CheckpointEvent = {
|
|
339
|
+
type: 'l2BlocksCheckpointed';
|
|
340
|
+
checkpoint: PublishedCheckpoint;
|
|
289
341
|
};
|
|
290
342
|
|
|
291
|
-
export type
|
|
292
|
-
type: '
|
|
293
|
-
validationResult:
|
|
343
|
+
export type InvalidCheckpointDetectedEvent = {
|
|
344
|
+
type: 'invalidCheckpointDetected';
|
|
345
|
+
validationResult: ValidateCheckpointNegativeResult;
|
|
294
346
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PublishedCheckpoint } from '../../checkpoint/published_checkpoint.js';
|
|
2
|
+
import type { L2BlockNew } from '../l2_block_new.js';
|
|
3
|
+
import type { CheckpointId, L2BlockId, L2BlockPruneReason, L2Tips } from '../l2_block_source.js';
|
|
3
4
|
|
|
4
5
|
/** Interface to the local view of the chain. Implemented by world-state and l2-tips-store. */
|
|
5
6
|
export interface L2BlockStreamLocalDataProvider {
|
|
@@ -15,11 +16,22 @@ export interface L2BlockStreamEventHandler {
|
|
|
15
16
|
export type L2BlockStreamEvent =
|
|
16
17
|
| /** Emits blocks added to the chain. */ {
|
|
17
18
|
type: 'blocks-added';
|
|
18
|
-
blocks:
|
|
19
|
+
blocks: L2BlockNew[];
|
|
19
20
|
}
|
|
20
|
-
| /**
|
|
21
|
+
| /** Emits checkpoints published to L1. */ {
|
|
22
|
+
type: 'chain-checkpointed';
|
|
23
|
+
checkpoint: PublishedCheckpoint;
|
|
24
|
+
block: L2BlockId;
|
|
25
|
+
}
|
|
26
|
+
| /**
|
|
27
|
+
* Reports last correct block (new tip of the proposed chain). Note that this is not necessarily the anchor block
|
|
28
|
+
* that will be used in the transaction - if the chain has already moved past the reorg, we'll also see blocks-added
|
|
29
|
+
* events that will push the anchor block forward.
|
|
30
|
+
*/ {
|
|
21
31
|
type: 'chain-pruned';
|
|
32
|
+
reason: L2BlockPruneReason;
|
|
22
33
|
block: L2BlockId;
|
|
34
|
+
checkpoint: CheckpointId;
|
|
23
35
|
}
|
|
24
36
|
| /** Reports new proven block. */ {
|
|
25
37
|
type: 'chain-proven';
|