Skip to content

Commit

Permalink
redact SubmitBlockErr
Browse files Browse the repository at this point in the history
  • Loading branch information
liamaharon committed Sep 13, 2024
1 parent db096d4 commit f315762
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
18 changes: 14 additions & 4 deletions crates/rbuilder/src/live_builder/block_output/relay_submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,22 @@ async fn submit_bid_to_the_relay(
cancel.cancel();
}
Err(SubmitBlockErr::BidBelowFloor | SubmitBlockErr::PayloadAttributesNotKnown) => {
trace!(err = ?relay_result.unwrap_err(), "Block not accepted by the relay");
trace!(
err = ?relay_result.unwrap_err(),
"Block not accepted by the relay"
);
}
Err(SubmitBlockErr::SimError(err)) => {
Err(SubmitBlockErr::SimError(_)) => {
inc_failed_block_simulations();
error!(err = ?err.clone(), "Error block simulation fail, cancelling");
store_error_event(SIM_ERROR_CATEGORY, &err.to_string(), &signed_submit_request);
store_error_event(
SIM_ERROR_CATEGORY,
relay_result.as_ref().unwrap_err().to_string().as_str(),
&signed_submit_request,
);
error!(
err = ?relay_result.unwrap_err(),
"Error block simulation fail, cancelling"
);
cancel.cancel();
}
Err(SubmitBlockErr::RelayError(RelayError::TooManyRequests)) => {
Expand Down
17 changes: 15 additions & 2 deletions crates/rbuilder/src/mev_boost/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ pub enum Error {
TooManyProofs,
}

#[derive(Debug, thiserror::Error)]
#[derive(thiserror::Error)]
pub enum SubmitBlockErr {
#[error("Relay error: {0}")]
RelayError(#[from] RelayError),
Expand All @@ -271,14 +271,27 @@ pub enum SubmitBlockErr {
#[error("RPC conversion Error")]
/// RPC validates the submissions (eg: limit of txs) much more that our model.
RPCConversionError(Error),
#[error("RPC serialization failed {0}")]
#[cfg_attr(
not(feature = "redact_sensitive"),
error("RPC serialization failed: {0}")
)]
#[cfg_attr(
feature = "redact_sensitive",
error("RPC serialization failed: [REDACTED]")
)]
RPCSerializationError(String),
#[error("Invalid header")]
InvalidHeader,
#[error("Block known")]
BlockKnown,
}

impl std::fmt::Debug for SubmitBlockErr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self)
}
}

// Data API
impl RelayClient {
async fn get_one_delivered_payload(
Expand Down

0 comments on commit f315762

Please sign in to comment.