Skip to content

Commit 250b5bc

Browse files
committed
Merge branch 'release-v7.0.0' into fix-beacon-pool-attestations
2 parents b3d116c + 9304a59 commit 250b5bc

File tree

10 files changed

+169
-59
lines changed

10 files changed

+169
-59
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4104,7 +4104,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
41044104
&mut state,
41054105
)
41064106
.unwrap_or_else(|e| {
4107-
error!(self.log, "error caching light_client data {:?}", e);
4107+
debug!(self.log, "error caching light_client data {:?}", e);
41084108
});
41094109
}
41104110

beacon_node/http_api/src/lib.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,39 @@ pub fn serve<T: BeaconChainTypes>(
11881188
},
11891189
);
11901190

1191+
// GET beacon/states/{state_id}/pending_consolidations
1192+
let get_beacon_state_pending_consolidations = beacon_states_path
1193+
.clone()
1194+
.and(warp::path("pending_consolidations"))
1195+
.and(warp::path::end())
1196+
.then(
1197+
|state_id: StateId,
1198+
task_spawner: TaskSpawner<T::EthSpec>,
1199+
chain: Arc<BeaconChain<T>>| {
1200+
task_spawner.blocking_json_task(Priority::P1, move || {
1201+
let (data, execution_optimistic, finalized) = state_id
1202+
.map_state_and_execution_optimistic_and_finalized(
1203+
&chain,
1204+
|state, execution_optimistic, finalized| {
1205+
let Ok(consolidations) = state.pending_consolidations() else {
1206+
return Err(warp_utils::reject::custom_bad_request(
1207+
"Pending consolidations not found".to_string(),
1208+
));
1209+
};
1210+
1211+
Ok((consolidations.clone(), execution_optimistic, finalized))
1212+
},
1213+
)?;
1214+
1215+
Ok(api_types::ExecutionOptimisticFinalizedResponse {
1216+
data,
1217+
execution_optimistic: Some(execution_optimistic),
1218+
finalized: Some(finalized),
1219+
})
1220+
})
1221+
},
1222+
);
1223+
11911224
// GET beacon/headers
11921225
//
11931226
// Note: this endpoint only returns information about blocks in the canonical chain. Given that
@@ -4857,6 +4890,7 @@ pub fn serve<T: BeaconChainTypes>(
48574890
.uor(get_beacon_state_randao)
48584891
.uor(get_beacon_state_pending_deposits)
48594892
.uor(get_beacon_state_pending_partial_withdrawals)
4893+
.uor(get_beacon_state_pending_consolidations)
48604894
.uor(get_beacon_headers)
48614895
.uor(get_beacon_headers_block_id)
48624896
.uor(get_beacon_block)

beacon_node/http_api/tests/tests.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,33 @@ impl ApiTester {
12471247
self
12481248
}
12491249

1250+
pub async fn test_beacon_states_pending_consolidations(self) -> Self {
1251+
for state_id in self.interesting_state_ids() {
1252+
let mut state_opt = state_id
1253+
.state(&self.chain)
1254+
.ok()
1255+
.map(|(state, _execution_optimistic, _finalized)| state);
1256+
1257+
let result = self
1258+
.client
1259+
.get_beacon_states_pending_consolidations(state_id.0)
1260+
.await
1261+
.unwrap()
1262+
.map(|res| res.data);
1263+
1264+
if result.is_none() && state_opt.is_none() {
1265+
continue;
1266+
}
1267+
1268+
let state = state_opt.as_mut().expect("result should be none");
1269+
let expected = state.pending_consolidations().unwrap();
1270+
1271+
assert_eq!(result.unwrap(), expected.to_vec());
1272+
}
1273+
1274+
self
1275+
}
1276+
12501277
pub async fn test_beacon_headers_all_slots(self) -> Self {
12511278
for slot in 0..CHAIN_LENGTH {
12521279
let slot = Slot::from(slot);
@@ -6476,6 +6503,8 @@ async fn beacon_get_state_info_electra() {
64766503
.test_beacon_states_pending_deposits()
64776504
.await
64786505
.test_beacon_states_pending_partial_withdrawals()
6506+
.await
6507+
.test_beacon_states_pending_consolidations()
64796508
.await;
64806509
}
64816510

common/eth2/src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,26 @@ impl BeaconNodeHttpClient {
821821
self.get_opt(path).await
822822
}
823823

824+
/// `GET beacon/states/{state_id}/pending_consolidations`
825+
///
826+
/// Returns `Ok(None)` on a 404 error.
827+
pub async fn get_beacon_states_pending_consolidations(
828+
&self,
829+
state_id: StateId,
830+
) -> Result<Option<ExecutionOptimisticFinalizedResponse<Vec<PendingConsolidation>>>, Error>
831+
{
832+
let mut path = self.eth_path(V1)?;
833+
834+
path.path_segments_mut()
835+
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
836+
.push("beacon")
837+
.push("states")
838+
.push(&state_id.to_string())
839+
.push("pending_consolidations");
840+
841+
self.get_opt(path).await
842+
}
843+
824844
/// `GET beacon/light_client/updates`
825845
///
826846
/// Returns `Ok(None)` on a 404 error.

common/eth2_network_config/built_in_network_configs/gnosis/config.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ DENEB_FORK_VERSION: 0x04000064
4343
DENEB_FORK_EPOCH: 889856 # 2024-03-11T18:30:20.000Z
4444
# Electra
4545
ELECTRA_FORK_VERSION: 0x05000064
46-
ELECTRA_FORK_EPOCH: 18446744073709551615
46+
ELECTRA_FORK_EPOCH: 1337856 # 2025-04-30T14:03:40.000Z
4747
# Fulu
4848
FULU_FORK_VERSION: 0x06000064
4949
FULU_FORK_EPOCH: 18446744073709551615
@@ -117,8 +117,20 @@ MAX_REQUEST_BLOB_SIDECARS: 768
117117
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 16384
118118
# `6`
119119
BLOB_SIDECAR_SUBNET_COUNT: 6
120-
# `uint64(6)`
121-
MAX_BLOBS_PER_BLOCK: 6
120+
# `uint64(2)`
121+
MAX_BLOBS_PER_BLOCK: 2
122+
123+
# Electra
124+
# 2**7 * 10**9 (= 128,000,000,000)
125+
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
126+
# 2**6 * 10**9 (= 64,000,000,000)
127+
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 64000000000
128+
# `2`
129+
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 2
130+
# `uint64(2)`
131+
MAX_BLOBS_PER_BLOCK_ELECTRA: 2
132+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
133+
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 256
122134

123135
# DAS
124136
NUMBER_OF_COLUMNS: 128

consensus/types/presets/mainnet/electra.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ MIN_ACTIVATION_BALANCE: 32000000000
77
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
88
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
99

10+
# Rewards and penalties
11+
# ---------------------------------------------------------------
12+
# 2**12 (= 4,096)
13+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
14+
# 2**12 (= 4,096)
15+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
16+
1017
# State list lengths
1118
# ---------------------------------------------------------------
12-
# `uint64(2**27)` (= 134,217,728)
19+
# 2**27 (= 134,217,728) pending deposits
1320
PENDING_DEPOSITS_LIMIT: 134217728
14-
# `uint64(2**27)` (= 134,217,728)
21+
# 2**27 (= 134,217,728) pending partial withdrawals
1522
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
16-
# `uint64(2**18)` (= 262,144)
23+
# 2**18 (= 262,144) pending consolidations
1724
PENDING_CONSOLIDATIONS_LIMIT: 262144
1825

19-
# Reward and penalty quotients
20-
# ---------------------------------------------------------------
21-
# `uint64(2**12)` (= 4,096)
22-
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
23-
# `uint64(2**12)` (= 4,096)
24-
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
25-
26-
# # Max operations per block
26+
# Max operations per block
2727
# ---------------------------------------------------------------
28-
# `uint64(2**0)` (= 1)
28+
# 2**0 (= 1) attester slashings
2929
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30-
# `uint64(2**3)` (= 8)
30+
# 2**3 (= 8) attestations
3131
MAX_ATTESTATIONS_ELECTRA: 8
32-
# `uint64(2**1)` (= 2)
33-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
3432

3533
# Execution
3634
# ---------------------------------------------------------------
37-
# 2**13 (= 8192) deposit requests
35+
# 2**13 (= 8,192) deposit requests
3836
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
3937
# 2**4 (= 16) withdrawal requests
4038
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16
39+
# 2**1 (= 2) consolidation requests
40+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
4141

4242
# Withdrawals processing
4343
# ---------------------------------------------------------------
44-
# 2**3 ( = 8) pending withdrawals
44+
# 2**3 (= 8) pending withdrawals
4545
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8
4646

4747
# Pending deposits processing
4848
# ---------------------------------------------------------------
49-
# 2**4 ( = 4) pending deposits
49+
# 2**4 (= 16) pending deposits
5050
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

consensus/types/presets/minimal/electra.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ MIN_ACTIVATION_BALANCE: 32000000000
77
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
88
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
99

10+
# Rewards and penalties
11+
# ---------------------------------------------------------------
12+
# 2**12 (= 4,096)
13+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
14+
# 2**12 (= 4,096)
15+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
16+
1017
# State list lengths
1118
# ---------------------------------------------------------------
12-
# `uint64(2**27)` (= 134,217,728)
19+
# 2**27 (= 134,217,728) pending deposits
1320
PENDING_DEPOSITS_LIMIT: 134217728
14-
# [customized] `uint64(2**6)` (= 64)
21+
# [customized] 2**6 (= 64) pending partial withdrawals
1522
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64
16-
# [customized] `uint64(2**6)` (= 64)
23+
# [customized] 2**6 (= 64) pending consolidations
1724
PENDING_CONSOLIDATIONS_LIMIT: 64
1825

19-
# Reward and penalty quotients
20-
# ---------------------------------------------------------------
21-
# `uint64(2**12)` (= 4,096)
22-
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
23-
# `uint64(2**12)` (= 4,096)
24-
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
25-
26-
# # Max operations per block
26+
# Max operations per block
2727
# ---------------------------------------------------------------
28-
# `uint64(2**0)` (= 1)
28+
# 2**0 (= 1) attester slashings
2929
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30-
# `uint64(2**3)` (= 8)
30+
# 2**3 (= 8) attestations
3131
MAX_ATTESTATIONS_ELECTRA: 8
32-
# `uint64(2**1)` (= 2)
33-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
3432

3533
# Execution
3634
# ---------------------------------------------------------------
37-
# [customized]
35+
# [customized] 2**2 (= 4) deposit requests
3836
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 4
3937
# [customized] 2**1 (= 2) withdrawal requests
4038
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2
39+
# 2**1 (= 2) consolidation requests
40+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
4141

4242
# Withdrawals processing
4343
# ---------------------------------------------------------------
44-
# 2**1 ( = 2) pending withdrawals
44+
# 2**1 (= 2) pending withdrawals
4545
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 2
4646

4747
# Pending deposits processing
4848
# ---------------------------------------------------------------
49-
# 2**4 ( = 4) pending deposits
49+
# 2**4 (= 16) pending deposits
5050
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

consensus/types/src/chain_spec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ impl ChainSpec {
12361236
* Electra hard fork params
12371237
*/
12381238
electra_fork_version: [0x05, 0x00, 0x00, 0x64],
1239-
electra_fork_epoch: None,
1239+
electra_fork_epoch: Some(Epoch::new(1337856)),
12401240
unset_deposit_requests_start_index: u64::MAX,
12411241
full_exit_request_amount: 0,
12421242
min_activation_balance: option_wrapper(|| {
@@ -1258,7 +1258,7 @@ impl ChainSpec {
12581258
})
12591259
.expect("calculation does not overflow"),
12601260
max_per_epoch_activation_exit_churn_limit: option_wrapper(|| {
1261-
u64::checked_pow(2, 8)?.checked_mul(u64::checked_pow(10, 9)?)
1261+
u64::checked_pow(2, 6)?.checked_mul(u64::checked_pow(10, 9)?)
12621262
})
12631263
.expect("calculation does not overflow"),
12641264

@@ -1300,7 +1300,7 @@ impl ChainSpec {
13001300
max_request_data_column_sidecars: default_max_request_data_column_sidecars(),
13011301
min_epochs_for_blob_sidecars_requests: 16384,
13021302
blob_sidecar_subnet_count: default_blob_sidecar_subnet_count(),
1303-
max_blobs_per_block: default_max_blobs_per_block(),
1303+
max_blobs_per_block: 2,
13041304

13051305
/*
13061306
* Derived Deneb Specific
@@ -1313,9 +1313,9 @@ impl ChainSpec {
13131313
/*
13141314
* Networking Electra specific
13151315
*/
1316-
max_blobs_per_block_electra: default_max_blobs_per_block_electra(),
1317-
blob_sidecar_subnet_count_electra: default_blob_sidecar_subnet_count_electra(),
1318-
max_request_blob_sidecars_electra: default_max_request_blob_sidecars_electra(),
1316+
max_blobs_per_block_electra: 2,
1317+
blob_sidecar_subnet_count_electra: 2,
1318+
max_request_blob_sidecars_electra: 256,
13191319

13201320
/*
13211321
* Application specific

0 commit comments

Comments
 (0)