@aztec/blob-lib 0.0.1-fake-c83136db25 → 0.0.1-fake-ceab37513c

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.
Files changed (65) hide show
  1. package/dest/blob.d.ts +98 -52
  2. package/dest/blob.d.ts.map +1 -1
  3. package/dest/blob.js +167 -73
  4. package/dest/blob_batching.d.ts +48 -15
  5. package/dest/blob_batching.d.ts.map +1 -1
  6. package/dest/blob_batching.js +120 -81
  7. package/dest/blob_batching_public_inputs.d.ts +71 -0
  8. package/dest/blob_batching_public_inputs.d.ts.map +1 -0
  9. package/dest/blob_batching_public_inputs.js +168 -0
  10. package/dest/encoding.d.ts +62 -22
  11. package/dest/encoding.d.ts.map +1 -1
  12. package/dest/encoding.js +104 -114
  13. package/dest/index.d.ts +2 -5
  14. package/dest/index.d.ts.map +1 -1
  15. package/dest/index.js +15 -5
  16. package/dest/sponge_blob.d.ts +9 -13
  17. package/dest/sponge_blob.d.ts.map +1 -1
  18. package/dest/sponge_blob.js +17 -28
  19. package/dest/testing.d.ts +12 -7
  20. package/dest/testing.d.ts.map +1 -1
  21. package/dest/testing.js +41 -54
  22. package/dest/types.d.ts +0 -2
  23. package/dest/types.d.ts.map +1 -1
  24. package/dest/types.js +0 -2
  25. package/package.json +4 -5
  26. package/src/blob.ts +198 -76
  27. package/src/blob_batching.ts +137 -109
  28. package/src/blob_batching_public_inputs.ts +252 -0
  29. package/src/encoding.ts +120 -136
  30. package/src/index.ts +18 -5
  31. package/src/sponge_blob.ts +14 -24
  32. package/src/testing.ts +40 -55
  33. package/src/types.ts +2 -2
  34. package/dest/blob_utils.d.ts +0 -30
  35. package/dest/blob_utils.d.ts.map +0 -1
  36. package/dest/blob_utils.js +0 -60
  37. package/dest/circuit_types/blob_accumulator.d.ts +0 -21
  38. package/dest/circuit_types/blob_accumulator.d.ts.map +0 -1
  39. package/dest/circuit_types/blob_accumulator.js +0 -58
  40. package/dest/circuit_types/final_blob_accumulator.d.ts +0 -22
  41. package/dest/circuit_types/final_blob_accumulator.d.ts.map +0 -1
  42. package/dest/circuit_types/final_blob_accumulator.js +0 -63
  43. package/dest/circuit_types/final_blob_batching_challenges.d.ts +0 -15
  44. package/dest/circuit_types/final_blob_batching_challenges.d.ts.map +0 -1
  45. package/dest/circuit_types/final_blob_batching_challenges.js +0 -25
  46. package/dest/circuit_types/index.d.ts +0 -4
  47. package/dest/circuit_types/index.d.ts.map +0 -1
  48. package/dest/circuit_types/index.js +0 -4
  49. package/dest/deserialize.d.ts +0 -14
  50. package/dest/deserialize.d.ts.map +0 -1
  51. package/dest/deserialize.js +0 -33
  52. package/dest/hash.d.ts +0 -35
  53. package/dest/hash.d.ts.map +0 -1
  54. package/dest/hash.js +0 -69
  55. package/dest/kzg_context.d.ts +0 -4
  56. package/dest/kzg_context.d.ts.map +0 -1
  57. package/dest/kzg_context.js +0 -5
  58. package/src/blob_utils.ts +0 -71
  59. package/src/circuit_types/blob_accumulator.ts +0 -84
  60. package/src/circuit_types/final_blob_accumulator.ts +0 -75
  61. package/src/circuit_types/final_blob_batching_challenges.ts +0 -29
  62. package/src/circuit_types/index.ts +0 -4
  63. package/src/deserialize.ts +0 -38
  64. package/src/hash.ts +0 -77
  65. package/src/kzg_context.ts +0 -5
@@ -0,0 +1,168 @@
1
+ import { BLS12_FQ_LIMBS, BLS12_FR_LIMBS } from '@aztec/constants';
2
+ import { BLS12Fq, BLS12Fr, BLS12Point, Fr } from '@aztec/foundation/fields';
3
+ import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ import { inspect } from 'util';
5
+ import { BatchedBlobAccumulator, FinalBlobBatchingChallenges } from './blob_batching.js';
6
+ /**
7
+ * See nr BlobAccumulatorPublicInputs and ts BatchedBlobAccumulator for documentation.
8
+ */ export class BlobAccumulatorPublicInputs {
9
+ blobCommitmentsHashAcc;
10
+ zAcc;
11
+ yAcc;
12
+ cAcc;
13
+ gammaAcc;
14
+ gammaPowAcc;
15
+ constructor(blobCommitmentsHashAcc, zAcc, yAcc, cAcc, gammaAcc, gammaPowAcc){
16
+ this.blobCommitmentsHashAcc = blobCommitmentsHashAcc;
17
+ this.zAcc = zAcc;
18
+ this.yAcc = yAcc;
19
+ this.cAcc = cAcc;
20
+ this.gammaAcc = gammaAcc;
21
+ this.gammaPowAcc = gammaPowAcc;
22
+ }
23
+ static empty() {
24
+ return new BlobAccumulatorPublicInputs(Fr.ZERO, Fr.ZERO, BLS12Fr.ZERO, BLS12Point.ZERO, Fr.ZERO, BLS12Fr.ZERO);
25
+ }
26
+ equals(other) {
27
+ return this.blobCommitmentsHashAcc.equals(other.blobCommitmentsHashAcc) && this.zAcc.equals(other.zAcc) && this.yAcc.equals(other.yAcc) && this.cAcc.equals(other.cAcc) && this.gammaAcc.equals(other.gammaAcc) && this.gammaPowAcc.equals(other.gammaPowAcc);
28
+ }
29
+ static fromBuffer(buffer) {
30
+ const reader = BufferReader.asReader(buffer);
31
+ return new BlobAccumulatorPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), BLS12Fr.fromBuffer(reader), BLS12Point.fromBuffer(reader), Fr.fromBuffer(reader), BLS12Fr.fromBuffer(reader));
32
+ }
33
+ toBuffer() {
34
+ return serializeToBuffer(this.blobCommitmentsHashAcc, this.zAcc, this.yAcc, this.cAcc, this.gammaAcc, this.gammaPowAcc);
35
+ }
36
+ /**
37
+ * Given blobs, accumulate all public inputs state.
38
+ * We assume the input blobs have not been evaluated at z.
39
+ * NOTE: Does NOT accumulate non circuit values including Q. This exists to simulate/check exactly what the circuit is doing
40
+ * and is unsafe for other use. For that reason, a toBatchedBlobAccumulator does not exist. See evaluateBlobs() oracle for usage.
41
+ * @returns An updated blob accumulator.
42
+ */ async accumulateBlobs(blobs, finalBlobChallenges) {
43
+ let acc = new BatchedBlobAccumulator(this.blobCommitmentsHashAcc, this.zAcc, this.yAcc, this.cAcc, BLS12Point.ZERO, this.gammaAcc, this.gammaPowAcc, finalBlobChallenges);
44
+ acc = await acc.accumulateBlobs(blobs);
45
+ return new BlobAccumulatorPublicInputs(acc.blobCommitmentsHashAcc, acc.zAcc, acc.yAcc, acc.cAcc, acc.gammaAcc, acc.gammaPow);
46
+ }
47
+ toFields() {
48
+ return [
49
+ this.blobCommitmentsHashAcc,
50
+ this.zAcc,
51
+ ...this.yAcc.toNoirBigNum().limbs.map(Fr.fromString),
52
+ ...this.cAcc.x.toNoirBigNum().limbs.map(Fr.fromString),
53
+ ...this.cAcc.y.toNoirBigNum().limbs.map(Fr.fromString),
54
+ new Fr(this.cAcc.isInfinite),
55
+ this.gammaAcc,
56
+ ...this.gammaPowAcc.toNoirBigNum().limbs.map(Fr.fromString)
57
+ ];
58
+ }
59
+ static fromFields(fields) {
60
+ const reader = FieldReader.asReader(fields);
61
+ return new BlobAccumulatorPublicInputs(reader.readField(), reader.readField(), BLS12Fr.fromNoirBigNum({
62
+ limbs: reader.readFieldArray(BLS12_FR_LIMBS).map((f)=>f.toString())
63
+ }), new BLS12Point(BLS12Fq.fromNoirBigNum({
64
+ limbs: reader.readFieldArray(BLS12_FQ_LIMBS).map((f)=>f.toString())
65
+ }), BLS12Fq.fromNoirBigNum({
66
+ limbs: reader.readFieldArray(BLS12_FQ_LIMBS).map((f)=>f.toString())
67
+ }), reader.readBoolean()), reader.readField(), BLS12Fr.fromNoirBigNum({
68
+ limbs: reader.readFieldArray(BLS12_FR_LIMBS).map((f)=>f.toString())
69
+ }));
70
+ }
71
+ /**
72
+ * Converts from an accumulator to a struct for the public inputs of our rollup circuits.
73
+ * @returns A BlobAccumulatorPublicInputs instance.
74
+ */ static fromBatchedBlobAccumulator(accumulator) {
75
+ return new BlobAccumulatorPublicInputs(accumulator.blobCommitmentsHashAcc, accumulator.zAcc, accumulator.yAcc, accumulator.cAcc, accumulator.gammaAcc, accumulator.gammaPow);
76
+ }
77
+ }
78
+ /**
79
+ * See nr FinalBlobAccumulatorPublicInputs and ts BatchedBlobAccumulator for documentation.
80
+ */ export class FinalBlobAccumulatorPublicInputs {
81
+ blobCommitmentsHash;
82
+ z;
83
+ y;
84
+ c;
85
+ constructor(blobCommitmentsHash, z, y, c){
86
+ this.blobCommitmentsHash = blobCommitmentsHash;
87
+ this.z = z;
88
+ this.y = y;
89
+ this.c = c;
90
+ }
91
+ static empty() {
92
+ return new FinalBlobAccumulatorPublicInputs(Fr.ZERO, Fr.ZERO, BLS12Fr.ZERO, BLS12Point.ZERO);
93
+ }
94
+ static fromBuffer(buffer) {
95
+ const reader = BufferReader.asReader(buffer);
96
+ return new FinalBlobAccumulatorPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), BLS12Fr.fromBuffer(reader), BLS12Point.fromBuffer(reader));
97
+ }
98
+ toBuffer() {
99
+ return serializeToBuffer(this.blobCommitmentsHash, this.z, this.y, this.c);
100
+ }
101
+ static fromBatchedBlob(blob) {
102
+ return new FinalBlobAccumulatorPublicInputs(blob.blobCommitmentsHash, blob.z, blob.y, blob.commitment);
103
+ }
104
+ toFields() {
105
+ return [
106
+ this.blobCommitmentsHash,
107
+ this.z,
108
+ ...this.y.toNoirBigNum().limbs.map(Fr.fromString),
109
+ ...this.c.toBN254Fields()
110
+ ];
111
+ }
112
+ // The below is used to send to L1 for proof verification
113
+ toString() {
114
+ // We prepend 32 bytes for the (unused) 'blobHash' slot. This is not read or required by getEpochProofPublicInputs() on L1, but
115
+ // is expected since we usually pass the full precompile inputs via verifyEpochRootProof() to getEpochProofPublicInputs() to ensure
116
+ // we use calldata rather than a slice in memory:
117
+ const buf = Buffer.concat([
118
+ Buffer.alloc(32),
119
+ this.z.toBuffer(),
120
+ this.y.toBuffer(),
121
+ this.c.compress()
122
+ ]);
123
+ return buf.toString('hex');
124
+ }
125
+ equals(other) {
126
+ return this.blobCommitmentsHash.equals(other.blobCommitmentsHash) && this.z.equals(other.z) && this.y.equals(other.y) && this.c.equals(other.c);
127
+ }
128
+ // Creates a random instance. Used for testing only - will not prove/verify.
129
+ static random() {
130
+ return new FinalBlobAccumulatorPublicInputs(Fr.random(), Fr.random(), BLS12Fr.random(), BLS12Point.random());
131
+ }
132
+ // Warning: MUST be final accumulator state.
133
+ static fromBatchedBlobAccumulator(accumulator) {
134
+ return new FinalBlobAccumulatorPublicInputs(accumulator.blobCommitmentsHashAcc, accumulator.zAcc, accumulator.yAcc, accumulator.cAcc);
135
+ }
136
+ [inspect.custom]() {
137
+ return `FinalBlobAccumulatorPublicInputs {
138
+ blobCommitmentsHash: ${inspect(this.blobCommitmentsHash)},
139
+ z: ${inspect(this.z)},
140
+ y: ${inspect(this.y)},
141
+ c: ${inspect(this.c)},
142
+ }`;
143
+ }
144
+ }
145
+ /**
146
+ * startBlobAccumulator: Accumulated opening proofs for all blobs before this block range.
147
+ * endBlobAccumulator: Accumulated opening proofs for all blobs after adding this block range.
148
+ * finalBlobChallenges: Final values z and gamma, shared across the epoch.
149
+ */ export class BlockBlobPublicInputs {
150
+ startBlobAccumulator;
151
+ endBlobAccumulator;
152
+ finalBlobChallenges;
153
+ constructor(startBlobAccumulator, endBlobAccumulator, finalBlobChallenges){
154
+ this.startBlobAccumulator = startBlobAccumulator;
155
+ this.endBlobAccumulator = endBlobAccumulator;
156
+ this.finalBlobChallenges = finalBlobChallenges;
157
+ }
158
+ static empty() {
159
+ return new BlockBlobPublicInputs(BlobAccumulatorPublicInputs.empty(), BlobAccumulatorPublicInputs.empty(), FinalBlobBatchingChallenges.empty());
160
+ }
161
+ static fromBuffer(buffer) {
162
+ const reader = BufferReader.asReader(buffer);
163
+ return new BlockBlobPublicInputs(reader.readObject(BlobAccumulatorPublicInputs), reader.readObject(BlobAccumulatorPublicInputs), reader.readObject(FinalBlobBatchingChallenges));
164
+ }
165
+ toBuffer() {
166
+ return serializeToBuffer(this.startBlobAccumulator, this.endBlobAccumulator, this.finalBlobChallenges);
167
+ }
168
+ }
@@ -1,26 +1,66 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
- export interface TxStartMarker {
3
- prefix: bigint;
4
- numBlobFields: number;
5
- revertCode: number;
6
- numNoteHashes: number;
7
- numNullifiers: number;
8
- numL2ToL1Msgs: number;
9
- numPublicDataWrites: number;
10
- numPrivateLogs: number;
11
- publicLogsLength: number;
12
- contractClassLogLength: number;
13
- }
14
- export declare function encodeTxStartMarker(txStartMarker: Omit<TxStartMarker, 'prefix'>): Fr;
15
- export declare function decodeTxStartMarker(field: Fr): TxStartMarker;
16
- export declare function getNumBlobFieldsFromTxStartMarker(field: Fr): number;
17
- export declare function isValidTxStartMarker(txStartMarker: TxStartMarker): boolean;
18
- export declare function createBlockEndMarker(numTxs: number): Fr;
19
- export declare function getNumTxsFromBlockEndMarker(field: Fr): number;
20
- export declare function isBlockEndMarker(field: Fr): boolean;
2
+ import type { Blob as BlobBuffer } from 'c-kzg';
3
+ export declare const TX_START_PREFIX = 8392562855083340404n;
4
+ export declare const TX_START_PREFIX_BYTES_LENGTH: number;
5
+ export declare const TX_EFFECT_PREFIX_BYTE_LENGTH: number;
6
+ export declare const REVERT_CODE_PREFIX = 1;
21
7
  /**
22
- * Check that the fields are emitted from the circuits and conform to the encoding.
23
- * @param blobFields - The concatenated fields from all blobs of an L1 block.
8
+ * Deserializes a blob buffer into an array of field elements.
9
+ *
10
+ * Blobs are converted into BN254 fields to perform a poseidon2 hash on them (fieldHash).
11
+ * This method is sparse, meaning it does not include trailing zeros at the end of the blob.
12
+ *
13
+ * However, we cannot simply trim the zero's from the end of the blob, as some logs may include zero's
14
+ * within them.
15
+ * If we end on a set of zeros, such as the log below:
16
+ * length 7: [ a, b, c, d, e, 0, 0]
17
+ *
18
+ * we will end up with the incorrect hash if we trim the zeros from the end.
19
+ *
20
+ * Each transactions logs contains a TX start prefix, which includes a string followed
21
+ * by the length ( in field elements ) of the transaction's log.
22
+ *
23
+ * This function finds the end of the last transaction's logs, and returns the array up to this point.
24
+ *
25
+ * We search for a series of Tx Prefixes progressing the cursor in the field reader until we hit
26
+ * a field that is not a Tx Prefix, this indicates that we have reached the end of the last transaction's logs.
27
+ *
28
+ * +------------------+------------------+------------------+------------------+
29
+ * | TX1 Start Prefix | TX1 Log Fields | TX2 Start Prefix | Padded zeros |
30
+ * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
31
+ * +------------------+------------------+------------------+------------------+
32
+ * ^
33
+ * |
34
+ * Function reads until here --------------------------------
35
+ *
36
+ * @param blob - The blob buffer to deserialize.
37
+ * @returns An array of field elements.
24
38
  */
25
- export declare function checkBlobFieldsEncoding(blobFields: Fr[]): boolean;
39
+ export declare function deserializeEncodedBlobToFields(blob: BlobBuffer): Fr[];
40
+ /**
41
+ * Get the length of the transaction from the first field.
42
+ *
43
+ * @param firstField - The first field of the transaction.
44
+ * @returns The length of the transaction.
45
+ *
46
+ * @throws If the first field does not include the correct prefix - encoding invalid.
47
+ */
48
+ export declare function getLengthFromFirstField(firstField: Fr): number;
49
+ /**
50
+ * Determines whether a field is the first field of a tx effect
51
+ */
52
+ export declare function isValidFirstField(field: Fr): boolean;
53
+ /**
54
+ * Extract the fields from a blob buffer, but do not take into account encoding
55
+ * that will include trailing zeros.
56
+ *
57
+ * +------------------+------------------+------------------+------------------+
58
+ * | | | | Padded zeros |
59
+ * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
60
+ * +------------------+------------------+------------------+------------------+
61
+ * ^
62
+ * |
63
+ * Function reads until here ----------------------
64
+ */
65
+ export declare function extractBlobFieldsFromBuffer(blob: BlobBuffer): Fr[];
26
66
  //# sourceMappingURL=encoding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAa9C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EA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,EAAE,GAAG,MAAM,CAO9D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,CAqBpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,CAYlE"}
package/dest/encoding.js CHANGED
@@ -1,123 +1,113 @@
1
- import { BLOCK_END_PREFIX, TX_START_PREFIX } from '@aztec/constants';
2
1
  import { Fr } from '@aztec/foundation/fields';
3
- import { FieldReader } from '@aztec/foundation/serialize';
4
- const NUM_BLOB_FIELDS_BIT_SIZE = 32n;
5
- const REVERT_CODE_BIT_SIZE = 8n;
6
- const NUM_NOTE_HASH_BIT_SIZE = 16n;
7
- const NUM_NULLIFIER_BIT_SIZE = 16n;
8
- const NUM_L2_TO_L1_MSG_BIT_SIZE = 16n;
9
- const NUM_PUBLIC_DATA_WRITE_BIT_SIZE = 16n;
10
- const NUM_PRIVATE_LOG_BIT_SIZE = 16n;
11
- const PUBLIC_LOGS_LENGTH_BIT_SIZE = 32n;
12
- const CONTRACT_CLASS_LOG_LENGTH_BIT_SIZE = 16n;
13
- // Must match the implementation in `noir-protocol-circuits/crates/rollup-lib/src/tx_base/components/tx_blob_data.nr`.
14
- export function encodeTxStartMarker(txStartMarker) {
15
- let value = TX_START_PREFIX;
16
- value <<= NUM_NOTE_HASH_BIT_SIZE;
17
- value += BigInt(txStartMarker.numNoteHashes);
18
- value <<= NUM_NULLIFIER_BIT_SIZE;
19
- value += BigInt(txStartMarker.numNullifiers);
20
- value <<= NUM_L2_TO_L1_MSG_BIT_SIZE;
21
- value += BigInt(txStartMarker.numL2ToL1Msgs);
22
- value <<= NUM_PUBLIC_DATA_WRITE_BIT_SIZE;
23
- value += BigInt(txStartMarker.numPublicDataWrites);
24
- value <<= NUM_PRIVATE_LOG_BIT_SIZE;
25
- value += BigInt(txStartMarker.numPrivateLogs);
26
- value <<= PUBLIC_LOGS_LENGTH_BIT_SIZE;
27
- value += BigInt(txStartMarker.publicLogsLength);
28
- value <<= CONTRACT_CLASS_LOG_LENGTH_BIT_SIZE;
29
- value += BigInt(txStartMarker.contractClassLogLength);
30
- value <<= REVERT_CODE_BIT_SIZE;
31
- value += BigInt(txStartMarker.revertCode);
32
- value <<= NUM_BLOB_FIELDS_BIT_SIZE;
33
- value += BigInt(txStartMarker.numBlobFields);
34
- return new Fr(value);
35
- }
36
- export function decodeTxStartMarker(field) {
37
- let value = field.toBigInt();
38
- const numBlobFields = Number(value & 2n ** NUM_BLOB_FIELDS_BIT_SIZE - 1n);
39
- value >>= NUM_BLOB_FIELDS_BIT_SIZE;
40
- const revertCode = Number(value & 2n ** REVERT_CODE_BIT_SIZE - 1n);
41
- value >>= REVERT_CODE_BIT_SIZE;
42
- const contractClassLogLength = Number(value & 2n ** CONTRACT_CLASS_LOG_LENGTH_BIT_SIZE - 1n);
43
- value >>= CONTRACT_CLASS_LOG_LENGTH_BIT_SIZE;
44
- const publicLogsLength = Number(value & 2n ** PUBLIC_LOGS_LENGTH_BIT_SIZE - 1n);
45
- value >>= PUBLIC_LOGS_LENGTH_BIT_SIZE;
46
- const numPrivateLogs = Number(value & 2n ** NUM_PRIVATE_LOG_BIT_SIZE - 1n);
47
- value >>= NUM_PRIVATE_LOG_BIT_SIZE;
48
- const numPublicDataWrites = Number(value & 2n ** NUM_PUBLIC_DATA_WRITE_BIT_SIZE - 1n);
49
- value >>= NUM_PUBLIC_DATA_WRITE_BIT_SIZE;
50
- const numL2ToL1Msgs = Number(value & 2n ** NUM_L2_TO_L1_MSG_BIT_SIZE - 1n);
51
- value >>= NUM_L2_TO_L1_MSG_BIT_SIZE;
52
- const numNullifiers = Number(value & 2n ** NUM_NULLIFIER_BIT_SIZE - 1n);
53
- value >>= NUM_NULLIFIER_BIT_SIZE;
54
- const numNoteHashes = Number(value & 2n ** NUM_NOTE_HASH_BIT_SIZE - 1n);
55
- value >>= NUM_NOTE_HASH_BIT_SIZE;
56
- // Do not throw if the prefix doesn't match.
57
- // The caller function can check it by calling `isValidTxStartMarker`, and decide what to do if it's incorrect.
58
- const prefix = value;
59
- return {
60
- prefix,
61
- numBlobFields,
62
- revertCode,
63
- numNoteHashes,
64
- numNullifiers,
65
- numL2ToL1Msgs,
66
- numPublicDataWrites,
67
- numPrivateLogs,
68
- publicLogsLength,
69
- contractClassLogLength
70
- };
71
- }
72
- export function getNumBlobFieldsFromTxStartMarker(field) {
73
- return Number(field.toBigInt() & 2n ** NUM_BLOB_FIELDS_BIT_SIZE - 1n);
74
- }
75
- export function isValidTxStartMarker(txStartMarker) {
76
- return txStartMarker.prefix === TX_START_PREFIX;
77
- }
78
- export function createBlockEndMarker(numTxs) {
79
- // Must match the implementation in `block_rollup_public_inputs_composer.nr > create_block_end_marker`.
80
- return new Fr(BLOCK_END_PREFIX * 256n * 256n + BigInt(numTxs));
81
- }
82
- export function getNumTxsFromBlockEndMarker(field) {
83
- return Number(field.toBigInt() & 0xffffn);
2
+ import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
+ // Note duplicated from stdlib !
4
+ // This will appear as 0x74785f7374617274 in logs
5
+ export const TX_START_PREFIX = 8392562855083340404n;
6
+ // These are helper constants to decode tx effects from blob encoded fields
7
+ export const TX_START_PREFIX_BYTES_LENGTH = TX_START_PREFIX.toString(16).length / 2;
8
+ // 7 bytes for: | 0 | txlen[0] | txlen[1] | 0 | REVERT_CODE_PREFIX | 0 | revertCode |
9
+ export const TX_EFFECT_PREFIX_BYTE_LENGTH = TX_START_PREFIX_BYTES_LENGTH + 7;
10
+ export const REVERT_CODE_PREFIX = 1;
11
+ /**
12
+ * Deserializes a blob buffer into an array of field elements.
13
+ *
14
+ * Blobs are converted into BN254 fields to perform a poseidon2 hash on them (fieldHash).
15
+ * This method is sparse, meaning it does not include trailing zeros at the end of the blob.
16
+ *
17
+ * However, we cannot simply trim the zero's from the end of the blob, as some logs may include zero's
18
+ * within them.
19
+ * If we end on a set of zeros, such as the log below:
20
+ * length 7: [ a, b, c, d, e, 0, 0]
21
+ *
22
+ * we will end up with the incorrect hash if we trim the zeros from the end.
23
+ *
24
+ * Each transactions logs contains a TX start prefix, which includes a string followed
25
+ * by the length ( in field elements ) of the transaction's log.
26
+ *
27
+ * This function finds the end of the last transaction's logs, and returns the array up to this point.
28
+ *
29
+ * We search for a series of Tx Prefixes progressing the cursor in the field reader until we hit
30
+ * a field that is not a Tx Prefix, this indicates that we have reached the end of the last transaction's logs.
31
+ *
32
+ * +------------------+------------------+------------------+------------------+
33
+ * | TX1 Start Prefix | TX1 Log Fields | TX2 Start Prefix | Padded zeros |
34
+ * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
35
+ * +------------------+------------------+------------------+------------------+
36
+ * ^
37
+ * |
38
+ * Function reads until here --------------------------------
39
+ *
40
+ * @param blob - The blob buffer to deserialize.
41
+ * @returns An array of field elements.
42
+ */ export function deserializeEncodedBlobToFields(blob) {
43
+ // Convert blob buffer to array of field elements
44
+ const reader = BufferReader.asReader(blob);
45
+ const array = reader.readArray(blob.length >> 5, Fr); // >> 5 = / 32 (bytes per field)
46
+ const fieldReader = FieldReader.asReader(array);
47
+ // Read fields until we hit zeros at the end
48
+ while(!fieldReader.isFinished()){
49
+ const currentField = fieldReader.peekField();
50
+ // Stop when we hit a zero field
51
+ if (!currentField || currentField.isZero()) {
52
+ break;
53
+ }
54
+ // Skip the remaining fields in this transaction
55
+ const len = getLengthFromFirstField(currentField);
56
+ fieldReader.skip(len);
57
+ }
58
+ // Return array up to last non-zero field
59
+ return array.slice(0, fieldReader.cursor);
84
60
  }
85
- export function isBlockEndMarker(field) {
86
- const value = field.toBigInt();
87
- const numTxs = value & 0xffffn;
88
- return value - numTxs === BLOCK_END_PREFIX * 256n * 256n;
61
+ /**
62
+ * Get the length of the transaction from the first field.
63
+ *
64
+ * @param firstField - The first field of the transaction.
65
+ * @returns The length of the transaction.
66
+ *
67
+ * @throws If the first field does not include the correct prefix - encoding invalid.
68
+ */ export function getLengthFromFirstField(firstField) {
69
+ // Check that the first field includes the correct prefix
70
+ if (!isValidFirstField(firstField)) {
71
+ throw new Error('Invalid prefix');
72
+ }
73
+ const buf = firstField.toBuffer().subarray(-TX_EFFECT_PREFIX_BYTE_LENGTH);
74
+ return new Fr(buf.subarray(TX_START_PREFIX_BYTES_LENGTH + 1, TX_START_PREFIX_BYTES_LENGTH + 3)).toNumber();
89
75
  }
90
76
  /**
91
- * Check that the fields are emitted from the circuits and conform to the encoding.
92
- * @param blobFields - The concatenated fields from all blobs of an L1 block.
93
- */ export function checkBlobFieldsEncoding(blobFields) {
94
- const reader = FieldReader.asReader(blobFields);
95
- const checkpointPrefix = reader.readField();
96
- if (checkpointPrefix.toBigInt() !== BigInt(blobFields.length)) {
77
+ * Determines whether a field is the first field of a tx effect
78
+ */ export function isValidFirstField(field) {
79
+ const buf = field.toBuffer();
80
+ if (!buf.subarray(0, field.size - TX_EFFECT_PREFIX_BYTE_LENGTH).equals(Buffer.alloc(field.size - TX_EFFECT_PREFIX_BYTE_LENGTH))) {
97
81
  return false;
98
82
  }
99
- const numFieldsInCheckpoint = checkpointPrefix.toNumber();
100
- let seenNumTxs = 0;
101
- while(reader.cursor < numFieldsInCheckpoint){
102
- const currentField = reader.readField();
103
- if (isBlockEndMarker(currentField)) {
104
- // Found a block end marker. Confirm that the number of txs in this block is correct.
105
- const numTxs = getNumTxsFromBlockEndMarker(currentField);
106
- if (numTxs !== seenNumTxs) {
107
- return false;
108
- }
109
- seenNumTxs = 0;
110
- continue;
111
- }
112
- // If the field is not a block end marker, it must be a tx start marker.
113
- const txStartMarker = decodeTxStartMarker(currentField);
114
- if (!isValidTxStartMarker(txStartMarker)) {
115
- return false;
116
- }
117
- seenNumTxs += 1;
118
- // Skip the remaining fields in this tx. -1 because we already read the tx start marker.
119
- reader.skip(txStartMarker.numBlobFields - 1);
120
- // TODO: Check the encoding of the tx if we want to be more strict.
83
+ const sliced = buf.subarray(-TX_EFFECT_PREFIX_BYTE_LENGTH);
84
+ if (// Checking we start with the correct prefix...
85
+ !new Fr(sliced.subarray(0, TX_START_PREFIX_BYTES_LENGTH)).equals(new Fr(TX_START_PREFIX)) || // ...and include the revert code prefix..
86
+ sliced[sliced.length - 3] !== REVERT_CODE_PREFIX || // ...and the following revert code is valid.
87
+ sliced[sliced.length - 1] > 4) {
88
+ return false;
121
89
  }
122
90
  return true;
123
91
  }
92
+ /**
93
+ * Extract the fields from a blob buffer, but do not take into account encoding
94
+ * that will include trailing zeros.
95
+ *
96
+ * +------------------+------------------+------------------+------------------+
97
+ * | | | | Padded zeros |
98
+ * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
99
+ * +------------------+------------------+------------------+------------------+
100
+ * ^
101
+ * |
102
+ * Function reads until here ----------------------
103
+ */ export function extractBlobFieldsFromBuffer(blob) {
104
+ const reader = BufferReader.asReader(blob);
105
+ const array = reader.readArray(blob.length >> 5, Fr);
106
+ // Find the index of the last non-zero field
107
+ let lastNonZeroIndex = array.length - 1;
108
+ while(lastNonZeroIndex >= 0 && array[lastNonZeroIndex].isZero()){
109
+ lastNonZeroIndex--;
110
+ }
111
+ // Return the trimmed array
112
+ return array.slice(0, lastNonZeroIndex + 1);
113
+ }
package/dest/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  export * from './blob.js';
2
2
  export * from './blob_batching.js';
3
- export * from './blob_utils.js';
4
- export * from './circuit_types/index.js';
5
- export * from './deserialize.js';
6
3
  export * from './encoding.js';
7
- export * from './errors.js';
8
- export * from './hash.js';
9
4
  export * from './interface.js';
5
+ export * from './errors.js';
6
+ export * from './blob_batching_public_inputs.js';
10
7
  export * from './sponge_blob.js';
11
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC"}
package/dest/index.js CHANGED
@@ -1,10 +1,20 @@
1
+ import cKzg from 'c-kzg';
2
+ const { loadTrustedSetup } = cKzg;
1
3
  export * from './blob.js';
2
4
  export * from './blob_batching.js';
3
- export * from './blob_utils.js';
4
- export * from './circuit_types/index.js';
5
- export * from './deserialize.js';
6
5
  export * from './encoding.js';
7
- export * from './errors.js';
8
- export * from './hash.js';
9
6
  export * from './interface.js';
7
+ export * from './errors.js';
8
+ export * from './blob_batching_public_inputs.js';
10
9
  export * from './sponge_blob.js';
10
+ try {
11
+ loadTrustedSetup(8); // See https://notes.ethereum.org/@jtraglia/windowed_multiplications
12
+ } catch (error) {
13
+ if (error.message.includes('trusted setup is already loaded')) {
14
+ // NB: The c-kzg lib has no way of checking whether the setup is loaded or not,
15
+ // and it throws an error if it's already loaded, even though nothing is wrong.
16
+ // This is a rudimentary way of ensuring we load the trusted setup if we need it.
17
+ } else {
18
+ throw new Error(error);
19
+ }
20
+ }
@@ -2,23 +2,23 @@ import { type FieldsOf } from '@aztec/foundation/array';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
4
4
  /**
5
- * A Poseidon2 sponge used to accumulate data that will be added to blobs.
5
+ * A Poseidon2 sponge used to accumulate data that will be added to a blob.
6
6
  * See noir-projects/noir-protocol-circuits/crates/types/src/abis/sponge_blob.nr.
7
7
  */
8
8
  export declare class SpongeBlob {
9
- /** Sponge with absorbed fields that will go into one or more blobs. */
9
+ /** Sponge with absorbed tx effects that will go into a blob. */
10
10
  readonly sponge: Poseidon2Sponge;
11
11
  /** Number of effects absorbed so far. */
12
- numAbsorbedFields: number;
12
+ fields: number;
13
13
  /** Number of effects that will be absorbed. */
14
- readonly numExpectedFields: number;
14
+ readonly expectedFields: number;
15
15
  constructor(
16
- /** Sponge with absorbed fields that will go into one or more blobs. */
16
+ /** Sponge with absorbed tx effects that will go into a blob. */
17
17
  sponge: Poseidon2Sponge,
18
18
  /** Number of effects absorbed so far. */
19
- numAbsorbedFields: number,
19
+ fields: number,
20
20
  /** Number of effects that will be absorbed. */
21
- numExpectedFields: number);
21
+ expectedFields: number);
22
22
  static fromBuffer(buffer: Buffer | BufferReader): SpongeBlob;
23
23
  toBuffer(): Buffer<ArrayBufferLike>;
24
24
  static getFields(fields: FieldsOf<SpongeBlob>): (number | Poseidon2Sponge)[];
@@ -28,11 +28,7 @@ export declare class SpongeBlob {
28
28
  absorb(fields: Fr[]): Promise<void>;
29
29
  squeeze(): Promise<Fr>;
30
30
  static empty(): SpongeBlob;
31
- /**
32
- * Initialize the sponge blob with the number of expected fields in the checkpoint and absorb it as the first field.
33
- * Note: `numExpectedFields` includes the first field absorbed in this method.
34
- */
35
- static init(numExpectedFields: number): Promise<SpongeBlob>;
31
+ static init(expectedFields: number): SpongeBlob;
36
32
  }
37
33
  export declare class Poseidon2Sponge {
38
34
  cache: Tuple<Fr, 3>;
@@ -46,7 +42,7 @@ export declare class Poseidon2Sponge {
46
42
  toFields(): Fr[];
47
43
  static fromFields(fields: Fr[] | FieldReader): Poseidon2Sponge;
48
44
  static empty(): Poseidon2Sponge;
49
- static init(numExpectedFields: number): Poseidon2Sponge;
45
+ static init(expectedFields: number): Poseidon2Sponge;
50
46
  performDuplex(): Promise<void>;
51
47
  absorb(fields: Fr[]): Promise<void>;
52
48
  squeeze(): Promise<Fr>;
@@ -1 +1 @@
1
- {"version":3,"file":"sponge_blob.d.ts","sourceRoot":"","sources":["../src/sponge_blob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,qBAAa,UAAU;IAEnB,uEAAuE;aACvD,MAAM,EAAE,eAAe;IACvC,yCAAyC;IAClC,iBAAiB,EAAE,MAAM;IAChC,+CAA+C;aAC/B,iBAAiB,EAAE,MAAM;;IALzC,uEAAuE;IACvD,MAAM,EAAE,eAAe;IACvC,yCAAyC;IAClC,iBAAiB,EAAE,MAAM;IAChC,+CAA+C;IAC/B,iBAAiB,EAAE,MAAM;IAG3C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU;IAK5D,QAAQ;IAIR,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI7C,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,UAAU;IASzD,KAAK;IAIC,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE;IAUnB,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;IAS5B,MAAM,CAAC,KAAK,IAAI,UAAU;IAI1B;;;OAGG;WACU,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAQlE;AAGD,qBAAa,eAAe;IAEjB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,EAA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