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

Make relay request timeout configurable or at least limited. #689

Open screwyprof opened 1 week ago

screwyprof commented 1 week ago

At the moment when a request to relay is made the default context with no timeout is passed which means the request will block until the server replies.

Later on the wait group will block until all the go-routines are done.

If I get it correctly, if we have a faulty relay which doesn't respond quick enough, all the other request still will be waiting.

It would be better if we could set a request timeout for each relay request.

alextes commented 2 days ago

Not quite. On that same line you link a http client is passed. If you follow the code to where it is constructed you can see some default timeout is passed on it. Not the most obvious but the timeout is set 😄. In other words, by default mev boost only waits a certain time and then works with whatever replies made it in time, if any.

Different calls use different timeouts. If you'd want to control them you can see a short description of cli arguments that control the timeouts here: https://github.com/flashbots/mev-boost#mev-boost-cli-arguments