Skip to content

Commit

Permalink
Update version of c-kzg to one which does not crash for blobs arrays …
Browse files Browse the repository at this point in the history
…of length 0 and 1
  • Loading branch information
dgcoffman committed Nov 8, 2022
1 parent 6a8d536 commit a63b043
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@lodestar/types": "^1.1.1",
"@lodestar/utils": "^1.1.1",
"bigint-buffer": "^1.1.5",
"c-kzg": "^0.0.8",
"c-kzg": "^0.0.9",
"cross-fetch": "^3.1.4",
"strict-event-emitter-types": "^2.0.0"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/validator/src/services/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ export class BlockProposingService {
blobsSidecar.beaconBlockRoot = blindedOrFullBlockHashTreeRoot(this.config, block);
blobsSidecar.beaconBlockSlot = block.slot;
blobsSidecar.blobs = blobs;

// c-kzg throws an error:
// free(): invalid next size (fast)
// when computeAggregateKzgProof is called with [] blobs
blobsSidecar.kzgAggregatedProof = blobs.length
? computeAggregateKzgProof(blobs)
: ssz.eip4844.KZGProof.defaultValue();
Expand Down
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4798,10 +4798,12 @@ bytes@3.1.2:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==

c-kzg@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/c-kzg/-/c-kzg-0.0.8.tgz#2d85e0746d3f2c18bb1b1141e2c46bce9dc3059b"
integrity sha512-7CQkVQyCnR57Kwlj+1NXEaMP/AQyQ04XLa6fa9R/+A76CIeNCw81luevzhdt2PsjzjBu2HB3QX2OG5n3xNxZBw==
c-kzg@^0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/c-kzg/-/c-kzg-0.0.9.tgz#c86bc6f155fc0552c4ab2ce04cad04b464aedacf"
integrity sha512-TAtjnlEN5hq4b6iEv7I4XZGQZ+gVWZBtfLIDvTMVf7jDjOiQjv3mJWrFNUeQxWq/GUsyew44oAukFDqbghjccg==
dependencies:
node-addon-api "^5.0.0"

cacache@^15.2.0:
version "15.3.0"
Expand Down Expand Up @@ -9846,6 +9848,11 @@ node-addon-api@^3.2.1:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161"
integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==

node-addon-api@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.0.0.tgz#7d7e6f9ef89043befdb20c1989c905ebde18c501"
integrity sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==

node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7:
version "2.6.7"
resolved "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz"
Expand Down

0 comments on commit a63b043

Please sign in to comment.