@aztec-labs/stdlib 6.0.0-nightly.20260922 → 6.0.0-nightly.20260923
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/block/proposal/committee_attestation.d.ts +1 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.js +5 -9
- 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 +2 -2
- package/dest/block/validate_block_result.d.ts +2 -2
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +1 -4
- package/dest/checkpoint/checkpoint_data.d.ts +9 -1
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +3 -0
- package/dest/checkpoint/published_checkpoint.d.ts +22 -3
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +23 -5
- package/dest/interfaces/proving-job.d.ts +70 -70
- package/package.json +6 -6
- package/src/block/proposal/committee_attestation.ts +5 -5
- package/src/block/test/l2_tips_store_test_suite.ts +7 -1
- package/src/block/validate_block_result.ts +4 -7
- package/src/checkpoint/checkpoint_data.ts +11 -0
- package/src/checkpoint/published_checkpoint.ts +26 -1
|
@@ -27,4 +27,4 @@ export declare class CommitteeAttestation {
|
|
|
27
27
|
equals(other: CommitteeAttestation): boolean;
|
|
28
28
|
toViem(): ViemCommitteeAttestation;
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWl0dGVlX2F0dGVzdGF0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmxvY2svcHJvcG9zYWwvY29tbWl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Bb0IsQ0FLckU7SUFFRCxNQUFNLENBQUMsTUFBTSxJQUFJLG9CQUFvQixDQUdwQztJQUVELE1BQU0sQ0FBQyxLQUFLLElBQUksb0JBQW9CLENBRW5DO0lBRUQsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUseUJBQXlCLEVBQUUsYUFBYSxFQUFFLE1BQU0sR0FBRyxvQkFBb0IsRUFBRSxDQTRDbEc7SUFFRCxRQUFRLElBQUksTUFBTSxDQUVqQjtJQUVELE1BQU0sQ0FBQyxLQUFLLEVBQUUsb0JBQW9CLEdBQUcsT0FBTyxDQUUzQztJQUVELE1BQU0sSUFBSSx3QkFBd0IsQ0FLakM7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE1G,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAEjC,qBAAa,oBAAoB;aAEb,OAAO,EAAE,UAAU;aACnB,SAAS,EAAE,SAAS;IAFtC,YACkB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,SAAS,EAClC;IAEJ,MAAM,KAAK,MAAM;;;;;;QAOhB;IAGD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB,CAE5D;IAGD,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB,CAE9F;IAED,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,oBAAoB,CAE/D;IAED,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB,CAEpE;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,oBAAoB,CAKrE;IAED,MAAM,CAAC,MAAM,IAAI,oBAAoB,CAGpC;IAED,MAAM,CAAC,KAAK,IAAI,oBAAoB,CAEnC;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,GAAG,oBAAoB,EAAE,CA4ClG;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAE3C;IAED,MAAM,IAAI,wBAAwB,CAKjC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec-labs/foundation/buffer';
|
|
1
2
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
2
3
|
import { Signature } from '@aztec-labs/foundation/eth-signature';
|
|
3
4
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
@@ -59,13 +60,9 @@ export class CommitteeAttestation {
|
|
|
59
60
|
throw new Error(`Insufficient data for signature at position ${i}`);
|
|
60
61
|
}
|
|
61
62
|
const v = dataBuffer[dataIndex];
|
|
62
|
-
const r =
|
|
63
|
-
const s =
|
|
64
|
-
const signature = Signature
|
|
65
|
-
r,
|
|
66
|
-
s,
|
|
67
|
-
v
|
|
68
|
-
});
|
|
63
|
+
const r = Buffer32.fromBuffer(dataBuffer.subarray(dataIndex + 1, dataIndex + 33));
|
|
64
|
+
const s = Buffer32.fromBuffer(dataBuffer.subarray(dataIndex + 33, dataIndex + 65));
|
|
65
|
+
const signature = new Signature(r, s, v);
|
|
69
66
|
// For signed attestations, we use a zero address as the address is recovered from the signature
|
|
70
67
|
attestations.push(new CommitteeAttestation(EthAddress.ZERO, signature));
|
|
71
68
|
dataIndex += 65;
|
|
@@ -74,8 +71,7 @@ export class CommitteeAttestation {
|
|
|
74
71
|
if (dataIndex + 20 > dataBuffer.length) {
|
|
75
72
|
throw new Error(`Insufficient data for address at position ${i}`);
|
|
76
73
|
}
|
|
77
|
-
const
|
|
78
|
-
const address = EthAddress.fromString(`0x${addressBytes.toString('hex')}`);
|
|
74
|
+
const address = EthAddress.fromBuffer(dataBuffer.subarray(dataIndex, dataIndex + 20));
|
|
79
75
|
// For address-only attestations, use empty signature
|
|
80
76
|
attestations.push(new CommitteeAttestation(address, Signature.empty()));
|
|
81
77
|
dataIndex += 20;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { L2TipsStore } from '../l2_block_stream/index.js';
|
|
2
2
|
export declare function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>): void;
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDJfdGlwc19zdG9yZV90ZXN0X3N1aXRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmxvY2svdGVzdC9sMl90aXBzX3N0b3JlX3Rlc3Rfc3VpdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUJBLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRS9ELHdCQUFnQixlQUFlLENBQUMsYUFBYSxFQUFFLE1BQU0sT0FBTyxDQUFDLFdBQVcsQ0FBQyxRQXd3QnhFIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_tips_store_test_suite.d.ts","sourceRoot":"","sources":["../../../src/block/test/l2_tips_store_test_suite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"l2_tips_store_test_suite.d.ts","sourceRoot":"","sources":["../../../src/block/test/l2_tips_store_test_suite.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,QAwwBxE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlockNumber, CheckpointNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
2
|
import { times } from '@aztec-labs/foundation/collection';
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
|
-
import { GENESIS_CHECKPOINT_HEADER_HASH, L2Block } from '@aztec-labs/stdlib/block';
|
|
4
|
+
import { CommitteeAttestationsAndSigners, GENESIS_CHECKPOINT_HEADER_HASH, L2Block } from '@aztec-labs/stdlib/block';
|
|
5
5
|
import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec-labs/stdlib/checkpoint';
|
|
6
6
|
import { BlockHeader } from '@aztec-labs/stdlib/tx';
|
|
7
7
|
import { expect } from 'vitest';
|
|
@@ -82,7 +82,7 @@ export function testL2TipsStore(makeTipsStore) {
|
|
|
82
82
|
for (const block of blocks){
|
|
83
83
|
blockToCheckpoint.set(block.number, checkpointNumber);
|
|
84
84
|
}
|
|
85
|
-
return new PublishedCheckpoint(checkpoint, L1PublishedData.random(), []);
|
|
85
|
+
return new PublishedCheckpoint(checkpoint, L1PublishedData.random(), [], CommitteeAttestationsAndSigners.packAttestations([]));
|
|
86
86
|
};
|
|
87
87
|
/** Creates a thin chain-checkpointed event carrying the block + checkpoint ids of the checkpoint's last block. */ const makeCheckpointedEvent = async (published)=>{
|
|
88
88
|
const lastBlock = published.checkpoint.blocks.at(-1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ViemCommitteeAttestations } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
2
2
|
import { EpochNumber } from '@aztec-labs/foundation/branded-types';
|
|
3
3
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
4
4
|
import { type ZodFor } from '@aztec-labs/foundation/schemas';
|
|
@@ -62,4 +62,4 @@ export type ValidateCheckpointResult = {
|
|
|
62
62
|
export declare const ValidateCheckpointResultSchema: ZodFor<ValidateCheckpointResult>;
|
|
63
63
|
export declare function serializeValidateCheckpointResult(result: ValidateCheckpointResult): Buffer;
|
|
64
64
|
export declare function deserializeValidateCheckpointResult(bufferOrReader: Buffer | BufferReader): ValidateCheckpointResult;
|
|
65
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
65
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVfYmxvY2tfcmVzdWx0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmxvY2svdmFsaWRhdGVfYmxvY2tfcmVzdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLHlCQUF5QixFQUUvQixNQUFNLHVEQUF1RCxDQUFDO0FBQy9ELE9BQU8sRUFBRSxXQUFXLEVBQXFCLE1BQU0sc0NBQXNDLENBQUM7QUFDdEYsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBQ2hFLE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBVyxNQUFNLGdDQUFnQyxDQUFDO0FBQ3RFLE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sa0NBQWtDLENBQUM7QUFJbkYsT0FBTyxFQUNMLEtBQUssY0FBYyxFQUlwQixNQUFNLGtDQUFrQyxDQUFDO0FBRTFDLE9BQU8s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BaUY7SUFDakYsTUFBTSxFQUFFLHFCQUFxQixDQUFDO0lBQzlCLHdFQUF3RTtJQUN4RSxZQUFZLEVBQUUsTUFBTSxDQUFDO0NBQ3RCLENBQUM7QUFFTix5REFBeUQ7QUFDekQsTUFBTSxNQUFNLHdCQUF3QixHQUFHO0lBQUUsS0FBSyxFQUFFLElBQUksQ0FBQTtDQUFFLEdBQUcsZ0NBQWdDLENBQUM7QUFFMUYsZUFBTyxNQUFNLDhCQUE4QixFQUFFLE1BQU0sQ0FBQyx3QkFBd0IsQ0F5QjFFLENBQUM7QUFFSCx3QkFBZ0IsaUNBQWlDLENBQUMsTUFBTSxFQUFFLHdCQUF3QixHQUFHLE1BQU0sQ0EyQjFGO0FBRUQsd0JBQWdCLG1DQUFtQyxDQUFDLGNBQWMsRUFBRSxNQUFNLEdBQUcsWUFBWSxHQUFHLHdCQUF3QixDQXNDbkgifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate_block_result.d.ts","sourceRoot":"","sources":["../../src/block/validate_block_result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"validate_block_result.d.ts","sourceRoot":"","sources":["../../src/block/validate_block_result.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAqB,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAInF,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,wDAAwD;AACxD,MAAM,MAAM,gCAAgC,GACxC;IACE,KAAK,EAAE,KAAK,CA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1
|
+
import { ViemCommitteeAttestationsSchema } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
1
2
|
import { EpochNumber, EpochNumberSchema } from '@aztec-labs/foundation/branded-types';
|
|
2
3
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
3
4
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
@@ -7,10 +8,6 @@ import { z } from 'zod';
|
|
|
7
8
|
import { CheckpointInfoSchema, deserializeCheckpointInfo, serializeCheckpointInfo } from '../checkpoint/checkpoint_info.js';
|
|
8
9
|
import { MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
9
10
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
10
|
-
/** Zod schema for the raw packed `CommitteeAttestations` viem tuple (two 0x-prefixed hex strings). */ const ViemCommitteeAttestationsSchema = z.object({
|
|
11
|
-
signatureIndices: schemas.HexStringWith0x,
|
|
12
|
-
signaturesOrAddresses: schemas.HexStringWith0x
|
|
13
|
-
});
|
|
14
11
|
export const ValidateCheckpointResultSchema = z.union([
|
|
15
12
|
z.object({
|
|
16
13
|
valid: z.literal(true)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ViemCommitteeAttestations } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
1
2
|
import { BlockNumber, CheckpointNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -15,6 +16,11 @@ export type CommonCheckpointData = {
|
|
|
15
16
|
/** Data stored with checkpoint data after publishing on l1 */
|
|
16
17
|
export type L1EnrichedCheckpointData = {
|
|
17
18
|
attestations: CommitteeAttestation[];
|
|
19
|
+
/**
|
|
20
|
+
* The packed `CommitteeAttestations` tuple exactly as posted to L1. {@link attestations} is what this tuple
|
|
21
|
+
* decodes to; only the tuple reproduces the `attestationsHash` the rollup stored at propose time.
|
|
22
|
+
*/
|
|
23
|
+
verbatimAttestations: ViemCommitteeAttestations;
|
|
18
24
|
l1: L1PublishedData;
|
|
19
25
|
};
|
|
20
26
|
/** Data stored alongside checkpoint data in storage */
|
|
@@ -86,6 +92,7 @@ export declare const CheckpointDataSchema: z.ZodPipe<z.ZodObject<{
|
|
|
86
92
|
address: import("@aztec-labs/foundation/eth-address").EthAddress;
|
|
87
93
|
signature: import("../block/proposal/committee_attestation.js").Signature;
|
|
88
94
|
}>>>;
|
|
95
|
+
verbatimAttestations: import("@aztec-labs/foundation/schemas").ZodFor<ViemCommitteeAttestations>;
|
|
89
96
|
l1: z.ZodPipe<z.ZodObject<{
|
|
90
97
|
blockNumber: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
91
98
|
timestamp: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
@@ -104,6 +111,7 @@ export declare const CheckpointDataSchema: z.ZodPipe<z.ZodObject<{
|
|
|
104
111
|
blockCount: number;
|
|
105
112
|
feeAssetPriceModifier: bigint;
|
|
106
113
|
attestations: CommitteeAttestation[];
|
|
114
|
+
verbatimAttestations: ViemCommitteeAttestations;
|
|
107
115
|
l1: L1PublishedData;
|
|
108
116
|
}>>;
|
|
109
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
117
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2twb2ludF9kYXRhLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2hlY2twb2ludC9jaGVja3BvaW50X2RhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLEtBQUsseUJBQXlCLEVBRS9CLE1BQU0sdURBQXVELENBQUM7QUFDL0QsT0FBTyxFQUNMLFdBQVcsRUFFWCxnQ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DAA+D;AAC/D,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,6BAA6B,GAAG,wBAAwB,CAAC;AAE7G;4DAC4D;AAC5D,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAExF;8FAC8F;AAC9F,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,GAAG,6BAA6B,GAAG,wBAAwB,CAAC;AAExH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;iBAUvC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0B9B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ViemCommitteeAttestationsSchema } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
1
2
|
import { BlockNumberSchema, CheckpointNumberSchema } from '@aztec-labs/foundation/branded-types';
|
|
2
3
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -25,6 +26,7 @@ export const CheckpointDataSchema = z.object({
|
|
|
25
26
|
blockCount: schemas.Integer,
|
|
26
27
|
feeAssetPriceModifier: schemas.BigInt,
|
|
27
28
|
attestations: z.array(CommitteeAttestation.schema),
|
|
29
|
+
verbatimAttestations: ViemCommitteeAttestationsSchema,
|
|
28
30
|
l1: L1PublishedData.schema
|
|
29
31
|
}).transform((obj)=>({
|
|
30
32
|
checkpointNumber: obj.checkpointNumber,
|
|
@@ -35,5 +37,6 @@ export const CheckpointDataSchema = z.object({
|
|
|
35
37
|
blockCount: obj.blockCount,
|
|
36
38
|
feeAssetPriceModifier: obj.feeAssetPriceModifier,
|
|
37
39
|
attestations: obj.attestations,
|
|
40
|
+
verbatimAttestations: obj.verbatimAttestations,
|
|
38
41
|
l1: obj.l1
|
|
39
42
|
}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ViemCommitteeAttestations } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
1
2
|
import { BufferReader } from '@aztec-labs/foundation/serialize';
|
|
2
3
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -29,13 +30,29 @@ export declare class PublishedCheckpoint {
|
|
|
29
30
|
l1: L1PublishedData;
|
|
30
31
|
/** The attestations for the last block in the checkpoint. */
|
|
31
32
|
attestations: CommitteeAttestation[];
|
|
33
|
+
/**
|
|
34
|
+
* The packed `CommitteeAttestations` tuple exactly as it appeared in the propose calldata. The rollup
|
|
35
|
+
* stores `keccak256(abi.encode(tuple))` and re-checks it when an epoch proof or an invalidation is
|
|
36
|
+
* submitted, so the tuple can only be reproduced from these bytes: repacking the decoded
|
|
37
|
+
* {@link attestations} zeroes bitmap bits past the committee size and canonicalizes recovery bytes,
|
|
38
|
+
* neither of which any decoder reads but both of which the stored hash covers.
|
|
39
|
+
*/
|
|
40
|
+
verbatimAttestations: ViemCommitteeAttestations;
|
|
32
41
|
constructor(
|
|
33
42
|
/** The checkpoint itself. */
|
|
34
43
|
checkpoint: Checkpoint,
|
|
35
44
|
/** Info on when this checkpoint was published on L1. */
|
|
36
45
|
l1: L1PublishedData,
|
|
37
46
|
/** The attestations for the last block in the checkpoint. */
|
|
38
|
-
attestations: CommitteeAttestation[]
|
|
47
|
+
attestations: CommitteeAttestation[],
|
|
48
|
+
/**
|
|
49
|
+
* The packed `CommitteeAttestations` tuple exactly as it appeared in the propose calldata. The rollup
|
|
50
|
+
* stores `keccak256(abi.encode(tuple))` and re-checks it when an epoch proof or an invalidation is
|
|
51
|
+
* submitted, so the tuple can only be reproduced from these bytes: repacking the decoded
|
|
52
|
+
* {@link attestations} zeroes bitmap bits past the committee size and canonicalizes recovery bytes,
|
|
53
|
+
* neither of which any decoder reads but both of which the stored hash covers.
|
|
54
|
+
*/
|
|
55
|
+
verbatimAttestations: ViemCommitteeAttestations);
|
|
39
56
|
static get schema(): z.ZodPipe<z.ZodObject<{
|
|
40
57
|
checkpoint: z.ZodPipe<z.ZodObject<{
|
|
41
58
|
archive: z.ZodPipe<z.ZodObject<{
|
|
@@ -90,14 +107,16 @@ export declare class PublishedCheckpoint {
|
|
|
90
107
|
address: import("@aztec-labs/foundation/eth-address").EthAddress;
|
|
91
108
|
signature: import("../block/proposal/committee_attestation.js").Signature;
|
|
92
109
|
}>>>;
|
|
110
|
+
verbatimAttestations: import("@aztec-labs/foundation/schemas").ZodFor<ViemCommitteeAttestations>;
|
|
93
111
|
}, z.core.$strip>, z.ZodTransform<PublishedCheckpoint, {
|
|
94
112
|
checkpoint: Checkpoint;
|
|
95
113
|
l1: L1PublishedData;
|
|
96
114
|
attestations: CommitteeAttestation[];
|
|
115
|
+
verbatimAttestations: ViemCommitteeAttestations;
|
|
97
116
|
}>>;
|
|
98
|
-
static getFields(fields: FieldsOf<PublishedCheckpoint>): readonly [Checkpoint, L1PublishedData, CommitteeAttestation[]];
|
|
117
|
+
static getFields(fields: FieldsOf<PublishedCheckpoint>): readonly [Checkpoint, L1PublishedData, CommitteeAttestation[], ViemCommitteeAttestations];
|
|
99
118
|
static from(fields: FieldsOf<PublishedCheckpoint>): PublishedCheckpoint;
|
|
100
119
|
static fromBuffer(bufferOrReader: Buffer | BufferReader): PublishedCheckpoint;
|
|
101
120
|
toBuffer(): Buffer;
|
|
102
121
|
}
|
|
103
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
122
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGlzaGVkX2NoZWNrcG9pbnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jaGVja3BvaW50L3B1Ymxpc2hlZF9jaGVja3BvaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFDTCxLQUFLLHlCQUF5QixFQUUvQixNQUFNLHVEQUF1RCxDQUFDO0FBSS9ELE9BQU8sRUFBRSxZQUFZLE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M3Qix3REFBd0Q7SUFDakQsRUFBRSxFQUFFLGVBQWU7SUFDMUIsNkRBQTZEO0lBQ3RELFlBQVksRUFBRSxvQkFBb0IsRUFBRTtJQUMzQzs7Ozs7O09BTUc7SUFDSSxvQkFBb0IsRUFBRSx5QkFBeUIsRUFDcEQ7SUFFSixNQUFNLEtBQUssTUFBTTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O1FBU2hCO0lBRUQsTUFBTSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsUUFBUSxDQUFDLG1CQUFtQixDQUFDLDZGQUVyRDtJQUVELE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyx1QkFFaEQ7SUFFRCxNQUFNLENBQUMsVUFBVSxDQUFDLGNBQWMsRUFBRSxNQUFNLEdBQUcsWUFBWSxHQUFHLG1CQUFtQixDQWlCNUU7SUFFTSxRQUFRLElBQUksTUFBTSxDQWV4QjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published_checkpoint.d.ts","sourceRoot":"","sources":["../../src/checkpoint/published_checkpoint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"published_checkpoint.d.ts","sourceRoot":"","sources":["../../src/checkpoint/published_checkpoint.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,uDAAuD,CAAC;AAI/D,OAAO,EAAE,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AAEnF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAA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@
|
|
|
1
1
|
// Ignoring import issue to fix portable inferred type issue in zod schema
|
|
2
|
+
import { ViemCommitteeAttestationsSchema } from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
2
3
|
import { Buffer32 } from '@aztec-labs/foundation/buffer';
|
|
3
4
|
import { randomBigInt } from '@aztec-labs/foundation/crypto/random';
|
|
4
5
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
5
6
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
7
|
+
import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
|
|
6
8
|
import { z } from 'zod';
|
|
7
9
|
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
8
10
|
import { MAX_BLOCK_HASH_STRING_LENGTH, MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
@@ -44,23 +46,33 @@ export class PublishedCheckpoint {
|
|
|
44
46
|
checkpoint;
|
|
45
47
|
l1;
|
|
46
48
|
attestations;
|
|
47
|
-
|
|
49
|
+
verbatimAttestations;
|
|
50
|
+
constructor(/** The checkpoint itself. */ checkpoint, /** Info on when this checkpoint was published on L1. */ l1, /** The attestations for the last block in the checkpoint. */ attestations, /**
|
|
51
|
+
* The packed `CommitteeAttestations` tuple exactly as it appeared in the propose calldata. The rollup
|
|
52
|
+
* stores `keccak256(abi.encode(tuple))` and re-checks it when an epoch proof or an invalidation is
|
|
53
|
+
* submitted, so the tuple can only be reproduced from these bytes: repacking the decoded
|
|
54
|
+
* {@link attestations} zeroes bitmap bits past the committee size and canonicalizes recovery bytes,
|
|
55
|
+
* neither of which any decoder reads but both of which the stored hash covers.
|
|
56
|
+
*/ verbatimAttestations){
|
|
48
57
|
this.checkpoint = checkpoint;
|
|
49
58
|
this.l1 = l1;
|
|
50
59
|
this.attestations = attestations;
|
|
60
|
+
this.verbatimAttestations = verbatimAttestations;
|
|
51
61
|
}
|
|
52
62
|
static get schema() {
|
|
53
63
|
return z.object({
|
|
54
64
|
checkpoint: Checkpoint.schema,
|
|
55
65
|
l1: L1PublishedData.schema,
|
|
56
|
-
attestations: z.array(CommitteeAttestation.schema)
|
|
66
|
+
attestations: z.array(CommitteeAttestation.schema),
|
|
67
|
+
verbatimAttestations: ViemCommitteeAttestationsSchema
|
|
57
68
|
}).transform((obj)=>PublishedCheckpoint.from(obj));
|
|
58
69
|
}
|
|
59
70
|
static getFields(fields) {
|
|
60
71
|
return [
|
|
61
72
|
fields.checkpoint,
|
|
62
73
|
fields.l1,
|
|
63
|
-
fields.attestations
|
|
74
|
+
fields.attestations,
|
|
75
|
+
fields.verbatimAttestations
|
|
64
76
|
];
|
|
65
77
|
}
|
|
66
78
|
static from(fields) {
|
|
@@ -73,9 +85,15 @@ export class PublishedCheckpoint {
|
|
|
73
85
|
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
74
86
|
const l1Timestamp = reader.readBigInt();
|
|
75
87
|
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
76
|
-
|
|
88
|
+
const verbatimAttestations = {
|
|
89
|
+
signatureIndices: bufferToHex(reader.readBuffer()),
|
|
90
|
+
signaturesOrAddresses: bufferToHex(reader.readBuffer())
|
|
91
|
+
};
|
|
92
|
+
return new PublishedCheckpoint(checkpoint, new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash), attestations, verbatimAttestations);
|
|
77
93
|
}
|
|
78
94
|
toBuffer() {
|
|
79
|
-
|
|
95
|
+
const signatureIndices = hexToBuffer(this.verbatimAttestations.signatureIndices);
|
|
96
|
+
const signaturesOrAddresses = hexToBuffer(this.verbatimAttestations.signaturesOrAddresses);
|
|
97
|
+
return serializeToBuffer(this.checkpoint, this.l1.blockNumber, this.l1.blockHash, this.l1.timestamp, this.attestations.length, this.attestations, signatureIndices.length, signatureIndices, signaturesOrAddresses.length, signaturesOrAddresses);
|
|
80
98
|
}
|
|
81
99
|
}
|
|
@@ -414,18 +414,6 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
414
414
|
}>>;
|
|
415
415
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
416
416
|
leafPreimage: z.ZodPipe<z.ZodObject<{
|
|
417
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
418
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
419
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
420
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
421
|
-
}>>;
|
|
422
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
423
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
424
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
425
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
426
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
427
|
-
nextIndex: bigint;
|
|
428
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
429
417
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
430
418
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
431
419
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -439,6 +427,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
439
427
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
440
428
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
441
429
|
nextIndex: bigint;
|
|
430
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
431
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
432
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
433
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
434
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
435
|
+
}>>;
|
|
436
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
437
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
438
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
439
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
440
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
441
|
+
nextIndex: bigint;
|
|
442
442
|
}>>;
|
|
443
443
|
}, z.core.$strip>, z.ZodTransform<{
|
|
444
444
|
readonly hintKey: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
@@ -459,18 +459,6 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
459
459
|
}>>;
|
|
460
460
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
461
461
|
leafPreimage: z.ZodPipe<z.ZodObject<{
|
|
462
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
463
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
464
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
465
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
466
|
-
}>>;
|
|
467
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
468
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
469
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
470
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
471
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
472
|
-
nextIndex: bigint;
|
|
473
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
474
462
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
475
463
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
476
464
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -484,6 +472,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
484
472
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
485
473
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
486
474
|
nextIndex: bigint;
|
|
475
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
476
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
477
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
478
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
479
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
480
|
+
}>>;
|
|
481
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
482
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
483
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
484
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
485
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
486
|
+
nextIndex: bigint;
|
|
487
487
|
}>>;
|
|
488
488
|
}, z.core.$strip>, z.ZodTransform<{
|
|
489
489
|
readonly hintKey: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
@@ -528,30 +528,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
528
528
|
}>>;
|
|
529
529
|
treeId: z.ZodNumber;
|
|
530
530
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
531
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
532
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
533
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
534
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
535
531
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
536
532
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
537
533
|
}, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
|
|
538
534
|
slot: import("@aztec-labs/foundation/schemas").Fr;
|
|
539
535
|
value: import("@aztec-labs/foundation/schemas").Fr;
|
|
536
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
537
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
538
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
539
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
540
540
|
}>>;
|
|
541
541
|
lowLeavesWitnessData: z.ZodObject<{
|
|
542
542
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
543
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
544
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
545
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
546
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
547
|
-
}>>;
|
|
548
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
549
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
550
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
551
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
552
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
553
|
-
nextIndex: bigint;
|
|
554
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
555
543
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
556
544
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
557
545
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -565,12 +553,7 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
565
553
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
566
554
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
567
555
|
nextIndex: bigint;
|
|
568
|
-
}
|
|
569
|
-
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
570
|
-
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
571
|
-
}, z.core.$strip>;
|
|
572
|
-
insertionWitnessData: z.ZodObject<{
|
|
573
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
556
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
574
557
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
575
558
|
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
576
559
|
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
@@ -582,7 +565,12 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
582
565
|
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
583
566
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
584
567
|
nextIndex: bigint;
|
|
585
|
-
}
|
|
568
|
+
}>>;
|
|
569
|
+
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
570
|
+
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
571
|
+
}, z.core.$strip>;
|
|
572
|
+
insertionWitnessData: z.ZodObject<{
|
|
573
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
586
574
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
587
575
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
588
576
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -596,6 +584,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
596
584
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
597
585
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
598
586
|
nextIndex: bigint;
|
|
587
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
588
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
589
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
590
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
591
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
592
|
+
}>>;
|
|
593
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
594
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
595
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
596
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
597
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
598
|
+
nextIndex: bigint;
|
|
599
599
|
}>>;
|
|
600
600
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
601
601
|
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
@@ -648,30 +648,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
648
648
|
}>>;
|
|
649
649
|
treeId: z.ZodNumber;
|
|
650
650
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
651
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
652
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
653
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
654
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
655
651
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
656
652
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
657
653
|
}, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
|
|
658
654
|
slot: import("@aztec-labs/foundation/schemas").Fr;
|
|
659
655
|
value: import("@aztec-labs/foundation/schemas").Fr;
|
|
656
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
657
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
658
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
659
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
660
660
|
}>>;
|
|
661
661
|
lowLeavesWitnessData: z.ZodObject<{
|
|
662
662
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
663
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
664
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
665
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
666
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
667
|
-
}>>;
|
|
668
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
669
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
670
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
671
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
672
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
673
|
-
nextIndex: bigint;
|
|
674
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
675
663
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
676
664
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
677
665
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -685,12 +673,7 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
685
673
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
686
674
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
687
675
|
nextIndex: bigint;
|
|
688
|
-
}
|
|
689
|
-
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
690
|
-
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
691
|
-
}, z.core.$strip>;
|
|
692
|
-
insertionWitnessData: z.ZodObject<{
|
|
693
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
676
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
694
677
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
695
678
|
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
696
679
|
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
@@ -702,7 +685,12 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
702
685
|
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
703
686
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
704
687
|
nextIndex: bigint;
|
|
705
|
-
}
|
|
688
|
+
}>>;
|
|
689
|
+
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
690
|
+
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
691
|
+
}, z.core.$strip>;
|
|
692
|
+
insertionWitnessData: z.ZodObject<{
|
|
693
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
706
694
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
707
695
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
708
696
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -716,6 +704,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
716
704
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
717
705
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
718
706
|
nextIndex: bigint;
|
|
707
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
708
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
709
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
710
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
711
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
712
|
+
}>>;
|
|
713
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
714
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
715
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
716
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
717
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
718
|
+
nextIndex: bigint;
|
|
719
719
|
}>>;
|
|
720
720
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
721
721
|
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec-labs/stdlib",
|
|
3
|
-
"version": "6.0.0-nightly.
|
|
3
|
+
"version": "6.0.0-nightly.20260923",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
95
95
|
"@aztec-foundation/bb.js": "6.0.0-nightly.20260921",
|
|
96
96
|
"@aztec-foundation/noir-noirc_abi": "6.0.0-nightly.20260921",
|
|
97
|
-
"@aztec-labs/blob-lib": "6.0.0-nightly.
|
|
98
|
-
"@aztec-labs/constants": "6.0.0-nightly.
|
|
99
|
-
"@aztec-labs/ethereum": "6.0.0-nightly.
|
|
100
|
-
"@aztec-labs/foundation": "6.0.0-nightly.
|
|
97
|
+
"@aztec-labs/blob-lib": "6.0.0-nightly.20260923",
|
|
98
|
+
"@aztec-labs/constants": "6.0.0-nightly.20260923",
|
|
99
|
+
"@aztec-labs/ethereum": "6.0.0-nightly.20260923",
|
|
100
|
+
"@aztec-labs/foundation": "6.0.0-nightly.20260923",
|
|
101
101
|
"@google-cloud/storage": "^7.15.0",
|
|
102
102
|
"axios": "^1.15.1",
|
|
103
103
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"msgpackr": "^1.11.2",
|
|
109
109
|
"pako": "^2.1.0",
|
|
110
110
|
"tslib": "^2.4.0",
|
|
111
|
-
"viem": "npm:@aztec/viem@2.38.
|
|
111
|
+
"viem": "npm:@aztec/viem@2.38.3",
|
|
112
112
|
"zod": "~4.4.3"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ViemCommitteeAttestation, ViemCommitteeAttestations } from '@aztec-labs/ethereum/contracts';
|
|
2
|
+
import { Buffer32 } from '@aztec-labs/foundation/buffer';
|
|
2
3
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
3
4
|
import { Signature } from '@aztec-labs/foundation/eth-signature';
|
|
4
5
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
@@ -76,10 +77,10 @@ export class CommitteeAttestation {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
const v = dataBuffer[dataIndex];
|
|
79
|
-
const r =
|
|
80
|
-
const s =
|
|
80
|
+
const r = Buffer32.fromBuffer(dataBuffer.subarray(dataIndex + 1, dataIndex + 33));
|
|
81
|
+
const s = Buffer32.fromBuffer(dataBuffer.subarray(dataIndex + 33, dataIndex + 65));
|
|
81
82
|
|
|
82
|
-
const signature = Signature
|
|
83
|
+
const signature = new Signature(r, s, v);
|
|
83
84
|
|
|
84
85
|
// For signed attestations, we use a zero address as the address is recovered from the signature
|
|
85
86
|
attestations.push(new CommitteeAttestation(EthAddress.ZERO, signature));
|
|
@@ -90,8 +91,7 @@ export class CommitteeAttestation {
|
|
|
90
91
|
throw new Error(`Insufficient data for address at position ${i}`);
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
const
|
|
94
|
-
const address = EthAddress.fromString(`0x${addressBytes.toString('hex')}`);
|
|
94
|
+
const address = EthAddress.fromBuffer(dataBuffer.subarray(dataIndex, dataIndex + 20));
|
|
95
95
|
|
|
96
96
|
// For address-only attestations, use empty signature
|
|
97
97
|
attestations.push(new CommitteeAttestation(address, Signature.empty()));
|
|
@@ -3,6 +3,7 @@ import { times } from '@aztec-labs/foundation/collection';
|
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
4
|
import {
|
|
5
5
|
type CheckpointId,
|
|
6
|
+
CommitteeAttestationsAndSigners,
|
|
6
7
|
GENESIS_CHECKPOINT_HEADER_HASH,
|
|
7
8
|
L2Block,
|
|
8
9
|
type L2BlockId,
|
|
@@ -91,7 +92,12 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
91
92
|
blockToCheckpoint.set(block.number, checkpointNumber);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
return new PublishedCheckpoint(
|
|
95
|
+
return new PublishedCheckpoint(
|
|
96
|
+
checkpoint,
|
|
97
|
+
L1PublishedData.random(),
|
|
98
|
+
[],
|
|
99
|
+
CommitteeAttestationsAndSigners.packAttestations([]),
|
|
100
|
+
);
|
|
95
101
|
};
|
|
96
102
|
|
|
97
103
|
/** Creates a thin chain-checkpointed event carrying the block + checkpoint ids of the checkpoint's last block. */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
type ViemCommitteeAttestations,
|
|
3
|
+
ViemCommitteeAttestationsSchema,
|
|
4
|
+
} from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
2
5
|
import { EpochNumber, EpochNumberSchema } from '@aztec-labs/foundation/branded-types';
|
|
3
6
|
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
4
7
|
import { type ZodFor, schemas } from '@aztec-labs/foundation/schemas';
|
|
@@ -71,12 +74,6 @@ export type ValidateCheckpointNegativeResult =
|
|
|
71
74
|
/** Result type for validating checkpoint attestations */
|
|
72
75
|
export type ValidateCheckpointResult = { valid: true } | ValidateCheckpointNegativeResult;
|
|
73
76
|
|
|
74
|
-
/** Zod schema for the raw packed `CommitteeAttestations` viem tuple (two 0x-prefixed hex strings). */
|
|
75
|
-
const ViemCommitteeAttestationsSchema: ZodFor<ViemCommitteeAttestations> = z.object({
|
|
76
|
-
signatureIndices: schemas.HexStringWith0x,
|
|
77
|
-
signaturesOrAddresses: schemas.HexStringWith0x,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
77
|
export const ValidateCheckpointResultSchema: ZodFor<ValidateCheckpointResult> = z.union([
|
|
81
78
|
z.object({ valid: z.literal(true) }),
|
|
82
79
|
z.object({
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ViemCommitteeAttestations,
|
|
3
|
+
ViemCommitteeAttestationsSchema,
|
|
4
|
+
} from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
1
5
|
import {
|
|
2
6
|
BlockNumber,
|
|
3
7
|
BlockNumberSchema,
|
|
@@ -24,6 +28,11 @@ export type CommonCheckpointData = {
|
|
|
24
28
|
/** Data stored with checkpoint data after publishing on l1 */
|
|
25
29
|
export type L1EnrichedCheckpointData = {
|
|
26
30
|
attestations: CommitteeAttestation[];
|
|
31
|
+
/**
|
|
32
|
+
* The packed `CommitteeAttestations` tuple exactly as posted to L1. {@link attestations} is what this tuple
|
|
33
|
+
* decodes to; only the tuple reproduces the `attestationsHash` the rollup stored at propose time.
|
|
34
|
+
*/
|
|
35
|
+
verbatimAttestations: ViemCommitteeAttestations;
|
|
27
36
|
l1: L1PublishedData;
|
|
28
37
|
};
|
|
29
38
|
|
|
@@ -86,6 +95,7 @@ export const CheckpointDataSchema = z
|
|
|
86
95
|
blockCount: schemas.Integer,
|
|
87
96
|
feeAssetPriceModifier: schemas.BigInt,
|
|
88
97
|
attestations: z.array(CommitteeAttestation.schema),
|
|
98
|
+
verbatimAttestations: ViemCommitteeAttestationsSchema,
|
|
89
99
|
l1: L1PublishedData.schema,
|
|
90
100
|
})
|
|
91
101
|
.transform(
|
|
@@ -98,6 +108,7 @@ export const CheckpointDataSchema = z
|
|
|
98
108
|
blockCount: obj.blockCount,
|
|
99
109
|
feeAssetPriceModifier: obj.feeAssetPriceModifier,
|
|
100
110
|
attestations: obj.attestations,
|
|
111
|
+
verbatimAttestations: obj.verbatimAttestations,
|
|
101
112
|
l1: obj.l1,
|
|
102
113
|
}),
|
|
103
114
|
);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
// Ignoring import issue to fix portable inferred type issue in zod schema
|
|
2
|
+
import {
|
|
3
|
+
type ViemCommitteeAttestations,
|
|
4
|
+
ViemCommitteeAttestationsSchema,
|
|
5
|
+
} from '@aztec-labs/ethereum/contracts/committee-attestations';
|
|
2
6
|
import { Buffer32 } from '@aztec-labs/foundation/buffer';
|
|
3
7
|
import { randomBigInt } from '@aztec-labs/foundation/crypto/random';
|
|
4
8
|
import { schemas } from '@aztec-labs/foundation/schemas';
|
|
5
9
|
import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
10
|
+
import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
|
|
6
11
|
import type { FieldsOf } from '@aztec-labs/foundation/types';
|
|
7
12
|
import { z } from 'zod';
|
|
8
13
|
|
|
@@ -60,6 +65,14 @@ export class PublishedCheckpoint {
|
|
|
60
65
|
public l1: L1PublishedData,
|
|
61
66
|
/** The attestations for the last block in the checkpoint. */
|
|
62
67
|
public attestations: CommitteeAttestation[],
|
|
68
|
+
/**
|
|
69
|
+
* The packed `CommitteeAttestations` tuple exactly as it appeared in the propose calldata. The rollup
|
|
70
|
+
* stores `keccak256(abi.encode(tuple))` and re-checks it when an epoch proof or an invalidation is
|
|
71
|
+
* submitted, so the tuple can only be reproduced from these bytes: repacking the decoded
|
|
72
|
+
* {@link attestations} zeroes bitmap bits past the committee size and canonicalizes recovery bytes,
|
|
73
|
+
* neither of which any decoder reads but both of which the stored hash covers.
|
|
74
|
+
*/
|
|
75
|
+
public verbatimAttestations: ViemCommitteeAttestations,
|
|
63
76
|
) {}
|
|
64
77
|
|
|
65
78
|
static get schema() {
|
|
@@ -68,12 +81,13 @@ export class PublishedCheckpoint {
|
|
|
68
81
|
checkpoint: Checkpoint.schema,
|
|
69
82
|
l1: L1PublishedData.schema,
|
|
70
83
|
attestations: z.array(CommitteeAttestation.schema),
|
|
84
|
+
verbatimAttestations: ViemCommitteeAttestationsSchema,
|
|
71
85
|
})
|
|
72
86
|
.transform(obj => PublishedCheckpoint.from(obj));
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
static getFields(fields: FieldsOf<PublishedCheckpoint>) {
|
|
76
|
-
return [fields.checkpoint, fields.l1, fields.attestations] as const;
|
|
90
|
+
return [fields.checkpoint, fields.l1, fields.attestations, fields.verbatimAttestations] as const;
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
static from(fields: FieldsOf<PublishedCheckpoint>) {
|
|
@@ -87,14 +101,21 @@ export class PublishedCheckpoint {
|
|
|
87
101
|
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
88
102
|
const l1Timestamp = reader.readBigInt();
|
|
89
103
|
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
104
|
+
const verbatimAttestations: ViemCommitteeAttestations = {
|
|
105
|
+
signatureIndices: bufferToHex(reader.readBuffer()),
|
|
106
|
+
signaturesOrAddresses: bufferToHex(reader.readBuffer()),
|
|
107
|
+
};
|
|
90
108
|
return new PublishedCheckpoint(
|
|
91
109
|
checkpoint,
|
|
92
110
|
new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash),
|
|
93
111
|
attestations,
|
|
112
|
+
verbatimAttestations,
|
|
94
113
|
);
|
|
95
114
|
}
|
|
96
115
|
|
|
97
116
|
public toBuffer(): Buffer {
|
|
117
|
+
const signatureIndices = hexToBuffer(this.verbatimAttestations.signatureIndices);
|
|
118
|
+
const signaturesOrAddresses = hexToBuffer(this.verbatimAttestations.signaturesOrAddresses);
|
|
98
119
|
return serializeToBuffer(
|
|
99
120
|
this.checkpoint,
|
|
100
121
|
this.l1.blockNumber,
|
|
@@ -102,6 +123,10 @@ export class PublishedCheckpoint {
|
|
|
102
123
|
this.l1.timestamp,
|
|
103
124
|
this.attestations.length,
|
|
104
125
|
this.attestations,
|
|
126
|
+
signatureIndices.length,
|
|
127
|
+
signatureIndices,
|
|
128
|
+
signaturesOrAddresses.length,
|
|
129
|
+
signaturesOrAddresses,
|
|
105
130
|
);
|
|
106
131
|
}
|
|
107
132
|
}
|