-
Notifications
You must be signed in to change notification settings - Fork 112
p2p/protocols, p2p/testing; conditional propagation of context #1648
Conversation
bafb94c
to
2045ee2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zelig there's no test coverage to make sure that this exchange goes smoothly between nodes which are differently configured. are you sure this is the way you'd like to proceed with this?
786796d
to
3bbdca3
Compare
thanks. |
2045ee2
to
b8b6b9a
Compare
p2p/protocols/protocol.go
Outdated
@@ -157,6 +146,10 @@ type Spec struct { | |||
initOnce sync.Once | |||
codes map[reflect.Type]uint64 | |||
types map[uint64]reflect.Type | |||
|
|||
// if the protocol allows for extending the p2p msg to propagate context | |||
// even if set to true context will propagate only if the remote peer supports it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment looks to be right if the property would be called EnableContext
. I would suggest to adjust the comment or rename DisableContext
to EnableContext
b8b6b9a
to
c0de2b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation is very nice. I do not see that previous one had explicit tests, maybe we could add some later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM.
* 'master' of github.com:ethersphere/swarm: chunk, storage: chunk.Store multiple chunk Put (ethersphere#1681) storage: fix pyramid chunker and hasherstore possible deadlocks (ethersphere#1679) pss: Use distance to determine single guaranteed recipient (ethersphere#1672) storage: fix possible hasherstore deadlock on waitC channel (ethersphere#1674) network: Add adaptive capabilities message (ethersphere#1619) p2p/protocols, p2p/testing; conditional propagation of context (ethersphere#1648) api/http: remove unnecessary conversion (ethersphere#1673) storage: fix LazyChunkReader.join potential deadlock (ethersphere#1670) HTTP API support for pinning contents (ethersphere#1658) pot: Add Distance methods with tests (ethersphere#1621) README.md: Update Vendored Dependencies section (ethersphere#1667) network, p2p, vendor: move vendored p2p/testing under swarm (ethersphere#1647) build, vendor: use go modules for vendoring (ethersphere#1532)
This PR refactors the code related to context propagation within
p2p/protocols
.The propagation of context is made conditional on a new
protocols.Spec
fieldDisableContext
in addition totracing.Enabled
. This allows for disabling context propagation for specific protocols only.Fixes #1575