@lodestar/beacon-node 1.45.0 → 1.46.0-dev.13423cff6d
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 +186 -57
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/config/constants.d.ts +1 -0
- package/lib/api/impl/config/constants.d.ts.map +1 -1
- package/lib/api/impl/config/constants.js +2 -1
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +2 -3
- 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 +172 -88
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/rest/base.d.ts.map +1 -1
- package/lib/api/rest/base.js +6 -3
- package/lib/api/rest/base.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +17 -3
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +0 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +2 -17
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +13 -5
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +3 -3
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +0 -1
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +44 -2
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +48 -6
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +25 -4
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +11 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +2 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/proposerPreferences.d.ts +14 -1
- package/lib/chain/errors/proposerPreferences.d.ts.map +1 -1
- package/lib/chain/errors/proposerPreferences.js +2 -0
- package/lib/chain/errors/proposerPreferences.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +11 -6
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.d.ts.map +1 -1
- package/lib/chain/lightClient/proofs.js +28 -2
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/lightClient/types.d.ts +3 -1
- package/lib/chain/lightClient/types.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +2 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.d.ts +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.d.ts.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.js +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +10 -6
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +10 -6
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +53 -4
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +5 -0
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +32 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +29 -0
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/proposerPreferences.d.ts +9 -2
- package/lib/chain/validation/proposerPreferences.d.ts.map +1 -1
- package/lib/chain/validation/proposerPreferences.js +65 -13
- package/lib/chain/validation/proposerPreferences.js.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js +2 -3
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.js +1 -1
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/lightclientSyncCommitteeWitness.d.ts.map +1 -1
- package/lib/db/repositories/lightclientSyncCommitteeWitness.js +42 -7
- package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
- package/lib/metrics/nodeJsMetrics.js +1 -1
- package/lib/metrics/nodeJsMetrics.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +2 -7
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/discv5/index.d.ts.map +1 -1
- package/lib/network/discv5/index.js +1 -4
- package/lib/network/discv5/index.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts +2 -2
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -9
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +2 -2
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +76 -233
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +24 -1
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +4 -1
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +2 -9
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +4 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +19 -11
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +1 -1
- package/lib/network/peers/datastore.d.ts.map +1 -1
- package/lib/network/peers/datastore.js +1 -1
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +12 -6
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +4 -2
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +20 -11
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/util.d.ts +1 -0
- package/lib/network/util.d.ts.map +1 -1
- package/lib/network/util.js +4 -0
- package/lib/network/util.js.map +1 -1
- package/lib/sync/constants.d.ts +6 -5
- package/lib/sync/constants.d.ts.map +1 -1
- package/lib/sync/constants.js +6 -5
- package/lib/sync/constants.js.map +1 -1
- package/lib/sync/range/batch.d.ts +10 -1
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +28 -10
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +30 -15
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts +18 -0
- package/lib/sync/range/utils/batches.d.ts.map +1 -1
- package/lib/sync/range/utils/batches.js +39 -0
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +7 -0
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +7 -2
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/util/execution.js +1 -1
- package/lib/util/execution.js.map +1 -1
- package/lib/util/profile.d.ts +3 -0
- package/lib/util/profile.d.ts.map +1 -1
- package/lib/util/profile.js +1 -27
- package/lib/util/profile.js.map +1 -1
- package/lib/util/sszBytes.js +1 -1
- package/package.json +29 -38
- package/src/api/impl/beacon/blocks/index.ts +221 -63
- package/src/api/impl/config/constants.ts +2 -0
- package/src/api/impl/lodestar/index.ts +2 -3
- package/src/api/impl/validator/index.ts +206 -98
- package/src/api/rest/base.ts +8 -3
- package/src/chain/archiveStore/archiveStore.ts +20 -3
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +0 -1
- package/src/chain/blocks/importBlock.ts +0 -17
- package/src/chain/blocks/utils/chainSegment.ts +16 -5
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +1 -1
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +1 -1
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +3 -3
- package/src/chain/bls/multithread/index.ts +0 -1
- package/src/chain/chain.ts +61 -2
- package/src/chain/errors/blockError.ts +44 -7
- package/src/chain/errors/executionPayloadEnvelope.ts +9 -0
- package/src/chain/errors/proposerPreferences.ts +16 -1
- package/src/chain/lightClient/index.ts +12 -7
- package/src/chain/lightClient/proofs.ts +36 -1
- package/src/chain/lightClient/types.ts +3 -1
- package/src/chain/opPools/aggregatedAttestationPool.ts +4 -2
- package/src/chain/opPools/proposerPreferencesPool.ts +1 -1
- package/src/chain/produceBlock/produceBlockBody.ts +1 -1
- package/src/chain/validation/aggregateAndProof.ts +12 -6
- package/src/chain/validation/attestation.ts +12 -6
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +69 -4
- package/src/chain/validation/executionPayloadBid.ts +34 -4
- package/src/chain/validation/executionPayloadEnvelope.ts +37 -0
- package/src/chain/validation/proposerPreferences.ts +75 -13
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +3 -3
- package/src/chain/validatorMonitor.ts +1 -1
- package/src/db/repositories/lightclientSyncCommitteeWitness.ts +57 -9
- package/src/metrics/nodeJsMetrics.ts +1 -1
- package/src/network/core/networkCoreWorkerHandler.ts +2 -6
- package/src/network/discv5/index.ts +1 -4
- package/src/network/gossip/encoding.ts +13 -7
- package/src/network/gossip/gossipsub.ts +7 -2
- package/src/network/gossip/topic.ts +30 -0
- package/src/network/interface.ts +3 -1
- package/src/network/libp2p/index.ts +2 -10
- package/src/network/network.ts +24 -15
- package/src/network/peers/datastore.ts +1 -1
- package/src/network/processor/gossipHandlers.ts +12 -6
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +4 -2
- package/src/network/reqresp/handlers/index.ts +21 -12
- package/src/network/util.ts +5 -0
- package/src/sync/constants.ts +6 -5
- package/src/sync/range/batch.ts +31 -10
- package/src/sync/range/chain.ts +36 -16
- package/src/sync/range/utils/batches.ts +44 -0
- package/src/sync/sync.ts +10 -0
- package/src/sync/unknownBlock.ts +8 -2
- package/src/util/execution.ts +1 -1
- package/src/util/profile.ts +1 -31
- package/src/util/sszBytes.ts +1 -1
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts +0 -2
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts.map +0 -1
- package/lib/bun-wrappers/prometheus-gc-stats.js +0 -8
- package/lib/bun-wrappers/prometheus-gc-stats.js.map +0 -1
- package/lib/network/peers/datastore_bun.d.ts +0 -3
- package/lib/network/peers/datastore_bun.d.ts.map +0 -1
- package/lib/network/peers/datastore_bun.js +0 -3
- package/lib/network/peers/datastore_bun.js.map +0 -1
- package/src/bun-wrappers/prometheus-gc-stats.ts +0 -7
- package/src/network/peers/datastore_bun.ts +0 -3
|
@@ -176,7 +176,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
176
176
|
|
|
177
177
|
// optimistically add gossip block to the seen cache
|
|
178
178
|
// if validation fails, we will NOT forward this gossip block to peers
|
|
179
|
-
// - if
|
|
179
|
+
// - if PARENT_BLOCK_UNKNOWN error, blockInput will then be queued inside BlockInputSync. If the gossip block is really invalid, it will be pruned there
|
|
180
180
|
// - if other validator errors, blockInput will stay in the seen cache and will be pruned on finalization
|
|
181
181
|
const blockInput = chain.seenBlockInputCache.getByBlock({
|
|
182
182
|
block: signedBlock,
|
|
@@ -187,7 +187,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
// Optimistically seed the payload-envelope cache too, mirroring seenBlockInputCache above.
|
|
190
|
-
// This ensures we have PayloadEnvelopeInput, even through "
|
|
190
|
+
// This ensures we have PayloadEnvelopeInput, even through "PARENT_BLOCK_UNKNOWN" error
|
|
191
191
|
// see https://github.com/ChainSafe/lodestar/issues/9475
|
|
192
192
|
if (isForkPostGloas(fork)) {
|
|
193
193
|
chain.seenPayloadEnvelopeInputCache.add({
|
|
@@ -227,7 +227,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
227
227
|
if (e instanceof BlockGossipError) {
|
|
228
228
|
logger.debug("Gossip block has error", {slot, root: blockShortHex, code: e.type.code});
|
|
229
229
|
if (
|
|
230
|
-
(e.type.code === BlockErrorCode.
|
|
230
|
+
(e.type.code === BlockErrorCode.PARENT_BLOCK_UNKNOWN ||
|
|
231
|
+
e.type.code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) &&
|
|
231
232
|
blockInput
|
|
232
233
|
) {
|
|
233
234
|
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
@@ -661,14 +662,19 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
661
662
|
break;
|
|
662
663
|
}
|
|
663
664
|
// ALREADY_KNOWN should not happen with ignoreIfKnown=true above
|
|
664
|
-
//
|
|
665
|
+
// PARENT_BLOCK_UNKNOWN should not happen, we handled this in validateBeaconBlock() function above
|
|
665
666
|
case BlockErrorCode.ALREADY_KNOWN:
|
|
666
|
-
case BlockErrorCode.
|
|
667
|
+
case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
|
|
667
668
|
case BlockErrorCode.PRESTATE_MISSING:
|
|
668
669
|
case BlockErrorCode.EXECUTION_ENGINE_ERROR:
|
|
669
|
-
// Errors might indicate an issue with our node or the connected EL client
|
|
670
|
+
// Errors might indicate an issue with our node or the connected EL client.
|
|
670
671
|
logLevel = LogLevel.error;
|
|
671
672
|
break;
|
|
673
|
+
case BlockErrorCode.EXECUTION_ENGINE_INVALID:
|
|
674
|
+
// the peer served a bad block
|
|
675
|
+
core.reportPeer(peerIdStr, PeerAction.LowToleranceError, "ExecutionEngineInvalid");
|
|
676
|
+
logLevel = LogLevel.warn;
|
|
677
|
+
break;
|
|
672
678
|
default:
|
|
673
679
|
// TODO: Should it use PeerId or string?
|
|
674
680
|
core.reportPeer(peerIdStr, PeerAction.LowToleranceError, "BadGossipBlock");
|
|
@@ -107,8 +107,10 @@ export function validateExecutionPayloadEnvelopesByRangeRequest(
|
|
|
107
107
|
// The gloas req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
108
108
|
// Archival nodes may still serve older retained payloads to allow genesis sync.
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
// Spec: EnvelopesByRange response is bounded by MAX_REQUEST_PAYLOADS (consensus-specs #5383),
|
|
111
|
+
// distinct from the MAX_REQUEST_BLOCKS_DENEB cap used for block-by-range.
|
|
112
|
+
if (count > config.MAX_REQUEST_PAYLOADS) {
|
|
113
|
+
count = config.MAX_REQUEST_PAYLOADS;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
return {startSlot, count};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {Type} from "@chainsafe/ssz";
|
|
2
|
+
import {ProtocolHandler, RespStatus, ResponseError} from "@lodestar/reqresp";
|
|
2
3
|
import {ssz} from "@lodestar/types";
|
|
3
4
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
4
5
|
import {IBeaconDb} from "../../../db/index.js";
|
|
@@ -29,6 +30,14 @@ function notImplemented(method: ReqRespMethod): ProtocolHandler {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
function deserializeRequestBody<T>(type: Type<T>, data: Uint8Array): T {
|
|
34
|
+
try {
|
|
35
|
+
return type.deserialize(data);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
throw new ResponseError(RespStatus.INVALID_REQUEST, e instanceof Error ? e.message : String(e));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
/**
|
|
33
42
|
* The ReqRespHandler module handles app-level requests / responses from other peers,
|
|
34
43
|
* fetching state from the chain and database as needed.
|
|
@@ -40,51 +49,51 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
|
|
|
40
49
|
[ReqRespMethod.Ping]: notImplemented(ReqRespMethod.Ping),
|
|
41
50
|
[ReqRespMethod.Metadata]: notImplemented(ReqRespMethod.Metadata),
|
|
42
51
|
[ReqRespMethod.BeaconBlocksByRange]: (req, peerId, peerClient) => {
|
|
43
|
-
const body = ssz.phase0.BeaconBlocksByRangeRequest
|
|
52
|
+
const body = deserializeRequestBody(ssz.phase0.BeaconBlocksByRangeRequest, req.data);
|
|
44
53
|
return onBeaconBlocksByRange(body, chain, db, peerId, peerClient);
|
|
45
54
|
},
|
|
46
55
|
[ReqRespMethod.BeaconBlocksByRoot]: (req) => {
|
|
47
56
|
const fork = chain.config.getForkName(chain.clock.currentSlot);
|
|
48
|
-
const body = BeaconBlocksByRootRequestType(fork, chain.config)
|
|
57
|
+
const body = deserializeRequestBody(BeaconBlocksByRootRequestType(fork, chain.config), req.data);
|
|
49
58
|
return onBeaconBlocksByRoot(body, chain);
|
|
50
59
|
},
|
|
51
60
|
[ReqRespMethod.BeaconBlocksByHead]: (req, peerId, peerClient) => {
|
|
52
|
-
const body = ssz.fulu.BeaconBlocksByHeadRequest
|
|
61
|
+
const body = deserializeRequestBody(ssz.fulu.BeaconBlocksByHeadRequest, req.data);
|
|
53
62
|
return onBeaconBlocksByHead(body, chain, peerId, peerClient);
|
|
54
63
|
},
|
|
55
64
|
[ReqRespMethod.BlobSidecarsByRoot]: (req) => {
|
|
56
65
|
const fork = chain.config.getForkName(chain.clock.currentSlot);
|
|
57
|
-
const body = BlobSidecarsByRootRequestType(fork, chain.config)
|
|
66
|
+
const body = deserializeRequestBody(BlobSidecarsByRootRequestType(fork, chain.config), req.data);
|
|
58
67
|
return onBlobSidecarsByRoot(body, chain);
|
|
59
68
|
},
|
|
60
69
|
[ReqRespMethod.BlobSidecarsByRange]: (req) => {
|
|
61
|
-
const body = ssz.deneb.BlobSidecarsByRangeRequest
|
|
70
|
+
const body = deserializeRequestBody(ssz.deneb.BlobSidecarsByRangeRequest, req.data);
|
|
62
71
|
return onBlobSidecarsByRange(body, chain, db);
|
|
63
72
|
},
|
|
64
73
|
[ReqRespMethod.DataColumnSidecarsByRange]: (req, peerId, peerClient) => {
|
|
65
|
-
const body = ssz.fulu.DataColumnSidecarsByRangeRequest
|
|
74
|
+
const body = deserializeRequestBody(ssz.fulu.DataColumnSidecarsByRangeRequest, req.data);
|
|
66
75
|
return onDataColumnSidecarsByRange(body, chain, db, peerId, peerClient);
|
|
67
76
|
},
|
|
68
77
|
[ReqRespMethod.DataColumnSidecarsByRoot]: (req, peerId, peerClient) => {
|
|
69
|
-
const body = DataColumnSidecarsByRootRequestType(chain.config)
|
|
78
|
+
const body = deserializeRequestBody(DataColumnSidecarsByRootRequestType(chain.config), req.data);
|
|
70
79
|
return onDataColumnSidecarsByRoot(body, chain, db, peerId, peerClient);
|
|
71
80
|
},
|
|
72
81
|
|
|
73
82
|
[ReqRespMethod.ExecutionPayloadEnvelopesByRoot]: (req, peerId, peerClient) => {
|
|
74
|
-
const body = ExecutionPayloadEnvelopesByRootRequestType(chain.config)
|
|
83
|
+
const body = deserializeRequestBody(ExecutionPayloadEnvelopesByRootRequestType(chain.config), req.data);
|
|
75
84
|
return onExecutionPayloadEnvelopesByRoot(body, chain, db, peerId, peerClient);
|
|
76
85
|
},
|
|
77
86
|
[ReqRespMethod.ExecutionPayloadEnvelopesByRange]: (req, peerId, peerClient) => {
|
|
78
|
-
const body = ssz.gloas.ExecutionPayloadEnvelopesByRangeRequest
|
|
87
|
+
const body = deserializeRequestBody(ssz.gloas.ExecutionPayloadEnvelopesByRangeRequest, req.data);
|
|
79
88
|
return onExecutionPayloadEnvelopesByRange(body, chain, db, peerId, peerClient);
|
|
80
89
|
},
|
|
81
90
|
|
|
82
91
|
[ReqRespMethod.LightClientBootstrap]: (req) => {
|
|
83
|
-
const body = ssz.Root
|
|
92
|
+
const body = deserializeRequestBody(ssz.Root, req.data);
|
|
84
93
|
return onLightClientBootstrap(body, chain);
|
|
85
94
|
},
|
|
86
95
|
[ReqRespMethod.LightClientUpdatesByRange]: (req) => {
|
|
87
|
-
const body = ssz.altair.LightClientUpdatesByRange
|
|
96
|
+
const body = deserializeRequestBody(ssz.altair.LightClientUpdatesByRange, req.data);
|
|
88
97
|
return onLightClientUpdatesByRange(body, chain);
|
|
89
98
|
},
|
|
90
99
|
[ReqRespMethod.LightClientFinalityUpdate]: () => onLightClientFinalityUpdate(chain),
|
package/src/network/util.ts
CHANGED
|
@@ -27,3 +27,8 @@ export function getConnection(libp2p: Libp2p, peerIdStr: string): Connection | u
|
|
|
27
27
|
export function isPublishToZeroPeersError(e: Error): boolean {
|
|
28
28
|
return e.message.includes("PublishError.NoPeersSubscribedToTopic");
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
// https://github.com/libp2p/js-libp2p/blob/f87cba928991736d9646b3e054c367f55cab315c/packages/gossipsub/src/gossipsub.ts#L2076
|
|
32
|
+
export function isPublishDuplicateError(e: Error): boolean {
|
|
33
|
+
return e.message.includes("PublishError.Duplicate");
|
|
34
|
+
}
|
package/src/sync/constants.ts
CHANGED
|
@@ -15,12 +15,13 @@ export const MAX_BATCH_DOWNLOAD_ATTEMPTS = 5;
|
|
|
15
15
|
export const RATE_LIMITED_PEER_BACKOFF_MS = 5_000;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Consider batch faulty
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Consider a batch faulty once its failed processing attempts EXCEED this number, i.e. the batch is
|
|
19
|
+
* processed up to `MAX_BATCH_PROCESSING_ATTEMPTS + 1` times before teardown (the check is `>`, same
|
|
20
|
+
* convention as `MAX_BATCH_DOWNLOAD_ATTEMPTS`).
|
|
21
|
+
* Some processing failures can be caused by a different batch, so range sync classifies the fault
|
|
22
|
+
* before deciding which batch to redownload.
|
|
22
23
|
**/
|
|
23
|
-
export const MAX_BATCH_PROCESSING_ATTEMPTS =
|
|
24
|
+
export const MAX_BATCH_PROCESSING_ATTEMPTS = 3;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Number of slots to offset batches.
|
package/src/sync/range/batch.ts
CHANGED
|
@@ -64,6 +64,7 @@ export type DownloadSuccessState = {
|
|
|
64
64
|
status: BatchStatus.AwaitingProcessing;
|
|
65
65
|
blocks: IBlockInput[];
|
|
66
66
|
payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null;
|
|
67
|
+
attempt: Attempt;
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
export type BatchState =
|
|
@@ -589,7 +590,11 @@ export class Batch {
|
|
|
589
590
|
}
|
|
590
591
|
|
|
591
592
|
if (allComplete) {
|
|
592
|
-
|
|
593
|
+
const attempt: Attempt = {
|
|
594
|
+
peers: this.getSuccessfulPeers(),
|
|
595
|
+
hash: hashBlocks(blocks, this.config),
|
|
596
|
+
};
|
|
597
|
+
this.state = {status: BatchStatus.AwaitingProcessing, blocks, payloadEnvelopes: newPayloadEnvelopes, attempt};
|
|
593
598
|
} else {
|
|
594
599
|
this.state = {status: BatchStatus.AwaitingDownload, blocks, payloadEnvelopes: newPayloadEnvelopes};
|
|
595
600
|
this.requests = this.getRequests(blocks);
|
|
@@ -646,15 +651,11 @@ export class Batch {
|
|
|
646
651
|
throw new BatchError(this.wrongStatusErrorType(BatchStatus.AwaitingProcessing));
|
|
647
652
|
}
|
|
648
653
|
|
|
649
|
-
const blocks = this.state
|
|
650
|
-
|
|
651
|
-
const hash = hashBlocks(blocks, this.config); // tracks blocks to report peer on processing error
|
|
652
|
-
// Reset successfulDownloads in case another download attempt needs to be made. When Attempt is successful or not
|
|
653
|
-
// the peers that the data came from will be handled by the Attempt that goes for processing.
|
|
654
|
-
const peers = this.getSuccessfulPeers();
|
|
654
|
+
const {blocks, payloadEnvelopes, attempt} = this.state;
|
|
655
|
+
// No need to track successfulDownloads anymore, the batch goes to Processing status.
|
|
655
656
|
this.successfulDownloads.clear();
|
|
656
|
-
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt
|
|
657
|
-
return {blocks, payloadEnvelopes, peers};
|
|
657
|
+
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt};
|
|
658
|
+
return {blocks, payloadEnvelopes, peers: attempt.peers};
|
|
658
659
|
}
|
|
659
660
|
|
|
660
661
|
/**
|
|
@@ -673,6 +674,26 @@ export class Batch {
|
|
|
673
674
|
};
|
|
674
675
|
}
|
|
675
676
|
|
|
677
|
+
/**
|
|
678
|
+
* Processing -> AwaitingProcessing
|
|
679
|
+
*
|
|
680
|
+
* The batch's own blocks are valid but processing failed because a previous batch did not
|
|
681
|
+
* deliver the parent. Keep the downloaded blocks and process them again once the previous
|
|
682
|
+
* batch is repaired.
|
|
683
|
+
*/
|
|
684
|
+
retainForReprocessing(): void {
|
|
685
|
+
if (this.state.status !== BatchStatus.Processing) {
|
|
686
|
+
throw new BatchError(this.wrongStatusErrorType(BatchStatus.Processing));
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
this.state = {
|
|
690
|
+
status: BatchStatus.AwaitingProcessing,
|
|
691
|
+
blocks: this.state.blocks,
|
|
692
|
+
payloadEnvelopes: this.state.payloadEnvelopes,
|
|
693
|
+
attempt: this.state.attempt,
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
676
697
|
/**
|
|
677
698
|
* Processing -> AwaitingDownload
|
|
678
699
|
*/
|
|
@@ -750,7 +771,7 @@ export enum BatchErrorCode {
|
|
|
750
771
|
INVALID_COUNT = "BATCH_ERROR_INVALID_COUNT",
|
|
751
772
|
MAX_DOWNLOAD_ATTEMPTS = "BATCH_ERROR_MAX_DOWNLOAD_ATTEMPTS",
|
|
752
773
|
MAX_PROCESSING_ATTEMPTS = "BATCH_ERROR_MAX_PROCESSING_ATTEMPTS",
|
|
753
|
-
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "
|
|
774
|
+
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "BATCH_ERROR_MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS",
|
|
754
775
|
}
|
|
755
776
|
|
|
756
777
|
type BatchErrorType =
|
package/src/sync/range/chain.ts
CHANGED
|
@@ -23,7 +23,9 @@ import {Batch, BatchError, BatchErrorCode, BatchMetadata, BatchStatus} from "./b
|
|
|
23
23
|
import {
|
|
24
24
|
ChainPeersBalancer,
|
|
25
25
|
PeerSyncInfo,
|
|
26
|
+
ProcessingFaultKind,
|
|
26
27
|
batchStartEpochIsAfterSlot,
|
|
28
|
+
classifyProcessingFault,
|
|
27
29
|
computeHighestTarget,
|
|
28
30
|
getBatchSlotRange,
|
|
29
31
|
getNextBatchToProcess,
|
|
@@ -708,23 +710,41 @@ export class SyncChain {
|
|
|
708
710
|
this.triggerBatchProcessor();
|
|
709
711
|
} else {
|
|
710
712
|
this.logger.verbose("Batch process error", logCtx, res.err);
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
for (const pendingBatch of this.batches.values()) {
|
|
724
|
-
if (pendingBatch.startEpoch < batch.startEpoch) {
|
|
725
|
-
this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
|
|
726
|
-
pendingBatch.validationError(res.err); // Throws after MAX_BATCH_PROCESSING_ATTEMPTS
|
|
713
|
+
|
|
714
|
+
const invalidatePreviousBatches = (): number => {
|
|
715
|
+
let invalidatedCount = 0;
|
|
716
|
+
for (const pendingBatch of this.batches.values()) {
|
|
717
|
+
if (
|
|
718
|
+
pendingBatch.startEpoch < batch.startEpoch &&
|
|
719
|
+
pendingBatch.state.status === BatchStatus.AwaitingValidation
|
|
720
|
+
) {
|
|
721
|
+
this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
|
|
722
|
+
pendingBatch.validationError(res.err);
|
|
723
|
+
invalidatedCount++;
|
|
724
|
+
}
|
|
727
725
|
}
|
|
726
|
+
return invalidatedCount;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
const prevBatch = this.batches.get(batch.startEpoch - EPOCHS_PER_BATCH);
|
|
730
|
+
switch (classifyProcessingFault(res.err, batch, prevBatch)) {
|
|
731
|
+
case ProcessingFaultKind.CurrentBatch:
|
|
732
|
+
batch.processingError(res.err);
|
|
733
|
+
break;
|
|
734
|
+
|
|
735
|
+
case ProcessingFaultKind.PreviousBatch:
|
|
736
|
+
// If no previous batch was invalidated, it means the error is on this batch
|
|
737
|
+
if (invalidatePreviousBatches() === 0) {
|
|
738
|
+
batch.processingError(res.err);
|
|
739
|
+
} else {
|
|
740
|
+
batch.retainForReprocessing();
|
|
741
|
+
}
|
|
742
|
+
break;
|
|
743
|
+
|
|
744
|
+
case ProcessingFaultKind.Ambiguous:
|
|
745
|
+
batch.processingError(res.err);
|
|
746
|
+
invalidatePreviousBatches();
|
|
747
|
+
break;
|
|
728
748
|
}
|
|
729
749
|
}
|
|
730
750
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
2
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
3
3
|
import {Epoch, Slot} from "@lodestar/types";
|
|
4
|
+
import {BlockError, BlockErrorCode} from "../../../chain/errors/index.js";
|
|
4
5
|
import {BATCH_SLOT_OFFSET, EPOCHS_PER_BATCH} from "../../constants.js";
|
|
5
6
|
import {Batch, BatchStatus} from "../batch.js";
|
|
6
7
|
|
|
@@ -117,3 +118,46 @@ export function isSyncChainDone(batches: Batch[], lastEpochWithProcessBlocks: Ep
|
|
|
117
118
|
|
|
118
119
|
return batchStartEpochIsAfterSlot(lastEpochWithProcessBlocks, targetSlot);
|
|
119
120
|
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Where a batch processing error should be attributed.
|
|
124
|
+
*/
|
|
125
|
+
export enum ProcessingFaultKind {
|
|
126
|
+
/** This batch's own blocks are bad or incomplete, so redownload this batch. */
|
|
127
|
+
CurrentBatch = "CurrentBatch",
|
|
128
|
+
/** This batch is valid, but a previous batch did not deliver the parent. */
|
|
129
|
+
PreviousBatch = "PreviousBatch",
|
|
130
|
+
/** The fault could be in this batch or a previous batch, so hedge both ways. */
|
|
131
|
+
Ambiguous = "Ambiguous",
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Classify a processChainSegment error for a batch so range sync only redownloads
|
|
136
|
+
* the batch or batches that could actually be at fault.
|
|
137
|
+
* Note that range sync is supposed to only handle linear chain, for forky condition we'll handle it via backward sync
|
|
138
|
+
* in BlockInputSync or the upcoming/TODO beacon_blocks_by_head req/resp.
|
|
139
|
+
*/
|
|
140
|
+
export function classifyProcessingFault(err: Error, batch: Batch, prevBatch: Batch | undefined): ProcessingFaultKind {
|
|
141
|
+
if (!(err instanceof BlockError)) {
|
|
142
|
+
return ProcessingFaultKind.CurrentBatch;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const {code} = err.type;
|
|
146
|
+
if (code !== BlockErrorCode.PARENT_BLOCK_UNKNOWN && code !== BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) {
|
|
147
|
+
return ProcessingFaultKind.CurrentBatch;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const firstErrorSlot = err.signedBlock.message.slot;
|
|
151
|
+
if (firstErrorSlot === batch.startSlot) {
|
|
152
|
+
// note that range sync is for linear chain, so this is clearly an issue of the previous batch
|
|
153
|
+
return prevBatch === undefined ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.PreviousBatch;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const prevTailSlot = batch.startSlot - 1;
|
|
157
|
+
const prevHasFullTail =
|
|
158
|
+
code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN
|
|
159
|
+
? (prevBatch?.getPayloadEnvelopes()?.get(prevTailSlot)?.hasPayloadEnvelope() ?? false)
|
|
160
|
+
: (prevBatch?.getBlocks().some((b) => b.slot === prevTailSlot) ?? false);
|
|
161
|
+
|
|
162
|
+
return prevHasFullTail ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.Ambiguous;
|
|
163
|
+
}
|
package/src/sync/sync.ts
CHANGED
|
@@ -75,6 +75,11 @@ export class BeaconSync implements IBeaconSync {
|
|
|
75
75
|
if (metrics) {
|
|
76
76
|
metrics.syncStatus.addCollect(() => this.scrapeMetrics(metrics));
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
// A from-scratch or large-gap start boots not synced; updateSyncState resumes once synced
|
|
80
|
+
if (this.state !== SyncState.Synced) {
|
|
81
|
+
this.chain.forkChoice.pauseFastConfirmation();
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
close(): void {
|
|
@@ -228,6 +233,8 @@ export class BeaconSync implements IBeaconSync {
|
|
|
228
233
|
|
|
229
234
|
// We have become synced, subscribe to all the gossip core topics
|
|
230
235
|
if (state === SyncState.Synced && this.chain.clock.currentEpoch >= MIN_EPOCH_TO_START_GOSSIP) {
|
|
236
|
+
this.chain.forkChoice.resumeFastConfirmation();
|
|
237
|
+
|
|
231
238
|
if (!this.network.isSubscribedToGossipCoreTopics()) {
|
|
232
239
|
this.network
|
|
233
240
|
.subscribeGossipCoreTopics()
|
|
@@ -251,6 +258,9 @@ export class BeaconSync implements IBeaconSync {
|
|
|
251
258
|
else if (state !== SyncState.Synced) {
|
|
252
259
|
const syncDiff = this.chain.clock.currentSlot - this.chain.forkChoice.getHead().slot;
|
|
253
260
|
if (syncDiff > this.slotImportTolerance * 2) {
|
|
261
|
+
// Same debounce as gossip: transient blips keep the rule running, only a real gap pauses it
|
|
262
|
+
this.chain.forkChoice.pauseFastConfirmation();
|
|
263
|
+
|
|
254
264
|
if (this.network.isSubscribedToGossipCoreTopics()) {
|
|
255
265
|
this.logger.warn(`Node sync has fallen behind by ${syncDiff} slots`);
|
|
256
266
|
this.network
|
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -819,7 +819,7 @@ export class BlockInputSync {
|
|
|
819
819
|
// case BlockErrorCode.ALREADY_KNOWN:
|
|
820
820
|
// case BlockErrorCode.GENESIS_BLOCK:
|
|
821
821
|
|
|
822
|
-
case BlockErrorCode.
|
|
822
|
+
case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
|
|
823
823
|
case BlockErrorCode.PRESTATE_MISSING:
|
|
824
824
|
// Should not happen, mark as downloaded to try again latter
|
|
825
825
|
this.logger.debug("Attempted to process block but its parent was still unknown", errorData, res.err);
|
|
@@ -841,10 +841,16 @@ export class BlockInputSync {
|
|
|
841
841
|
|
|
842
842
|
case BlockErrorCode.EXECUTION_ENGINE_ERROR:
|
|
843
843
|
// Removing the block(s) without penalizing the peers, hoping for EL to
|
|
844
|
-
// recover on a latter download + verify attempt
|
|
844
|
+
// recover on a latter download + verify attempt.
|
|
845
845
|
this.removeAllDescendants(pendingBlock);
|
|
846
846
|
break;
|
|
847
847
|
|
|
848
|
+
case BlockErrorCode.EXECUTION_ENGINE_INVALID:
|
|
849
|
+
// the peer served a bad block
|
|
850
|
+
this.logger.debug("Execution engine rejected block from unknown parent sync", errorData, res.err);
|
|
851
|
+
this.removeAndDownScoreAllDescendants(pendingBlock);
|
|
852
|
+
break;
|
|
853
|
+
|
|
848
854
|
default:
|
|
849
855
|
// Block is not correct with respect to our chain. Log error loudly
|
|
850
856
|
this.logger.debug("Error processing block from unknown parent sync", errorData, res.err);
|
package/src/util/execution.ts
CHANGED
|
@@ -199,7 +199,7 @@ export async function getDataColumnSidecarsFromExecution(
|
|
|
199
199
|
const previouslyMissingColumns = input.getMissingSampledColumnMeta().missing;
|
|
200
200
|
const sampledColumns = previouslyMissingColumns.map((columnIndex) => dataColumnSidecars[columnIndex]);
|
|
201
201
|
|
|
202
|
-
// for columns
|
|
202
|
+
// for columns we have already seen, publishDataColumnSidecar() catches PublishError.Duplicate and marks alreadyPublished=true
|
|
203
203
|
emitter.emit(ChainEvent.publishDataColumns, sampledColumns);
|
|
204
204
|
// TODO: Can we record dataColumns.sentPeersPerSubnet metric here somehow
|
|
205
205
|
|
package/src/util/profile.ts
CHANGED
|
@@ -8,21 +8,10 @@ export enum ProfileThread {
|
|
|
8
8
|
DISC5 = "discv5",
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The time to take a Bun profile.
|
|
13
|
-
* If we increase this time it'll potentiall cause the app to crash.
|
|
14
|
-
* If we decrease this time, profile recorded will be fragmented and hard to analyze.
|
|
15
|
-
*/
|
|
16
|
-
const BUN_PROFILE_MS = 3 * 1000;
|
|
17
|
-
|
|
18
|
-
export async function profileThread(thread: ProfileThread, durationMs: number, dirpath: string): Promise<string> {
|
|
19
|
-
return globalThis.Bun ? profileBun(thread, durationMs) : profileNodeJS(thread, durationMs, dirpath);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
11
|
/**
|
|
23
12
|
* Take `durationMs` profile of the current thread and return the persisted file path.
|
|
24
13
|
*/
|
|
25
|
-
async function
|
|
14
|
+
export async function profileThread(thread: ProfileThread, durationMs: number, dirpath: string): Promise<string> {
|
|
26
15
|
const inspector = await import("node:inspector");
|
|
27
16
|
|
|
28
17
|
// due to some typing issues, not able to use promisify here
|
|
@@ -54,25 +43,6 @@ async function profileNodeJS(thread: ProfileThread, durationMs: number, dirpath:
|
|
|
54
43
|
return filePath;
|
|
55
44
|
}
|
|
56
45
|
|
|
57
|
-
/**
|
|
58
|
-
* Unlike NodeJS, Bun console.profile() api flush data to the inspector,
|
|
59
|
-
* so this api returns ms taken of this profile instead of file path.
|
|
60
|
-
*/
|
|
61
|
-
async function profileBun(thread: ProfileThread, durationMs: number): Promise<string> {
|
|
62
|
-
const start = Date.now();
|
|
63
|
-
let now = Date.now();
|
|
64
|
-
while (now - start < durationMs) {
|
|
65
|
-
// biome-ignore lint/suspicious/noConsole: need to use console api to profile in Bun
|
|
66
|
-
console.profile(String(now));
|
|
67
|
-
await sleep(BUN_PROFILE_MS);
|
|
68
|
-
// biome-ignore lint/suspicious/noConsole: need to use console api to profile in Bun
|
|
69
|
-
console.profileEnd(String(now));
|
|
70
|
-
now = Date.now();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return `Successfully take Bun ${thread} thread profile in ${now - start}ms. Check your inspector to see the profile.`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
46
|
/**
|
|
77
47
|
* Write heap snapshot of the current thread to the specified file.
|
|
78
48
|
*/
|
package/src/util/sszBytes.ts
CHANGED
|
@@ -706,7 +706,7 @@ export function getBlockRootFromPayloadAttestationMessageSerialized(data: Uint8A
|
|
|
706
706
|
* blockHash: Bytes32 (32 bytes)
|
|
707
707
|
* prevRandao: Bytes32 (32 bytes)
|
|
708
708
|
* feeRecipient: ExecutionAddress(20 bytes)
|
|
709
|
-
* gasLimit:
|
|
709
|
+
* gasLimit: UintBn64 (8 bytes)
|
|
710
710
|
* builderIndex: BuilderIndex (8 bytes)
|
|
711
711
|
* slot: Slot (8 bytes) ← absolute offset 264
|
|
712
712
|
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-gc-stats.d.ts","sourceRoot":"","sources":["../../src/bun-wrappers/prometheus-gc-stats.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,eAEtB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Bun does not support `GCProfiler` from `node:v8`a
|
|
2
|
-
// Which is exposed from `@chainsafe/prometheus-gc-stats` and used in `packages/beacon-node/src/metrics/nodeJsMetrics.ts`
|
|
3
|
-
// So we expose a dummy function for Bun runtime which do nothing for now
|
|
4
|
-
// TODO: May look get some useful data from `bun:jsc`
|
|
5
|
-
export function gcStats() {
|
|
6
|
-
return () => { };
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=prometheus-gc-stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-gc-stats.js","sourceRoot":"","sources":["../../src/bun-wrappers/prometheus-gc-stats.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,yHAAyH;AACzH,yEAAyE;AACzE,qDAAqD;AACrD,MAAM,UAAU,OAAO,GAAG;IACxB,OAAO,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;AAAA,CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datastore_bun.d.ts","sourceRoot":"","sources":["../../../src/network/peers/datastore_bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,oBAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datastore_bun.js","sourceRoot":"","sources":["../../../src/network/peers/datastore_bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Bun does not support `GCProfiler` from `node:v8`a
|
|
2
|
-
// Which is exposed from `@chainsafe/prometheus-gc-stats` and used in `packages/beacon-node/src/metrics/nodeJsMetrics.ts`
|
|
3
|
-
// So we expose a dummy function for Bun runtime which do nothing for now
|
|
4
|
-
// TODO: May look get some useful data from `bun:jsc`
|
|
5
|
-
export function gcStats() {
|
|
6
|
-
return () => {};
|
|
7
|
-
}
|