Skip to content

Commit

Permalink
lower minimum timeout and tie apprequest deadlines to the maximum tim…
Browse files Browse the repository at this point in the history
…eout
  • Loading branch information
iansuvak committed Jan 29, 2025
1 parent eeec832 commit 29829f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion peers/app_request_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (

const (
InboundMessageChannelSize = 1000
DefaultAppRequestTimeout = time.Second * 2
ValidatorRefreshPeriod = time.Second * 5
NumBootstrapNodes = 5
)
Expand Down
11 changes: 9 additions & 2 deletions peers/external_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import (

var _ router.ExternalHandler = &RelayerExternalHandler{}

const (
maximumNetworkTimeout = constants.DefaultNetworkMaximumTimeout

// Re-exposing DefaultAppRequestTimeout for use by message creators to set deadlines
DefaultAppRequestTimeout = maximumNetworkTimeout
)

// Note: all of the external handler's methods are called on peer goroutines. It
// is possible for multiple concurrent calls to happen with different NodeIDs.
// However, a given NodeID will only be performing one call at a time.
Expand All @@ -47,8 +54,8 @@ func NewRelayerExternalHandler(
// TODO: Leaving this static for now, but we may want to have this as a config option
cfg := timer.AdaptiveTimeoutConfig{
InitialTimeout: constants.DefaultNetworkInitialTimeout,
MinimumTimeout: constants.DefaultNetworkInitialTimeout,
MaximumTimeout: constants.DefaultNetworkMaximumTimeout,
MinimumTimeout: constants.DefaultNetworkMinimumTimeout,
MaximumTimeout: maximumNetworkTimeout,
TimeoutCoefficient: constants.DefaultNetworkTimeoutCoefficient,
TimeoutHalflife: constants.DefaultNetworkTimeoutHalflife,
}
Expand Down

0 comments on commit 29829f7

Please # to comment.