Skip to content

Commit d970f91

Browse files
committed
Reduce noisy tendermint logs (#163)
* Reduce noisy tendermint logs * Suppress logs for all entering Use peermanager scores for blocksync peers and don't error out on block mismatch (#162) * Use peermanager scores for blocksync peers * Add debug * Randomize * debug * use state to filter * debug * debug * debug * debug * add comments * don't err * revert timeout * Add missing param * Remove flaky test * fix nil * debug * debug * debug * debug --------- Co-authored-by: Yiming Zang <50607998+yzang2019@users.noreply.github.com> Perf: Increase buffer size for pubsub server to boost performance (#167) * Increase buffer size for pubsub server * Add more timeout for test failure * Add more timeout * Fix test split scripts * Fix test split * Fix unit test * Unit test * Unit test [P2P] Optimize block pool requester retry and peer pick up logic (#170) * P2P Improvements: Fix block sync reactor and block pool retry logic Fix block sync auto restart not working as expected (#175) Fix edge case for blocksync (#178) Replay events during restart to avoid tx missing (#211) Add a new config to speed up block sync (#244) * Never switch to consensus due to timeout * Add blocksync peer config to speed up block sync rate * Fix config parsing * Add some logs feat: Exclude unconditional peers when connection limit checking (#245) Improve Peer Score Algorithm (#248) * feat: improve peer scoring algo * debug * debug * more debug * debug TryDiaNext * remove log * fix score type * rever block sync logic * rever block sync logic * rever block sync logic * Add block request log * Add apply block latency * add processEpeerEvent log back * update unit test * update unit test --------- Co-authored-by: yzang2019 <zymfrank@gmail.com>
1 parent ebd8ff2 commit d970f91

23 files changed

+598
-475
lines changed

.github/workflows/tests.yml

+77-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,80 @@ jobs:
3131
- name: Run Go Tests
3232
run: |
3333
NUM_SPLIT=20
34-
make test-group-${{matrix.part}} NUM_SPLIT=20
35-
if: env.GIT_DIFF
34+
make split-test-packages
35+
make test-group-${{matrix.part}}
36+
37+
- name: Upload coverage artifact
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
41+
path: ./${{ matrix.part }}.profile.out
42+
43+
upload-coverage-report:
44+
needs: tests
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-go@v3
49+
with:
50+
go-version: 1.19
51+
52+
# Download all coverage reports from the 'tests' job
53+
- name: Download coverage reports
54+
uses: actions/download-artifact@v3
55+
56+
- name: Set GOPATH
57+
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
58+
59+
- name: Add GOPATH/bin to PATH
60+
run: echo "GOBIN=$(go env GOPATH)/bin" >> $GITHUB_ENV
61+
62+
- name: Install gocovmerge
63+
run: go get github.com/wadey/gocovmerge && go install github.com/wadey/gocovmerge
64+
65+
- name: Merge coverage reports
66+
run: gocovmerge $(find . -type f -name '*profile.out') > coverage.txt
67+
68+
- name: Check coverage report lines
69+
run: wc -l coverage.txt
70+
continue-on-error: true
71+
72+
- name: Check coverage report files
73+
run: ls **/*profile.out
74+
continue-on-error: true
75+
76+
# Now we upload the merged report to Codecov
77+
- name: Upload coverage to Codecov
78+
uses: codecov/codecov-action@v3
79+
with:
80+
file: ./coverage.txt
81+
token: ${{ secrets.CODECOV_TOKEN }}
82+
fail_ci_if_error: true
83+
84+
unit-test-check:
85+
name: Unit Test Check
86+
runs-on: ubuntu-latest
87+
needs: tests
88+
if: always()
89+
steps:
90+
- name: Get workflow conclusion
91+
id: workflow_conclusion
92+
uses: nick-fields/retry@v2
93+
with:
94+
max_attempts: 2
95+
retry_on: error
96+
timeout_seconds: 60
97+
command: |
98+
jobs=$(curl https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs)
99+
job_statuses=$(echo "$jobs" | jq -r '.jobs[] | .conclusion')
100+
101+
for status in $job_statuses
102+
do
103+
echo "Status: $status"
104+
if [[ "$status" == "failure" ]]; then
105+
echo "Some or all tests have failed!"
106+
exit 1
107+
fi
108+
done
109+
110+
echo "All tests have passed!"

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,6 @@ $(BUILDDIR)/packages.txt:$(GO_TEST_FILES) $(BUILDDIR)
345345
go list -f "{{ if (or .TestGoFiles .XTestGoFiles) }}{{ .ImportPath }}{{ end }}" ./... | sort > $@
346346

347347
split-test-packages:$(BUILDDIR)/packages.txt
348-
split -d -n l/$(NUM_SPLIT) $< $<.
348+
split -d -l $(NUM_SPLIT) $< $<.
349349
test-group-%:split-test-packages
350-
cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=10m -race -coverprofile=$(BUILDDIR)/$*.profile.out
350+
cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=15m -race -covermode=atomic -coverprofile=$*.profile.out

config/config.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,9 @@ type P2PConfig struct { //nolint: maligned
629629
// Comma separated list of nodes to keep persistent connections to
630630
PersistentPeers string `mapstructure:"persistent-peers"`
631631

632+
// Comma separated list of nodes for block sync only
633+
BlockSyncPeers string `mapstructure:"blocksync-peers"`
634+
632635
// UPNP port forwarding
633636
UPNP bool `mapstructure:"upnp"`
634637

@@ -698,7 +701,7 @@ func DefaultP2PConfig() *P2PConfig {
698701
RecvRate: 5120000, // 5 mB/s
699702
PexReactor: true,
700703
AllowDuplicateIP: false,
701-
HandshakeTimeout: 20 * time.Second,
704+
HandshakeTimeout: 5 * time.Second,
702705
DialTimeout: 3 * time.Second,
703706
TestDialFail: false,
704707
QueueType: "simple-priority",
@@ -1363,9 +1366,9 @@ func DefaultSelfRemediationConfig() *SelfRemediationConfig {
13631366
P2pNoPeersRestarWindowSeconds: 0,
13641367
StatesyncNoPeersRestartWindowSeconds: 0,
13651368
BlocksBehindThreshold: 0,
1366-
BlocksBehindCheckIntervalSeconds: 30,
1369+
BlocksBehindCheckIntervalSeconds: 60,
13671370
// 30 minutes
1368-
RestartCooldownSeconds: 1800,
1371+
RestartCooldownSeconds: 600,
13691372
}
13701373
}
13711374

config/toml.go

+3
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ bootstrap-peers = "{{ .P2P.BootstrapPeers }}"
303303
# Comma separated list of nodes to keep persistent connections to
304304
persistent-peers = "{{ .P2P.PersistentPeers }}"
305305
306+
# Comma separated list of nodes for block sync only
307+
blocksync-peers = "{{ .P2P.BlockSyncPeers }}"
308+
306309
# UPNP port forwarding
307310
upnp = {{ .P2P.UPNP }}
308311

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/tendermint/tendermint
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/BurntSushi/toml v1.1.0

0 commit comments

Comments
 (0)