Skip to content

Commit

Permalink
increase timeout and improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
TennisBowling committed Aug 31, 2024
1 parent 44cc8fe commit 5a54752
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ async fn client_fcu(
Some(payload_status) => {
// check if they want to build a block
if fcu_request.payload_attributes.is_some_and(|x| !x.is_null()) {
tracing::debug!("Client wants to build a block");
tracing::debug!("Client forkchoiceUpdated: Client wants to build a block");
if payload_status.status == PayloadStatusStatus::Valid {
// pass along to EL since the status would be VALID
tracing::debug!("Client fcU was VALID, forwarding payloadAttributes");
tracing::debug!("Client forkchoiceUpdated was VALID, forwarding payloadAttributes");
let fcu_result = make_auth_request(
&state.auth_node,
&request,
Expand All @@ -481,14 +481,14 @@ async fn client_fcu(
.await
.map_err(|e| {
RpcErrorResponse::server_error(
format!("Error querying EL: {:?}", e),
format!("Client forkchoiceUpdated: Error querying EL: {:?}", e),
request.id,
)
})?;

return Ok(RpcResponse::new(fcu_result, id));
} else {
tracing::warn!("Tried passing client CL payloadAttributes but cached EL response is not VALID");
tracing::warn!("Client forkchoiceUpdated: Tried passing client CL payloadAttributes but cached EL response is not VALID");
return Ok(RpcResponse::new(
json!(ForkchoiceUpdatedResponse {
payload_status: PayloadStatus::new_syncing(),
Expand All @@ -508,7 +508,7 @@ async fn client_fcu(
))
}
None => {
tracing::warn!("Client newPayload: Did not find in cache, returning SYNCING");
tracing::warn!("Client forkchoiceUpdated: Did not find in cache, returning SYNCING");
Ok(RpcResponse::new(
json!(ForkchoiceUpdatedResponse {
payload_status: PayloadStatus::new_syncing(),
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ where
.into_value()
.subscribe();

tokio::time::timeout(Duration::from_millis(7000), receiver.recv())
tokio::time::timeout(Duration::from_millis(7800), receiver.recv())
.await
.ok()
.map(|x| x.ok())?
Expand Down

0 comments on commit 5a54752

Please sign in to comment.