Closed otherview closed 1 month ago
Attention: Patch coverage is 43.51852%
with 61 lines
in your changes are missing coverage. Please review.
Project coverage is 61.91%. Comparing base (
aedfc6b
) to head (1115d76
). Report is 1 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
cmd/thor/utils.go | 0.00% | 29 Missing :warning: |
cmd/thor/p2p/p2p.go | 60.34% | 23 Missing :warning: |
p2psrv/server.go | 16.66% | 5 Missing :warning: |
cmd/thor/main.go | 0.00% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
Connected with https://github.com/vechain/protocol-board-repo/issues/165 . It was hard to follow the expected behaviour when combining (
allowed-peers
,bootnodes
, and stored cached peers). This was mainly due to the use of flag value retrieval, directory setup, and a few other operations being mixed with the flag operation behaviour. The PR decouples the setup of data and directories from the flag combination logic. It was also very hard to test. This PR does a bit of refactoring around thep2pcom
and makes it more testable. The logic now works as follows:fallbackbootnodes
and try to loadcachedPeers
, append these two.bootnodes
is set, ignorefallbackbootnodes
and try to loadcachedPeers
, append these two.allowedPeers
is set, ignorebootnodes
,fallbackbootnodes
andcachedPeers
.This PR also introduces a
test/datagen
package that makes it easier to generate randomized data.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: