@lodestar/validator 1.35.0-dev.c85be4e26c → 1.35.0-dev.c9deb9b59f
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/buckets.d.ts.map +1 -0
- package/lib/defaults.d.ts.map +1 -0
- package/lib/genesis.d.ts.map +1 -0
- package/lib/index.d.ts +7 -7
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/metrics.d.ts.map +1 -0
- package/lib/metrics.js +14 -14
- package/lib/metrics.js.map +1 -1
- package/lib/repositories/index.d.ts.map +1 -0
- package/lib/repositories/metaDataRepository.d.ts.map +1 -0
- package/lib/repositories/metaDataRepository.js +4 -3
- package/lib/repositories/metaDataRepository.js.map +1 -1
- package/lib/services/attestation.d.ts.map +1 -0
- package/lib/services/attestation.js +77 -60
- package/lib/services/attestation.js.map +1 -1
- package/lib/services/attestationDuties.d.ts.map +1 -0
- package/lib/services/attestationDuties.js +105 -98
- package/lib/services/attestationDuties.js.map +1 -1
- package/lib/services/block.d.ts.map +1 -0
- package/lib/services/block.js +64 -56
- package/lib/services/block.js.map +1 -1
- package/lib/services/blockDuties.d.ts +2 -2
- package/lib/services/blockDuties.d.ts.map +1 -0
- package/lib/services/blockDuties.js +35 -26
- package/lib/services/blockDuties.js.map +1 -1
- package/lib/services/chainHeaderTracker.d.ts.map +1 -0
- package/lib/services/chainHeaderTracker.js +30 -27
- package/lib/services/chainHeaderTracker.js.map +1 -1
- package/lib/services/doppelgangerService.d.ts.map +1 -0
- package/lib/services/doppelgangerService.js +52 -45
- package/lib/services/doppelgangerService.js.map +1 -1
- package/lib/services/emitter.d.ts +1 -1
- package/lib/services/emitter.d.ts.map +1 -0
- package/lib/services/externalSignerSync.d.ts.map +1 -0
- package/lib/services/externalSignerSync.js +1 -1
- package/lib/services/externalSignerSync.js.map +1 -1
- package/lib/services/indices.d.ts.map +1 -0
- package/lib/services/indices.js +8 -5
- package/lib/services/indices.js.map +1 -1
- package/lib/services/prepareBeaconProposer.d.ts.map +1 -0
- package/lib/services/prepareBeaconProposer.js.map +1 -1
- package/lib/services/syncCommittee.d.ts.map +1 -0
- package/lib/services/syncCommittee.js +80 -61
- package/lib/services/syncCommittee.js.map +1 -1
- package/lib/services/syncCommitteeDuties.d.ts.map +1 -0
- package/lib/services/syncCommitteeDuties.js +28 -23
- package/lib/services/syncCommitteeDuties.js.map +1 -1
- package/lib/services/syncingStatusTracker.d.ts.map +1 -0
- package/lib/services/syncingStatusTracker.js +32 -27
- package/lib/services/syncingStatusTracker.js.map +1 -1
- package/lib/services/utils.d.ts.map +1 -0
- package/lib/services/validatorStore.d.ts.map +1 -0
- package/lib/services/validatorStore.js +9 -3
- package/lib/services/validatorStore.js.map +1 -1
- package/lib/slashingProtection/attestation/attestationByTargetRepository.d.ts.map +1 -0
- package/lib/slashingProtection/attestation/attestationByTargetRepository.js +7 -3
- package/lib/slashingProtection/attestation/attestationByTargetRepository.js.map +1 -1
- package/lib/slashingProtection/attestation/attestationLowerBoundRepository.d.ts.map +1 -0
- package/lib/slashingProtection/attestation/attestationLowerBoundRepository.js +5 -3
- package/lib/slashingProtection/attestation/attestationLowerBoundRepository.js.map +1 -1
- package/lib/slashingProtection/attestation/errors.d.ts.map +1 -0
- package/lib/slashingProtection/attestation/index.d.ts.map +1 -0
- package/lib/slashingProtection/attestation/index.js +3 -0
- package/lib/slashingProtection/attestation/index.js.map +1 -1
- package/lib/slashingProtection/block/blockBySlotRepository.d.ts.map +1 -0
- package/lib/slashingProtection/block/blockBySlotRepository.js +7 -3
- package/lib/slashingProtection/block/blockBySlotRepository.js.map +1 -1
- package/lib/slashingProtection/block/errors.d.ts.map +1 -0
- package/lib/slashingProtection/block/index.d.ts.map +1 -0
- package/lib/slashingProtection/block/index.js +1 -0
- package/lib/slashingProtection/block/index.js.map +1 -1
- package/lib/slashingProtection/index.d.ts +1 -1
- package/lib/slashingProtection/index.d.ts.map +1 -0
- package/lib/slashingProtection/index.js +3 -0
- package/lib/slashingProtection/index.js.map +1 -1
- package/lib/slashingProtection/interchange/errors.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/formats/completeV4.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/formats/index.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/formats/v5.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/index.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/parseInterchange.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/serializeInterchange.d.ts.map +1 -0
- package/lib/slashingProtection/interchange/types.d.ts.map +1 -0
- package/lib/slashingProtection/interface.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/distanceStoreRepository.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/distanceStoreRepository.js +8 -0
- package/lib/slashingProtection/minMaxSurround/distanceStoreRepository.js.map +1 -1
- package/lib/slashingProtection/minMaxSurround/errors.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/index.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/interface.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/minMaxSurround.d.ts.map +1 -0
- package/lib/slashingProtection/minMaxSurround/minMaxSurround.js +2 -0
- package/lib/slashingProtection/minMaxSurround/minMaxSurround.js.map +1 -1
- package/lib/slashingProtection/types.d.ts.map +1 -0
- package/lib/slashingProtection/utils.d.ts +1 -1
- package/lib/slashingProtection/utils.d.ts.map +1 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/util/batch.d.ts.map +1 -0
- package/lib/util/clock.d.ts +3 -0
- package/lib/util/clock.d.ts.map +1 -0
- package/lib/util/clock.js +16 -9
- package/lib/util/clock.js.map +1 -1
- package/lib/util/difference.d.ts.map +1 -0
- package/lib/util/externalSignerClient.d.ts.map +1 -0
- package/lib/util/format.d.ts.map +1 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/logger.d.ts.map +1 -0
- package/lib/util/params.d.ts.map +1 -0
- package/lib/util/params.js +18 -2
- package/lib/util/params.js.map +1 -1
- package/lib/util/url.d.ts.map +1 -0
- package/lib/validator.d.ts.map +1 -0
- package/lib/validator.js +16 -1
- package/lib/validator.js.map +1 -1
- package/package.json +19 -16
- package/src/buckets.ts +30 -0
- package/src/defaults.ts +8 -0
- package/src/genesis.ts +19 -0
- package/src/index.ts +22 -0
- package/src/metrics.ts +417 -0
- package/src/repositories/index.ts +1 -0
- package/src/repositories/metaDataRepository.ts +42 -0
- package/src/services/attestation.ts +362 -0
- package/src/services/attestationDuties.ts +406 -0
- package/src/services/block.ts +261 -0
- package/src/services/blockDuties.ts +217 -0
- package/src/services/chainHeaderTracker.ts +89 -0
- package/src/services/doppelgangerService.ts +286 -0
- package/src/services/emitter.ts +43 -0
- package/src/services/externalSignerSync.ts +81 -0
- package/src/services/indices.ts +165 -0
- package/src/services/prepareBeaconProposer.ts +119 -0
- package/src/services/syncCommittee.ts +338 -0
- package/src/services/syncCommitteeDuties.ts +337 -0
- package/src/services/syncingStatusTracker.ts +74 -0
- package/src/services/utils.ts +58 -0
- package/src/services/validatorStore.ts +830 -0
- package/src/slashingProtection/attestation/attestationByTargetRepository.ts +77 -0
- package/src/slashingProtection/attestation/attestationLowerBoundRepository.ts +44 -0
- package/src/slashingProtection/attestation/errors.ts +66 -0
- package/src/slashingProtection/attestation/index.ts +171 -0
- package/src/slashingProtection/block/blockBySlotRepository.ts +78 -0
- package/src/slashingProtection/block/errors.ts +28 -0
- package/src/slashingProtection/block/index.ts +94 -0
- package/src/slashingProtection/index.ts +95 -0
- package/src/slashingProtection/interchange/errors.ts +15 -0
- package/src/slashingProtection/interchange/formats/completeV4.ts +125 -0
- package/src/slashingProtection/interchange/formats/index.ts +7 -0
- package/src/slashingProtection/interchange/formats/v5.ts +120 -0
- package/src/slashingProtection/interchange/index.ts +5 -0
- package/src/slashingProtection/interchange/parseInterchange.ts +55 -0
- package/src/slashingProtection/interchange/serializeInterchange.ts +35 -0
- package/src/slashingProtection/interchange/types.ts +18 -0
- package/src/slashingProtection/interface.ts +28 -0
- package/src/slashingProtection/minMaxSurround/distanceStoreRepository.ts +57 -0
- package/src/slashingProtection/minMaxSurround/errors.ts +27 -0
- package/src/slashingProtection/minMaxSurround/index.ts +4 -0
- package/src/slashingProtection/minMaxSurround/interface.ts +23 -0
- package/src/slashingProtection/minMaxSurround/minMaxSurround.ts +104 -0
- package/src/slashingProtection/types.ts +12 -0
- package/src/slashingProtection/utils.ts +42 -0
- package/src/types.ts +31 -0
- package/src/util/batch.ts +15 -0
- package/src/util/clock.ts +169 -0
- package/src/util/difference.ts +10 -0
- package/src/util/externalSignerClient.ts +277 -0
- package/src/util/format.ts +3 -0
- package/src/util/index.ts +6 -0
- package/src/util/logger.ts +51 -0
- package/src/util/params.ts +320 -0
- package/src/util/url.ts +16 -0
- package/src/validator.ts +418 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import {BlobScheduleEntry, ChainConfig, SpecJson, chainConfigToJson, deserializeBlobSchedule} from "@lodestar/config";
|
|
2
|
+
import {BeaconPreset, activePreset, presetToJson} from "@lodestar/params";
|
|
3
|
+
|
|
4
|
+
export class NotEqualParamsError extends Error {}
|
|
5
|
+
|
|
6
|
+
type ConfigWithPreset = ChainConfig & BeaconPreset;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Assert localConfig values match externalSpecJson. externalSpecJson may contain more values than localConfig.
|
|
10
|
+
*
|
|
11
|
+
* This check ensures that the validator is connected to a beacon node of the exact same network and params.
|
|
12
|
+
* Otherwise, signatures may be rejected, time may be un-equal and other bugs that are harder to debug caused
|
|
13
|
+
* by different parameters.
|
|
14
|
+
*
|
|
15
|
+
* This check however can't compare the full config as is, since some parameters are not critical to the spec and
|
|
16
|
+
* can be changed un-expectedly. Also, fork parameters can change un-expectedly, like their _FORK_VERSION or _EPOCH.
|
|
17
|
+
* Note that the config API endpoint is not precisely specified, so each clients can return a different set of
|
|
18
|
+
* parameters.
|
|
19
|
+
*
|
|
20
|
+
* So this check only compares a specific list of parameters that are consensus critical, ignoring the rest. Typed
|
|
21
|
+
* config and preset ensure new parameters are labeled critical or ignore, facilitating maintenance of the list.
|
|
22
|
+
*/
|
|
23
|
+
export function assertEqualParams(localConfig: ChainConfig, externalSpecJson: SpecJson): void {
|
|
24
|
+
// Before comparing, add preset which is bundled in api impl config route.
|
|
25
|
+
// config and preset must be serialized to JSON for safe comparisions.
|
|
26
|
+
const localSpecJson = {
|
|
27
|
+
...chainConfigToJson(localConfig),
|
|
28
|
+
...presetToJson(activePreset),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Get list of keys to check, and keys to ignore. Otherwise this function throws for false positives
|
|
32
|
+
const criticalParams = getSpecCriticalParams(localConfig);
|
|
33
|
+
|
|
34
|
+
// Accumulate errors first and print all of them at once
|
|
35
|
+
const errors: string[] = [];
|
|
36
|
+
|
|
37
|
+
for (const key of Object.keys(criticalParams) as (keyof typeof criticalParams)[]) {
|
|
38
|
+
if (
|
|
39
|
+
// Ignore non-critical params
|
|
40
|
+
!criticalParams[key] ||
|
|
41
|
+
// This condition should never be true, but just in case
|
|
42
|
+
localSpecJson[key] === undefined ||
|
|
43
|
+
// The config/spec endpoint is poorly specified, so in practice each client returns a custom selection of keys.
|
|
44
|
+
// For example Lighthouse returns a manually selected list of keys that may be updated at any time.
|
|
45
|
+
// https://github.com/sigp/lighthouse/blob/bac7c3fa544495a257722aaad9cd8f72fee2f2b4/consensus/types/src/chain_spec.rs#L941
|
|
46
|
+
//
|
|
47
|
+
// So if we assert that spec critical keys are present in the spec we may break interoperability unexpectedly.
|
|
48
|
+
// So it's best to ignore keys are not defined in both specs and trust that the ones defined are sufficient
|
|
49
|
+
// to detect spec discrepancies in all cases.
|
|
50
|
+
externalSpecJson[key] === undefined
|
|
51
|
+
) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (key === "BLOB_SCHEDULE") {
|
|
56
|
+
const localBlobSchedule = deserializeBlobSchedule(localSpecJson[key]).sort((a, b) => a.EPOCH - b.EPOCH);
|
|
57
|
+
const remoteBlobSchedule = deserializeBlobSchedule(externalSpecJson[key]).sort((a, b) => a.EPOCH - b.EPOCH);
|
|
58
|
+
|
|
59
|
+
if (localBlobSchedule.length !== remoteBlobSchedule.length) {
|
|
60
|
+
errors.push(`BLOB_SCHEDULE different length: ${localBlobSchedule.length} != ${remoteBlobSchedule.length}`);
|
|
61
|
+
|
|
62
|
+
// Skip per entry comparison
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
for (let i = 0; i < localBlobSchedule.length; i++) {
|
|
67
|
+
const localEntry = localBlobSchedule[i];
|
|
68
|
+
const remoteEntry = remoteBlobSchedule[i];
|
|
69
|
+
|
|
70
|
+
for (const entryKey of ["EPOCH", "MAX_BLOBS_PER_BLOCK"] as Array<keyof BlobScheduleEntry>) {
|
|
71
|
+
const localValue = String(localEntry[entryKey]);
|
|
72
|
+
const remoteValue = String(remoteEntry[entryKey]);
|
|
73
|
+
|
|
74
|
+
if (localValue !== remoteValue) {
|
|
75
|
+
errors.push(`BLOB_SCHEDULE[${i}].${entryKey} different value: ${localValue} != ${remoteValue}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Skip generic string comparison
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Must compare JSON serialized specs, to ensure all strings are rendered in the same way
|
|
85
|
+
// Must compare as lowercase to ensure checksum addresses and names have same capilatization
|
|
86
|
+
const localValue = String(localSpecJson[key]).toLocaleLowerCase();
|
|
87
|
+
const remoteValue = String(externalSpecJson[key]).toLocaleLowerCase();
|
|
88
|
+
if (localValue !== remoteValue) {
|
|
89
|
+
errors.push(`${key} different value: ${localValue} != ${remoteValue}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (errors.length > 0) {
|
|
94
|
+
throw new NotEqualParamsError("Local and remote configs are different\n" + errors.join("\n"));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function getSpecCriticalParams(localConfig: ChainConfig): Record<keyof ConfigWithPreset, boolean> {
|
|
99
|
+
const altairForkRelevant = localConfig.ALTAIR_FORK_EPOCH < Infinity;
|
|
100
|
+
const bellatrixForkRelevant = localConfig.BELLATRIX_FORK_EPOCH < Infinity;
|
|
101
|
+
const capellaForkRelevant = localConfig.CAPELLA_FORK_EPOCH < Infinity;
|
|
102
|
+
const denebForkRelevant = localConfig.DENEB_FORK_EPOCH < Infinity;
|
|
103
|
+
const electraForkRelevant = localConfig.ELECTRA_FORK_EPOCH < Infinity;
|
|
104
|
+
const fuluForkRelevant = localConfig.FULU_FORK_EPOCH < Infinity;
|
|
105
|
+
const gloasForkRelevant = localConfig.GLOAS_FORK_EPOCH < Infinity;
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
// # Config
|
|
109
|
+
///////////
|
|
110
|
+
|
|
111
|
+
PRESET_BASE: false, // Not relevant, each preset value is checked below
|
|
112
|
+
CONFIG_NAME: false, // Arbitrary string, not relevant
|
|
113
|
+
// validator client behaviour does not change with this parameters, so it's not concerned about them.
|
|
114
|
+
// However, with the override ttd flag, the validator and beacon could be out of sync and prevent it from running.
|
|
115
|
+
TERMINAL_TOTAL_DIFFICULTY: false,
|
|
116
|
+
TERMINAL_BLOCK_HASH: false,
|
|
117
|
+
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: false,
|
|
118
|
+
|
|
119
|
+
// Genesis
|
|
120
|
+
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: true,
|
|
121
|
+
MIN_GENESIS_TIME: true,
|
|
122
|
+
GENESIS_FORK_VERSION: true,
|
|
123
|
+
GENESIS_DELAY: true,
|
|
124
|
+
|
|
125
|
+
// Forking
|
|
126
|
+
// Altair
|
|
127
|
+
ALTAIR_FORK_VERSION: altairForkRelevant,
|
|
128
|
+
ALTAIR_FORK_EPOCH: altairForkRelevant,
|
|
129
|
+
// Bellatrix
|
|
130
|
+
BELLATRIX_FORK_VERSION: bellatrixForkRelevant,
|
|
131
|
+
BELLATRIX_FORK_EPOCH: bellatrixForkRelevant,
|
|
132
|
+
// Capella
|
|
133
|
+
CAPELLA_FORK_VERSION: capellaForkRelevant,
|
|
134
|
+
CAPELLA_FORK_EPOCH: capellaForkRelevant,
|
|
135
|
+
// Deneb
|
|
136
|
+
DENEB_FORK_VERSION: denebForkRelevant,
|
|
137
|
+
DENEB_FORK_EPOCH: denebForkRelevant,
|
|
138
|
+
// electra
|
|
139
|
+
ELECTRA_FORK_VERSION: electraForkRelevant,
|
|
140
|
+
ELECTRA_FORK_EPOCH: electraForkRelevant,
|
|
141
|
+
// fulu
|
|
142
|
+
FULU_FORK_VERSION: fuluForkRelevant,
|
|
143
|
+
FULU_FORK_EPOCH: fuluForkRelevant,
|
|
144
|
+
// gloas
|
|
145
|
+
GLOAS_FORK_VERSION: gloasForkRelevant,
|
|
146
|
+
GLOAS_FORK_EPOCH: gloasForkRelevant,
|
|
147
|
+
|
|
148
|
+
// Time parameters
|
|
149
|
+
SECONDS_PER_SLOT: false, // Deprecated
|
|
150
|
+
SLOT_DURATION_MS: true,
|
|
151
|
+
SECONDS_PER_ETH1_BLOCK: false, // Legacy
|
|
152
|
+
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: true,
|
|
153
|
+
SHARD_COMMITTEE_PERIOD: true,
|
|
154
|
+
ETH1_FOLLOW_DISTANCE: true,
|
|
155
|
+
PROPOSER_REORG_CUTOFF_BPS: true,
|
|
156
|
+
ATTESTATION_DUE_BPS: true,
|
|
157
|
+
AGGREGATE_DUE_BPS: true,
|
|
158
|
+
// Altair
|
|
159
|
+
SYNC_MESSAGE_DUE_BPS: altairForkRelevant,
|
|
160
|
+
CONTRIBUTION_DUE_BPS: altairForkRelevant,
|
|
161
|
+
|
|
162
|
+
// Validator cycle
|
|
163
|
+
INACTIVITY_SCORE_BIAS: true,
|
|
164
|
+
INACTIVITY_SCORE_RECOVERY_RATE: true,
|
|
165
|
+
EJECTION_BALANCE: true,
|
|
166
|
+
MIN_PER_EPOCH_CHURN_LIMIT: true,
|
|
167
|
+
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: denebForkRelevant,
|
|
168
|
+
CHURN_LIMIT_QUOTIENT: true,
|
|
169
|
+
|
|
170
|
+
// Fork choice
|
|
171
|
+
PROPOSER_SCORE_BOOST: false, // Ignored as it's changing https://github.com/ethereum/consensus-specs/pull/2895
|
|
172
|
+
REORG_HEAD_WEIGHT_THRESHOLD: false, // Non-critical since proposer boost reorg is optional feature
|
|
173
|
+
REORG_PARENT_WEIGHT_THRESHOLD: false, // Non-critical since proposer boost reorg is optional feature
|
|
174
|
+
REORG_MAX_EPOCHS_SINCE_FINALIZATION: false, // Non-critical since proposer boost reorg is optional feature
|
|
175
|
+
|
|
176
|
+
// Deposit contract
|
|
177
|
+
DEPOSIT_CHAIN_ID: false, // Non-critical
|
|
178
|
+
DEPOSIT_NETWORK_ID: false, // Non-critical
|
|
179
|
+
DEPOSIT_CONTRACT_ADDRESS: true,
|
|
180
|
+
|
|
181
|
+
// Networking (non-critical as those do not affect consensus)
|
|
182
|
+
MAX_REQUEST_BLOCKS: false,
|
|
183
|
+
MAX_REQUEST_BLOCKS_DENEB: false,
|
|
184
|
+
MIN_EPOCHS_FOR_BLOCK_REQUESTS: false,
|
|
185
|
+
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: false,
|
|
186
|
+
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: false,
|
|
187
|
+
BLOB_SIDECAR_SUBNET_COUNT: false,
|
|
188
|
+
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: false,
|
|
189
|
+
DATA_COLUMN_SIDECAR_SUBNET_COUNT: false,
|
|
190
|
+
MAX_REQUEST_BLOB_SIDECARS: false,
|
|
191
|
+
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: false,
|
|
192
|
+
MAX_REQUEST_DATA_COLUMN_SIDECARS: false,
|
|
193
|
+
|
|
194
|
+
// # Phase0Preset
|
|
195
|
+
/////////////////
|
|
196
|
+
|
|
197
|
+
MAX_COMMITTEES_PER_SLOT: true,
|
|
198
|
+
TARGET_COMMITTEE_SIZE: true,
|
|
199
|
+
MAX_VALIDATORS_PER_COMMITTEE: true,
|
|
200
|
+
|
|
201
|
+
SHUFFLE_ROUND_COUNT: true,
|
|
202
|
+
|
|
203
|
+
HYSTERESIS_QUOTIENT: true,
|
|
204
|
+
HYSTERESIS_DOWNWARD_MULTIPLIER: true,
|
|
205
|
+
HYSTERESIS_UPWARD_MULTIPLIER: true,
|
|
206
|
+
|
|
207
|
+
// Gwei Values
|
|
208
|
+
MIN_DEPOSIT_AMOUNT: true,
|
|
209
|
+
MAX_EFFECTIVE_BALANCE: true,
|
|
210
|
+
EFFECTIVE_BALANCE_INCREMENT: true,
|
|
211
|
+
|
|
212
|
+
// Time parameters
|
|
213
|
+
MIN_ATTESTATION_INCLUSION_DELAY: true,
|
|
214
|
+
SLOTS_PER_EPOCH: true,
|
|
215
|
+
MIN_SEED_LOOKAHEAD: true,
|
|
216
|
+
MAX_SEED_LOOKAHEAD: true,
|
|
217
|
+
EPOCHS_PER_ETH1_VOTING_PERIOD: true,
|
|
218
|
+
SLOTS_PER_HISTORICAL_ROOT: true,
|
|
219
|
+
MIN_EPOCHS_TO_INACTIVITY_PENALTY: true,
|
|
220
|
+
|
|
221
|
+
// State vector lengths
|
|
222
|
+
EPOCHS_PER_HISTORICAL_VECTOR: true,
|
|
223
|
+
EPOCHS_PER_SLASHINGS_VECTOR: true,
|
|
224
|
+
HISTORICAL_ROOTS_LIMIT: true,
|
|
225
|
+
VALIDATOR_REGISTRY_LIMIT: true,
|
|
226
|
+
|
|
227
|
+
// Reward and penalty quotients
|
|
228
|
+
BASE_REWARD_FACTOR: true,
|
|
229
|
+
WHISTLEBLOWER_REWARD_QUOTIENT: true,
|
|
230
|
+
PROPOSER_REWARD_QUOTIENT: true,
|
|
231
|
+
INACTIVITY_PENALTY_QUOTIENT: true,
|
|
232
|
+
MIN_SLASHING_PENALTY_QUOTIENT: true,
|
|
233
|
+
PROPORTIONAL_SLASHING_MULTIPLIER: true,
|
|
234
|
+
|
|
235
|
+
// Max operations per block
|
|
236
|
+
MAX_PROPOSER_SLASHINGS: true,
|
|
237
|
+
MAX_ATTESTER_SLASHINGS: true,
|
|
238
|
+
MAX_ATTESTATIONS: true,
|
|
239
|
+
MAX_DEPOSITS: true,
|
|
240
|
+
MAX_VOLUNTARY_EXITS: true,
|
|
241
|
+
|
|
242
|
+
// # AltairPreset
|
|
243
|
+
/////////////////
|
|
244
|
+
|
|
245
|
+
SYNC_COMMITTEE_SIZE: altairForkRelevant,
|
|
246
|
+
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: altairForkRelevant,
|
|
247
|
+
INACTIVITY_PENALTY_QUOTIENT_ALTAIR: altairForkRelevant,
|
|
248
|
+
MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR: altairForkRelevant,
|
|
249
|
+
PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: altairForkRelevant,
|
|
250
|
+
MIN_SYNC_COMMITTEE_PARTICIPANTS: false, // Only relevant for lightclients
|
|
251
|
+
UPDATE_TIMEOUT: false, // Only relevant for lightclients
|
|
252
|
+
|
|
253
|
+
// # BellatrixPreset
|
|
254
|
+
/////////////////
|
|
255
|
+
|
|
256
|
+
INACTIVITY_PENALTY_QUOTIENT_BELLATRIX: bellatrixForkRelevant,
|
|
257
|
+
MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX: bellatrixForkRelevant,
|
|
258
|
+
PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX: bellatrixForkRelevant,
|
|
259
|
+
MAX_BYTES_PER_TRANSACTION: bellatrixForkRelevant,
|
|
260
|
+
MAX_TRANSACTIONS_PER_PAYLOAD: bellatrixForkRelevant,
|
|
261
|
+
BYTES_PER_LOGS_BLOOM: bellatrixForkRelevant,
|
|
262
|
+
MAX_EXTRA_DATA_BYTES: bellatrixForkRelevant,
|
|
263
|
+
|
|
264
|
+
// # CapellaPreset
|
|
265
|
+
/////////////////
|
|
266
|
+
MAX_BLS_TO_EXECUTION_CHANGES: capellaForkRelevant,
|
|
267
|
+
MAX_WITHDRAWALS_PER_PAYLOAD: capellaForkRelevant,
|
|
268
|
+
MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP: capellaForkRelevant,
|
|
269
|
+
|
|
270
|
+
// # DenebPreset
|
|
271
|
+
/////////////////
|
|
272
|
+
FIELD_ELEMENTS_PER_BLOB: denebForkRelevant,
|
|
273
|
+
MAX_BLOB_COMMITMENTS_PER_BLOCK: denebForkRelevant,
|
|
274
|
+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: denebForkRelevant,
|
|
275
|
+
MAX_BLOBS_PER_BLOCK: denebForkRelevant,
|
|
276
|
+
|
|
277
|
+
// ELECTRA
|
|
278
|
+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: electraForkRelevant,
|
|
279
|
+
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: electraForkRelevant,
|
|
280
|
+
MAX_ATTESTER_SLASHINGS_ELECTRA: electraForkRelevant,
|
|
281
|
+
MAX_ATTESTATIONS_ELECTRA: electraForkRelevant,
|
|
282
|
+
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: electraForkRelevant,
|
|
283
|
+
MAX_PENDING_DEPOSITS_PER_EPOCH: electraForkRelevant,
|
|
284
|
+
MAX_EFFECTIVE_BALANCE_ELECTRA: electraForkRelevant,
|
|
285
|
+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: electraForkRelevant,
|
|
286
|
+
MIN_ACTIVATION_BALANCE: electraForkRelevant,
|
|
287
|
+
PENDING_DEPOSITS_LIMIT: electraForkRelevant,
|
|
288
|
+
PENDING_PARTIAL_WITHDRAWALS_LIMIT: electraForkRelevant,
|
|
289
|
+
PENDING_CONSOLIDATIONS_LIMIT: electraForkRelevant,
|
|
290
|
+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: electraForkRelevant,
|
|
291
|
+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: electraForkRelevant,
|
|
292
|
+
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: electraForkRelevant,
|
|
293
|
+
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: electraForkRelevant,
|
|
294
|
+
MAX_BLOBS_PER_BLOCK_ELECTRA: electraForkRelevant,
|
|
295
|
+
|
|
296
|
+
// FULU
|
|
297
|
+
/////////////////
|
|
298
|
+
CELLS_PER_EXT_BLOB: fuluForkRelevant,
|
|
299
|
+
FIELD_ELEMENTS_PER_CELL: fuluForkRelevant,
|
|
300
|
+
FIELD_ELEMENTS_PER_EXT_BLOB: fuluForkRelevant,
|
|
301
|
+
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: fuluForkRelevant,
|
|
302
|
+
NUMBER_OF_COLUMNS: fuluForkRelevant,
|
|
303
|
+
NUMBER_OF_CUSTODY_GROUPS: fuluForkRelevant,
|
|
304
|
+
SAMPLES_PER_SLOT: fuluForkRelevant,
|
|
305
|
+
CUSTODY_REQUIREMENT: fuluForkRelevant,
|
|
306
|
+
VALIDATOR_CUSTODY_REQUIREMENT: fuluForkRelevant,
|
|
307
|
+
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: fuluForkRelevant,
|
|
308
|
+
BLOB_SCHEDULE: fuluForkRelevant,
|
|
309
|
+
|
|
310
|
+
// GLOAS
|
|
311
|
+
ATTESTATION_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
312
|
+
AGGREGATE_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
313
|
+
SYNC_MESSAGE_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
314
|
+
CONTRIBUTION_DUE_BPS_GLOAS: gloasForkRelevant,
|
|
315
|
+
PAYLOAD_ATTESTATION_DUE_BPS: gloasForkRelevant,
|
|
316
|
+
PTC_SIZE: gloasForkRelevant,
|
|
317
|
+
MAX_PAYLOAD_ATTESTATIONS: gloasForkRelevant,
|
|
318
|
+
BUILDER_PENDING_WITHDRAWALS_LIMIT: gloasForkRelevant,
|
|
319
|
+
};
|
|
320
|
+
}
|
package/src/util/url.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins multiple url parts safely
|
|
3
|
+
* - Does not break the protocol double slash //
|
|
4
|
+
* - Cleans double slashes at any point
|
|
5
|
+
* @param args ("http://localhost/", "/node/", "/genesis_time")
|
|
6
|
+
* @return "http://localhost/node/genesis_time"
|
|
7
|
+
*/
|
|
8
|
+
export function urlJoin(...args: string[]): string {
|
|
9
|
+
return (
|
|
10
|
+
args
|
|
11
|
+
.join("/")
|
|
12
|
+
.replace(/([^:]\/)\/+/g, "$1")
|
|
13
|
+
// Remove duplicate slashes in the front
|
|
14
|
+
.replace(/^(\/)+/, "/")
|
|
15
|
+
);
|
|
16
|
+
}
|