-
-
Notifications
You must be signed in to change notification settings - Fork 348
/
Copy pathoptions.ts
98 lines (93 loc) · 3.72 KB
/
options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import {SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY} from "@lodestar/params";
import {defaultOptions as defaultValidatorOptions} from "@lodestar/validator";
import {ArchiverOpts} from "./archiver/index.js";
import {ForkChoiceOpts} from "./forkChoice/index.js";
import {LightClientServerOpts} from "./lightClient/index.js";
import {CheckpointStateCacheOpts} from "./stateCache/stateContextCheckpointsCache.js";
import {StateContextCacheOpts} from "./stateCache/stateContextCache.js";
export type IChainOptions = BlockProcessOpts &
PoolOpts &
SeenCacheOpts &
ForkChoiceOpts &
ArchiverOpts &
StateContextCacheOpts &
CheckpointStateCacheOpts &
LightClientServerOpts & {
blsVerifyAllMainThread?: boolean;
blsVerifyAllMultiThread?: boolean;
persistInvalidSszObjects?: boolean;
persistInvalidSszObjectsDir?: string;
skipCreateStateCacheIfAvailable?: boolean;
suggestedFeeRecipient: string;
maxSkipSlots?: number;
/** Ensure blobs returned by the execution engine are valid */
sanityCheckExecutionEngineBlobs?: boolean;
/** Max number of produced blobs by local validators to cache */
maxCachedBlobSidecars?: number;
/** Max number of produced block roots (blinded or full) cached for broadcast validations */
maxCachedProducedRoots?: number;
/** Option to load a custom kzg trusted setup in txt format */
trustedSetup?: string;
broadcastValidationStrictness?: string;
minSameMessageSignatureSetsToBatch: number;
};
export type BlockProcessOpts = {
/**
* Do not use BLS batch verify to validate all block signatures at once.
* Will double processing times. Use only for debugging purposes.
*/
disableBlsBatchVerify?: boolean;
/**
* Override SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY
*/
safeSlotsToImportOptimistically: number;
/**
* Assert progressive balances the same to EpochTransitionCache
*/
assertCorrectProgressiveBalances?: boolean;
/** Used for fork_choice spec tests */
disableOnBlockError?: boolean;
/** Used for fork_choice spec tests */
disablePrepareNextSlot?: boolean;
/**
* Used to connect beacon in follow mode to an EL,
* will still issue fcU for block proposal
*/
disableImportExecutionFcU?: boolean;
emitPayloadAttributes?: boolean;
};
export type PoolOpts = {
/**
* Only preaggregate attestation/sync committee message since clockSlot - preaggregateSlotDistance
*/
preaggregateSlotDistance?: number;
};
export type SeenCacheOpts = {
/**
* Slot distance from current slot to cache AttestationData
*/
attDataCacheSlotDistance?: number;
};
export const defaultChainOptions: IChainOptions = {
blsVerifyAllMainThread: false,
blsVerifyAllMultiThread: false,
disableBlsBatchVerify: false,
proposerBoostEnabled: true,
computeUnrealized: true,
safeSlotsToImportOptimistically: SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY,
suggestedFeeRecipient: defaultValidatorOptions.suggestedFeeRecipient,
assertCorrectProgressiveBalances: false,
archiveStateEpochFrequency: 1024,
emitPayloadAttributes: false,
// for gossip block validation, it's unlikely we see a reorg with 32 slots
// for attestation validation, having this value ensures we don't have to regen states most of the time
maxSkipSlots: 32,
broadcastValidationStrictness: "warn",
// should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
// batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
// since this batch attestation work is designed to work with useWorker=true, make this the lowest value
minSameMessageSignatureSetsToBatch: 2,
// since Sep 2023, only cache up to 32 states by default. If a big reorg happens it'll load checkpoint state from disk and regen from there.
maxStates: 32,
maxEpochsInMemory: 2,
};