Skip to content

feat: make relay bid collection optional via CLI flag#828

Merged
rose2221 merged 8 commits intomainfrom
feat/relay_cli
Oct 22, 2025
Merged

feat: make relay bid collection optional via CLI flag#828
rose2221 merged 8 commits intomainfrom
feat/relay_cli

Conversation

@rose2221
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Collaborator

@aloknerurkar aloknerurkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the comment from the previous PR where we need to have one common file for doing the three API calls which can be used by both backfill and forward indexing needs to be addressed. Not sure why you havent already done that yet. It should take a few hours to do at the most.

#802 (comment)

Comment thread tools/indexer/cmd/start.go Outdated
Comment thread tools/indexer/cmd/start.go Outdated

for _, bid := range bids {

logger.Info("[BIDS] processing bids for block", "block", ei.BlockNumber, "slot", ei.Slot)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand why we are still using this [KEY] format in the logs. I have already given comments about this multiple times in the previous PR also. This is not needed. This doesnt help when you are parsing logs. It might be confusing to someone who is new to the codebase. We should be uniform all across. I would suggest remove all the log messages with this type of string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've removed it now, thanks for the same.

Comment thread tools/indexer/cmd/main.go
Value: 15 * time.Second,
})

optionRelayFlag = altsrc.NewBoolFlag(&cli.BoolFlag{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is relay mode is supposed to mean. This flag is to specify whether we are collecting the bids from relay right? Relay mode is too generalized and confusing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've changed it to RelayData, is that fine?

Rose Jethani added 2 commits October 17, 2025 18:03
@rose2221
Copy link
Copy Markdown
Contributor Author

Also the comment from the previous PR where we need to have one common file for doing the three API calls which can be used by both backfill and forward indexing needs to be addressed. Not sure why you havent already done that yet. It should take a few hours to do at the most.

#802 (comment)

i've created a new package ingest to address this.

@rose2221
Copy link
Copy Markdown
Contributor Author

I’ve updated the PR to modify the backfill logic, it now fetches beacon data from the Rated API (which supports batching) and retrieves validator information from the QuickNode API.

rows = append(rows, row)
}
}
if len(rows) > 0 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually how many rows does this return?

I think maybe it could be better if you have one channel where all these go routines would write the BidRows' and then the batch update happens only once in the end once all goroutines are finished. But not sure how much of a performance gain this would give.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, it depends for each relay per slot, it’s around 30–40 bids. I’ve also added flags to make the number of relays configurable, so if I batch process them, it could lead to higher memory usage. For example, if there are around 5 relays, that would mean roughly 150–200 bids in total. I can implement batching if needed, but since the bids data is optional and the flag for it defaults to false, I don’t think there would be a significant performance gain. What do you think?

@@ -1,21 +1,40 @@
package config
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont really think a separate pkg is needed for this. I dont mind having this but it seems unnecessary just to have a struct definition and default values in separate pkg

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, the config struct is being used across multiple packages and moving it elsewhere would cause circular imports. I could move it to the database package itself doesn’t import anything from config, but conceptually it doesn’t really fit the config isn’t specific to database logic. I could move it there, but in few parts of the repo it has been to keep a separate file:- for example: validators-monitor/config/config.go I don’t have a strong preference, though moving it could improve readability a bit if you think that’s cleaner. What do you think?
.

@rose2221 rose2221 requested a review from aloknerurkar October 22, 2025 12:20
@rose2221 rose2221 merged commit 50364fc into main Oct 22, 2025
4 of 5 checks passed
@rose2221 rose2221 deleted the feat/relay_cli branch October 22, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants