New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(blst): add new blst to all packages with bls #5493
Conversation
ca0c265
to
3b85012
Compare
@matthewkeil Please do not replace bls everywhere, only in the hot path verifying gossip data in the beacon chain. Such that do not change any other package beyond the beacon-node |
packages/beacon-node/package.json
Outdated
@@ -98,6 +98,7 @@ | |||
"@chainsafe/as-chacha20poly1305": "^0.1.0", | |||
"@chainsafe/as-sha256": "^0.3.1", | |||
"@chainsafe/bls": "7.1.1", | |||
"@chainsafe/blst": "file:../../../blst-ts-2/rebuild", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dapplion I have the new bindings stubbed in using a file import. How would you prefer I handle this for CI? Should I publish a version to @matthewkeil/blst
or something similar? Or perhaps an odd semVer number that we can delete from @chainsage/blst
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I published at blst-ts-test
for now
…void import confusion
there was a build error on linux. I am updating the bindings and I built a workflow to test all three platforms in the |
Performance Report✔️ no performance regression detected Full benchmark results
|
Converting to draft as this must not be merged until extensive testing in mainnet + internal audit of the lib |
Motivation
The @chainsafe/blst library was rebuilt with Napi to put bls work on the
libuv
thread pool in-lieu of a worker thread. The goal is to lower the overhead for bls work and to share it across all worker threads to increase bls throughput and to lower worker thread overhead. There will also be no latency with the messaging between workers.Description
Swapped out sync for async functions for all bls calls on main thread in
packages/beacon-node
Inclusions in
packages/beacon-node
package.json
to include@chainsafe/blst
Implementation notes for review
getAggregatedPubkey
inbeacon-node/src/chain/bls/utils.ts
has a SWIG signatureSet (from@lodestar/state-transition
) as param so converted in function to new binding format... not ideal but want to prevent upstream changesThese two were dependency of functions inside and outside of worker thread. were converted to two functions (sync and async:
verifySignatureSetsMaybeBatch
inbeacon-node/src/chain/bls/maybeBatch.ts
getAggregatedPubkey
inbeacon-node/src/chain/bls/utils.ts
Files that still have
@chainsafe/bls
:beacon-node/src/chain/bls/maybeBatch.ts
beacon-node/src/chain/bls/utils.ts
beacon-node/src/chain/bls/multithread/index.ts
beacon-node/src/chain/bls/multithread/worker.ts