Uh oh!
There was an error while loading. Please reload this page.
feat(pbs): Log auction participants with bid value and delta at INFO level - #426
Closed
selfuryon wants to merge 2 commits into
Closed
feat(pbs): Log auction participants with bid value and delta at INFO level#426selfuryon wants to merge 2 commits into
selfuryon wants to merge 2 commits into
Conversation
selfuryon
commented
Feb 15, 2026
ContributorAuthor
Failed test isn't from my code :) |
selfuryon
commented
Feb 15, 2026
ContributorAuthor
This PR should fix tests: #427 |
| value = %value, | ||
| value_eth = format_ether(value), | ||
| value_delta = %delta, | ||
| selected, |
Collaborator
There was a problem hiding this comment.
An issue is if the max bid is the same across relays there will be multiple logs with selected = true. You can add more logic to set selected but potentially a more efficient approach that avoids pushing the losing GetHeaderResponses to a vec is:
// ....letmut relay_bids:Vec<(&str,U256,B256)> = Vec::with_capacity(relays.len());letmut best_value = U256::ZERO;letmut best_response:Option<GetHeaderResponse> = None;letmut best_relay_id:Option<&str> = None;for(i, res)in results.into_iter().enumerate(){let relay_id = relays[i].id.as_str();match res {Ok(Some(res)) => {let value = *res.data.message.value();let block_hash = res.block_hash();RELAY_LAST_SLOT.with_label_values(&[relay_id]).set(params.slotasi64);let value_gwei = (value / U256::from(1_000_000_000)).try_into().unwrap_or_default();RELAY_HEADER_VALUE.with_label_values(&[relay_id]).set(value_gwei);if best_response.is_none() || value > best_value {
best_value = value;
best_response = Some(res);// move winner here
best_relay_id = Some(relay_id);}else{// buffer small fields for logging
relay_bids.push((relay_id, value, block_hash));}}Ok(_) => {}Err(err)if err.is_timeout() => error!(err = "Timed Out", relay_id),Err(err) => error!(%err, relay_id),}}// Log winner first (if any)ifletSome(winner) = best_response.as_ref(){let relay_id = best_relay_id.unwrap_or("unknown");info!(
relay_id,
value = %best_value,
value_eth = format_ether(best_value),
value_delta = %U256::ZERO,
selected = true,
block_hash = %winner.block_hash(),"Auction participant");}// Log the restfor(relay_id, value, block_hash)in relay_bids {let delta = best_value.saturating_sub(value);info!(
relay_id,
value = %value,
value_eth = format_ether(value),
value_delta = %delta,
selected = false,
block_hash = %block_hash,"Auction participant");}// Return the moved winning responselet max_bid = best_response;Ok(max_bid)
Closed
JasonVranek
commented
Mar 26, 2026
Collaborator
closed by #443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have auction logs in Vouch which I really like. This log shows bid auction and who won it with which value, so I also want to add that type of logs in PBS module too