Skip to content

Commit

Permalink
docs: changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Dec 13, 2024
1 parent 299720f commit ba60cc4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ The following emojis are used to highlight certain changes:

### Added

- `bitswap/client/messagequeue`: Expose `DontHaveTimeoutConfig` to hold configuration values for dontHaveTimeoutMgr
- Provide function DefaultDontHaveTimeoutConfig to return a DontHaveTimeoutConfig populated with default values
- Bitswap client New has new option for caller to supply a DontHaveTimeoutConfig
- If the required onHaveTimeout function is nil, then disable the dontaHaveTimeoutMgr
- `bitswap/client`: Improved timeout configuration for block requests
- Exposed `DontHaveTimeoutConfig` to hold configuration values for `dontHaveTimeoutMgr` which controls how long to wait for requested block, and if timeout should emit a synthetic DontHave response
- Added `DefaultDontHaveTimeoutConfig()` to return a `DontHaveTimeoutConfig` populated with default values
- Added optional `WithDontHaveTimeoutConfig` to allow passing a custom `DontHaveTimeoutConfig`
- If `DontHaveTimeoutConfig.onDontHaveTimeout` is `nil`, then `dontaHaveTimeoutMgr` is disabled and synthetic DontHave won't be emitted on timeout

### Changed

Expand Down
10 changes: 9 additions & 1 deletion bitswap/client/internal/messagequeue/donthavetimeoutmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,39 @@ import (
)

type DontHaveTimeoutConfig struct {
// OnDontHaveTimeout is the function called when DontHaveTimeout hits.
OnDontHaveTimeout func([]cid.Cid)

// DontHaveTimeout is used to simulate a DONT_HAVE when communicating with
// a peer whose Bitswap client doesn't support the DONT_HAVE response,
// or when the peer takes too long to respond.
// If the peer doesn't respond to a want-block within the timeout, the
// local node assumes that the peer doesn't have the block.
DontHaveTimeout time.Duration

// MaxExpectedWantProcessTime is the maximum amount of time we expect a
// peer takes to process a want and initiate sending a response to us
MaxExpectedWantProcessTime time.Duration
// maxTimeout is the maximum allowed timeout, regardless of latency

// MaxTimeout is the maximum allowed timeout, regardless of latency
MaxTimeout time.Duration

// PingLatencyMultiplier is multiplied by the average ping time to
// get an upper bound on how long we expect to wait for a peer's response
// to arrive
PingLatencyMultiplier int

// MessageLatencyAlpha is the alpha supplied to the message latency EWMA
MessageLatencyAlpha float64

// MessageLatencyMultiplier gives a margin for error. The timeout is calculated as
// MessageLatencyMultiplier * message latency
MessageLatencyMultiplier int

// timeoutsSignal used for testing -- caller-provided channel to signals
// when a dont have timeout was triggered.
timeoutsSignal chan<- struct{}

// clock is a mockable time api used for testing.
clock clock.Clock
}
Expand Down

0 comments on commit ba60cc4

Please sign in to comment.