flashbots / mev-boost

MEV-Boost allows Ethereum validators to source high-MEV blocks from a competitive builder marketplace
https://boost.flashbots.net
MIT License
1.17k stars 208 forks source link

Add request start time metrics to request header field #647

Closed bhakiyakalimuthu closed 4 months ago

bhakiyakalimuthu commented 5 months ago

📝 Summary

This PR introduces the ability to add the request start time in Unix milliseconds and the start time into the slot to the request headers. This enhancement facilitates the measurement of latency between the validator and the relay.

⛱ Motivation and Context

By adding these time metrics into the headers, we can better analyze the causes of request delays, determining whether they are due to network latency or performance issues with the validator node.

✅ I have run these commands

bhakiyakalimuthu commented 5 months ago

This seems reasonable 👍 good idea.

Can we add back the deleted blank lines? This is just a nit.

Those lines were deleted for a reason. Linter was throwing error as below if the lines were not removed. server/service.go:295:1: Function name: handleGetHeader, Cyclomatic Complexity: 24, Halstead Volume: 5978.93, Maintainability Index: 19 (maintidx) func (m *BoostService) handleGetHeader(w http.ResponseWriter, req *http.Request) { ^ make: *** [lint] Error 1

avalonche commented 5 months ago

interesting that removing blank lines makes the linter think there is less complexity. the function probably needs refactoring

bhakiyakalimuthu commented 5 months ago

interesting that removing blank lines makes the linter think there is less complexity. the function probably needs refactoring

Hi @avalonche Is there anything else we need to address, or are we ready to merge this PR?