@aztec/blob-lib 0.0.1-commit.86469d5 → 0.0.1-commit.87a0206
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/blob_batching.js +3 -3
- package/package.json +3 -3
- package/src/blob_batching.ts +3 -3
package/dest/blob_batching.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BLOBS_PER_CHECKPOINT, MAX_CHECKPOINTS_PER_EPOCH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
|
|
3
3
|
import { sha256ToField } from '@aztec/foundation/crypto/sha256';
|
|
4
4
|
import { BLS12Fr, BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
@@ -56,8 +56,8 @@ import { getKzg } from './kzg_context.js';
|
|
|
56
56
|
* @returns A batched blob.
|
|
57
57
|
*/ static async batch(blobFieldsPerCheckpoint, verifyProof = false) {
|
|
58
58
|
const numCheckpoints = blobFieldsPerCheckpoint.length;
|
|
59
|
-
if (numCheckpoints >
|
|
60
|
-
throw new Error(`Too many checkpoints sent to batch(). The maximum is ${
|
|
59
|
+
if (numCheckpoints > MAX_CHECKPOINTS_PER_EPOCH) {
|
|
60
|
+
throw new Error(`Too many checkpoints sent to batch(). The maximum is ${MAX_CHECKPOINTS_PER_EPOCH}. Got ${numCheckpoints}.`);
|
|
61
61
|
}
|
|
62
62
|
// Precalculate the values (z and gamma) and initialize the accumulator:
|
|
63
63
|
let acc = await this.fromBlobFields(blobFieldsPerCheckpoint);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/blob-lib",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.87a0206",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"../package.common.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aztec/constants": "0.0.1-commit.
|
|
31
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
30
|
+
"@aztec/constants": "0.0.1-commit.87a0206",
|
|
31
|
+
"@aztec/foundation": "0.0.1-commit.87a0206",
|
|
32
32
|
"@crate-crypto/node-eth-kzg": "^0.10.0",
|
|
33
33
|
"tslib": "^2.4.0"
|
|
34
34
|
},
|
package/src/blob_batching.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BLOBS_PER_CHECKPOINT, MAX_CHECKPOINTS_PER_EPOCH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
|
|
3
3
|
import { sha256ToField } from '@aztec/foundation/crypto/sha256';
|
|
4
4
|
import { BLS12Fr, BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
@@ -75,9 +75,9 @@ export class BatchedBlobAccumulator {
|
|
|
75
75
|
*/
|
|
76
76
|
static async batch(blobFieldsPerCheckpoint: Fr[][], verifyProof = false): Promise<BatchedBlob> {
|
|
77
77
|
const numCheckpoints = blobFieldsPerCheckpoint.length;
|
|
78
|
-
if (numCheckpoints >
|
|
78
|
+
if (numCheckpoints > MAX_CHECKPOINTS_PER_EPOCH) {
|
|
79
79
|
throw new Error(
|
|
80
|
-
`Too many checkpoints sent to batch(). The maximum is ${
|
|
80
|
+
`Too many checkpoints sent to batch(). The maximum is ${MAX_CHECKPOINTS_PER_EPOCH}. Got ${numCheckpoints}.`,
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|