Skip to content

Commit feedf5d

Browse files
authored
Add CI fixes to holesky-rescue (#7071)
* Add CI fixes. * Remove log and update cli docs. * Build caches after loading state from disk. * Revert payload invalidation API - wasn't working because of the justification being permanently updated.
1 parent 9436f23 commit feedf5d

File tree

7 files changed

+36
-38
lines changed

7 files changed

+36
-38
lines changed

beacon_node/beacon_chain/src/block_verification.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,8 +1785,11 @@ pub fn check_block_is_finalized_checkpoint_or_descendant<
17851785
// If we have a split block newer than finalization then we also ban blocks which are not
17861786
// descended from that split block.
17871787
let split = chain.store.get_split_info();
1788+
let is_descendant_from_split_block =
1789+
split.slot == 0 || fork_choice.is_descendant(split.block_root, block.parent_root());
1790+
17881791
if fork_choice.is_finalized_checkpoint_or_descendant(block.parent_root())
1789-
&& fork_choice.is_descendant(split.block_root, block.parent_root())
1792+
&& is_descendant_from_split_block
17901793
{
17911794
Ok(block)
17921795
} else {

beacon_node/http_api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ metrics = { workspace = true }
2828
network = { workspace = true }
2929
operation_pool = { workspace = true }
3030
parking_lot = { workspace = true }
31-
proto_array = { workspace = true }
3231
rand = { workspace = true }
3332
safe_arith = { workspace = true }
3433
sensitive_url = { workspace = true }
@@ -51,6 +50,7 @@ warp_utils = { workspace = true }
5150
[dev-dependencies]
5251
genesis = { workspace = true }
5352
logging = { workspace = true }
53+
proto_array = { workspace = true }
5454
serde_json = { workspace = true }
5555

5656
[[test]]

beacon_node/http_api/src/lib.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4603,34 +4603,6 @@ pub fn serve<T: BeaconChainTypes>(
46034603
},
46044604
);
46054605

4606-
let post_lighthouse_fork_choice_invalidate = warp::path("lighthouse")
4607-
.and(warp::path("fork_choice"))
4608-
.and(warp::path("invalidate"))
4609-
.and(warp::path::end())
4610-
.and(task_spawner_filter.clone())
4611-
.and(chain_filter.clone())
4612-
.and(warp_utils::json::json())
4613-
.then(
4614-
|task_spawner: TaskSpawner<T::EthSpec>,
4615-
chain: Arc<BeaconChain<T>>,
4616-
block_root: Hash256| {
4617-
task_spawner.blocking_json_task(Priority::P0, move || {
4618-
let invalidation =
4619-
proto_array::InvalidationOperation::InvalidateOne { block_root };
4620-
chain
4621-
.canonical_head
4622-
.fork_choice_write_lock()
4623-
.on_invalid_execution_payload(&invalidation)
4624-
.map_err(|e| {
4625-
warp_utils::reject::custom_server_error(format!(
4626-
"not invalidated due to error: {e:?}"
4627-
))
4628-
})?;
4629-
Ok("invalidated")
4630-
})
4631-
},
4632-
);
4633-
46344606
// GET lighthouse/analysis/block_rewards
46354607
let get_lighthouse_block_rewards = warp::path("lighthouse")
46364608
.and(warp::path("analysis"))
@@ -4992,7 +4964,6 @@ pub fn serve<T: BeaconChainTypes>(
49924964
.uor(post_validator_liveness_epoch)
49934965
.uor(post_lighthouse_liveness)
49944966
.uor(post_lighthouse_database_reconstruct)
4995-
.uor(post_lighthouse_fork_choice_invalidate)
49964967
.uor(post_lighthouse_block_rewards)
49974968
.uor(post_lighthouse_ui_validator_metrics)
49984969
.uor(post_lighthouse_ui_validator_info)

beacon_node/store/src/hot_cold_store.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,10 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
15411541
let state_from_disk = self.load_hot_state(state_root, update_cache)?;
15421542

15431543
if let Some((mut state, block_root)) = state_from_disk {
1544+
state.update_tree_hash_cache()?;
1545+
state.build_all_caches(&self.spec)?;
1546+
15441547
if update_cache {
1545-
state.update_tree_hash_cache()?;
1546-
state.build_all_caches(&self.spec)?;
15471548
self.state_cache
15481549
.lock()
15491550
.put_state(*state_root, block_root, &state)?;

book/src/help_bn.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Options:
8080
Specifies the verbosity level used when emitting logs to the terminal.
8181
[default: info] [possible values: info, debug, trace, warn, error,
8282
crit]
83+
--disable-attesting
84+
Turn off attestation related APIs so that we have some hope of
85+
producing blocks
8386
--discovery-port <PORT>
8487
The UDP port that discovery will listen on. Defaults to `port`
8588
--discovery-port6 <PORT>
@@ -385,12 +388,18 @@ Options:
385388
Number of validators per chunk stored on disk.
386389
--slots-per-restore-point <SLOT_COUNT>
387390
DEPRECATED. This flag has no effect.
391+
--state-cache-headroom <N>
392+
Minimum number of states to cull from the state cache when it gets
393+
full [default: 1]
388394
--state-cache-size <STATE_CACHE_SIZE>
389-
Specifies the size of the state cache [default: 128]
395+
Specifies the size of the state cache [default: 32]
390396
--suggested-fee-recipient <SUGGESTED-FEE-RECIPIENT>
391397
Emergency fallback fee recipient for use in case the validator client
392398
does not have one configured. You should set this flag on the
393399
validator client instead of (or in addition to) setting it here.
400+
--sync-tolerance-epochs <sync-tolerance-epochs>
401+
If the beacon node is within this many epochs from the head, we
402+
declare it to be synced regardless of the network sync state
394403
-t, --testnet-dir <DIR>
395404
Path to directory containing eth2_testnet specs. Defaults to a
396405
hard-coded Lighthouse testnet. Only effective if there is no existing

book/src/help_vc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ Flags:
175175
If this flag is set, Lighthouse will query the Beacon Node for only
176176
block headers during proposals and will sign over headers. Useful for
177177
outsourcing execution payload construction during proposals.
178+
--disable-attesting
179+
Disable everything except block proposals
178180
--disable-auto-discover
179181
If present, do not attempt to discover new validators in the
180182
validators-dir. Validators will need to be manually added to the

consensus/proto_array/src/proto_array.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,15 @@ impl ProtoArray {
531531
|| latest_valid_ancestor_is_descendant
532532
{
533533
match &node.execution_status {
534-
ExecutionStatus::Valid(hash) | ExecutionStatus::Optimistic(hash) => {
534+
// It's illegal for an execution client to declare that some previously-valid block
535+
// is now invalid. This is a consensus failure on their behalf.
536+
ExecutionStatus::Valid(hash) => {
537+
return Err(Error::ValidExecutionStatusBecameInvalid {
538+
block_root: node.root,
539+
payload_block_hash: *hash,
540+
})
541+
}
542+
ExecutionStatus::Optimistic(hash) => {
535543
invalidated_indices.insert(index);
536544
node.execution_status = ExecutionStatus::Invalid(*hash);
537545

@@ -589,9 +597,13 @@ impl ProtoArray {
589597
if let Some(parent_index) = node.parent {
590598
if invalidated_indices.contains(&parent_index) {
591599
match &node.execution_status {
592-
ExecutionStatus::Valid(hash)
593-
| ExecutionStatus::Optimistic(hash)
594-
| ExecutionStatus::Invalid(hash) => {
600+
ExecutionStatus::Valid(hash) => {
601+
return Err(Error::ValidExecutionStatusBecameInvalid {
602+
block_root: node.root,
603+
payload_block_hash: *hash,
604+
})
605+
}
606+
ExecutionStatus::Optimistic(hash) | ExecutionStatus::Invalid(hash) => {
595607
node.execution_status = ExecutionStatus::Invalid(*hash)
596608
}
597609
ExecutionStatus::Irrelevant(_) => {

0 commit comments

Comments
 (0)