mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
Replace INTERVALS_PER_SLOT with explicit slot component times (#7944)
https://github.com/ethereum/consensus-specs/pull/4476 Co-Authored-By: Barnabas Busa <barnabas.busa@ethereum.org> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -47,6 +47,8 @@ TRANSITION_TOTAL_DIFFICULTY: 4294967296
|
||||
# ---------------------------------------------------------------
|
||||
# 12 seconds
|
||||
SECONDS_PER_SLOT: 12
|
||||
# 12 seconds
|
||||
SLOT_DURATION_MS: 12000
|
||||
# 14 (estimate from Eth1 mainnet)
|
||||
SECONDS_PER_ETH1_BLOCK: 14
|
||||
# 2**8 (= 256) epochs ~27 hours
|
||||
@@ -55,6 +57,18 @@ MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
|
||||
SHARD_COMMITTEE_PERIOD: 256
|
||||
# 2**11 (= 2,048) Eth1 blocks ~8 hours
|
||||
ETH1_FOLLOW_DISTANCE: 2048
|
||||
# 1667 basis points, ~17% of SLOT_DURATION_MS
|
||||
PROPOSER_REORG_CUTOFF_BPS: 1667
|
||||
# 3333 basis points, ~33% of SLOT_DURATION_MS
|
||||
ATTESTATION_DUE_BPS: 3333
|
||||
# 6667 basis points, ~67% of SLOT_DURATION_MS
|
||||
AGGREGATE_DUE_BPS: 6667
|
||||
|
||||
# Altair
|
||||
# 3333 basis points, ~33% of SLOT_DURATION_MS
|
||||
SYNC_MESSAGE_DUE_BPS: 3333
|
||||
# 6667 basis points, ~67% of SLOT_DURATION_MS
|
||||
CONTRIBUTION_DUE_BPS: 6667
|
||||
|
||||
|
||||
# Validator cycle
|
||||
|
||||
@@ -2332,7 +2332,7 @@ fn enable_proposer_re_orgs_default() {
|
||||
DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION,
|
||||
);
|
||||
assert_eq!(
|
||||
config.chain.re_org_cutoff(12),
|
||||
config.chain.re_org_cutoff(Duration::from_secs(12)),
|
||||
Duration::from_secs(12) / DEFAULT_RE_ORG_CUTOFF_DENOMINATOR
|
||||
);
|
||||
});
|
||||
@@ -2384,7 +2384,10 @@ fn proposer_re_org_cutoff() {
|
||||
.flag("proposer-reorg-cutoff", Some("500"))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| {
|
||||
assert_eq!(config.chain.re_org_cutoff(12), Duration::from_millis(500))
|
||||
assert_eq!(
|
||||
config.chain.re_org_cutoff(Duration::from_secs(12)),
|
||||
Duration::from_millis(500)
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user