@lodestar/beacon-node 1.45.0-dev.fadf0fbb1f → 1.46.0-dev.8fc4e297d2
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/beacon/index.d.ts +1 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +4 -0
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +2 -2
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +9 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +2 -2
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.js +2 -2
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -2
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/utils.d.ts +23 -0
- package/lib/api/impl/utils.d.ts.map +1 -1
- package/lib/api/impl/utils.js +44 -1
- package/lib/api/impl/utils.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts +0 -14
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +192 -143
- 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 +14 -3
- package/lib/api/rest/base.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +3 -21
- 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 +2 -2
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -1
- package/lib/chain/builderCircuitBreaker.d.ts +31 -0
- package/lib/chain/builderCircuitBreaker.d.ts.map +1 -0
- package/lib/chain/builderCircuitBreaker.js +59 -0
- package/lib/chain/builderCircuitBreaker.js.map +1 -0
- package/lib/chain/chain.d.ts +2 -0
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +26 -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/interface.d.ts +2 -0
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.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.js +1 -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/options.d.ts +4 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +12 -7
- package/lib/chain/prepareNextSlot.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/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.js +13 -12
- 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 +64 -11
- 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/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/execution/builder/http.d.ts +18 -0
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +20 -11
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +6 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +18 -0
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/network/core/metrics.d.ts +65 -0
- package/lib/network/core/metrics.d.ts.map +1 -1
- package/lib/network/core/metrics.js +94 -0
- package/lib/network/core/metrics.js.map +1 -1
- package/lib/network/discv5/utils.d.ts.map +1 -1
- package/lib/network/discv5/utils.js +12 -3
- package/lib/network/discv5/utils.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 +22 -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 +4 -3
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +80 -232
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +47 -4
- 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/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/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +10 -0
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/score/score.d.ts +3 -1
- package/lib/network/peers/score/score.d.ts.map +1 -1
- package/lib/network/peers/score/score.js +6 -1
- package/lib/network/peers/score/score.js.map +1 -1
- package/lib/network/peers/score/store.d.ts.map +1 -1
- package/lib/network/peers/score/store.js +6 -1
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +14 -0
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +16 -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/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/package.json +23 -21
- package/src/api/impl/beacon/blocks/index.ts +221 -63
- package/src/api/impl/beacon/index.ts +1 -1
- package/src/api/impl/beacon/pool/index.ts +5 -0
- package/src/api/impl/beacon/state/index.ts +3 -2
- package/src/api/impl/beacon/state/utils.ts +11 -0
- package/src/api/impl/debug/index.ts +3 -2
- package/src/api/impl/lodestar/index.ts +2 -2
- package/src/api/impl/proof/index.ts +2 -2
- package/src/api/impl/utils.ts +51 -1
- package/src/api/impl/validator/index.ts +224 -157
- package/src/api/rest/base.ts +17 -3
- package/src/chain/blocks/importBlock.ts +1 -23
- 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 +2 -2
- package/src/chain/builderCircuitBreaker.ts +84 -0
- package/src/chain/chain.ts +38 -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/interface.ts +2 -0
- 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 +1 -1
- package/src/chain/opPools/proposerPreferencesPool.ts +1 -1
- package/src/chain/options.ts +4 -0
- package/src/chain/prepareNextSlot.ts +11 -7
- package/src/chain/validation/aggregateAndProof.ts +12 -6
- package/src/chain/validation/attestation.ts +12 -6
- package/src/chain/validation/block.ts +69 -4
- package/src/chain/validation/executionPayloadBid.ts +16 -11
- package/src/chain/validation/executionPayloadEnvelope.ts +37 -0
- package/src/chain/validation/proposerPreferences.ts +74 -11
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +3 -3
- package/src/db/repositories/lightclientSyncCommitteeWitness.ts +57 -9
- package/src/execution/builder/http.ts +30 -17
- package/src/metrics/metrics/beacon.ts +19 -0
- package/src/network/core/metrics.ts +94 -0
- package/src/network/discv5/utils.ts +11 -3
- package/src/network/gossip/encoding.ts +20 -7
- package/src/network/gossip/gossipsub.ts +9 -3
- package/src/network/gossip/topic.ts +58 -4
- package/src/network/interface.ts +3 -1
- package/src/network/network.ts +24 -15
- package/src/network/peers/peerManager.ts +11 -0
- package/src/network/peers/score/score.ts +8 -1
- package/src/network/peers/score/store.ts +8 -1
- package/src/network/peers/utils/prioritizePeers.ts +15 -0
- package/src/network/processor/gossipHandlers.ts +17 -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/sync.ts +10 -0
- package/src/sync/unknownBlock.ts +8 -2
- package/src/util/execution.ts +1 -1
|
@@ -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/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
|
|