Conversation
f8bae31 to
9ec56fd
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1676 +/- ##
===========================================
- Coverage 62.13% 62.09% -0.04%
===========================================
Files 121 121
Lines 11094 11120 +26
===========================================
+ Hits 6893 6905 +12
- Misses 3583 3597 +14
Partials 618 618
|
9ec56fd to
c749e3f
Compare
| "github.com/tendermint/tmlibs/log" | ||
|
|
||
| cfg "github.com/tendermint/tendermint/config" | ||
| "github.com/tendermint/tendermint/config" |
There was a problem hiding this comment.
third change of this sort on my memory. we should make a standard and stick with it
There was a problem hiding this comment.
I made it consistent inside of p2p in the follow-up PR which comes right after this one is through.
|
|
||
| func (sw *Switch) addInboundPeerWithConfig(conn net.Conn, config *PeerConfig) error { | ||
| func (sw *Switch) addInboundPeerWithConfig( | ||
| conn net.Conn, |
There was a problem hiding this comment.
Is this the result of default formatter? or you manually splitting the line
There was a problem hiding this comment.
This is how arguments are split when ranged over multiple lines.
| sw.peerConfig.MConfig.SendRate = config.SendRate | ||
| sw.peerConfig.MConfig.RecvRate = config.RecvRate | ||
| sw.peerConfig.MConfig.MaxPacketMsgPayloadSize = config.MaxPacketMsgPayloadSize | ||
| sw.config.MConfig.FlushThrottle = time.Duration(cfg.FlushThrottleTimeout) * time.Millisecond |
There was a problem hiding this comment.
I thought the whole idea was to get rid of this block after merge.
There was a problem hiding this comment.
Coming next, I first wanted to collapse configs and in the next step get rid of the config dependency completey.
There was a problem hiding this comment.
It will another 2-3 distinct PRs, I want to avoid massive changesets for this.
| // DefaultMConnConfig returns the default config. | ||
| func DefaultMConnConfig() *MConnConfig { | ||
| return &MConnConfig{ | ||
| func DefaultMConnConfig() MConnConfig { |
There was a problem hiding this comment.
all our Default..Config functions return pointers. Maybe we should be consistent
There was a problem hiding this comment.
Using pointers turned out to be racy, in general I would challenge that those should be mutable. Having them non-pointers would communicate that better. On other other hand we can always dereference them where they are consumed.
| // Peer connection configuration. | ||
| HandshakeTimeout time.Duration `mapstructure:"handshake_timeout"` | ||
| DialTimeout time.Duration `mapstructure:"dial_timeout"` | ||
| MConfig tmconn.MConnConfig `mapstructure:"connection"` |
There was a problem hiding this comment.
should this be a pointer too?
There was a problem hiding this comment.
Same point as above, it shouldn't be mutated.
63b2e98 to
ea89686
Compare
As both configs are concerned with the p2p packaage and PeerConfig is only used inside of the package there is no good reason to keep the couple of fields separate, therefore it is collapsed into the more general P2PConifg. This is a stepping stone towards a setup where the components inside of p2p do not have any knowledge about the config. follow-up to #1325
| p.Logger.Debug( | ||
| "Unknown channel for peer", | ||
| "channel", | ||
| chID, |
There was a problem hiding this comment.
we should keep the pairs on a single line
There was a problem hiding this comment.
Will include in the next one.
|
|
||
| func createSwitchAndAddReactors(reactors ...p2p.Reactor) *p2p.Switch { | ||
| sw := p2p.MakeSwitch(config, 0, "127.0.0.1", "123.123.123", func(i int, sw *p2p.Switch) *p2p.Switch { return sw }) | ||
| sw := p2p.MakeSwitch(cfg, 0, "127.0.0.1", "123.123.123", func(i int, sw *p2p.Switch) *p2p.Switch { return sw }) |
There was a problem hiding this comment.
maybe it would be better to make it more explicit by calling it testCfg or something ?
There was a problem hiding this comment.
That it is global state is already a smell, it's gonna vanish when all the config traces are gone from the package.
…#1676) * Revert "ADR 109: Modularize test infra (tendermint#1488)" This reverts commit e4a82ef64128786e1e2ec3a5d60a3be3a48918d9. Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove part of ADR 109 that deals with modularization of E2E test infra Signed-off-by: Thane Thomson <connect@thanethomson.com> * Mark ADR 109 as accepted Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add tracking issue to ADR 109 Signed-off-by: Thane Thomson <connect@thanethomson.com> --------- Signed-off-by: Thane Thomson <connect@thanethomson.com>
As both configs are concerned with the p2p packaage and PeerConfig is only used inside of the package there is no good reason to keep the couple of fields separate, therefore it is collapsed into the more general P2PConifg. This is a stepping stone towards a setup where the components inside of p2p do not have any knowledge about the config.
follow-up to #1325