flashbots / suave-std

Collection of helpful smart contracts to build Suapps
The Unlicense
44 stars 13 forks source link

add timeout param to HttpRequest #97

Closed zeroXbrock closed 3 months ago

zeroXbrock commented 3 months ago

This should fix the most common cases of this error: context deadline exceeded (Client.Timeout exceeded while awaiting headers). When not present in the HttpRequest struct, suave-geth sets the default to 42ms, instead of interpreting the missing value as 0 and setting the default to 5 seconds, like it should. Adding the param to the HttpRequest struct correctly zeroes the value when it's undefined, so suave-geth can interpret the value correctly.