Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions crates/networking/rpc/engine/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ethrex_blockchain::{
payload::{BuildPayloadArgs, create_payload},
};
use ethrex_common::types::{BlockHeader, ELASTICITY_MULTIPLIER};
use ethrex_p2p::sync::SyncMode;
use serde_json::Value;
use tracing::{info, warn};

Expand Down Expand Up @@ -219,22 +220,10 @@ async fn handle_forkchoice(
));
}

/* Revert #4985
if context.syncer.sync_mode() == SyncMode::Snap {
// Don't trigger a sync if the block is already canonical
if context
.storage
.is_canonical_sync(fork_choice_state.head_block_hash)?
{
// Disable snapsync mode so we can process incoming payloads
context.syncer.disable_snap();
} else {
context
.syncer
.sync_to_head(fork_choice_state.head_block_hash);
return Ok((None, PayloadStatus::syncing().into()));
}
} */
if syncer.sync_mode() == SyncMode::Snap {
syncer.sync_to_head(fork_choice_state.head_block_hash);
return Ok((None, PayloadStatus::syncing().into()));
}

match apply_fork_choice(
&context.storage,
Expand Down