Skip to content

Commit cbf1c04

Browse files
committed
resolve merge conflicts between untstable and release-v7.0.0
2 parents d323699 + 0486802 commit cbf1c04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1422
-242
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ mockito = "1.5.0"
159159
num_cpus = "1"
160160
parking_lot = "0.12"
161161
paste = "1"
162-
prometheus = "0.13"
162+
prometheus = { version = "0.13", default-features = false }
163163
quickcheck = "1"
164164
quickcheck_macros = "1"
165165
quote = "1"
@@ -174,7 +174,7 @@ reqwest = { version = "0.11", default-features = false, features = [
174174
"rustls-tls",
175175
"native-tls-vendored",
176176
] }
177-
ring = "0.16"
177+
ring = "0.17"
178178
rpds = "0.11"
179179
rusqlite = { version = "0.28", features = ["bundled"] }
180180
serde = { version = "1", features = ["derive"] }

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ install-audit:
250250
cargo install --force cargo-audit
251251

252252
audit-CI:
253-
cargo audit --ignore RUSTSEC-2025-0009 --ignore RUSTSEC-2024-0437
253+
cargo audit
254254

255255
# Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose.
256256
vendor:

beacon_node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "beacon_node"
3-
version = "7.0.0-beta.0"
3+
version = "7.0.0-beta.4"
44
authors = [
55
"Paul Hauner <[email protected]>",
66
"Age Manning <[email protected]",

beacon_node/beacon_chain/src/attestation_rewards.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
5151
.state_root_at_slot(state_slot)?
5252
.ok_or(BeaconChainError::NoStateForSlot(state_slot))?;
5353

54+
// This branch is reached from the HTTP API. We assume the user wants
55+
// to cache states so that future calls are faster.
5456
let state = self
55-
.get_state(&state_root, Some(state_slot))?
57+
.get_state(&state_root, Some(state_slot), true)?
5658
.ok_or(BeaconChainError::MissingBeaconState(state_root))?;
5759

5860
if state.fork_name_unchecked().altair_enabled() {

beacon_node/beacon_chain/src/attestation_verification.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,12 @@ fn verify_head_block_is_known<T: BeaconChainTypes>(
11261126
}
11271127
}
11281128

1129+
if !verify_attestation_is_finalized_checkpoint_or_descendant(attestation.data(), chain) {
1130+
return Err(Error::HeadBlockFinalized {
1131+
beacon_block_root: attestation.data().beacon_block_root,
1132+
});
1133+
}
1134+
11291135
Ok(block)
11301136
} else if chain.is_pre_finalization_block(attestation.data().beacon_block_root)? {
11311137
Err(Error::HeadBlockFinalized {
@@ -1359,6 +1365,29 @@ pub fn verify_committee_index<E: EthSpec>(attestation: AttestationRef<E>) -> Res
13591365
Ok(())
13601366
}
13611367

1368+
fn verify_attestation_is_finalized_checkpoint_or_descendant<T: BeaconChainTypes>(
1369+
attestation_data: &AttestationData,
1370+
chain: &BeaconChain<T>,
1371+
) -> bool {
1372+
// If we have a split block newer than finalization then we also ban attestations which are not
1373+
// descended from that split block. It's important not to try checking `is_descendant` if
1374+
// finality is ahead of the split and the split block has been pruned, as `is_descendant` will
1375+
// return `false` in this case.
1376+
let fork_choice = chain.canonical_head.fork_choice_read_lock();
1377+
let attestation_block_root = attestation_data.beacon_block_root;
1378+
let finalized_slot = fork_choice
1379+
.finalized_checkpoint()
1380+
.epoch
1381+
.start_slot(T::EthSpec::slots_per_epoch());
1382+
let split = chain.store.get_split_info();
1383+
let is_descendant_from_split_block = split.slot == 0
1384+
|| split.slot <= finalized_slot
1385+
|| fork_choice.is_descendant(split.block_root, attestation_block_root);
1386+
1387+
fork_choice.is_finalized_checkpoint_or_descendant(attestation_block_root)
1388+
&& is_descendant_from_split_block
1389+
}
1390+
13621391
/// Assists in readability.
13631392
type CommitteesPerSlot = u64;
13641393

beacon_node/beacon_chain/src/attester_cache.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,10 @@ impl AttesterCache {
325325
return Ok(value);
326326
}
327327

328+
// We use `cache_state = true` here because if we are attesting to the state it's likely
329+
// to be recent and useful for other things.
328330
let mut state: BeaconState<T::EthSpec> = chain
329-
.get_state(&state_root, None)?
331+
.get_state(&state_root, None, true)?
330332
.ok_or(Error::MissingBeaconState(state_root))?;
331333

332334
if state.slot() > slot {

0 commit comments

Comments
 (0)