Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 12 additions & 8 deletions crates/networking/rpc/engine/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ethrex_blockchain::{
use ethrex_common::types::{BlockHeader, ELASTICITY_MULTIPLIER};
use ethrex_p2p::sync::SyncMode;
use serde_json::Value;
use tracing::{debug, info, warn};
use tracing::{info, warn};

use crate::{
rpc::{RpcApiContext, RpcHandler},
Expand Down Expand Up @@ -170,12 +170,12 @@ async fn handle_forkchoice(
context: RpcApiContext,
version: usize,
) -> Result<(Option<BlockHeader>, ForkChoiceResponse), RpcErr> {
debug!(
"New fork choice request v{} with head: {:#x}, safe: {:#x}, finalized: {:#x}.",
version,
fork_choice_state.head_block_hash,
fork_choice_state.safe_block_hash,
fork_choice_state.finalized_block_hash
info!(
version = format!("v{}", version),
head = format!("{:#x}", fork_choice_state.head_block_hash),
safe = format!("{:#x}", fork_choice_state.safe_block_hash),
finalized = format!("v{:#x}", fork_choice_state.finalized_block_hash),
"New fork choice request",
);

if let Some(latest_valid_hash) = context
Expand Down Expand Up @@ -369,7 +369,6 @@ async fn build_payload(
fork_choice_state: &ForkChoiceState,
version: u8,
) -> Result<u64, RpcErr> {
info!("Fork choice updated includes payload attributes. Creating a new payload.");
let args = BuildPayloadArgs {
parent: fork_choice_state.head_block_hash,
timestamp: attributes.timestamp,
Expand All @@ -384,6 +383,11 @@ async fn build_payload(
let payload_id = args
.id()
.map_err(|error| RpcErr::Internal(error.to_string()))?;

info!(
id = payload_id,
"Fork choice updated includes payload attributes. Creating a new payload"
);
let payload = match create_payload(&args, &context.storage, context.node_data.extra_data) {
Ok(payload) => payload,
Err(ChainError::EvmError(error)) => return Err(error.into()),
Expand Down
7 changes: 5 additions & 2 deletions crates/networking/rpc/engine/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ async fn handle_new_payload_v1_v2(
let latest_valid_hash = block.header.parent_hash;

if context.syncer.sync_mode() == SyncMode::Snap {
warn!("Snap sync in progress, skipping new payload validation");
debug!("Snap sync in progress, skipping new payload validation");
return Ok(PayloadStatus::syncing());
}

Expand Down Expand Up @@ -783,7 +783,10 @@ fn validate_fork(block: &Block, fork: Fork, context: &RpcApiContext) -> Result<(
}

async fn get_payload(payload_id: u64, context: &RpcApiContext) -> Result<PayloadBundle, RpcErr> {
debug!("Requested payload with id: {:#018x}", payload_id);
info!(
id = format!("{:#018x}", payload_id),
"Requested payload with"
);
let (blobs_bundle, requests, block_value, block) = {
let PayloadBuildResult {
blobs_bundle,
Expand Down