@lodestar/beacon-node 1.35.0-dev.8689cc3545 → 1.35.0-dev.894daf8b44
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 +8 -2
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/config/constants.d.ts +9 -9
- package/lib/api/impl/config/constants.js +16 -9
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/lodestar/index.js +1 -1
- 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 +24 -33
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +3 -2
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +7 -6
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +8 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +1 -7
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +1 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +4 -6
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +2 -2
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +2 -0
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +2 -3
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/attestationPool.js +3 -5
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts +3 -2
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js +6 -5
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/types.d.ts +1 -1
- package/lib/chain/opPools/types.d.ts.map +1 -1
- package/lib/chain/opPools/types.js +1 -1
- package/lib/chain/opPools/types.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +3 -3
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +8 -8
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -4
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +13 -4
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +1 -0
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -0
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +8 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +9 -8
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +1 -1
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.d.ts.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js +4 -3
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.d.ts +6 -4
- package/lib/chain/validation/lightClientOptimisticUpdate.d.ts.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js +11 -11
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +21 -15
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -1
- package/lib/metrics/metrics/lodestar.js +3 -3
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/gossipsub.js +1 -1
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/scoringParameters.js +4 -4
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/network.d.ts +1 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +9 -9
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +2 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/processor/gossipHandlers.js +1 -1
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +2 -3
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +1 -1
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/node/notifier.js +1 -1
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/types.d.ts +0 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +0 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +18 -20
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +2 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +8 -3
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +2 -1
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/clock.d.ts +8 -3
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +8 -5
- package/lib/util/clock.js.map +1 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +4 -2
- package/lib/util/dataColumns.js.map +1 -1
- package/package.json +14 -14
- package/src/api/impl/beacon/blocks/index.ts +11 -2
- package/src/api/impl/config/constants.ts +17 -9
- package/src/api/impl/lodestar/index.ts +1 -1
- package/src/api/impl/validator/index.ts +25 -37
- package/src/chain/archiveStore/historicalState/worker.ts +1 -1
- package/src/chain/blocks/blockInput/blockInput.ts +7 -4
- package/src/chain/blocks/importBlock.ts +8 -12
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -2
- package/src/chain/blocks/writeBlockInputToDb.ts +1 -9
- package/src/chain/chain.ts +3 -16
- package/src/chain/emitter.ts +2 -2
- package/src/chain/lightClient/index.ts +11 -3
- package/src/chain/opPools/attestationPool.ts +2 -3
- package/src/chain/opPools/syncCommitteeMessagePool.ts +5 -3
- package/src/chain/opPools/types.ts +1 -1
- package/src/chain/prepareNextSlot.ts +8 -8
- package/src/chain/produceBlock/produceBlockBody.ts +16 -14
- package/src/chain/regen/interface.ts +1 -0
- package/src/chain/seenCache/seenGossipBlockInput.ts +10 -2
- package/src/chain/stateCache/persistentCheckpointsCache.ts +10 -8
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/lightClientFinalityUpdate.ts +4 -3
- package/src/chain/validation/lightClientOptimisticUpdate.ts +12 -11
- package/src/chain/validatorMonitor.ts +28 -17
- package/src/metrics/metrics/lodestar.ts +3 -3
- package/src/network/gossip/gossipsub.ts +1 -1
- package/src/network/gossip/scoringParameters.ts +4 -4
- package/src/network/network.ts +9 -9
- package/src/network/peers/peerManager.ts +2 -1
- package/src/network/processor/gossipHandlers.ts +1 -1
- package/src/network/processor/index.ts +2 -3
- package/src/network/subnets/attnetsService.ts +3 -6
- package/src/node/notifier.ts +1 -1
- package/src/sync/types.ts +0 -2
- package/src/sync/unknownBlock.ts +19 -21
- package/src/sync/utils/downloadByRange.ts +12 -6
- package/src/sync/utils/downloadByRoot.ts +12 -4
- package/src/util/clock.ts +14 -6
- package/src/util/dataColumns.ts +11 -2
package/src/chain/chain.ts
CHANGED
|
@@ -254,20 +254,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
254
254
|
if (!clock) clock = new Clock({config, genesisTime: this.genesisTime, signal});
|
|
255
255
|
|
|
256
256
|
this.blacklistedBlocks = new Map((opts.blacklistedBlocks ?? []).map((hex) => [hex, null]));
|
|
257
|
-
|
|
258
|
-
this.attestationPool = new AttestationPool(
|
|
259
|
-
config,
|
|
260
|
-
clock,
|
|
261
|
-
preAggregateCutOffTime,
|
|
262
|
-
this.opts?.preaggregateSlotDistance,
|
|
263
|
-
metrics
|
|
264
|
-
);
|
|
257
|
+
this.attestationPool = new AttestationPool(config, clock, this.opts?.preaggregateSlotDistance, metrics);
|
|
265
258
|
this.aggregatedAttestationPool = new AggregatedAttestationPool(this.config, metrics);
|
|
266
|
-
this.syncCommitteeMessagePool = new SyncCommitteeMessagePool(
|
|
267
|
-
clock,
|
|
268
|
-
preAggregateCutOffTime,
|
|
269
|
-
this.opts?.preaggregateSlotDistance
|
|
270
|
-
);
|
|
259
|
+
this.syncCommitteeMessagePool = new SyncCommitteeMessagePool(config, clock, this.opts?.preaggregateSlotDistance);
|
|
271
260
|
this.syncContributionAndProofPool = new SyncContributionAndProofPool(clock, metrics, logger);
|
|
272
261
|
|
|
273
262
|
this.seenAggregatedAttestations = new SeenAggregatedAttestations(metrics);
|
|
@@ -730,7 +719,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
730
719
|
feeRecipient,
|
|
731
720
|
commonBlockBodyPromise,
|
|
732
721
|
parentBlockRoot,
|
|
733
|
-
parentSlot,
|
|
734
722
|
}: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}
|
|
735
723
|
): Promise<{
|
|
736
724
|
block: AssembledBlockType<T>;
|
|
@@ -756,7 +744,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
756
744
|
graffiti,
|
|
757
745
|
slot,
|
|
758
746
|
feeRecipient,
|
|
759
|
-
parentSlot,
|
|
760
747
|
parentBlockRoot,
|
|
761
748
|
proposerIndex,
|
|
762
749
|
proposerPubKey,
|
|
@@ -1150,7 +1137,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1150
1137
|
const metrics = this.metrics;
|
|
1151
1138
|
if (metrics && (slot + 1) % SLOTS_PER_EPOCH === 0) {
|
|
1152
1139
|
// On the last slot of the epoch
|
|
1153
|
-
sleep(
|
|
1140
|
+
sleep(this.config.SLOT_DURATION_MS / 2)
|
|
1154
1141
|
.then(() => this.validatorMonitor?.onceEveryEndOfEpoch(this.getHeadState()))
|
|
1155
1142
|
.catch((e) => {
|
|
1156
1143
|
if (!isErrorAborted(e)) this.logger.error("Error on validator monitor onceEveryEndOfEpoch", {slot}, e);
|
package/src/chain/emitter.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {StrictEventEmitter} from "strict-event-emitter-types";
|
|
|
3
3
|
import {routes} from "@lodestar/api";
|
|
4
4
|
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
5
5
|
import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
|
|
6
|
-
import {
|
|
6
|
+
import {RootHex, deneb, fulu, phase0} from "@lodestar/types";
|
|
7
7
|
import {PeerIdStr} from "../util/peerId.js";
|
|
8
8
|
import {BlockInputSource, IBlockInput} from "./blocks/blockInput/types.js";
|
|
9
9
|
|
|
@@ -76,7 +76,7 @@ type ApiEvents = {[K in routes.events.EventType]: (data: routes.events.EventData
|
|
|
76
76
|
|
|
77
77
|
export type ChainEventData = {
|
|
78
78
|
[ChainEvent.unknownParent]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
|
|
79
|
-
[ChainEvent.unknownBlockRoot]: {
|
|
79
|
+
[ChainEvent.unknownBlockRoot]: {rootHex: RootHex; peer?: PeerIdStr; source: BlockInputSource};
|
|
80
80
|
[ChainEvent.incompleteBlockInput]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
ForkName,
|
|
12
12
|
ForkPostAltair,
|
|
13
13
|
ForkPostBellatrix,
|
|
14
|
+
ForkPreGloas,
|
|
14
15
|
ForkSeq,
|
|
15
16
|
MIN_SYNC_COMMITTEE_PARTICIPANTS,
|
|
16
17
|
SYNC_COMMITTEE_SIZE,
|
|
@@ -741,17 +742,24 @@ export function sumBits(bits: BitArray): number {
|
|
|
741
742
|
return bits.getTrueBitIndexes().length;
|
|
742
743
|
}
|
|
743
744
|
|
|
744
|
-
|
|
745
|
+
// TODO GLOAS: Pending light-client spec but this function probably won't be used
|
|
746
|
+
// in Gloas. So we can assume any types here are pre-gloas
|
|
747
|
+
export function blockToLightClientHeader(
|
|
748
|
+
fork: ForkName,
|
|
749
|
+
block: BeaconBlock<ForkPostAltair & ForkPreGloas>
|
|
750
|
+
): LightClientHeader {
|
|
745
751
|
const blockSlot = block.slot;
|
|
746
752
|
const beacon: phase0.BeaconBlockHeader = {
|
|
747
753
|
slot: blockSlot,
|
|
748
754
|
proposerIndex: block.proposerIndex,
|
|
749
755
|
parentRoot: block.parentRoot,
|
|
750
756
|
stateRoot: block.stateRoot,
|
|
751
|
-
bodyRoot: (ssz[fork].BeaconBlockBody as SSZTypesFor<ForkPostAltair, "BeaconBlockBody">).hashTreeRoot(
|
|
757
|
+
bodyRoot: (ssz[fork].BeaconBlockBody as SSZTypesFor<ForkPostAltair & ForkPreGloas, "BeaconBlockBody">).hashTreeRoot(
|
|
758
|
+
block.body
|
|
759
|
+
),
|
|
752
760
|
};
|
|
753
761
|
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
754
|
-
const blockBody = block.body as BeaconBlockBody<ForkPostBellatrix>;
|
|
762
|
+
const blockBody = block.body as BeaconBlockBody<ForkPostBellatrix & ForkPreGloas>;
|
|
755
763
|
const execution = executionPayloadToPayloadHeader(ForkSeq[fork], blockBody.executionPayload);
|
|
756
764
|
return {
|
|
757
765
|
beacon,
|
|
@@ -74,7 +74,6 @@ export class AttestationPool {
|
|
|
74
74
|
constructor(
|
|
75
75
|
private readonly config: ChainForkConfig,
|
|
76
76
|
private readonly clock: IClock,
|
|
77
|
-
private readonly cutOffSecFromSlot: number,
|
|
78
77
|
private readonly preaggregateSlotDistance = 0,
|
|
79
78
|
private readonly metrics: Metrics | null = null
|
|
80
79
|
) {}
|
|
@@ -98,7 +97,7 @@ export class AttestationPool {
|
|
|
98
97
|
* `SignedAggregateAndProof`.
|
|
99
98
|
*
|
|
100
99
|
* If the attestation is too old (low slot) to be included in the pool it is simply dropped
|
|
101
|
-
* and no error is returned. Also if it's at clock slot but come to the pool later than
|
|
100
|
+
* and no error is returned. Also if it's at clock slot but come to the pool later than AGGREGATE_DUE_BPS
|
|
102
101
|
* of slot time, it's dropped too since it's not helpful for the validator anymore
|
|
103
102
|
*
|
|
104
103
|
* Expects the attestation to be fully validated:
|
|
@@ -126,7 +125,7 @@ export class AttestationPool {
|
|
|
126
125
|
|
|
127
126
|
// Reject gossip attestations in the current slot but come to this pool very late
|
|
128
127
|
// for api attestations, we allow them to be added to the pool
|
|
129
|
-
if (!priority && this.clock.
|
|
128
|
+
if (!priority && this.clock.msFromSlot(slot) > this.config.getAggregateDueMs(fork)) {
|
|
130
129
|
return InsertOutcome.Late;
|
|
131
130
|
}
|
|
132
131
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {Signature, aggregateSignatures} from "@chainsafe/blst";
|
|
2
2
|
import {BitArray} from "@chainsafe/ssz";
|
|
3
|
+
import {ChainForkConfig} from "@lodestar/config";
|
|
3
4
|
import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params";
|
|
4
5
|
import {Root, Slot, SubcommitteeIndex, SubnetID, altair} from "@lodestar/types";
|
|
5
6
|
import {MapDef, toRootHex} from "@lodestar/utils";
|
|
@@ -44,8 +45,8 @@ export class SyncCommitteeMessagePool {
|
|
|
44
45
|
private lowestPermissibleSlot = 0;
|
|
45
46
|
|
|
46
47
|
constructor(
|
|
48
|
+
private readonly config: ChainForkConfig,
|
|
47
49
|
private readonly clock: IClock,
|
|
48
|
-
private readonly cutOffSecFromSlot: number,
|
|
49
50
|
private readonly preaggregateSlotDistance = 0
|
|
50
51
|
) {}
|
|
51
52
|
|
|
@@ -68,6 +69,7 @@ export class SyncCommitteeMessagePool {
|
|
|
68
69
|
priority?: boolean
|
|
69
70
|
): InsertOutcome {
|
|
70
71
|
const {slot, beaconBlockRoot} = signature;
|
|
72
|
+
const fork = this.config.getForkName(slot);
|
|
71
73
|
const rootHex = toRootHex(beaconBlockRoot);
|
|
72
74
|
const lowestPermissibleSlot = this.lowestPermissibleSlot;
|
|
73
75
|
|
|
@@ -76,8 +78,8 @@ export class SyncCommitteeMessagePool {
|
|
|
76
78
|
return InsertOutcome.Old;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
// validator gets SyncCommitteeContribution at
|
|
80
|
-
if (!priority && this.clock.
|
|
81
|
+
// validator gets SyncCommitteeContribution at CONTRIBUTION_DUE_BPS of slot, it's no use to preaggregate later than that time
|
|
82
|
+
if (!priority && this.clock.msFromSlot(slot) > this.config.getSyncContributionDueMs(fork)) {
|
|
81
83
|
return InsertOutcome.Late;
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -13,7 +13,7 @@ export enum InsertOutcome {
|
|
|
13
13
|
Old = "Old",
|
|
14
14
|
/** The pool has reached its limit. No changes were made. */
|
|
15
15
|
ReachLimit = "ReachLimit",
|
|
16
|
-
/** Messages don't bring any value, for example attestations come to the pool at >
|
|
16
|
+
/** Messages don't bring any value, for example attestations come to the pool at > AGGREGATE_DUE_BPS of slot. No changes were made */
|
|
17
17
|
Late = "Late",
|
|
18
18
|
/** The data is know, and the new participants have been added to the aggregated signature */
|
|
19
19
|
Aggregated = "Aggregated",
|
|
@@ -22,17 +22,18 @@ import {IBeaconChain} from "./interface.js";
|
|
|
22
22
|
import {getPayloadAttributesForSSE, prepareExecutionPayload} from "./produceBlock/produceBlockBody.js";
|
|
23
23
|
import {RegenCaller} from "./regen/index.js";
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// TODO GLOAS: re-evaluate this timing
|
|
26
|
+
/* With 12s slot times, this scheduler will run 4s before the start of each slot (`12 - 0.6667 * 12 = 4`). */
|
|
27
|
+
export const PREPARE_NEXT_SLOT_BPS = 6667;
|
|
27
28
|
|
|
28
29
|
/* We don't want to do more epoch transition than this */
|
|
29
30
|
const PREPARE_EPOCH_LIMIT = 1;
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* At Bellatrix, if we are responsible for proposing in next slot, we want to prepare payload
|
|
33
|
-
* 4s
|
|
34
|
+
* 4s before the start of next slot at PREPARE_NEXT_SLOT_BPS of the current slot.
|
|
34
35
|
*
|
|
35
|
-
* For all forks, when clock
|
|
36
|
+
* For all forks, when clock reaches PREPARE_NEXT_SLOT_BPS of slot before an epoch, we want to prepare for the next epoch
|
|
36
37
|
* transition from our head so that:
|
|
37
38
|
* + validators vote for block head on time through attestation
|
|
38
39
|
* + validators propose blocks on time
|
|
@@ -74,10 +75,9 @@ export class PrepareNextSlotScheduler {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
try {
|
|
77
|
-
// At
|
|
78
|
-
// epoch transition
|
|
79
|
-
|
|
80
|
-
await sleep(slotMs - slotMs / SCHEDULER_LOOKAHEAD_FACTOR, this.signal);
|
|
78
|
+
// At PREPARE_NEXT_SLOT_BPS (~67%) of the current slot we prepare payload for the next slot
|
|
79
|
+
// or precompute epoch transition
|
|
80
|
+
await sleep(this.config.getSlotComponentDurationMs(PREPARE_NEXT_SLOT_BPS), this.signal);
|
|
81
81
|
|
|
82
82
|
// calling updateHead() here before we produce a block to reduce reorg possibility
|
|
83
83
|
const {slot: headSlot, blockRoot: headRoot} = this.chain.recomputeForkChoiceHead(
|
|
@@ -4,9 +4,11 @@ import {
|
|
|
4
4
|
ForkPostBellatrix,
|
|
5
5
|
ForkPostDeneb,
|
|
6
6
|
ForkPostFulu,
|
|
7
|
+
ForkPreGloas,
|
|
7
8
|
ForkSeq,
|
|
8
9
|
isForkPostAltair,
|
|
9
10
|
isForkPostBellatrix,
|
|
11
|
+
isForkPostGloas,
|
|
10
12
|
} from "@lodestar/params";
|
|
11
13
|
import {
|
|
12
14
|
CachedBeaconStateAllForks,
|
|
@@ -90,7 +92,6 @@ export type BlockAttributes = {
|
|
|
90
92
|
graffiti: Bytes32;
|
|
91
93
|
slot: Slot;
|
|
92
94
|
parentBlockRoot: Root;
|
|
93
|
-
parentSlot: Slot;
|
|
94
95
|
feeRecipient?: string;
|
|
95
96
|
};
|
|
96
97
|
|
|
@@ -182,7 +183,14 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
182
183
|
};
|
|
183
184
|
this.logger.verbose("Producing beacon block body", logMeta);
|
|
184
185
|
|
|
185
|
-
if (
|
|
186
|
+
if (isForkPostGloas(fork)) {
|
|
187
|
+
// TODO GLOAS: Set body.signedExecutionPayloadBid and body.payloadAttestation
|
|
188
|
+
const commonBlockBody = await commonBlockBodyPromise;
|
|
189
|
+
blockBody = Object.assign({}, commonBlockBody) as AssembledBodyType<T>;
|
|
190
|
+
executionPayloadValue = BigInt(0);
|
|
191
|
+
|
|
192
|
+
// We don't deal with blinded blocks, execution engine, blobs and execution requests post-gloas
|
|
193
|
+
} else if (isForkPostBellatrix(fork)) {
|
|
186
194
|
const safeBlockHash = this.forkChoice.getJustifiedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
|
|
187
195
|
const finalizedBlockHash = this.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
|
|
188
196
|
const feeRecipient = requestedFeeRecipient ?? this.beaconProposerCache.getOrDefault(proposerIndex);
|
|
@@ -307,6 +315,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
307
315
|
|
|
308
316
|
// blockType === BlockType.Full
|
|
309
317
|
else {
|
|
318
|
+
// enginePromise only supports pre-gloas
|
|
310
319
|
const enginePromise = (async () => {
|
|
311
320
|
const endExecutionPayload = this.metrics?.executionBlockProductionTimeSteps.startTimer();
|
|
312
321
|
|
|
@@ -384,13 +393,13 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
384
393
|
blockBody = Object.assign({}, commonBlockBody) as AssembledBodyType<BlockType.Blinded>;
|
|
385
394
|
|
|
386
395
|
if (engineRes.isPremerge) {
|
|
387
|
-
(blockBody as BeaconBlockBody<ForkPostBellatrix>).executionPayload = engineRes.executionPayload;
|
|
396
|
+
(blockBody as BeaconBlockBody<ForkPostBellatrix & ForkPreGloas>).executionPayload = engineRes.executionPayload;
|
|
388
397
|
executionPayloadValue = engineRes.executionPayloadValue;
|
|
389
398
|
} else {
|
|
390
399
|
const {prepType, payloadId, executionPayload, blobsBundle, executionRequests} = engineRes;
|
|
391
400
|
shouldOverrideBuilder = engineRes.shouldOverrideBuilder;
|
|
392
401
|
|
|
393
|
-
(blockBody as BeaconBlockBody<ForkPostBellatrix>).executionPayload = executionPayload;
|
|
402
|
+
(blockBody as BeaconBlockBody<ForkPostBellatrix & ForkPreGloas>).executionPayload = executionPayload;
|
|
394
403
|
(produceResult as ProduceFullBellatrix).executionPayload = executionPayload;
|
|
395
404
|
executionPayloadValue = engineRes.executionPayloadValue;
|
|
396
405
|
Object.assign(logMeta, {transactions: executionPayload.transactions.length, shouldOverrideBuilder});
|
|
@@ -723,15 +732,7 @@ export async function produceCommonBlockBody<T extends BlockType>(
|
|
|
723
732
|
this: BeaconChain,
|
|
724
733
|
blockType: T,
|
|
725
734
|
currentState: CachedBeaconStateAllForks,
|
|
726
|
-
{
|
|
727
|
-
randaoReveal,
|
|
728
|
-
graffiti,
|
|
729
|
-
slot,
|
|
730
|
-
parentSlot,
|
|
731
|
-
parentBlockRoot,
|
|
732
|
-
}: BlockAttributes & {
|
|
733
|
-
parentSlot: Slot;
|
|
734
|
-
}
|
|
735
|
+
{randaoReveal, graffiti, slot, parentBlockRoot}: BlockAttributes
|
|
735
736
|
): Promise<CommonBlockBody> {
|
|
736
737
|
const stepsMetrics =
|
|
737
738
|
blockType === BlockType.Full
|
|
@@ -783,7 +784,8 @@ export async function produceCommonBlockBody<T extends BlockType>(
|
|
|
783
784
|
|
|
784
785
|
const endSyncAggregate = stepsMetrics?.startTimer();
|
|
785
786
|
if (ForkSeq[fork] >= ForkSeq.altair) {
|
|
786
|
-
const
|
|
787
|
+
const previousSlot = slot - 1;
|
|
788
|
+
const syncAggregate = this.syncContributionAndProofPool.getAggregate(previousSlot, parentBlockRoot);
|
|
787
789
|
this.metrics?.production.producedSyncAggregateParticipants.observe(
|
|
788
790
|
syncAggregate.syncCommitteeBits.getTrueBitIndexes().length
|
|
789
791
|
);
|
|
@@ -10,6 +10,7 @@ export enum RegenCaller {
|
|
|
10
10
|
produceBlock = "produceBlock",
|
|
11
11
|
validateGossipBlock = "validateGossipBlock",
|
|
12
12
|
validateGossipBlob = "validateGossipBlob",
|
|
13
|
+
validateGossipDataColumn = "validateGossipDataColumn",
|
|
13
14
|
precomputeEpoch = "precomputeEpoch",
|
|
14
15
|
predictProposerHead = "predictProposerHead",
|
|
15
16
|
produceAttestationData = "produceAttestationData",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
3
|
-
import {ForkName, ForkPostFulu, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
3
|
+
import {ForkName, ForkPostFulu, ForkPreGloas, isForkPostDeneb, isForkPostFulu, isForkPostGloas} from "@lodestar/params";
|
|
4
4
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
5
5
|
import {RootHex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
6
6
|
import {LodestarError, Logger} from "@lodestar/utils";
|
|
@@ -155,6 +155,12 @@ export class SeenBlockInput {
|
|
|
155
155
|
let blockInput = this.blockInputs.get(blockRootHex) as IBlockInput;
|
|
156
156
|
if (!blockInput) {
|
|
157
157
|
const {forkName, daOutOfRange} = this.buildCommonProps(block.message.slot);
|
|
158
|
+
|
|
159
|
+
// TODO GLOAS: Implement
|
|
160
|
+
if (isForkPostGloas(forkName)) {
|
|
161
|
+
throw Error("Not implemented");
|
|
162
|
+
}
|
|
163
|
+
// Pre-deneb
|
|
158
164
|
if (!isForkPostDeneb(forkName)) {
|
|
159
165
|
blockInput = BlockInputPreData.createFromBlock({
|
|
160
166
|
block,
|
|
@@ -165,9 +171,10 @@ export class SeenBlockInput {
|
|
|
165
171
|
seenTimestampSec,
|
|
166
172
|
peerIdStr,
|
|
167
173
|
});
|
|
174
|
+
// Fulu Only
|
|
168
175
|
} else if (isForkPostFulu(forkName)) {
|
|
169
176
|
blockInput = BlockInputColumns.createFromBlock({
|
|
170
|
-
block: block as SignedBeaconBlock<ForkPostFulu>,
|
|
177
|
+
block: block as SignedBeaconBlock<ForkPostFulu & ForkPreGloas>,
|
|
171
178
|
blockRootHex,
|
|
172
179
|
daOutOfRange,
|
|
173
180
|
forkName,
|
|
@@ -177,6 +184,7 @@ export class SeenBlockInput {
|
|
|
177
184
|
seenTimestampSec,
|
|
178
185
|
peerIdStr,
|
|
179
186
|
});
|
|
187
|
+
// Deneb and Electra
|
|
180
188
|
} else {
|
|
181
189
|
blockInput = BlockInputBlobs.createFromBlock({
|
|
182
190
|
block: block as SignedBeaconBlock<ForkBlobsDA>,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
|
-
import {INTERVALS_PER_SLOT} from "@lodestar/params";
|
|
3
2
|
import {
|
|
4
3
|
CachedBeaconStateAllForks,
|
|
5
4
|
computeStartSlotAtEpoch,
|
|
@@ -59,6 +58,9 @@ type LoadedStateBytesData = {persistedKey: DatastoreKey; stateBytes: Uint8Array}
|
|
|
59
58
|
*/
|
|
60
59
|
export const DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY = 3;
|
|
61
60
|
|
|
61
|
+
// TODO GLOAS: re-evaluate this timing
|
|
62
|
+
const PROCESS_CHECKPOINT_STATES_BPS = 6667;
|
|
63
|
+
|
|
62
64
|
/**
|
|
63
65
|
* An implementation of CheckpointStateCache that keep up to n epoch checkpoint states in memory and persist the rest to disk
|
|
64
66
|
* - If it's more than `maxEpochsInMemory` epochs old, it will persist n last epochs to disk based on the view of the block
|
|
@@ -464,14 +466,14 @@ export class PersistentCheckpointStateCache implements CheckpointStateCache {
|
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
const blockSlot = state.slot;
|
|
467
|
-
const
|
|
469
|
+
const processCPStatesTimeMs = state.config.getSlotComponentDurationMs(PROCESS_CHECKPOINT_STATES_BPS);
|
|
468
470
|
// we always have clock in production, fallback value is only for test
|
|
469
|
-
const
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
//
|
|
473
|
-
// normally it should only persist checkpoint states at
|
|
474
|
-
await sleep(
|
|
471
|
+
const msFromSlot = this.clock?.msFromSlot(blockSlot) ?? processCPStatesTimeMs;
|
|
472
|
+
const msToProcessCPStates = processCPStatesTimeMs - msFromSlot;
|
|
473
|
+
if (msToProcessCPStates > 0) {
|
|
474
|
+
// At ~67% of slot is the most free time of every slot, take that chance to persist checkpoint states
|
|
475
|
+
// normally it should only persist checkpoint states at ~67% of slot 0 of epoch
|
|
476
|
+
await sleep(msToProcessCPStates, this.signal);
|
|
475
477
|
}
|
|
476
478
|
// at syncing time, it's critical to persist checkpoint states as soon as possible to avoid OOM during unfinality time
|
|
477
479
|
// if node is synced this is not a hot time because block comes late, we'll likely miss attestation already, or the block is orphaned
|
|
@@ -99,7 +99,7 @@ export async function validateGossipDataColumnSidecar(
|
|
|
99
99
|
// this is something we should change this in the future to make the code airtight to the spec.
|
|
100
100
|
// 7) [REJECT] The sidecar's block's parent passes validation.
|
|
101
101
|
const blockState = await chain.regen
|
|
102
|
-
.getBlockSlotState(parentRoot, blockHeader.slot, {dontTransferCache: true}, RegenCaller.
|
|
102
|
+
.getBlockSlotState(parentRoot, blockHeader.slot, {dontTransferCache: true}, RegenCaller.validateGossipDataColumn)
|
|
103
103
|
.catch(() => {
|
|
104
104
|
throw new DataColumnSidecarGossipError(GossipAction.IGNORE, {
|
|
105
105
|
code: DataColumnSidecarErrorCode.PARENT_UNKNOWN,
|
|
@@ -25,9 +25,10 @@ export function validateLightClientFinalityUpdate(
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// [IGNORE] The finality_update is received after the block at signature_slot was given enough time to propagate
|
|
28
|
-
// through the network -- i.e. validate that
|
|
29
|
-
// (
|
|
30
|
-
|
|
28
|
+
// through the network -- i.e. validate that `get_sync_message_due_ms(epoch)`
|
|
29
|
+
// milliseconds (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) has
|
|
30
|
+
// transpired since the start of `signature_slot`.
|
|
31
|
+
if (updateReceivedTooEarly(config, chain.clock, gossipedFinalityUpdate)) {
|
|
31
32
|
throw new LightClientError(GossipAction.IGNORE, {
|
|
32
33
|
code: LightClientErrorCode.FINALITY_UPDATE_RECEIVED_TOO_EARLY,
|
|
33
34
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {computeTimeAtSlot} from "@lodestar/state-transition";
|
|
3
2
|
import {LightClientOptimisticUpdate} from "@lodestar/types";
|
|
4
3
|
import {MAXIMUM_GOSSIP_CLOCK_DISPARITY} from "../../constants/index.js";
|
|
5
4
|
import {assertLightClientServer} from "../../node/utils/lightclient.js";
|
|
5
|
+
import {IClock} from "../../util/clock.js";
|
|
6
6
|
import {GossipAction} from "../errors/index.js";
|
|
7
7
|
import {LightClientError, LightClientErrorCode} from "../errors/lightClientError.js";
|
|
8
8
|
import {IBeaconChain} from "../interface.js";
|
|
@@ -26,9 +26,10 @@ export function validateLightClientOptimisticUpdate(
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// [IGNORE] The optimistic_update is received after the block at signature_slot was given enough time to propagate
|
|
29
|
-
// through the network -- i.e. validate that
|
|
30
|
-
// (
|
|
31
|
-
|
|
29
|
+
// through the network -- i.e. validate that `get_sync_message_due_ms(epoch)`
|
|
30
|
+
// milliseconds (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) has
|
|
31
|
+
// transpired since the start of `signature_slot`.
|
|
32
|
+
if (updateReceivedTooEarly(config, chain.clock, gossipedOptimisticUpdate)) {
|
|
32
33
|
throw new LightClientError(GossipAction.IGNORE, {
|
|
33
34
|
code: LightClientErrorCode.OPTIMISTIC_UPDATE_RECEIVED_TOO_EARLY,
|
|
34
35
|
});
|
|
@@ -48,20 +49,20 @@ export function validateLightClientOptimisticUpdate(
|
|
|
48
49
|
/**
|
|
49
50
|
* Returns true, if the spec condition below triggers an IGNORE.
|
|
50
51
|
*
|
|
51
|
-
* Sig +
|
|
52
|
+
* Sig + SYNC_MESSAGE_DUE_BPS time
|
|
52
53
|
* -----|-----
|
|
53
54
|
* xxx|------- (x is not okay)
|
|
54
55
|
*
|
|
55
56
|
* [IGNORE] The *update is received after the block at signature_slot was given enough time to propagate
|
|
56
|
-
* through the network -- i.e. validate that
|
|
57
|
-
* (
|
|
57
|
+
* through the network -- i.e. validate that `get_sync_message_due_ms(epoch)`
|
|
58
|
+
* milliseconds (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) has
|
|
59
|
+
* transpired since the start of `signature_slot`.
|
|
58
60
|
*/
|
|
59
61
|
export function updateReceivedTooEarly(
|
|
60
62
|
config: ChainForkConfig,
|
|
61
|
-
|
|
63
|
+
clock: IClock,
|
|
62
64
|
update: Pick<LightClientOptimisticUpdate, "signatureSlot">
|
|
63
65
|
): boolean {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
return Date.now() < earliestAllowedTimestampMs;
|
|
66
|
+
const fork = config.getForkName(update.signatureSlot);
|
|
67
|
+
return clock.msFromSlot(update.signatureSlot) < config.getSyncMessageDueMs(fork) - MAXIMUM_GOSSIP_CLOCK_DISPARITY;
|
|
67
68
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {ForkSeq,
|
|
1
|
+
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
+
import {ForkSeq, MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
3
|
import {
|
|
4
4
|
CachedBeaconStateAllForks,
|
|
5
5
|
CachedBeaconStateAltair,
|
|
6
6
|
ParticipationFlags,
|
|
7
7
|
computeEpochAtSlot,
|
|
8
8
|
computeStartSlotAtEpoch,
|
|
9
|
+
computeTimeAtSlot,
|
|
9
10
|
getBlockRootAtSlot,
|
|
10
11
|
getCurrentSlot,
|
|
11
12
|
parseAttesterFlags,
|
|
@@ -34,8 +35,9 @@ const MAX_CACHED_EPOCHS = 4;
|
|
|
34
35
|
|
|
35
36
|
const MAX_CACHED_DISTINCT_TARGETS = 4;
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
const
|
|
38
|
+
// TODO GLOAS: re-evaluate these timings
|
|
39
|
+
const LATE_ATTESTATION_SUBMISSION_BPS = 5000;
|
|
40
|
+
const LATE_BLOCK_SUBMISSION_BPS = 2500;
|
|
39
41
|
|
|
40
42
|
const RETAIN_REGISTERED_VALIDATORS_MS = 1 * 3600 * 1000; // 1 hour
|
|
41
43
|
|
|
@@ -450,8 +452,11 @@ export function createValidatorMonitor(
|
|
|
450
452
|
|
|
451
453
|
onPoolSubmitUnaggregatedAttestation(seenTimestampSec, indexedAttestation, subnet, sentPeers) {
|
|
452
454
|
const data = indexedAttestation.data;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
+
const fork = config.getForkName(data.slot);
|
|
456
|
+
// Returns the duration between when the attestation `data` could be produced (ATTESTATION_DUE_BPS through the slot) and `seenTimestamp`.
|
|
457
|
+
const delaySec =
|
|
458
|
+
seenTimestampSec -
|
|
459
|
+
(computeTimeAtSlot(config, data.slot, genesisTime) + config.getAttestationDueMs(fork) / 1000);
|
|
455
460
|
for (const index of indexedAttestation.attestingIndices) {
|
|
456
461
|
const validator = validators.get(index);
|
|
457
462
|
if (validator) {
|
|
@@ -483,8 +488,11 @@ export function createValidatorMonitor(
|
|
|
483
488
|
const src = OpSource.gossip;
|
|
484
489
|
const data = indexedAttestation.data;
|
|
485
490
|
const epoch = computeEpochAtSlot(data.slot);
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
const fork = config.getForkName(data.slot);
|
|
492
|
+
// Returns the duration between when the attestation `data` could be produced (ATTESTATION_DUE_BPS through the slot) and `seenTimestamp`.
|
|
493
|
+
const delaySec =
|
|
494
|
+
seenTimestampSec -
|
|
495
|
+
(computeTimeAtSlot(config, data.slot, genesisTime) + config.getAttestationDueMs(fork) / 1000);
|
|
488
496
|
|
|
489
497
|
for (const index of indexedAttestation.attestingIndices) {
|
|
490
498
|
const validator = validators.get(index);
|
|
@@ -500,8 +508,10 @@ export function createValidatorMonitor(
|
|
|
500
508
|
|
|
501
509
|
onPoolSubmitAggregatedAttestation(seenTimestampSec, indexedAttestation, sentPeers) {
|
|
502
510
|
const data = indexedAttestation.data;
|
|
503
|
-
|
|
504
|
-
|
|
511
|
+
const fork = config.getForkName(data.slot);
|
|
512
|
+
// Returns the duration between when a `AggregateAndproof` with `data` could be produced (AGGREGATE_DUE_BPS through the slot) and `seenTimestamp`.
|
|
513
|
+
const delaySec =
|
|
514
|
+
seenTimestampSec - (computeTimeAtSlot(config, data.slot, genesisTime) + config.getAggregateDueMs(fork) / 1000);
|
|
505
515
|
|
|
506
516
|
for (const index of indexedAttestation.attestingIndices) {
|
|
507
517
|
const validator = validators.get(index);
|
|
@@ -527,8 +537,10 @@ export function createValidatorMonitor(
|
|
|
527
537
|
const src = OpSource.gossip;
|
|
528
538
|
const data = indexedAttestation.data;
|
|
529
539
|
const epoch = computeEpochAtSlot(data.slot);
|
|
530
|
-
|
|
531
|
-
|
|
540
|
+
const fork = config.getForkName(data.slot);
|
|
541
|
+
// Returns the duration between when a `AggregateAndproof` with `data` could be produced (AGGREGATE_DUE_BPS through the slot) and `seenTimestamp`.
|
|
542
|
+
const delaySec =
|
|
543
|
+
seenTimestampSec - (computeTimeAtSlot(config, data.slot, genesisTime) + config.getAggregateDueMs(fork) / 1000);
|
|
532
544
|
|
|
533
545
|
const aggregatorIndex = signedAggregateAndProof.message.aggregatorIndex;
|
|
534
546
|
const validatorAggregator = validators.get(aggregatorIndex);
|
|
@@ -822,7 +834,7 @@ export function createValidatorMonitor(
|
|
|
822
834
|
* - Was the attestation seen in a block?
|
|
823
835
|
*/
|
|
824
836
|
function renderAttestationSummary(
|
|
825
|
-
config:
|
|
837
|
+
config: ChainForkConfig,
|
|
826
838
|
rootCache: RootHexCache,
|
|
827
839
|
summary: AttestationSummary | undefined,
|
|
828
840
|
flags: ParticipationFlags
|
|
@@ -925,8 +937,7 @@ function renderAttestationSummary(
|
|
|
925
937
|
}
|
|
926
938
|
|
|
927
939
|
const submittedLate =
|
|
928
|
-
summary.poolSubmitDelayMinSec >
|
|
929
|
-
(INTERVALS_LATE_ATTESTATION_SUBMISSION * config.SECONDS_PER_SLOT) / INTERVALS_PER_SLOT;
|
|
940
|
+
summary.poolSubmitDelayMinSec > config.getSlotComponentDurationMs(LATE_ATTESTATION_SUBMISSION_BPS) / 1000;
|
|
930
941
|
|
|
931
942
|
const aggregateInclusion = summary.aggregateInclusionDelaysSec.length > 0;
|
|
932
943
|
|
|
@@ -1030,7 +1041,7 @@ function isMissedSlot(rootCache: RootHexCache, slot: Slot): boolean {
|
|
|
1030
1041
|
}
|
|
1031
1042
|
|
|
1032
1043
|
function renderBlockProposalSummary(
|
|
1033
|
-
config:
|
|
1044
|
+
config: ChainForkConfig,
|
|
1034
1045
|
rootCache: RootHexCache,
|
|
1035
1046
|
summary: EpochSummary | undefined,
|
|
1036
1047
|
proposalSlot: Slot
|
|
@@ -1053,7 +1064,7 @@ function renderBlockProposalSummary(
|
|
|
1053
1064
|
|
|
1054
1065
|
if (
|
|
1055
1066
|
proposal.poolSubmitDelaySec !== null &&
|
|
1056
|
-
proposal.poolSubmitDelaySec >
|
|
1067
|
+
proposal.poolSubmitDelaySec > config.getSlotComponentDurationMs(LATE_BLOCK_SUBMISSION_BPS) / 1000
|
|
1057
1068
|
) {
|
|
1058
1069
|
out += "_late";
|
|
1059
1070
|
}
|
|
@@ -862,9 +862,9 @@ export function createLodestarMetrics(
|
|
|
862
862
|
help: "Time elapsed between block slot time and the time block becomes head",
|
|
863
863
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
864
864
|
}),
|
|
865
|
-
|
|
866
|
-
name: "
|
|
867
|
-
help: "Total times an imported block is set as head after the
|
|
865
|
+
setHeadAfterCutoff: register.gauge({
|
|
866
|
+
name: "lodestar_import_block_set_head_after_cutoff_total",
|
|
867
|
+
help: "Total times an imported block is set as head after ATTESTATION_DUE_BPS of the slot",
|
|
868
868
|
}),
|
|
869
869
|
bySource: register.gauge<{source: BlockInputSource}>({
|
|
870
870
|
name: "lodestar_import_block_by_source_total",
|
|
@@ -105,7 +105,7 @@ export class Eth2Gossipsub extends GossipSub {
|
|
|
105
105
|
mcacheLength: 6,
|
|
106
106
|
mcacheGossip: 3,
|
|
107
107
|
// this should be in ms
|
|
108
|
-
seenTTL: config.
|
|
108
|
+
seenTTL: config.SLOT_DURATION_MS * SLOTS_PER_EPOCH * 2,
|
|
109
109
|
scoreParams,
|
|
110
110
|
scoreThresholds: gossipScoreThresholds,
|
|
111
111
|
// For a single stream, await processing each RPC before processing the next
|
|
@@ -84,10 +84,10 @@ export function computeGossipPeerScoreParams({
|
|
|
84
84
|
config: BeaconConfig;
|
|
85
85
|
eth2Context: Eth2Context;
|
|
86
86
|
}): Partial<PeerScoreParams> {
|
|
87
|
-
const decayIntervalMs = config.
|
|
87
|
+
const decayIntervalMs = config.SLOT_DURATION_MS;
|
|
88
88
|
const decayToZero = 0.01;
|
|
89
|
-
const epochDurationMs = config.
|
|
90
|
-
const slotDurationMs = config.
|
|
89
|
+
const epochDurationMs = config.SLOT_DURATION_MS * SLOTS_PER_EPOCH;
|
|
90
|
+
const slotDurationMs = config.SLOT_DURATION_MS;
|
|
91
91
|
const scoreParameterDecayFn = (decayTimeMs: number): number => {
|
|
92
92
|
return scoreParameterDecayWithBase(decayTimeMs, decayIntervalMs, decayToZero);
|
|
93
93
|
};
|
|
@@ -265,7 +265,7 @@ function getTopicScoreParams(
|
|
|
265
265
|
|
|
266
266
|
if (meshMessageInfo) {
|
|
267
267
|
const {decaySlots, capFactor, activationWindow, currentSlot} = meshMessageInfo;
|
|
268
|
-
const decayTimeMs = config.
|
|
268
|
+
const decayTimeMs = config.SLOT_DURATION_MS * decaySlots;
|
|
269
269
|
params.meshMessageDeliveriesDecay = scoreParameterDecayFn(decayTimeMs);
|
|
270
270
|
params.meshMessageDeliveriesThreshold = threshold(params.meshMessageDeliveriesDecay, expectedMessageRate / 50);
|
|
271
271
|
params.meshMessageDeliveriesCap = Math.max(capFactor * params.meshMessageDeliveriesThreshold, 2);
|