flashbots / rbuilder

rbuilder is a blazingly fast, state of the art Ethereum MEV-Boost block builder written in Rust
Apache License 2.0
186 stars 21 forks source link

feat: timeout txs that take more than 1ms to execute #26

Open bertmiller opened 2 weeks ago

bertmiller commented 2 weeks ago

Occasionally, because some precompiles are slow, there are transactions that take disproportionately long to execute (eg over 1ms). We should have a feature that allows us to time out these and drop them.

ryanschneider commented 2 weeks ago

We might want to consider using something other than wall time, I could see a pathological case where we discard all txs because of some noisy neighbor. Not sure if revm has some other metrics (besides gas) that we could consider instead.

Also, I had a related idea: instead of outright discarding the transaction, we could select! on the EVM async future and a timer, and if the timer is hit send the EVM future to a "low priority" channel that we continue to try to execute the transaction on until the next block.

Not sure if doing all that is worth the work though, but could be if these slow txs sometimes still yield value.