@lodestar/beacon-node 1.46.0-dev.e6f04acd82 → 1.46.0-dev.eabf12abae
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 +37 -15
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +15 -6
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +3 -3
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +3 -4
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +6 -0
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +31 -25
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/utils/polarBearBanner.d.ts +2 -0
- package/lib/chain/blocks/utils/polarBearBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/polarBearBanner.js +51 -0
- package/lib/chain/blocks/utils/polarBearBanner.js.map +1 -0
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +21 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/chain.d.ts +5 -0
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +55 -0
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +6 -0
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -0
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/options.d.ts +2 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +107 -29
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +6 -6
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.d.ts +20 -4
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js +49 -2
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/validation/block.d.ts +4 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +32 -18
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +21 -16
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +14 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +38 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +12 -1
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +20 -3
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +11 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +8 -0
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +20 -3
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/util/clock.d.ts +2 -7
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +2 -7
- package/lib/util/clock.js.map +1 -1
- package/lib/util/workerEvents.d.ts +7 -1
- package/lib/util/workerEvents.d.ts.map +1 -1
- package/lib/util/workerEvents.js +17 -5
- package/lib/util/workerEvents.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/beacon/blocks/index.ts +65 -16
- package/src/api/impl/validator/index.ts +19 -6
- package/src/chain/blocks/importBlock.ts +3 -2
- package/src/chain/blocks/importExecutionPayload.ts +8 -4
- package/src/chain/blocks/index.ts +7 -0
- package/src/chain/blocks/utils/chainSegment.ts +35 -28
- package/src/chain/blocks/utils/polarBearBanner.ts +50 -0
- package/src/chain/blocks/verifyBlock.ts +28 -2
- package/src/chain/chain.ts +60 -0
- package/src/chain/emitter.ts +7 -0
- package/src/chain/interface.ts +3 -0
- package/src/chain/options.ts +3 -0
- package/src/chain/prepareNextSlot.ts +140 -39
- package/src/chain/produceBlock/produceBlockBody.ts +11 -6
- package/src/chain/seenCache/seenBlockProposers.ts +72 -5
- package/src/chain/validation/block.ts +41 -19
- package/src/chain/validation/dataColumnSidecar.ts +27 -17
- package/src/metrics/metrics/lodestar.ts +39 -0
- package/src/network/core/networkCore.ts +13 -1
- package/src/network/core/networkCoreWorkerHandler.ts +18 -3
- package/src/network/network.ts +16 -1
- package/src/network/processor/gossipHandlers.ts +7 -0
- package/src/network/reqresp/score.ts +22 -3
- package/src/util/clock.ts +2 -7
- package/src/util/workerEvents.ts +18 -6
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.46.0-dev.
|
|
14
|
+
"version": "1.46.0-dev.eabf12abae",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@chainsafe/discv5": "^12.0.1",
|
|
106
106
|
"@chainsafe/enr": "^6.0.1",
|
|
107
107
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
108
|
-
"@chainsafe/libp2p-quic": "^2.1.
|
|
108
|
+
"@chainsafe/libp2p-quic": "^2.1.2",
|
|
109
109
|
"@chainsafe/persistent-merkle-tree": "^1.3.0",
|
|
110
110
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
111
111
|
"@chainsafe/snappy-wasm": "^0.5.0",
|
|
@@ -126,17 +126,17 @@
|
|
|
126
126
|
"@libp2p/peer-id": "^6.0.4",
|
|
127
127
|
"@libp2p/prometheus-metrics": "^5.0.14",
|
|
128
128
|
"@libp2p/tcp": "^11.0.13",
|
|
129
|
-
"@lodestar/api": "^1.46.0-dev.
|
|
130
|
-
"@lodestar/config": "^1.46.0-dev.
|
|
131
|
-
"@lodestar/db": "^1.46.0-dev.
|
|
132
|
-
"@lodestar/fork-choice": "^1.46.0-dev.
|
|
133
|
-
"@lodestar/logger": "^1.46.0-dev.
|
|
134
|
-
"@lodestar/params": "^1.46.0-dev.
|
|
135
|
-
"@lodestar/reqresp": "^1.46.0-dev.
|
|
136
|
-
"@lodestar/state-transition": "^1.46.0-dev.
|
|
137
|
-
"@lodestar/types": "^1.46.0-dev.
|
|
138
|
-
"@lodestar/utils": "^1.46.0-dev.
|
|
139
|
-
"@lodestar/validator": "^1.46.0-dev.
|
|
129
|
+
"@lodestar/api": "^1.46.0-dev.eabf12abae",
|
|
130
|
+
"@lodestar/config": "^1.46.0-dev.eabf12abae",
|
|
131
|
+
"@lodestar/db": "^1.46.0-dev.eabf12abae",
|
|
132
|
+
"@lodestar/fork-choice": "^1.46.0-dev.eabf12abae",
|
|
133
|
+
"@lodestar/logger": "^1.46.0-dev.eabf12abae",
|
|
134
|
+
"@lodestar/params": "^1.46.0-dev.eabf12abae",
|
|
135
|
+
"@lodestar/reqresp": "^1.46.0-dev.eabf12abae",
|
|
136
|
+
"@lodestar/state-transition": "^1.46.0-dev.eabf12abae",
|
|
137
|
+
"@lodestar/types": "^1.46.0-dev.eabf12abae",
|
|
138
|
+
"@lodestar/utils": "^1.46.0-dev.eabf12abae",
|
|
139
|
+
"@lodestar/validator": "^1.46.0-dev.eabf12abae",
|
|
140
140
|
"@multiformats/multiaddr": "^13.0.1",
|
|
141
141
|
"datastore-core": "^11.0.2",
|
|
142
142
|
"datastore-level": "^12.0.2",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"@libp2p/interface-internal": "^3.0.13",
|
|
159
159
|
"@libp2p/logger": "^6.2.2",
|
|
160
160
|
"@libp2p/utils": "^7.0.13",
|
|
161
|
-
"@lodestar/spec-test-util": "^1.46.0-dev.
|
|
161
|
+
"@lodestar/spec-test-util": "^1.46.0-dev.eabf12abae",
|
|
162
162
|
"@types/js-yaml": "^4.0.5",
|
|
163
163
|
"@types/qs": "^6.9.7",
|
|
164
164
|
"@types/tmp": "^0.2.3",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"beacon",
|
|
176
176
|
"blockchain"
|
|
177
177
|
],
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "9f3566a942890d0e4fc69ebf21d56614ffd925a5"
|
|
179
179
|
}
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
ProduceFullGloas,
|
|
59
59
|
} from "../../../../chain/produceBlock/index.js";
|
|
60
60
|
import {RegenCaller} from "../../../../chain/regen/index.js";
|
|
61
|
-
import {validateGossipBlock} from "../../../../chain/validation/block.js";
|
|
61
|
+
import {validateGossipBlock, verifyBlockProposerSignature} from "../../../../chain/validation/block.js";
|
|
62
62
|
import {validateApiExecutionPayloadBid} from "../../../../chain/validation/executionPayloadBid.js";
|
|
63
63
|
import {validateApiExecutionPayloadEnvelope} from "../../../../chain/validation/executionPayloadEnvelope.js";
|
|
64
64
|
import {OpSource} from "../../../../chain/validatorMonitor.js";
|
|
@@ -268,7 +268,6 @@ export function getBeaconBlockApi({
|
|
|
268
268
|
await verifyBlocksInEpoch.call(chain as BeaconChain, parentBlock, [blockForImport], null, {
|
|
269
269
|
...opts,
|
|
270
270
|
verifyOnly: true,
|
|
271
|
-
skipVerifyBlockSignatures: true,
|
|
272
271
|
skipVerifyExecutionPayload: true,
|
|
273
272
|
seenTimestampSec,
|
|
274
273
|
});
|
|
@@ -285,12 +284,31 @@ export function getBeaconBlockApi({
|
|
|
285
284
|
|
|
286
285
|
chain.logger.debug("Consensus validated while publishing block", valLogMeta);
|
|
287
286
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
287
|
+
// Non-local blocks had their proposer and block-body signatures checked by verifyBlocksInEpoch above
|
|
288
|
+
// Locally produced blocks already passed block production validation, so only their proposer signature is unchecked
|
|
289
|
+
// Verify that signature and observe the block root here
|
|
290
|
+
if (blockLocallyProduced) {
|
|
291
|
+
try {
|
|
292
|
+
await verifyBlockProposerSignature(chain, signedBlock, blockRoot);
|
|
293
|
+
chain.seenBlockProposers.observeBlockRoot(
|
|
294
|
+
slot,
|
|
295
|
+
signedBlock.message.proposerIndex,
|
|
296
|
+
blockRoot,
|
|
297
|
+
signedBlockToSignedHeader(config, signedBlock)
|
|
298
|
+
);
|
|
299
|
+
} catch (e) {
|
|
300
|
+
chain.logger.error(
|
|
301
|
+
"Proposer signature validation failed while publishing the block",
|
|
302
|
+
valLogMeta,
|
|
303
|
+
e as Error
|
|
304
|
+
);
|
|
305
|
+
chain.persistInvalidSszValue(
|
|
306
|
+
chain.config.getForkTypes(slot).SignedBeaconBlock,
|
|
307
|
+
signedBlock,
|
|
308
|
+
"api_reject_consensus_failure"
|
|
309
|
+
);
|
|
310
|
+
throw e;
|
|
292
311
|
}
|
|
293
|
-
chain.logger.warn(message, valLogMeta);
|
|
294
312
|
}
|
|
295
313
|
break;
|
|
296
314
|
}
|
|
@@ -318,6 +336,25 @@ export function getBeaconBlockApi({
|
|
|
318
336
|
await sleep(msToBlockSlot);
|
|
319
337
|
}
|
|
320
338
|
|
|
339
|
+
if (broadcastValidation === routes.beacon.BroadcastValidation.consensusAndEquivocation) {
|
|
340
|
+
const conflictingRoots = chain.seenBlockProposers.getConflictingBlockRoots(
|
|
341
|
+
slot,
|
|
342
|
+
signedBlock.message.proposerIndex,
|
|
343
|
+
blockRoot
|
|
344
|
+
);
|
|
345
|
+
if (conflictingRoots.length > 0) {
|
|
346
|
+
chain.logger.warn("Not publishing block due to proposer equivocation", {
|
|
347
|
+
...valLogMeta,
|
|
348
|
+
conflictingRoots: conflictingRoots.join(", "),
|
|
349
|
+
});
|
|
350
|
+
throw new ApiError(
|
|
351
|
+
400,
|
|
352
|
+
`Block is a proposer equivocation, conflicting block roots: ${conflictingRoots.join(", ")}`
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
chain.logger.debug("Equivocation validated while publishing the block", valLogMeta);
|
|
356
|
+
}
|
|
357
|
+
|
|
321
358
|
// TODO: Validate block
|
|
322
359
|
const delaySec = seenTimestampSec - computeTimeAtSlot(config, slot, chain.genesisTime);
|
|
323
360
|
metrics?.gossipBlock.elapsedTimeTillReceived.observe({source: OpSource.api}, delaySec);
|
|
@@ -775,15 +812,6 @@ export function getBeaconBlockApi({
|
|
|
775
812
|
throw new ApiError(400, (error as Error).message);
|
|
776
813
|
}
|
|
777
814
|
chain.logger.debug("Consensus validated while publishing execution payload envelope", valLogMeta);
|
|
778
|
-
|
|
779
|
-
// TODO GLOAS: check the block is not a proposer equivocation before publishing the envelope
|
|
780
|
-
if (broadcastValidation === routes.beacon.BroadcastValidation.consensusAndEquivocation) {
|
|
781
|
-
const message = `Equivocation checks not yet implemented for broadcastValidation=${broadcastValidation}`;
|
|
782
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
783
|
-
throw Error(message);
|
|
784
|
-
}
|
|
785
|
-
chain.logger.warn(message, valLogMeta);
|
|
786
|
-
}
|
|
787
815
|
break;
|
|
788
816
|
}
|
|
789
817
|
|
|
@@ -886,6 +914,27 @@ export function getBeaconBlockApi({
|
|
|
886
914
|
await sleep(msToBlockSlot);
|
|
887
915
|
}
|
|
888
916
|
|
|
917
|
+
// Keep this as the final async validation before publishing. A conflicting block may be observed while the
|
|
918
|
+
// envelope, blob data, or slot timing is being validated above.
|
|
919
|
+
if (broadcastValidation === routes.beacon.BroadcastValidation.consensusAndEquivocation) {
|
|
920
|
+
const conflictingRoots = chain.seenBlockProposers.getConflictingBlockRoots(
|
|
921
|
+
slot,
|
|
922
|
+
payloadInput.proposerIndex,
|
|
923
|
+
blockRootHex
|
|
924
|
+
);
|
|
925
|
+
if (conflictingRoots.length > 0) {
|
|
926
|
+
chain.logger.warn("Not publishing execution payload envelope due to proposer equivocation", {
|
|
927
|
+
...valLogMeta,
|
|
928
|
+
conflictingRoots: conflictingRoots.join(", "),
|
|
929
|
+
});
|
|
930
|
+
throw new ApiError(
|
|
931
|
+
400,
|
|
932
|
+
`Block of execution payload envelope is a proposer equivocation, conflicting block roots: ${conflictingRoots.join(", ")}`
|
|
933
|
+
);
|
|
934
|
+
}
|
|
935
|
+
chain.logger.debug("Equivocation validated while publishing execution payload envelope", valLogMeta);
|
|
936
|
+
}
|
|
937
|
+
|
|
889
938
|
if (payloadInput.hasPayloadEnvelope()) {
|
|
890
939
|
// The envelope may have been added while this request was being validated, e.g. via gossip
|
|
891
940
|
chain.logger.debug("Execution payload envelope already added during publishing", valLogMeta);
|
|
@@ -339,12 +339,13 @@ export function getValidatorApi(
|
|
|
339
339
|
* Following activities should be skipped on an Optimistic head (with Syncing status):
|
|
340
340
|
* 1. Attestation if targetRoot is optimistic
|
|
341
341
|
* 2. SyncCommitteeContribution if if the root for which to produce contribution is Optimistic.
|
|
342
|
-
* 3. ProduceBlock if the parentRoot (chain's current head is optimistic
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
342
|
+
* 3. ProduceBlock if the parentRoot (chain's current head) is optimistic. Must be checked
|
|
343
|
+
* explicitly as only local payload production consults the EL, blinded blocks from an
|
|
344
|
+
* external builder or bid based blocks (gloas) can be produced without a synced EL.
|
|
345
|
+
* 4. SyncCommitteeSignature (base sync committee message) is aborted in the validator client
|
|
346
|
+
* (see SyncCommitteeService) when the head root it would sign is optimistic, since it is
|
|
347
|
+
* produced from the head root without a beacon-node produce endpoint to gate here. Spec:
|
|
348
|
+
* https://github.com/ethereum/consensus-specs/blob/v1.6.1/sync/optimistic.md#participating-in-sync-committees
|
|
348
349
|
*/
|
|
349
350
|
|
|
350
351
|
function notOnOptimisticBlockRoot(beaconBlockRoot: Root): void {
|
|
@@ -545,6 +546,12 @@ export function getValidatorApi(
|
|
|
545
546
|
const parentBlock = chain.getProposerHead(slot);
|
|
546
547
|
const {blockRoot: parentBlockRootHex, slot: parentSlot} = parentBlock;
|
|
547
548
|
const parentBlockRoot = fromHex(parentBlockRootHex);
|
|
549
|
+
// An optimistic validator MUST NOT produce a block
|
|
550
|
+
if (isOptimisticBlock(parentBlock)) {
|
|
551
|
+
throw new NodeIsSyncing(
|
|
552
|
+
`Parent block's execution payload not yet validated, executionPayloadBlockHash=${parentBlock.executionPayloadBlockHash}`
|
|
553
|
+
);
|
|
554
|
+
}
|
|
548
555
|
notOnOutOfRangeData(parentBlockRoot);
|
|
549
556
|
metrics?.blockProductionSlotDelta.set(slot - parentSlot);
|
|
550
557
|
|
|
@@ -870,6 +877,12 @@ export function getValidatorApi(
|
|
|
870
877
|
const parentBlock = chain.getProposerHead(slot);
|
|
871
878
|
const {blockRoot: parentBlockRootHex, slot: parentSlot} = parentBlock;
|
|
872
879
|
const parentBlockRoot = fromHex(parentBlockRootHex);
|
|
880
|
+
// An optimistic validator MUST NOT produce a block
|
|
881
|
+
if (isOptimisticBlock(parentBlock)) {
|
|
882
|
+
throw new NodeIsSyncing(
|
|
883
|
+
`Parent block's execution payload not yet validated, executionPayloadBlockHash=${parentBlock.executionPayloadBlockHash}`
|
|
884
|
+
);
|
|
885
|
+
}
|
|
873
886
|
notOnOutOfRangeData(parentBlockRoot);
|
|
874
887
|
metrics?.blockProductionSlotDelta.set(slot - parentSlot);
|
|
875
888
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ForkChoiceError,
|
|
7
7
|
ForkChoiceErrorCode,
|
|
8
8
|
NotReorgedReason,
|
|
9
|
+
getFinalizedExecutionBlockHash,
|
|
9
10
|
getSafeExecutionBlockHash,
|
|
10
11
|
} from "@lodestar/fork-choice";
|
|
11
12
|
import {
|
|
@@ -443,8 +444,8 @@ export async function importBlock(
|
|
|
443
444
|
* the current finalized block does not contain any execution payload at all (pre MERGE_EPOCH) or if it contains a
|
|
444
445
|
* zero block hash (pre TTD)
|
|
445
446
|
*/
|
|
446
|
-
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
|
|
447
|
-
const finalizedBlockHash = this.forkChoice.
|
|
447
|
+
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice, this.logger);
|
|
448
|
+
const finalizedBlockHash = getFinalizedExecutionBlockHash(this.forkChoice, this.logger);
|
|
448
449
|
if (headBlockHash !== ZERO_HASH_HEX) {
|
|
449
450
|
this.executionEngine
|
|
450
451
|
.notifyForkchoiceUpdate(
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ExecutionStatus,
|
|
4
|
+
PayloadExecutionStatus,
|
|
5
|
+
getFinalizedExecutionBlockHash,
|
|
6
|
+
getSafeExecutionBlockHash,
|
|
7
|
+
} from "@lodestar/fork-choice";
|
|
3
8
|
import {DataAvailabilityStatus, isStatePostGloas} from "@lodestar/state-transition";
|
|
4
9
|
import {isErrorAborted} from "@lodestar/utils";
|
|
5
|
-
import {ZERO_HASH_HEX} from "../../constants/index.js";
|
|
6
10
|
import {ExecutionPayloadStatus} from "../../execution/index.js";
|
|
7
11
|
import {isQueueErrorAborted} from "../../util/queue/index.js";
|
|
8
12
|
import {BeaconChain} from "../chain.js";
|
|
@@ -245,8 +249,8 @@ export async function importExecutionPayload(
|
|
|
245
249
|
// 7. Queue notifyForkchoiceUpdate to engine api
|
|
246
250
|
const head = this.forkChoice.getHead();
|
|
247
251
|
if (!this.opts.disableImportExecutionFcU && blockRootHex === head.blockRoot) {
|
|
248
|
-
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
|
|
249
|
-
const finalizedBlockHash = this.forkChoice.
|
|
252
|
+
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice, this.logger);
|
|
253
|
+
const finalizedBlockHash = getFinalizedExecutionBlockHash(this.forkChoice, this.logger);
|
|
250
254
|
this.executionEngine.notifyForkchoiceUpdate(fork, blockHashHex, safeBlockHash, finalizedBlockHash).catch((e) => {
|
|
251
255
|
if (!isErrorAborted(e) && !isQueueErrorAborted(e)) {
|
|
252
256
|
this.logger.error("Error pushing notifyForkchoiceUpdate()", {blockHashHex, finalizedBlockHash}, e);
|
|
@@ -108,6 +108,13 @@ export async function processBlocks(
|
|
|
108
108
|
throw segmentExecStatus.execAborted.execError;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
if (opts.skipVerifyBlockSignatures !== true) {
|
|
112
|
+
for (const blockInput of relevantBlocks) {
|
|
113
|
+
const block = blockInput.getBlock().message;
|
|
114
|
+
this.seenBlockProposers.add(block.slot, block.proposerIndex);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
111
118
|
const {executionStatuses} = segmentExecStatus;
|
|
112
119
|
const verifiedBlocksBySlot = new Map<Slot, FullyVerifiedBlock>();
|
|
113
120
|
for (let i = 0; i < relevantBlocks.length; i++) {
|
|
@@ -31,23 +31,40 @@ export function assertLinearChainSegment(
|
|
|
31
31
|
payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null,
|
|
32
32
|
parentBlock: ProtoBlock | null
|
|
33
33
|
): ChainSegmentResult {
|
|
34
|
+
if (blocks.length === 0) {
|
|
35
|
+
return {warnings: null};
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
const warnings: OrphanedPayloadEnvelope[] = [];
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
// Starts from the known forkchoice parent's execution hash.
|
|
38
|
-
// - FULL variant (envelope present for slot): advances to envelope.payload.blockHash
|
|
39
|
-
// - EMPTY variant (no envelope for slot): execution hash is unchanged
|
|
40
|
-
let currentExecHash: string | null = parentBlock?.executionPayloadBlockHash ?? null;
|
|
41
|
-
// Checkpoint sync first batch: parent is the anchor PENDING whose executionPayloadBlockHash
|
|
42
|
-
// is the inherited parentBlockHash semantic (= grandparent's payload), not its own payload.
|
|
43
|
-
// If parent's own payload envelope arrives in this batch, advance currentExecHash to that
|
|
44
|
-
// payload's blockHash so the segment validation sees the true EL chain head.
|
|
40
|
+
let parentExecHash: string | null = parentBlock?.executionPayloadBlockHash ?? null;
|
|
45
41
|
if (parentBlock !== null) {
|
|
46
42
|
const parentPayloadInput = payloadEnvelopes?.get(parentBlock.slot);
|
|
47
43
|
if (parentPayloadInput?.hasPayloadEnvelope()) {
|
|
48
|
-
|
|
44
|
+
// Checkpoint-sync first batch: the anchor is stored PENDING with the inherited (grandparent)
|
|
45
|
+
// hash, not its own payload. Its payload envelope is in this batch, so use that blockHash as
|
|
46
|
+
// the real parent EL head.
|
|
47
|
+
parentExecHash = parentPayloadInput.getBlockHashHex();
|
|
49
48
|
}
|
|
50
49
|
}
|
|
50
|
+
|
|
51
|
+
// Track the expected execution payload block hash through the segment, seeded from the FIRST
|
|
52
|
+
// block's own bid
|
|
53
|
+
const firstBlockMessage = blocks[0].getBlock().message;
|
|
54
|
+
let currentExecHash: string | null = isGloasBeaconBlock(firstBlockMessage)
|
|
55
|
+
? toRootHex(firstBlockMessage.body.signedExecutionPayloadBid.message.parentBlockHash)
|
|
56
|
+
: null;
|
|
57
|
+
|
|
58
|
+
// First block must build on the parent's EL head. PARENT_PAYLOAD_UNKNOWN (vs the in-segment
|
|
59
|
+
// NON_LINEAR_PAYLOAD_ROOTS below) tells range sync this is a parent-link problem, not an in-batch one.
|
|
60
|
+
if (parentExecHash !== null && currentExecHash !== null && currentExecHash !== parentExecHash) {
|
|
61
|
+
throw new BlockError(blocks[0].getBlock(), {
|
|
62
|
+
code: BlockErrorCode.PARENT_PAYLOAD_UNKNOWN,
|
|
63
|
+
parentRoot: toRootHex(firstBlockMessage.parentRoot),
|
|
64
|
+
parentBlockHash: currentExecHash,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
51
68
|
// Track the execution hash before the last FULL advancement so we can recover
|
|
52
69
|
// if the next block reveals that envelope was orphaned.
|
|
53
70
|
let prevExecHash: string | null = currentExecHash;
|
|
@@ -76,8 +93,7 @@ export function assertLinearChainSegment(
|
|
|
76
93
|
}
|
|
77
94
|
|
|
78
95
|
if (isGloasBeaconBlock(block.message)) {
|
|
79
|
-
//
|
|
80
|
-
// chain is seeded mid-segment by the first FULL envelope.
|
|
96
|
+
// currentExecHash and prevExecHash are only null for a pre-gloas first block (fork-transition segment); always set post-gloas.
|
|
81
97
|
if (currentExecHash !== null) {
|
|
82
98
|
// Verify the bid's parentBlockHash matches the tracked execution hash.
|
|
83
99
|
// This ensures the block was built on the correct FULL or EMPTY variant of its parent.
|
|
@@ -86,22 +102,13 @@ export function assertLinearChainSegment(
|
|
|
86
102
|
// Maybe the previous slot's FULL envelope was orphaned — try falling back.
|
|
87
103
|
// If even prevExecHash doesn't match, the segment is non-linear.
|
|
88
104
|
if (bidParentHash !== prevExecHash) {
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
throw new BlockError(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
parentRoot: toRootHex(block.message.parentRoot),
|
|
97
|
-
parentBlockHash: bidParentHash,
|
|
98
|
-
}
|
|
99
|
-
: {
|
|
100
|
-
code: BlockErrorCode.NON_LINEAR_PAYLOAD_ROOTS,
|
|
101
|
-
parentBlockHash: bidParentHash,
|
|
102
|
-
expectedBlockHash: currentExecHash,
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
+
// Broken link inside the segment: throw NON_LINEAR_PAYLOAD_ROOTS instead of PARENT_PAYLOAD_UNKNOWN
|
|
106
|
+
// this is important for range sync to handle accordingly
|
|
107
|
+
throw new BlockError(block, {
|
|
108
|
+
code: BlockErrorCode.NON_LINEAR_PAYLOAD_ROOTS,
|
|
109
|
+
parentBlockHash: bidParentHash,
|
|
110
|
+
expectedBlockHash: currentExecHash,
|
|
111
|
+
});
|
|
105
112
|
}
|
|
106
113
|
if (lastFullSlot !== null && payloadEnvelopes !== null) {
|
|
107
114
|
const orphanedInput = payloadEnvelopes.get(lastFullSlot);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const GLOAS_POLAR_BEAR_BANNER = String.raw`
|
|
2
|
+
|
|
3
|
+
__ . .- '%%%░░░░░
|
|
4
|
+
/ '-. , ' '%%%░░░░
|
|
5
|
+
_.--""""--.._; . * .-' '%%%%░░
|
|
6
|
+
\ / _."" .' '-._ ' . '%%%%
|
|
7
|
+
L ."; ; ; '-. . / ' * '""
|
|
8
|
+
Ø / / .' ' ; '. ' ; |
|
|
9
|
+
D / ; e ' ) ( ' ; \ . .' ,:
|
|
10
|
+
E ; : P ( ' ) : '-.\ ' '
|
|
11
|
+
S ; ; B ).( '. '; ' '
|
|
12
|
+
T : : S (/:\) \ :
|
|
13
|
+
A : \ ': / : \ \ '.;
|
|
14
|
+
R \ \ '; \\ // ; ;
|
|
15
|
+
/ \ \ : .' \ \|/ | /
|
|
16
|
+
'>' : ' '.; |
|
|
17
|
+
/ ,' / '. ;/ _\
|
|
18
|
+
;,' ; '. '.; '-.
|
|
19
|
+
;' .' : '. '. / \, \ \ \
|
|
20
|
+
\ :,' : '. '. \ ; ::\_/_/_/::
|
|
21
|
+
~| .-=:.-" -,- "-.,=-.\ ;.; :::; ; ;::
|
|
22
|
+
~|\ |('.' : .')| \: '. :::::::
|
|
23
|
+
~|:\ \\/ : \// ; \ _____
|
|
24
|
+
~~\:\ ■ : .:. : _/ ; \hjw:
|
|
25
|
+
~~~\/ | ; ; ; | \"""
|
|
26
|
+
~~.' ■ : _ _ ; / ; /|~~
|
|
27
|
+
~/ | '. \'; ;'/ .' .' / /:|~~
|
|
28
|
+
| ■ ! : : !_.' / .--::/~~~
|
|
29
|
+
|\___ | '.: :.'/\ ; ____.':|:|/~~~~
|
|
30
|
+
\:::|\ ■ \'_'/ | : : ___/|:::|:'"""~~~~~
|
|
31
|
+
~'""|:\ | ;"^" | ! :__/|::|/""""~~~~~~~~~~
|
|
32
|
+
~~~~\::\_____ .-' | ; |::|/""~~~~~~~~~~~~~~~~
|
|
33
|
+
~~~~~\:|::::|\ / / / / / /"""~~~~~~~~~~~~~~~~~~~~
|
|
34
|
+
~~~~~~\|::::|:'--\_\_\__.'-| ;~~~~~~~~~~~~~~~~~~~~~~~~
|
|
35
|
+
~~~~~~~~""""~\::::::::::::/ .'~~~~~~~~~~~~~<><~~~~~~~~~
|
|
36
|
+
~~~~~~~~~~~~~~""""'"""".-' /~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
37
|
+
~~~~~~~__,------.__.--/ , , , |/--._~~~~~~~~~~~~~~~~~~~~~~~
|
|
38
|
+
~~~~~~/ | . :\| | |v' \__~~~~~~~~~~~~~~~~~~~~
|
|
39
|
+
~~~~~|\ ■ /:\ :::v-;v-':: \_~~~~~~~~~~~~~~~~~~
|
|
40
|
+
~~~~~\:\ / : \ ::::::::: \~~~~~~~~~~~~~~~~~
|
|
41
|
+
~~~~~~\|'-. / : \ /|~~~~~~~~~~~~~~~~
|
|
42
|
+
~~~~~~~~': \ \'. ,'/ ___ ____/:/~~~~~~~~~<><~~~~
|
|
43
|
+
~~~~~~~~~~\|: \ ' / /|:|\ /|:::|/~~~~~~~~~~~~~~~~~
|
|
44
|
+
~~~~~~~~~~~|: \:/ //"""\\ /:/"""~~~~~~~~~~~~~~~~~~~
|
|
45
|
+
~~~><>~~~~~|\ ' //~~~~~\\______/:/~~~~~~~~~~~~~~~~~~~~~~~
|
|
46
|
+
~~~~~~~~~~~'|\____//~~~~~~~\|GLOAS|/~~~~~~~~<><~~~~~~~~~~~~~
|
|
47
|
+
~~~~~~~~~~~~\|:::|/~~~~~~~~~'"""""'~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
48
|
+
~~~~~~~~~~~~~'"""'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
49
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~eth
|
|
50
|
+
`;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {ForkName, ForkSeq, isForkPostFulu} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
DataAvailabilityStatus,
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
computeEpochAtSlot,
|
|
7
|
+
signedBlockToSignedHeader,
|
|
8
|
+
} from "@lodestar/state-transition";
|
|
9
|
+
import {IndexedAttestation, Slot, deneb, ssz} from "@lodestar/types";
|
|
10
|
+
import {toRootHex} from "@lodestar/utils";
|
|
5
11
|
import {getBlobKzgCommitments} from "../../util/dataColumns.js";
|
|
6
12
|
import type {BeaconChain} from "../chain.js";
|
|
7
13
|
import {BlockError, BlockErrorCode} from "../errors/index.js";
|
|
@@ -13,6 +19,7 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
13
19
|
import {DENEB_BLOWFISH_BANNER} from "./utils/blowfishBanner.js";
|
|
14
20
|
import {ELECTRA_GIRAFFE_BANNER} from "./utils/giraffeBanner.js";
|
|
15
21
|
import {CAPELLA_OWL_BANNER} from "./utils/ownBanner.js";
|
|
22
|
+
import {GLOAS_POLAR_BEAR_BANNER} from "./utils/polarBearBanner.js";
|
|
16
23
|
import {FULU_ZEBRA_BANNER} from "./utils/zebraBanner.js";
|
|
17
24
|
import {verifyBlocksDataAvailability} from "./verifyBlocksDataAvailability.js";
|
|
18
25
|
import {SegmentExecStatus, verifyBlocksExecutionPayload} from "./verifyBlocksExecutionPayloads.js";
|
|
@@ -203,6 +210,20 @@ export async function verifyBlocksInEpoch(
|
|
|
203
210
|
// maybe chain with the above verifyBlocksSignatures()
|
|
204
211
|
]);
|
|
205
212
|
|
|
213
|
+
if (opts.skipVerifyBlockSignatures !== true) {
|
|
214
|
+
for (const block of blocks) {
|
|
215
|
+
const {slot, proposerIndex} = block.message;
|
|
216
|
+
const signedBlockHeader = signedBlockToSignedHeader(this.config, block);
|
|
217
|
+
const blockRoot = toRootHex(ssz.phase0.BeaconBlockHeader.hashTreeRoot(signedBlockHeader.message));
|
|
218
|
+
this.seenBlockProposers.observeBlockRoot(slot, proposerIndex, blockRoot, signedBlockHeader);
|
|
219
|
+
// Only produce a slashing while importing the block. A block that is verified before it is published
|
|
220
|
+
// must not be treated as equivocation evidence since it may never be seen by the network
|
|
221
|
+
if (opts.verifyOnly !== true && this.seenBlockProposers.isEquivocating(slot, proposerIndex)) {
|
|
222
|
+
this.processProposerEquivocation(slot, proposerIndex);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
206
227
|
if (opts.verifyOnly !== true) {
|
|
207
228
|
const fromForkBoundary = this.config.getForkBoundaryAtEpoch(computeEpochAtSlot(parentBlock.slot));
|
|
208
229
|
const toForkBoundary = this.config.getForkBoundaryAtEpoch(computeEpochAtSlot(lastBlock.message.slot));
|
|
@@ -230,6 +251,11 @@ export async function verifyBlocksInEpoch(
|
|
|
230
251
|
this.logger.info("Activating peerDAS", {epoch: this.config.FULU_FORK_EPOCH});
|
|
231
252
|
break;
|
|
232
253
|
|
|
254
|
+
case ForkName.gloas:
|
|
255
|
+
this.logger.info(GLOAS_POLAR_BEAR_BANNER);
|
|
256
|
+
this.logger.info("Activating ePBS", {epoch: this.config.GLOAS_FORK_EPOCH});
|
|
257
|
+
break;
|
|
258
|
+
|
|
233
259
|
default:
|
|
234
260
|
}
|
|
235
261
|
}
|
package/src/chain/chain.ts
CHANGED
|
@@ -130,6 +130,7 @@ import {CPStateDatastore} from "./stateCache/datastore/types.js";
|
|
|
130
130
|
import {FIFOBlockStateCache} from "./stateCache/fifoBlockStateCache.js";
|
|
131
131
|
import {PersistentCheckpointStateCache} from "./stateCache/persistentCheckpointsCache.js";
|
|
132
132
|
import {CheckpointStateCache} from "./stateCache/types.js";
|
|
133
|
+
import {validateApiProposerSlashing} from "./validation/proposerSlashing.js";
|
|
133
134
|
import {ValidatorMonitor} from "./validatorMonitor.js";
|
|
134
135
|
|
|
135
136
|
/**
|
|
@@ -200,6 +201,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
200
201
|
readonly seenAggregatedAttestations: SeenAggregatedAttestations;
|
|
201
202
|
readonly seenExecutionPayloadBids = new SeenExecutionPayloadBids();
|
|
202
203
|
readonly seenBlockProposers = new SeenBlockProposers();
|
|
204
|
+
/** Proposer indexes with an in-flight proposer slashing production */
|
|
205
|
+
private readonly producingProposerSlashing = new Set<ValidatorIndex>();
|
|
203
206
|
readonly seenSyncCommitteeMessages = new SeenSyncCommitteeMessages();
|
|
204
207
|
readonly seenContributionAndProof: SeenContributionAndProof;
|
|
205
208
|
readonly seenAttestationDatas: SeenAttestationDatas;
|
|
@@ -1163,6 +1166,63 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1163
1166
|
return this.payloadEnvelopeProcessor.processPayloadEnvelopeJob(payloadInput, opts);
|
|
1164
1167
|
}
|
|
1165
1168
|
|
|
1169
|
+
processProposerEquivocation(blockSlot: Slot, proposerIndex: ValidatorIndex): void {
|
|
1170
|
+
this.produceProposerSlashing(blockSlot, proposerIndex).catch((e) => {
|
|
1171
|
+
this.logger.debug("Error producing proposer slashing", {slot: blockSlot, proposerIndex}, e as Error);
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/** Produce a proposer slashing from two conflicting signed block headers observed for the same slot and proposer */
|
|
1176
|
+
private async produceProposerSlashing(blockSlot: Slot, proposerIndex: ValidatorIndex): Promise<void> {
|
|
1177
|
+
if (this.opts.disableProposerSlashings === true || this.producingProposerSlashing.has(proposerIndex)) {
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
if (this.opPool.hasSeenProposerSlashing(proposerIndex)) {
|
|
1182
|
+
this.logger.debug("Not producing proposer slashing, already in the op pool", {
|
|
1183
|
+
slot: blockSlot,
|
|
1184
|
+
proposerIndex,
|
|
1185
|
+
});
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
const headers = this.seenBlockProposers.getEquivocationHeaders(blockSlot, proposerIndex);
|
|
1190
|
+
if (headers === null) {
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
this.producingProposerSlashing.add(proposerIndex);
|
|
1195
|
+
try {
|
|
1196
|
+
const [header1, header2] = headers;
|
|
1197
|
+
// ProposerSlashing uses the bigint variant of the signed block header, see types package for details
|
|
1198
|
+
const proposerSlashing: phase0.ProposerSlashing = {
|
|
1199
|
+
signedHeader1: {
|
|
1200
|
+
message: {...header1.message, slot: BigInt(header1.message.slot)},
|
|
1201
|
+
signature: header1.signature,
|
|
1202
|
+
},
|
|
1203
|
+
signedHeader2: {
|
|
1204
|
+
message: {...header2.message, slot: BigInt(header2.message.slot)},
|
|
1205
|
+
signature: header2.signature,
|
|
1206
|
+
},
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
try {
|
|
1210
|
+
await validateApiProposerSlashing(this, proposerSlashing);
|
|
1211
|
+
} catch (e) {
|
|
1212
|
+
this.logger.debug("Produced proposer slashing is not valid", {slot: blockSlot, proposerIndex}, e as Error);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
this.opPool.insertProposerSlashing(proposerSlashing);
|
|
1217
|
+
this.emitter.emit(routes.events.EventType.proposerSlashing, proposerSlashing);
|
|
1218
|
+
this.emitter.emit(ChainEvent.publishProposerSlashing, proposerSlashing);
|
|
1219
|
+
this.metrics?.opPool.proposerSlashingsProduced.inc();
|
|
1220
|
+
this.logger.info("Produced proposer slashing from observed equivocation", {slot: blockSlot, proposerIndex});
|
|
1221
|
+
} finally {
|
|
1222
|
+
this.producingProposerSlashing.delete(proposerIndex);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1166
1226
|
getStatus(): Status {
|
|
1167
1227
|
const head = this.forkChoice.getHead();
|
|
1168
1228
|
const finalizedCheckpoint = this.forkChoice.getFinalizedCheckpoint();
|
package/src/chain/emitter.ts
CHANGED
|
@@ -50,6 +50,11 @@ export enum ChainEvent {
|
|
|
50
50
|
* and are ready to be published.
|
|
51
51
|
*/
|
|
52
52
|
publishBlobSidecars = "publishBlobSidecars",
|
|
53
|
+
/**
|
|
54
|
+
* This event signals that a proposer slashing has been produced from an observed equivocation
|
|
55
|
+
* and is ready to be published.
|
|
56
|
+
*/
|
|
57
|
+
publishProposerSlashing = "publishProposerSlashing",
|
|
53
58
|
/**
|
|
54
59
|
* Trigger an update of status so reqresp by peers have current earliestAvailableSlot
|
|
55
60
|
*/
|
|
@@ -110,6 +115,8 @@ export type IChainEvents = ApiEvents & {
|
|
|
110
115
|
|
|
111
116
|
[ChainEvent.publishBlobSidecars]: (sidecars: deneb.BlobSidecar[]) => void;
|
|
112
117
|
|
|
118
|
+
[ChainEvent.publishProposerSlashing]: (proposerSlashing: phase0.ProposerSlashing) => void;
|
|
119
|
+
|
|
113
120
|
[ChainEvent.updateStatus]: () => void;
|
|
114
121
|
|
|
115
122
|
// Sync events that are chain->chain. Initiated from network requests but do not cross the network
|
package/src/chain/interface.ts
CHANGED
|
@@ -262,6 +262,9 @@ export interface IBeaconChain {
|
|
|
262
262
|
/** Process execution payload envelope: verify, import to fork choice, and persist to DB */
|
|
263
263
|
processExecutionPayload(payloadInput: PayloadEnvelopeInput, opts?: ImportPayloadOpts): Promise<void>;
|
|
264
264
|
|
|
265
|
+
/** Produce and publish a proposer slashing from an observed equivocation. Does not throw, only logs errors */
|
|
266
|
+
processProposerEquivocation(blockSlot: Slot, proposerIndex: ValidatorIndex): void;
|
|
267
|
+
|
|
265
268
|
getStatus(): Status;
|
|
266
269
|
|
|
267
270
|
recomputeForkChoiceHead(caller: ForkchoiceCaller): ProtoBlock;
|
package/src/chain/options.ts
CHANGED
|
@@ -37,6 +37,8 @@ export type IChainOptions = BlockProcessOpts &
|
|
|
37
37
|
suggestedFeeRecipient: string;
|
|
38
38
|
graffitiAppend?: boolean;
|
|
39
39
|
maxSkipSlots?: number;
|
|
40
|
+
/** Do not produce proposer slashings from observed equivocations and do not include proposer slashings in produced blocks */
|
|
41
|
+
disableProposerSlashings?: boolean;
|
|
40
42
|
/** Ensure blobs returned by the execution engine are valid */
|
|
41
43
|
sanityCheckExecutionEngineBlobs?: boolean;
|
|
42
44
|
/** Max number of produced blobs by local validators to cache */
|
|
@@ -122,6 +124,7 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
122
124
|
// for gossip block validation, it's unlikely we see a reorg with 32 slots
|
|
123
125
|
// for attestation validation, having this value ensures we don't have to regen states most of the time
|
|
124
126
|
maxSkipSlots: 32,
|
|
127
|
+
disableProposerSlashings: false,
|
|
125
128
|
broadcastValidationStrictness: "warn",
|
|
126
129
|
// should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
|
|
127
130
|
// batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
|