@lodestar/beacon-node 1.40.0-dev.1c71f4299a → 1.40.0-dev.2ae7375100
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/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +7 -7
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +10 -2
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +9 -8
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +7 -3
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +1 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +3 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +5 -3
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.d.ts +2 -2
- package/lib/chain/bls/multithread/jobItem.d.ts.map +1 -1
- package/lib/chain/bls/multithread/jobItem.js +2 -2
- package/lib/chain/bls/multithread/jobItem.js.map +1 -1
- package/lib/chain/bls/singleThread.d.ts +4 -2
- package/lib/chain/bls/singleThread.d.ts.map +1 -1
- package/lib/chain/bls/singleThread.js +4 -2
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.d.ts +2 -2
- package/lib/chain/bls/utils.d.ts.map +1 -1
- package/lib/chain/bls/utils.js +9 -6
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +8 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +36 -18
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +14 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +48 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -0
- package/lib/chain/errors/executionPayloadBid.js +15 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +48 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js +16 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -0
- package/lib/chain/errors/index.d.ts +3 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +3 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/errors/payloadAttestation.d.ts +34 -0
- package/lib/chain/errors/payloadAttestation.d.ts.map +1 -0
- package/lib/chain/errors/payloadAttestation.js +13 -0
- package/lib/chain/errors/payloadAttestation.js.map +1 -0
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +18 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +7 -2
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +21 -0
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -0
- package/lib/chain/opPools/executionPayloadBidPool.js +57 -0
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -0
- package/lib/chain/opPools/index.d.ts +2 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +2 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts +24 -0
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/payloadAttestationPool.js +109 -0
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -0
- package/lib/chain/prepareNextSlot.js +6 -4
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +5 -3
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +3 -8
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -1
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -2
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +2 -16
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +5 -7
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +7 -17
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +3 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +3 -1
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +5 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +5 -0
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +12 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +30 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +15 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +28 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +1 -0
- package/lib/chain/seenCache/seenGossipBlockInput.js +1 -1
- package/lib/chain/validation/aggregateAndProof.js +35 -14
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts +2 -2
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +27 -8
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +1 -1
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.d.ts.map +1 -1
- package/lib/chain/validation/blobSidecar.js +3 -3
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +5 -4
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +3 -3
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +5 -0
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -0
- package/lib/chain/validation/executionPayloadBid.js +104 -0
- package/lib/chain/validation/executionPayloadBid.js.map +1 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts +5 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/validation/executionPayloadEnvelope.js +89 -0
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -0
- package/lib/chain/validation/payloadAttestationMessage.d.ts +9 -0
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -0
- package/lib/chain/validation/payloadAttestationMessage.js +72 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -0
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts +2 -3
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js +8 -3
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +3 -3
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.d.ts +2 -3
- package/lib/chain/validation/signatureSets/selectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.js +8 -3
- package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +3 -3
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +1 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +3 -3
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.js +1 -1
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +3 -5
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +1 -1
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +7 -4
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/checkpointState.js +0 -1
- package/lib/db/repositories/checkpointState.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +20 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +40 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +20 -2
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +3 -0
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js +38 -2
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +77 -1
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +20 -0
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +34 -0
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +16 -0
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +3 -0
- package/lib/network/processor/index.js.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/verify.d.ts +1 -2
- package/lib/sync/backfill/verify.d.ts.map +1 -1
- package/lib/sync/backfill/verify.js +2 -2
- package/lib/sync/backfill/verify.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/beacon/blocks/index.ts +9 -7
- package/src/api/impl/lodestar/index.ts +12 -3
- package/src/api/impl/validator/index.ts +12 -11
- package/src/chain/ColumnReconstructionTracker.ts +8 -4
- package/src/chain/blocks/verifyBlock.ts +0 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +4 -12
- package/src/chain/bls/multithread/index.ts +7 -4
- package/src/chain/bls/multithread/jobItem.ts +7 -3
- package/src/chain/bls/singleThread.ts +5 -3
- package/src/chain/bls/utils.ts +15 -7
- package/src/chain/chain.ts +39 -26
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/executionPayloadBid.ts +35 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +34 -0
- package/src/chain/errors/index.ts +3 -0
- package/src/chain/errors/payloadAttestation.ts +25 -0
- package/src/chain/forkChoice/index.ts +19 -0
- package/src/chain/interface.ts +16 -1
- package/src/chain/opPools/executionPayloadBidPool.ts +77 -0
- package/src/chain/opPools/index.ts +2 -0
- package/src/chain/opPools/payloadAttestationPool.ts +157 -0
- package/src/chain/prepareNextSlot.ts +6 -6
- package/src/chain/produceBlock/produceBlockBody.ts +7 -5
- package/src/chain/regen/interface.ts +2 -12
- package/src/chain/regen/queued.ts +3 -23
- package/src/chain/regen/regen.ts +10 -25
- package/src/chain/seenCache/index.ts +3 -1
- package/src/chain/seenCache/seenAttesters.ts +5 -0
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -0
- package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +34 -0
- package/src/chain/seenCache/seenGossipBlockInput.ts +1 -1
- package/src/chain/validation/aggregateAndProof.ts +36 -14
- package/src/chain/validation/attestation.ts +33 -16
- package/src/chain/validation/attesterSlashing.ts +1 -6
- package/src/chain/validation/blobSidecar.ts +2 -7
- package/src/chain/validation/block.ts +5 -4
- package/src/chain/validation/dataColumnSidecar.ts +2 -7
- package/src/chain/validation/executionPayloadBid.ts +141 -0
- package/src/chain/validation/executionPayloadEnvelope.ts +122 -0
- package/src/chain/validation/payloadAttestationMessage.ts +109 -0
- package/src/chain/validation/proposerSlashing.ts +1 -6
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +9 -14
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -4
- package/src/chain/validation/signatureSets/selectionProof.ts +9 -9
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -4
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -3
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -4
- package/src/chain/validation/syncCommittee.ts +1 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +3 -5
- package/src/chain/validation/voluntaryExit.ts +1 -1
- package/src/chain/validatorMonitor.ts +10 -5
- package/src/db/repositories/checkpointState.ts +1 -1
- package/src/metrics/metrics/lodestar.ts +40 -0
- package/src/network/gossip/interface.ts +17 -0
- package/src/network/gossip/scoringParameters.ts +44 -2
- package/src/network/gossip/topic.ts +21 -0
- package/src/network/processor/gossipHandlers.ts +48 -0
- package/src/network/processor/gossipQueues/index.ts +16 -0
- package/src/network/processor/index.ts +3 -0
- package/src/sync/backfill/backfill.ts +2 -2
- package/src/sync/backfill/verify.ts +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../src/sync/backfill/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../src/sync/backfill/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAgB,4BAA4B,EAAC,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAgC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,aAAa,CAAC;AASrE,MAAM,UAAU,mBAAmB,CACjC,MAAoB,EACpB,MAA2B,EAC3B,UAAgB;IAMhB,IAAI,QAAQ,GAAS,UAAU,CAAC;IAChC,IAAI,UAAU,GAAyB,IAAI,CAAC;IAE5C,MAAM,cAAc,GAAwB,EAAE,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC1C,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,iBAAiB,CAAC,EAAC,IAAI,EAAE,qBAAqB,CAAC,YAAY,EAAC,CAAC,CAAC;YAC1E,CAAC;YACD,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,qBAAqB,CAAC,UAAU,EAAC,CAAC;QAC/E,CAAC;QACD,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,UAAU,GAAG,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;QACtE,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;IACD,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAAoB,EACpB,GAAiB,EACjB,MAA2B;IAE3B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO;IAC3E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAqB,EAAE,KAAK,EAAE,EAAE;QAChE,6CAA6C;QAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY;YAAE,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAChG,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,mBAAmB,CAAC,UAAU,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,iBAAiB,CAAC,EAAC,IAAI,EAAE,qBAAqB,CAAC,iBAAiB,EAAC,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.40.0-dev.
|
|
14
|
+
"version": "1.40.0-dev.2ae7375100",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -134,18 +134,18 @@
|
|
|
134
134
|
"@libp2p/peer-id": "^5.1.0",
|
|
135
135
|
"@libp2p/prometheus-metrics": "^4.3.15",
|
|
136
136
|
"@libp2p/tcp": "^10.1.8",
|
|
137
|
-
"@lodestar/api": "^1.40.0-dev.
|
|
138
|
-
"@lodestar/config": "^1.40.0-dev.
|
|
139
|
-
"@lodestar/db": "^1.40.0-dev.
|
|
140
|
-
"@lodestar/fork-choice": "^1.40.0-dev.
|
|
141
|
-
"@lodestar/light-client": "^1.40.0-dev.
|
|
142
|
-
"@lodestar/logger": "^1.40.0-dev.
|
|
143
|
-
"@lodestar/params": "^1.40.0-dev.
|
|
144
|
-
"@lodestar/reqresp": "^1.40.0-dev.
|
|
145
|
-
"@lodestar/state-transition": "^1.40.0-dev.
|
|
146
|
-
"@lodestar/types": "^1.40.0-dev.
|
|
147
|
-
"@lodestar/utils": "^1.40.0-dev.
|
|
148
|
-
"@lodestar/validator": "^1.40.0-dev.
|
|
137
|
+
"@lodestar/api": "^1.40.0-dev.2ae7375100",
|
|
138
|
+
"@lodestar/config": "^1.40.0-dev.2ae7375100",
|
|
139
|
+
"@lodestar/db": "^1.40.0-dev.2ae7375100",
|
|
140
|
+
"@lodestar/fork-choice": "^1.40.0-dev.2ae7375100",
|
|
141
|
+
"@lodestar/light-client": "^1.40.0-dev.2ae7375100",
|
|
142
|
+
"@lodestar/logger": "^1.40.0-dev.2ae7375100",
|
|
143
|
+
"@lodestar/params": "^1.40.0-dev.2ae7375100",
|
|
144
|
+
"@lodestar/reqresp": "^1.40.0-dev.2ae7375100",
|
|
145
|
+
"@lodestar/state-transition": "^1.40.0-dev.2ae7375100",
|
|
146
|
+
"@lodestar/types": "^1.40.0-dev.2ae7375100",
|
|
147
|
+
"@lodestar/utils": "^1.40.0-dev.2ae7375100",
|
|
148
|
+
"@lodestar/validator": "^1.40.0-dev.2ae7375100",
|
|
149
149
|
"@multiformats/multiaddr": "^12.1.3",
|
|
150
150
|
"datastore-core": "^10.0.2",
|
|
151
151
|
"datastore-fs": "^10.0.6",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
170
170
|
"@libp2p/interface-internal": "^2.3.18",
|
|
171
171
|
"@libp2p/logger": "^5.1.21",
|
|
172
|
-
"@lodestar/spec-test-util": "^1.40.0-dev.
|
|
172
|
+
"@lodestar/spec-test-util": "^1.40.0-dev.2ae7375100",
|
|
173
173
|
"@types/js-yaml": "^4.0.5",
|
|
174
174
|
"@types/qs": "^6.9.7",
|
|
175
175
|
"@types/tmp": "^0.2.3",
|
|
@@ -188,5 +188,5 @@
|
|
|
188
188
|
"beacon",
|
|
189
189
|
"blockchain"
|
|
190
190
|
],
|
|
191
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "e67984c4ee553bcb1ccc33f9e8fec3c5023b8401"
|
|
192
192
|
}
|
|
@@ -434,11 +434,13 @@ export function getBeaconBlockApi({
|
|
|
434
434
|
const nonFinalizedBlocks = chain.forkChoice.getBlockSummariesByParentRoot(parentRoot);
|
|
435
435
|
await Promise.all(
|
|
436
436
|
nonFinalizedBlocks.map(async (summary) => {
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const canonical = chain.forkChoice.getCanonicalBlockAtSlot(block.message.slot);
|
|
437
|
+
const blockResult = await chain.getBlockByRoot(summary.blockRoot);
|
|
438
|
+
if (blockResult) {
|
|
439
|
+
const canonical = chain.forkChoice.getCanonicalBlockAtSlot(blockResult.block.message.slot);
|
|
440
440
|
if (canonical) {
|
|
441
|
-
result.push(
|
|
441
|
+
result.push(
|
|
442
|
+
toBeaconHeaderResponse(config, blockResult.block, canonical.blockRoot === summary.blockRoot)
|
|
443
|
+
);
|
|
442
444
|
if (isOptimisticBlock(canonical)) {
|
|
443
445
|
executionOptimistic = true;
|
|
444
446
|
}
|
|
@@ -492,9 +494,9 @@ export function getBeaconBlockApi({
|
|
|
492
494
|
finalized = false;
|
|
493
495
|
|
|
494
496
|
if (summary.blockRoot !== toRootHex(canonicalRoot)) {
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
result.push(toBeaconHeaderResponse(config, block));
|
|
497
|
+
const blockResult = await chain.getBlockByRoot(summary.blockRoot);
|
|
498
|
+
if (blockResult) {
|
|
499
|
+
result.push(toBeaconHeaderResponse(config, blockResult.block));
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
502
|
})
|
|
@@ -244,6 +244,18 @@ export function getLodestarApi({
|
|
|
244
244
|
data: chain.validatorMonitor?.getMonitoredValidatorIndices() ?? [],
|
|
245
245
|
};
|
|
246
246
|
},
|
|
247
|
+
|
|
248
|
+
async getCustodyInfo() {
|
|
249
|
+
const {custodyColumns, targetCustodyGroupCount} = chain.custodyConfig;
|
|
250
|
+
|
|
251
|
+
return {
|
|
252
|
+
data: {
|
|
253
|
+
earliestCustodiedSlot: chain.earliestAvailableSlot,
|
|
254
|
+
custodyGroupCount: targetCustodyGroupCount,
|
|
255
|
+
custodyColumns,
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
},
|
|
247
259
|
};
|
|
248
260
|
}
|
|
249
261
|
|
|
@@ -255,9 +267,6 @@ function regenRequestToJson(config: ChainForkConfig, regenRequest: RegenRequest)
|
|
|
255
267
|
slot: regenRequest.args[1],
|
|
256
268
|
};
|
|
257
269
|
|
|
258
|
-
case "getCheckpointState":
|
|
259
|
-
return ssz.phase0.Checkpoint.toJson(regenRequest.args[0]);
|
|
260
|
-
|
|
261
270
|
case "getPreState": {
|
|
262
271
|
const slot = regenRequest.args[0].slot;
|
|
263
272
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
4
|
-
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
4
|
+
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
5
5
|
import {
|
|
6
6
|
ForkName,
|
|
7
7
|
ForkPostBellatrix,
|
|
@@ -413,10 +413,10 @@ export function getValidatorApi(
|
|
|
413
413
|
// as of now fee recipient checks can not be performed because builder does not return bid recipient
|
|
414
414
|
{
|
|
415
415
|
commonBlockBodyPromise,
|
|
416
|
-
|
|
416
|
+
parentBlock,
|
|
417
417
|
}: Omit<routes.validator.ExtraProduceBlockOpts, "builderSelection"> & {
|
|
418
418
|
commonBlockBodyPromise: Promise<CommonBlockBody>;
|
|
419
|
-
|
|
419
|
+
parentBlock: ProtoBlock;
|
|
420
420
|
}
|
|
421
421
|
): Promise<ProduceBlindedBlockRes> {
|
|
422
422
|
const version = config.getForkName(slot);
|
|
@@ -447,7 +447,7 @@ export function getValidatorApi(
|
|
|
447
447
|
timer = metrics?.blockProductionTime.startTimer();
|
|
448
448
|
const {block, executionPayloadValue, consensusBlockValue} = await chain.produceBlindedBlock({
|
|
449
449
|
slot,
|
|
450
|
-
|
|
450
|
+
parentBlock,
|
|
451
451
|
randaoReveal,
|
|
452
452
|
graffiti,
|
|
453
453
|
commonBlockBodyPromise,
|
|
@@ -482,10 +482,10 @@ export function getValidatorApi(
|
|
|
482
482
|
feeRecipient,
|
|
483
483
|
strictFeeRecipientCheck,
|
|
484
484
|
commonBlockBodyPromise,
|
|
485
|
-
|
|
485
|
+
parentBlock,
|
|
486
486
|
}: Omit<routes.validator.ExtraProduceBlockOpts, "builderSelection"> & {
|
|
487
487
|
commonBlockBodyPromise: Promise<CommonBlockBody>;
|
|
488
|
-
|
|
488
|
+
parentBlock: ProtoBlock;
|
|
489
489
|
}
|
|
490
490
|
): Promise<ProduceBlockContentsRes & {shouldOverrideBuilder?: boolean}> {
|
|
491
491
|
const source = ProducedBlockSource.engine;
|
|
@@ -496,7 +496,7 @@ export function getValidatorApi(
|
|
|
496
496
|
timer = metrics?.blockProductionTime.startTimer();
|
|
497
497
|
const {block, executionPayloadValue, consensusBlockValue, shouldOverrideBuilder} = await chain.produceBlock({
|
|
498
498
|
slot,
|
|
499
|
-
|
|
499
|
+
parentBlock,
|
|
500
500
|
randaoReveal,
|
|
501
501
|
graffiti,
|
|
502
502
|
feeRecipient,
|
|
@@ -569,7 +569,8 @@ export function getValidatorApi(
|
|
|
569
569
|
notWhileSyncing();
|
|
570
570
|
await waitForSlot(slot); // Must never request for a future slot > currentSlot
|
|
571
571
|
|
|
572
|
-
const
|
|
572
|
+
const parentBlock = chain.getProposerHead(slot);
|
|
573
|
+
const {blockRoot: parentBlockRootHex, slot: parentSlot} = parentBlock;
|
|
573
574
|
const parentBlockRoot = fromHex(parentBlockRootHex);
|
|
574
575
|
notOnOutOfRangeData(parentBlockRoot);
|
|
575
576
|
metrics?.blockProductionSlotDelta.set(slot - parentSlot);
|
|
@@ -638,7 +639,7 @@ export function getValidatorApi(
|
|
|
638
639
|
// can't do fee recipient checks as builder bid doesn't return feeRecipient as of now
|
|
639
640
|
strictFeeRecipientCheck: false,
|
|
640
641
|
commonBlockBodyPromise,
|
|
641
|
-
|
|
642
|
+
parentBlock,
|
|
642
643
|
})
|
|
643
644
|
: Promise.reject(new Error("Builder disabled"));
|
|
644
645
|
|
|
@@ -647,7 +648,7 @@ export function getValidatorApi(
|
|
|
647
648
|
feeRecipient,
|
|
648
649
|
strictFeeRecipientCheck,
|
|
649
650
|
commonBlockBodyPromise,
|
|
650
|
-
|
|
651
|
+
parentBlock,
|
|
651
652
|
}).then((engineBlock) => {
|
|
652
653
|
// Once the engine returns a block, in the event of either:
|
|
653
654
|
// - suspected builder censorship
|
|
@@ -689,7 +690,7 @@ export function getValidatorApi(
|
|
|
689
690
|
chain
|
|
690
691
|
.produceCommonBlockBody({
|
|
691
692
|
slot,
|
|
692
|
-
|
|
693
|
+
parentBlock,
|
|
693
694
|
randaoReveal,
|
|
694
695
|
graffiti: graffitiBytes,
|
|
695
696
|
})
|
|
@@ -8,12 +8,12 @@ import {ChainEventEmitter} from "./emitter.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Minimum time to wait before attempting reconstruction
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const RECONSTRUCTION_DELAY_MIN_BPS = 667;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Maximum time to wait before attempting reconstruction
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const RECONSTRUCTION_DELAY_MAX_BPS = 1000;
|
|
17
17
|
|
|
18
18
|
export type ColumnReconstructionTrackerInit = {
|
|
19
19
|
logger: Logger;
|
|
@@ -41,11 +41,16 @@ export class ColumnReconstructionTracker {
|
|
|
41
41
|
/** Track if a reconstruction attempt is in-flight */
|
|
42
42
|
running = false;
|
|
43
43
|
|
|
44
|
+
private readonly minDelayMs: number;
|
|
45
|
+
private readonly maxDelayMs: number;
|
|
46
|
+
|
|
44
47
|
constructor(init: ColumnReconstructionTrackerInit) {
|
|
45
48
|
this.logger = init.logger;
|
|
46
49
|
this.emitter = init.emitter;
|
|
47
50
|
this.metrics = init.metrics;
|
|
48
51
|
this.config = init.config;
|
|
52
|
+
this.minDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MIN_BPS);
|
|
53
|
+
this.maxDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MAX_BPS);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
triggerColumnReconstruction(blockInput: BlockInputColumns): void {
|
|
@@ -61,8 +66,7 @@ export class ColumnReconstructionTracker {
|
|
|
61
66
|
// just that it has been triggered for this block root.
|
|
62
67
|
this.running = true;
|
|
63
68
|
this.lastBlockRootHex = blockInput.blockRootHex;
|
|
64
|
-
const delay =
|
|
65
|
-
RECONSTRUCTION_DELAY_MIN_MS + Math.random() * (RECONSTRUCTION_DELAY_MAX_MS - RECONSTRUCTION_DELAY_MIN_MS);
|
|
69
|
+
const delay = this.minDelayMs + Math.random() * (this.maxDelayMs - this.minDelayMs);
|
|
66
70
|
sleep(delay)
|
|
67
71
|
.then(() => {
|
|
68
72
|
const logCtx = {slot: blockInput.slot, root: blockInput.blockRootHex};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {CachedBeaconStateAllForks,
|
|
2
|
+
import {CachedBeaconStateAllForks, getBlockSignatureSets} from "@lodestar/state-transition";
|
|
3
3
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
4
4
|
import {Logger} from "@lodestar/utils";
|
|
5
5
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -17,7 +17,6 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
17
17
|
*/
|
|
18
18
|
export async function verifyBlocksSignatures(
|
|
19
19
|
config: BeaconConfig,
|
|
20
|
-
index2pubkey: Index2PubkeyCache,
|
|
21
20
|
bls: IBlsVerifier,
|
|
22
21
|
logger: Logger,
|
|
23
22
|
metrics: Metrics | null,
|
|
@@ -42,16 +41,9 @@ export async function verifyBlocksSignatures(
|
|
|
42
41
|
: //
|
|
43
42
|
// Verify signatures per block to track which block is invalid
|
|
44
43
|
bls.verifySignatureSets(
|
|
45
|
-
getBlockSignatureSets(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
currentSyncCommitteeIndexed,
|
|
49
|
-
block,
|
|
50
|
-
indexedAttestationsByBlock[i],
|
|
51
|
-
{
|
|
52
|
-
skipProposerSignature: opts.validProposerSignature,
|
|
53
|
-
}
|
|
54
|
-
)
|
|
44
|
+
getBlockSignatureSets(config, currentSyncCommitteeIndexed, block, indexedAttestationsByBlock[i], {
|
|
45
|
+
skipProposerSignature: opts.validProposerSignature,
|
|
46
|
+
})
|
|
55
47
|
);
|
|
56
48
|
|
|
57
49
|
// getBlockSignatureSets() takes 45ms in benchmarks for 2022Q2 mainnet blocks (100 sigs). When syncing a 32 blocks
|
|
@@ -7,7 +7,7 @@ import {Worker, spawn} from "@chainsafe/threads";
|
|
|
7
7
|
self = undefined;
|
|
8
8
|
|
|
9
9
|
import {PublicKey} from "@chainsafe/blst";
|
|
10
|
-
import {ISignatureSet} from "@lodestar/state-transition";
|
|
10
|
+
import {ISignatureSet, Index2PubkeyCache} from "@lodestar/state-transition";
|
|
11
11
|
import {Logger} from "@lodestar/utils";
|
|
12
12
|
import {Metrics} from "../../../metrics/index.js";
|
|
13
13
|
import {LinkedList} from "../../../util/array.js";
|
|
@@ -34,6 +34,7 @@ const workerDir = process.env.NODE_ENV === "test" ? "../../../../lib/chain/bls/m
|
|
|
34
34
|
export type BlsMultiThreadWorkerPoolModules = {
|
|
35
35
|
logger: Logger;
|
|
36
36
|
metrics: Metrics | null;
|
|
37
|
+
index2pubkey: Index2PubkeyCache;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export type BlsMultiThreadWorkerPoolOptions = {
|
|
@@ -113,6 +114,7 @@ type WorkerDescriptor = {
|
|
|
113
114
|
export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
114
115
|
private readonly logger: Logger;
|
|
115
116
|
private readonly metrics: Metrics | null;
|
|
117
|
+
private readonly index2pubkey: Index2PubkeyCache;
|
|
116
118
|
|
|
117
119
|
private readonly workers: WorkerDescriptor[];
|
|
118
120
|
private readonly jobs = new LinkedList<JobQueueItem>();
|
|
@@ -128,9 +130,10 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
128
130
|
private workersBusy = 0;
|
|
129
131
|
|
|
130
132
|
constructor(options: BlsMultiThreadWorkerPoolOptions, modules: BlsMultiThreadWorkerPoolModules) {
|
|
131
|
-
const {logger, metrics} = modules;
|
|
133
|
+
const {logger, metrics, index2pubkey} = modules;
|
|
132
134
|
this.logger = logger;
|
|
133
135
|
this.metrics = metrics;
|
|
136
|
+
this.index2pubkey = index2pubkey;
|
|
134
137
|
this.blsVerifyAllMultiThread = options.blsVerifyAllMultiThread ?? false;
|
|
135
138
|
|
|
136
139
|
// Use compressed for herumi for now.
|
|
@@ -170,7 +173,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
170
173
|
try {
|
|
171
174
|
return verifySignatureSetsMaybeBatch(
|
|
172
175
|
sets.map((set) => ({
|
|
173
|
-
publicKey: getAggregatedPubkey(set),
|
|
176
|
+
publicKey: getAggregatedPubkey(set, this.index2pubkey),
|
|
174
177
|
message: set.signingRoot.valueOf(),
|
|
175
178
|
signature: set.signature,
|
|
176
179
|
}))
|
|
@@ -395,7 +398,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
|
|
|
395
398
|
try {
|
|
396
399
|
// Note: This can throw, must be handled per-job.
|
|
397
400
|
// Pubkey and signature aggregation is defered here
|
|
398
|
-
workReq = await jobItemWorkReq(job, this.metrics);
|
|
401
|
+
workReq = await jobItemWorkReq(job, this.index2pubkey, this.metrics);
|
|
399
402
|
} catch (e) {
|
|
400
403
|
this.metrics?.blsThreadPool.errorAggregateSignatureSetsCount.inc({type: job.type});
|
|
401
404
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {PublicKey, asyncAggregateWithRandomness} from "@chainsafe/blst";
|
|
2
|
-
import {ISignatureSet, SignatureSetType} from "@lodestar/state-transition";
|
|
2
|
+
import {ISignatureSet, Index2PubkeyCache, SignatureSetType} from "@lodestar/state-transition";
|
|
3
3
|
import {Metrics} from "../../../metrics/metrics.js";
|
|
4
4
|
import {LinkedList} from "../../../util/array.js";
|
|
5
5
|
import {VerifySignatureOpts} from "../interface.js";
|
|
@@ -48,14 +48,18 @@ export function jobItemSigSets(job: JobQueueItem): number {
|
|
|
48
48
|
* Prepare BlsWorkReq from JobQueueItem
|
|
49
49
|
* WARNING: May throw with untrusted user input
|
|
50
50
|
*/
|
|
51
|
-
export async function jobItemWorkReq(
|
|
51
|
+
export async function jobItemWorkReq(
|
|
52
|
+
job: JobQueueItem,
|
|
53
|
+
index2pubkey: Index2PubkeyCache,
|
|
54
|
+
metrics: Metrics | null
|
|
55
|
+
): Promise<BlsWorkReq> {
|
|
52
56
|
switch (job.type) {
|
|
53
57
|
case JobQueueItemType.default:
|
|
54
58
|
return {
|
|
55
59
|
opts: job.opts,
|
|
56
60
|
sets: job.sets.map((set) => ({
|
|
57
61
|
// this can throw, handled in the consumer code
|
|
58
|
-
publicKey: getAggregatedPubkey(set, metrics).toBytes(),
|
|
62
|
+
publicKey: getAggregatedPubkey(set, index2pubkey, metrics).toBytes(),
|
|
59
63
|
signature: set.signature,
|
|
60
64
|
message: set.signingRoot,
|
|
61
65
|
})),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {PublicKey, Signature, aggregatePublicKeys, aggregateSignatures, verify} from "@chainsafe/blst";
|
|
2
|
-
import {ISignatureSet} from "@lodestar/state-transition";
|
|
2
|
+
import {ISignatureSet, Index2PubkeyCache} from "@lodestar/state-transition";
|
|
3
3
|
import {Metrics} from "../../metrics/index.js";
|
|
4
4
|
import {IBlsVerifier} from "./interface.js";
|
|
5
5
|
import {verifySignatureSetsMaybeBatch} from "./maybeBatch.js";
|
|
@@ -7,16 +7,18 @@ import {getAggregatedPubkey, getAggregatedPubkeysCount} from "./utils.js";
|
|
|
7
7
|
|
|
8
8
|
export class BlsSingleThreadVerifier implements IBlsVerifier {
|
|
9
9
|
private readonly metrics: Metrics | null;
|
|
10
|
+
private readonly index2pubkey: Index2PubkeyCache;
|
|
10
11
|
|
|
11
|
-
constructor({metrics = null}: {metrics: Metrics | null}) {
|
|
12
|
+
constructor({metrics = null, index2pubkey}: {metrics: Metrics | null; index2pubkey: Index2PubkeyCache}) {
|
|
12
13
|
this.metrics = metrics;
|
|
14
|
+
this.index2pubkey = index2pubkey;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
async verifySignatureSets(sets: ISignatureSet[]): Promise<boolean> {
|
|
16
18
|
this.metrics?.bls.aggregatedPubkeys.inc(getAggregatedPubkeysCount(sets));
|
|
17
19
|
|
|
18
20
|
const setsAggregated = sets.map((set) => ({
|
|
19
|
-
publicKey: getAggregatedPubkey(set),
|
|
21
|
+
publicKey: getAggregatedPubkey(set, this.index2pubkey, this.metrics),
|
|
20
22
|
message: set.signingRoot,
|
|
21
23
|
signature: set.signature,
|
|
22
24
|
}));
|
package/src/chain/bls/utils.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import {PublicKey, aggregatePublicKeys} from "@chainsafe/blst";
|
|
2
|
-
import {ISignatureSet, SignatureSetType} from "@lodestar/state-transition";
|
|
2
|
+
import {ISignatureSet, Index2PubkeyCache, SignatureSetType} from "@lodestar/state-transition";
|
|
3
3
|
import {Metrics} from "../../metrics/metrics.js";
|
|
4
4
|
|
|
5
|
-
export function getAggregatedPubkey(
|
|
5
|
+
export function getAggregatedPubkey(
|
|
6
|
+
signatureSet: ISignatureSet,
|
|
7
|
+
index2pubkey: Index2PubkeyCache,
|
|
8
|
+
metrics: Metrics | null = null
|
|
9
|
+
): PublicKey {
|
|
6
10
|
switch (signatureSet.type) {
|
|
7
11
|
case SignatureSetType.single:
|
|
8
12
|
return signatureSet.pubkey;
|
|
9
13
|
|
|
14
|
+
case SignatureSetType.indexed:
|
|
15
|
+
return index2pubkey[signatureSet.index];
|
|
16
|
+
|
|
10
17
|
case SignatureSetType.aggregate: {
|
|
11
18
|
const timer = metrics?.blsThreadPool.pubkeysAggregationMainThreadDuration.startTimer();
|
|
12
|
-
const pubkeys =
|
|
19
|
+
const pubkeys = signatureSet.indices.map((i) => index2pubkey[i]);
|
|
20
|
+
const aggregated = aggregatePublicKeys(pubkeys);
|
|
13
21
|
timer?.();
|
|
14
|
-
return
|
|
22
|
+
return aggregated;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
default:
|
|
@@ -20,11 +28,11 @@ export function getAggregatedPubkey(signatureSet: ISignatureSet, metrics: Metric
|
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
export function getAggregatedPubkeysCount(signatureSets: ISignatureSet[]): number {
|
|
23
|
-
let
|
|
31
|
+
let pubkeysCount = 0;
|
|
24
32
|
for (const set of signatureSets) {
|
|
25
33
|
if (set.type === SignatureSetType.aggregate) {
|
|
26
|
-
|
|
34
|
+
pubkeysCount += set.indices.length;
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
|
-
return
|
|
37
|
+
return pubkeysCount;
|
|
30
38
|
}
|