Skip to content

Commit 2c4fd27

Browse files
authored
Merge of #5233
2 parents 18e1668 + b3a8bf1 commit 2c4fd27

File tree

5 files changed

+84
-27
lines changed

5 files changed

+84
-27
lines changed

common/eth2_network_config/built_in_network_configs/mainnet/config.yaml

+51-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Mainnet config
22

33
# Extends the mainnet preset
4-
CONFIG_NAME: 'mainnet'
54
PRESET_BASE: 'mainnet'
65

6+
# Free-form short name of the network that this configuration applies to - known
7+
# canonical network names include:
8+
# * 'mainnet' - there can be only one
9+
# * 'prater' - testnet
10+
# Must match the regex: [a-z0-9\-]
11+
CONFIG_NAME: 'mainnet'
12+
713
# Transition
814
# ---------------------------------------------------------------
915
# Estimated on Sept 15, 2022
@@ -12,6 +18,8 @@ TERMINAL_TOTAL_DIFFICULTY: 58750000000000000000000
1218
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
1319
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
1420

21+
22+
1523
# Genesis
1624
# ---------------------------------------------------------------
1725
# `2**14` (= 16,384)
@@ -32,22 +40,16 @@ GENESIS_DELAY: 604800
3240

3341
# Altair
3442
ALTAIR_FORK_VERSION: 0x01000000
35-
ALTAIR_FORK_EPOCH: 74240
36-
# Merge
43+
ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC
44+
# Bellatrix
3745
BELLATRIX_FORK_VERSION: 0x02000000
38-
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
46+
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
3947
# Capella
4048
CAPELLA_FORK_VERSION: 0x03000000
41-
CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC
49+
CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC
4250
# Deneb
4351
DENEB_FORK_VERSION: 0x04000000
44-
DENEB_FORK_EPOCH: 18446744073709551615
45-
# Sharding
46-
SHARDING_FORK_VERSION: 0x03000000
47-
SHARDING_FORK_EPOCH: 18446744073709551615
48-
49-
# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D.
50-
TRANSITION_TOTAL_DIFFICULTY: 4294967296
52+
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
5153

5254

5355
# Time parameters
@@ -74,16 +76,22 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
7476
EJECTION_BALANCE: 16000000000
7577
# 2**2 (= 4)
7678
MIN_PER_EPOCH_CHURN_LIMIT: 4
77-
# 2**3 (= 8)
78-
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
7979
# 2**16 (= 65,536)
8080
CHURN_LIMIT_QUOTIENT: 65536
81-
81+
# [New in Deneb:EIP7514] 2**3 (= 8)
82+
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
8283

8384
# Fork choice
8485
# ---------------------------------------------------------------
8586
# 40%
8687
PROPOSER_SCORE_BOOST: 40
88+
# 20%
89+
REORG_HEAD_WEIGHT_THRESHOLD: 20
90+
# 160%
91+
REORG_PARENT_WEIGHT_THRESHOLD: 160
92+
# `2` epochs
93+
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2
94+
8795

8896
# Deposit contract
8997
# ---------------------------------------------------------------
@@ -92,17 +100,43 @@ DEPOSIT_CHAIN_ID: 1
92100
DEPOSIT_NETWORK_ID: 1
93101
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa
94102

95-
# Network
103+
104+
# Networking
96105
# ---------------------------------------------------------------
97-
SUBNETS_PER_NODE: 2
106+
# `10 * 2**20` (= 10485760, 10 MiB)
98107
GOSSIP_MAX_SIZE: 10485760
108+
# `2**10` (= 1024)
109+
MAX_REQUEST_BLOCKS: 1024
110+
# `2**8` (= 256)
111+
EPOCHS_PER_SUBNET_SUBSCRIPTION: 256
112+
# `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 33024, ~5 months)
99113
MIN_EPOCHS_FOR_BLOCK_REQUESTS: 33024
114+
# `10 * 2**20` (=10485760, 10 MiB)
100115
MAX_CHUNK_SIZE: 10485760
116+
# 5s
101117
TTFB_TIMEOUT: 5
118+
# 10s
102119
RESP_TIMEOUT: 10
120+
ATTESTATION_PROPAGATION_SLOT_RANGE: 32
121+
# 500ms
122+
MAXIMUM_GOSSIP_CLOCK_DISPARITY: 500
103123
MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000
104124
MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000
125+
# 2 subnets per node
126+
SUBNETS_PER_NODE: 2
127+
# 2**8 (= 64)
105128
ATTESTATION_SUBNET_COUNT: 64
106129
ATTESTATION_SUBNET_EXTRA_BITS: 0
130+
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
107131
ATTESTATION_SUBNET_PREFIX_BITS: 6
108132
ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3
133+
134+
# Deneb
135+
# `2**7` (=128)
136+
MAX_REQUEST_BLOCKS_DENEB: 128
137+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
138+
MAX_REQUEST_BLOB_SIDECARS: 768
139+
# `2**12` (= 4096 epochs, ~18 days)
140+
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
141+
# `6`
142+
BLOB_SIDECAR_SUBNET_COUNT: 6

common/eth2_network_config/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,8 @@ mod tests {
583583
} else {
584584
GenesisStateSource::Unknown
585585
};
586+
// With Deneb enabled by default we must set a trusted setup here.
587+
let kzg_trusted_setup = get_trusted_setup_from_config(&config).unwrap();
586588

587589
let testnet = Eth2NetworkConfig {
588590
deposit_contract_deploy_block,
@@ -593,7 +595,7 @@ mod tests {
593595
.map(Encode::as_ssz_bytes)
594596
.map(Into::into),
595597
config,
596-
kzg_trusted_setup: None,
598+
kzg_trusted_setup: Some(kzg_trusted_setup),
597599
};
598600

599601
testnet

consensus/types/presets/mainnet/deneb.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ FIELD_ELEMENTS_PER_BLOB: 4096
88
MAX_BLOB_COMMITMENTS_PER_BLOCK: 4096
99
# `uint64(6)`
1010
MAX_BLOBS_PER_BLOCK: 6
11-
# `floorlog2(BLOB_KZG_COMMITMENTS_GINDEX) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 12 = 17
11+
# `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 12 = 17
1212
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 17

consensus/types/src/chain_spec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ impl ChainSpec {
681681
* Deneb hard fork params
682682
*/
683683
deneb_fork_version: [0x04, 0x00, 0x00, 0x00],
684-
deneb_fork_epoch: None,
684+
deneb_fork_epoch: Some(Epoch::new(269568)),
685685

686686
/*
687687
* Network specific

lighthouse/tests/beacon_node.rs

+28-7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ impl CommandLineTest {
5555
}
5656

5757
fn run_with_zero_port(&mut self) -> CompletedTest<Config> {
58+
// Required since Deneb was enabled on mainnet.
59+
self.cmd.arg("--allow-insecure-genesis-sync");
60+
self.run_with_zero_port_and_no_genesis_sync()
61+
}
62+
63+
fn run_with_zero_port_and_no_genesis_sync(&mut self) -> CompletedTest<Config> {
5864
self.cmd.arg("-z");
5965
self.run()
6066
}
@@ -93,16 +99,16 @@ fn staking_flag() {
9399
}
94100

95101
#[test]
96-
fn allow_insecure_genesis_sync() {
97-
CommandLineTest::new()
98-
.run_with_zero_port()
99-
.with_config(|config| {
100-
assert_eq!(config.allow_insecure_genesis_sync, false);
101-
});
102+
#[should_panic]
103+
fn allow_insecure_genesis_sync_default() {
104+
CommandLineTest::new().run_with_zero_port_and_no_genesis_sync();
105+
}
102106

107+
#[test]
108+
fn allow_insecure_genesis_sync_enabled() {
103109
CommandLineTest::new()
104110
.flag("allow-insecure-genesis-sync", None)
105-
.run_with_zero_port()
111+
.run_with_zero_port_and_no_genesis_sync()
106112
.with_config(|config| {
107113
assert_eq!(config.allow_insecure_genesis_sync, true);
108114
});
@@ -851,6 +857,7 @@ fn network_port_flag_over_ipv4() {
851857
let port = 0;
852858
CommandLineTest::new()
853859
.flag("port", Some(port.to_string().as_str()))
860+
.flag("allow-insecure-genesis-sync", None)
854861
.run()
855862
.with_config(|config| {
856863
assert_eq!(
@@ -867,6 +874,7 @@ fn network_port_flag_over_ipv4() {
867874
let port = 9000;
868875
CommandLineTest::new()
869876
.flag("port", Some(port.to_string().as_str()))
877+
.flag("allow-insecure-genesis-sync", None)
870878
.run()
871879
.with_config(|config| {
872880
assert_eq!(
@@ -886,6 +894,7 @@ fn network_port_flag_over_ipv6() {
886894
CommandLineTest::new()
887895
.flag("listen-address", Some("::1"))
888896
.flag("port", Some(port.to_string().as_str()))
897+
.flag("allow-insecure-genesis-sync", None)
889898
.run()
890899
.with_config(|config| {
891900
assert_eq!(
@@ -903,6 +912,7 @@ fn network_port_flag_over_ipv6() {
903912
CommandLineTest::new()
904913
.flag("listen-address", Some("::1"))
905914
.flag("port", Some(port.to_string().as_str()))
915+
.flag("allow-insecure-genesis-sync", None)
906916
.run()
907917
.with_config(|config| {
908918
assert_eq!(
@@ -925,6 +935,7 @@ fn network_port_flag_over_ipv4_and_ipv6() {
925935
.flag("listen-address", Some("::1"))
926936
.flag("port", Some(port.to_string().as_str()))
927937
.flag("port6", Some(port6.to_string().as_str()))
938+
.flag("allow-insecure-genesis-sync", None)
928939
.run()
929940
.with_config(|config| {
930941
assert_eq!(
@@ -954,6 +965,7 @@ fn network_port_flag_over_ipv4_and_ipv6() {
954965
.flag("listen-address", Some("::1"))
955966
.flag("port", Some(port.to_string().as_str()))
956967
.flag("port6", Some(port6.to_string().as_str()))
968+
.flag("allow-insecure-genesis-sync", None)
957969
.run()
958970
.with_config(|config| {
959971
assert_eq!(
@@ -983,6 +995,7 @@ fn network_port_and_discovery_port_flags_over_ipv4() {
983995
CommandLineTest::new()
984996
.flag("port", Some(tcp4_port.to_string().as_str()))
985997
.flag("discovery-port", Some(disc4_port.to_string().as_str()))
998+
.flag("allow-insecure-genesis-sync", None)
986999
.run()
9871000
.with_config(|config| {
9881001
assert_eq!(
@@ -1003,6 +1016,7 @@ fn network_port_and_discovery_port_flags_over_ipv6() {
10031016
.flag("listen-address", Some("::1"))
10041017
.flag("port", Some(tcp6_port.to_string().as_str()))
10051018
.flag("discovery-port", Some(disc6_port.to_string().as_str()))
1019+
.flag("allow-insecure-genesis-sync", None)
10061020
.run()
10071021
.with_config(|config| {
10081022
assert_eq!(
@@ -1028,6 +1042,7 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() {
10281042
.flag("discovery-port", Some(disc4_port.to_string().as_str()))
10291043
.flag("port6", Some(tcp6_port.to_string().as_str()))
10301044
.flag("discovery-port6", Some(disc6_port.to_string().as_str()))
1045+
.flag("allow-insecure-genesis-sync", None)
10311046
.run()
10321047
.with_config(|config| {
10331048
assert_eq!(
@@ -1067,6 +1082,7 @@ fn network_port_discovery_quic_port_flags_over_ipv4_and_ipv6() {
10671082
.flag("port6", Some(tcp6_port.to_string().as_str()))
10681083
.flag("discovery-port6", Some(disc6_port.to_string().as_str()))
10691084
.flag("quic-port6", Some(quic6_port.to_string().as_str()))
1085+
.flag("allow-insecure-genesis-sync", None)
10701086
.run()
10711087
.with_config(|config| {
10721088
assert_eq!(
@@ -1293,6 +1309,7 @@ fn enr_match_flag_over_ipv4() {
12931309
.flag("listen-address", Some("127.0.0.2"))
12941310
.flag("discovery-port", Some(udp4_port.to_string().as_str()))
12951311
.flag("port", Some(tcp4_port.to_string().as_str()))
1312+
.flag("allow-insecure-genesis-sync", None)
12961313
.run()
12971314
.with_config(|config| {
12981315
assert_eq!(
@@ -1324,6 +1341,7 @@ fn enr_match_flag_over_ipv6() {
13241341
.flag("listen-address", Some(ADDR))
13251342
.flag("discovery-port", Some(udp6_port.to_string().as_str()))
13261343
.flag("port", Some(tcp6_port.to_string().as_str()))
1344+
.flag("allow-insecure-genesis-sync", None)
13271345
.run()
13281346
.with_config(|config| {
13291347
assert_eq!(
@@ -1364,6 +1382,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() {
13641382
.flag("listen-address", Some(IPV6_ADDR))
13651383
.flag("discovery-port6", Some(udp6_port.to_string().as_str()))
13661384
.flag("port6", Some(tcp6_port.to_string().as_str()))
1385+
.flag("allow-insecure-genesis-sync", None)
13671386
.run()
13681387
.with_config(|config| {
13691388
assert_eq!(
@@ -1490,6 +1509,7 @@ fn http_port_flag() {
14901509
.flag("http", None)
14911510
.flag("http-port", Some(port1.to_string().as_str()))
14921511
.flag("port", Some(port2.to_string().as_str()))
1512+
.flag("allow-insecure-genesis-sync", None)
14931513
.run()
14941514
.with_config(|config| assert_eq!(config.http_api.listen_port, port1));
14951515
}
@@ -1647,6 +1667,7 @@ fn metrics_port_flag() {
16471667
.flag("metrics", None)
16481668
.flag("metrics-port", Some(port1.to_string().as_str()))
16491669
.flag("port", Some(port2.to_string().as_str()))
1670+
.flag("allow-insecure-genesis-sync", None)
16501671
.run()
16511672
.with_config(|config| assert_eq!(config.http_metrics.listen_port, port1));
16521673
}

0 commit comments

Comments
 (0)