mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
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.
This commit is contained in:
@@ -1785,8 +1785,11 @@ pub fn check_block_is_finalized_checkpoint_or_descendant<
|
|||||||
// If we have a split block newer than finalization then we also ban blocks which are not
|
// If we have a split block newer than finalization then we also ban blocks which are not
|
||||||
// descended from that split block.
|
// descended from that split block.
|
||||||
let split = chain.store.get_split_info();
|
let split = chain.store.get_split_info();
|
||||||
|
let is_descendant_from_split_block =
|
||||||
|
split.slot == 0 || fork_choice.is_descendant(split.block_root, block.parent_root());
|
||||||
|
|
||||||
if fork_choice.is_finalized_checkpoint_or_descendant(block.parent_root())
|
if fork_choice.is_finalized_checkpoint_or_descendant(block.parent_root())
|
||||||
&& fork_choice.is_descendant(split.block_root, block.parent_root())
|
&& is_descendant_from_split_block
|
||||||
{
|
{
|
||||||
Ok(block)
|
Ok(block)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ metrics = { workspace = true }
|
|||||||
network = { workspace = true }
|
network = { workspace = true }
|
||||||
operation_pool = { workspace = true }
|
operation_pool = { workspace = true }
|
||||||
parking_lot = { workspace = true }
|
parking_lot = { workspace = true }
|
||||||
proto_array = { workspace = true }
|
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
safe_arith = { workspace = true }
|
safe_arith = { workspace = true }
|
||||||
sensitive_url = { workspace = true }
|
sensitive_url = { workspace = true }
|
||||||
@@ -51,6 +50,7 @@ warp_utils = { workspace = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
genesis = { workspace = true }
|
genesis = { workspace = true }
|
||||||
logging = { workspace = true }
|
logging = { workspace = true }
|
||||||
|
proto_array = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
|
|||||||
@@ -4603,34 +4603,6 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let post_lighthouse_fork_choice_invalidate = warp::path("lighthouse")
|
|
||||||
.and(warp::path("fork_choice"))
|
|
||||||
.and(warp::path("invalidate"))
|
|
||||||
.and(warp::path::end())
|
|
||||||
.and(task_spawner_filter.clone())
|
|
||||||
.and(chain_filter.clone())
|
|
||||||
.and(warp_utils::json::json())
|
|
||||||
.then(
|
|
||||||
|task_spawner: TaskSpawner<T::EthSpec>,
|
|
||||||
chain: Arc<BeaconChain<T>>,
|
|
||||||
block_root: Hash256| {
|
|
||||||
task_spawner.blocking_json_task(Priority::P0, move || {
|
|
||||||
let invalidation =
|
|
||||||
proto_array::InvalidationOperation::InvalidateOne { block_root };
|
|
||||||
chain
|
|
||||||
.canonical_head
|
|
||||||
.fork_choice_write_lock()
|
|
||||||
.on_invalid_execution_payload(&invalidation)
|
|
||||||
.map_err(|e| {
|
|
||||||
warp_utils::reject::custom_server_error(format!(
|
|
||||||
"not invalidated due to error: {e:?}"
|
|
||||||
))
|
|
||||||
})?;
|
|
||||||
Ok("invalidated")
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// GET lighthouse/analysis/block_rewards
|
// GET lighthouse/analysis/block_rewards
|
||||||
let get_lighthouse_block_rewards = warp::path("lighthouse")
|
let get_lighthouse_block_rewards = warp::path("lighthouse")
|
||||||
.and(warp::path("analysis"))
|
.and(warp::path("analysis"))
|
||||||
@@ -4992,7 +4964,6 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
.uor(post_validator_liveness_epoch)
|
.uor(post_validator_liveness_epoch)
|
||||||
.uor(post_lighthouse_liveness)
|
.uor(post_lighthouse_liveness)
|
||||||
.uor(post_lighthouse_database_reconstruct)
|
.uor(post_lighthouse_database_reconstruct)
|
||||||
.uor(post_lighthouse_fork_choice_invalidate)
|
|
||||||
.uor(post_lighthouse_block_rewards)
|
.uor(post_lighthouse_block_rewards)
|
||||||
.uor(post_lighthouse_ui_validator_metrics)
|
.uor(post_lighthouse_ui_validator_metrics)
|
||||||
.uor(post_lighthouse_ui_validator_info)
|
.uor(post_lighthouse_ui_validator_info)
|
||||||
|
|||||||
@@ -1541,9 +1541,10 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
|||||||
let state_from_disk = self.load_hot_state(state_root, update_cache)?;
|
let state_from_disk = self.load_hot_state(state_root, update_cache)?;
|
||||||
|
|
||||||
if let Some((mut state, block_root)) = state_from_disk {
|
if let Some((mut state, block_root)) = state_from_disk {
|
||||||
|
state.update_tree_hash_cache()?;
|
||||||
|
state.build_all_caches(&self.spec)?;
|
||||||
|
|
||||||
if update_cache {
|
if update_cache {
|
||||||
state.update_tree_hash_cache()?;
|
|
||||||
state.build_all_caches(&self.spec)?;
|
|
||||||
self.state_cache
|
self.state_cache
|
||||||
.lock()
|
.lock()
|
||||||
.put_state(*state_root, block_root, &state)?;
|
.put_state(*state_root, block_root, &state)?;
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ Options:
|
|||||||
Specifies the verbosity level used when emitting logs to the terminal.
|
Specifies the verbosity level used when emitting logs to the terminal.
|
||||||
[default: info] [possible values: info, debug, trace, warn, error,
|
[default: info] [possible values: info, debug, trace, warn, error,
|
||||||
crit]
|
crit]
|
||||||
|
--disable-attesting
|
||||||
|
Turn off attestation related APIs so that we have some hope of
|
||||||
|
producing blocks
|
||||||
--discovery-port <PORT>
|
--discovery-port <PORT>
|
||||||
The UDP port that discovery will listen on. Defaults to `port`
|
The UDP port that discovery will listen on. Defaults to `port`
|
||||||
--discovery-port6 <PORT>
|
--discovery-port6 <PORT>
|
||||||
@@ -385,12 +388,18 @@ Options:
|
|||||||
Number of validators per chunk stored on disk.
|
Number of validators per chunk stored on disk.
|
||||||
--slots-per-restore-point <SLOT_COUNT>
|
--slots-per-restore-point <SLOT_COUNT>
|
||||||
DEPRECATED. This flag has no effect.
|
DEPRECATED. This flag has no effect.
|
||||||
|
--state-cache-headroom <N>
|
||||||
|
Minimum number of states to cull from the state cache when it gets
|
||||||
|
full [default: 1]
|
||||||
--state-cache-size <STATE_CACHE_SIZE>
|
--state-cache-size <STATE_CACHE_SIZE>
|
||||||
Specifies the size of the state cache [default: 128]
|
Specifies the size of the state cache [default: 32]
|
||||||
--suggested-fee-recipient <SUGGESTED-FEE-RECIPIENT>
|
--suggested-fee-recipient <SUGGESTED-FEE-RECIPIENT>
|
||||||
Emergency fallback fee recipient for use in case the validator client
|
Emergency fallback fee recipient for use in case the validator client
|
||||||
does not have one configured. You should set this flag on the
|
does not have one configured. You should set this flag on the
|
||||||
validator client instead of (or in addition to) setting it here.
|
validator client instead of (or in addition to) setting it here.
|
||||||
|
--sync-tolerance-epochs <sync-tolerance-epochs>
|
||||||
|
If the beacon node is within this many epochs from the head, we
|
||||||
|
declare it to be synced regardless of the network sync state
|
||||||
-t, --testnet-dir <DIR>
|
-t, --testnet-dir <DIR>
|
||||||
Path to directory containing eth2_testnet specs. Defaults to a
|
Path to directory containing eth2_testnet specs. Defaults to a
|
||||||
hard-coded Lighthouse testnet. Only effective if there is no existing
|
hard-coded Lighthouse testnet. Only effective if there is no existing
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ Flags:
|
|||||||
If this flag is set, Lighthouse will query the Beacon Node for only
|
If this flag is set, Lighthouse will query the Beacon Node for only
|
||||||
block headers during proposals and will sign over headers. Useful for
|
block headers during proposals and will sign over headers. Useful for
|
||||||
outsourcing execution payload construction during proposals.
|
outsourcing execution payload construction during proposals.
|
||||||
|
--disable-attesting
|
||||||
|
Disable everything except block proposals
|
||||||
--disable-auto-discover
|
--disable-auto-discover
|
||||||
If present, do not attempt to discover new validators in the
|
If present, do not attempt to discover new validators in the
|
||||||
validators-dir. Validators will need to be manually added to the
|
validators-dir. Validators will need to be manually added to the
|
||||||
|
|||||||
@@ -531,7 +531,15 @@ impl ProtoArray {
|
|||||||
|| latest_valid_ancestor_is_descendant
|
|| latest_valid_ancestor_is_descendant
|
||||||
{
|
{
|
||||||
match &node.execution_status {
|
match &node.execution_status {
|
||||||
ExecutionStatus::Valid(hash) | ExecutionStatus::Optimistic(hash) => {
|
// It's illegal for an execution client to declare that some previously-valid block
|
||||||
|
// is now invalid. This is a consensus failure on their behalf.
|
||||||
|
ExecutionStatus::Valid(hash) => {
|
||||||
|
return Err(Error::ValidExecutionStatusBecameInvalid {
|
||||||
|
block_root: node.root,
|
||||||
|
payload_block_hash: *hash,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ExecutionStatus::Optimistic(hash) => {
|
||||||
invalidated_indices.insert(index);
|
invalidated_indices.insert(index);
|
||||||
node.execution_status = ExecutionStatus::Invalid(*hash);
|
node.execution_status = ExecutionStatus::Invalid(*hash);
|
||||||
|
|
||||||
@@ -589,9 +597,13 @@ impl ProtoArray {
|
|||||||
if let Some(parent_index) = node.parent {
|
if let Some(parent_index) = node.parent {
|
||||||
if invalidated_indices.contains(&parent_index) {
|
if invalidated_indices.contains(&parent_index) {
|
||||||
match &node.execution_status {
|
match &node.execution_status {
|
||||||
ExecutionStatus::Valid(hash)
|
ExecutionStatus::Valid(hash) => {
|
||||||
| ExecutionStatus::Optimistic(hash)
|
return Err(Error::ValidExecutionStatusBecameInvalid {
|
||||||
| ExecutionStatus::Invalid(hash) => {
|
block_root: node.root,
|
||||||
|
payload_block_hash: *hash,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ExecutionStatus::Optimistic(hash) | ExecutionStatus::Invalid(hash) => {
|
||||||
node.execution_status = ExecutionStatus::Invalid(*hash)
|
node.execution_status = ExecutionStatus::Invalid(*hash)
|
||||||
}
|
}
|
||||||
ExecutionStatus::Irrelevant(_) => {
|
ExecutionStatus::Irrelevant(_) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user