From f76ce05f8053e01565cb23b2be00d03711092d18 Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Thu, 13 Jun 2024 22:26:45 +0200 Subject: [PATCH] cleanup --- docs/2024-06_bidcollect.md | 11 +++++------ services/bidcollect/types.go | 7 ++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/2024-06_bidcollect.md b/docs/2024-06_bidcollect.md index 1126af7..3c598d0 100644 --- a/docs/2024-06_bidcollect.md +++ b/docs/2024-06_bidcollect.md @@ -6,18 +6,17 @@ Relayscan.io collects a full, public archive of bids across [relays](../vars/rel --- -### Bids source types - -0. [getHeader polling](https://ethereum.github.io/builder-specs/#/Builder/getHeader) -1. [Data API polling](https://flashbots.github.io/relay-specs/#/Data/getReceivedBids) -2. [Ultrasound top-bid websocket stream](https://github.com/ultrasoundmoney/docs/blob/main/top-bid-websocket.md) - ### Output For every day, there are two CSV files: 1. All bids 2. Top bids only +### Bids source types + +- `0`: [getHeader polling](https://ethereum.github.io/builder-specs/#/Builder/getHeader) +- `1`: [Data API polling](https://flashbots.github.io/relay-specs/#/Data/getReceivedBids) +- `2`: [Ultrasound top-bid websocket stream](https://github.com/ultrasoundmoney/docs/blob/main/top-bid-websocket.md) ### Collected fields diff --git a/services/bidcollect/types.go b/services/bidcollect/types.go index 800e3f9..3e30f49 100644 --- a/services/bidcollect/types.go +++ b/services/bidcollect/types.go @@ -80,6 +80,11 @@ func (bid *CommonBid) ToCSVFields() []string { bidIntoSlotTmsString = fmt.Sprint(bitIntoSlotTms) } + bidIsOptimisticString := "" + if bid.SourceType == SourceTypeDataAPI { + bidIsOptimisticString = boolToString(bid.OptimisticSubmission) + } + return []string{ // Collector-internal fields fmt.Sprint(bid.SourceType), @@ -105,7 +110,7 @@ func (bid *CommonBid) ToCSVFields() []string { // Data API bid.ProposerPubkey, bid.ProposerFeeRecipient, - boolToString(bid.OptimisticSubmission), + bidIsOptimisticString, } }