Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor improvements: logging, comments, locks #726

Merged
merged 127 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
8fc733f
feat: socket client uses pririority queue to determine processing order
lklimek Jan 8, 2024
7311bde
chore(consensus): add timing debug to makeProposal
lklimek Jan 8, 2024
4ef1833
build: update go.mod/go.sum
lklimek Jan 8, 2024
ea83b4f
chore: socket client debug
lklimek Jan 10, 2024
98025f6
chore: change abci client priorities
lklimek Jan 11, 2024
0bbe9bd
feat: abci client prometheus support
lklimek Jan 11, 2024
91aa568
fix(e2e): panic when no key provided in e2e test
lklimek Jan 11, 2024
0568723
chore: fix typo
lklimek Jan 11, 2024
73f5c57
chore: add missing NoopCloser
lklimek Jan 11, 2024
e86d67b
chore: abciclient metrics
lklimek Jan 11, 2024
f61dfd5
chore: abci metrics remove SentMessagesTotal which is a duplicate
lklimek Jan 11, 2024
ff8c2f3
refactor!: remove consensus params commit timeout
lklimek Jan 11, 2024
b9c498a
chore: remove unused consensus params - backward-compat way
lklimek Jan 11, 2024
1eefd46
chore: proto abci version revert
lklimek Jan 11, 2024
5e41958
feat(p2p): throttled channel
lklimek Jan 11, 2024
cdde233
feat: limit mempool broadcast to 5/s
lklimek Jan 11, 2024
f356737
refactor(p2p): move chan descs to p2p.channel_params and tune priorities
lklimek Jan 12, 2024
6a142e7
feat: detect non-deterministic ResponsePrepareProposal
lklimek Jan 12, 2024
1f0e9d9
chore: decrease log size
lklimek Jan 12, 2024
5b2a393
chore: more debug
lklimek Jan 12, 2024
6be0eaa
fix(consensus): propose locked block when it is available
lklimek Jan 12, 2024
f75ae58
chore: improve logs
lklimek Jan 15, 2024
51317c5
fix(consensus): ValidBlock must be equal LockedBlock
lklimek Jan 15, 2024
07beb3f
fix(consensus): publish valid block event if it's updated
lklimek Jan 15, 2024
cc457a6
chore: improve log readability
lklimek Jan 15, 2024
b0224ef
chore: log num txs of complete proposal block
lklimek Jan 15, 2024
2109237
chore(mempool): log when txs are processed
lklimek Jan 15, 2024
80f3c9c
chore(mempool): add timeout of checktx for p2p messages
lklimek Jan 15, 2024
66186bd
chore(p2p): remove unneeded stopMtx from MConnection
lklimek Jan 15, 2024
23cb8c6
chore(p2p): further debugging
lklimek Jan 15, 2024
c39ef2c
revert: remove checktx timeout as it needs more careful error handling
lklimek Jan 15, 2024
052af38
feat(abciclient): expire checktx abci calls on messages from p2p
lklimek Jan 16, 2024
ed4c661
feat: socket client prio queue improved
lklimek Jan 16, 2024
cefd014
test: socket client priority queue
lklimek Jan 16, 2024
96d9aa3
chore(mempool): p2p checktx timeout 1s
lklimek Jan 16, 2024
68a9a7a
chore(rpc): broadcasttx timeout 1s
lklimek Jan 16, 2024
1769d2e
chore(kvstore): check ctx.Err in handlers for testing
lklimek Jan 16, 2024
06dd3ce
chore(mempool,rpc): checktx timeout 1s using const
lklimek Jan 16, 2024
f6f934e
fix(consensus): proposed block validity conditions
lklimek Jan 16, 2024
e2bc0b7
chore(mempool): send rate limits
lklimek Jan 16, 2024
5c08a9c
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Jan 30, 2024
92e634f
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Feb 2, 2024
f336485
chore: fix after merge
lklimek Feb 2, 2024
e0c447c
chore: incoming mempool channel size eq to mempool size
lklimek Feb 2, 2024
cfa50c2
feat: timeout when trying to enqueue incoming mempool messages
lklimek Feb 2, 2024
27caa0a
chore: disable rate limits on mempool
lklimek Feb 2, 2024
310ad0b
chore: fix panic
lklimek Feb 2, 2024
bc991ff
chore: increase enqueue timeout to 10ms
lklimek Feb 2, 2024
3bba22f
chore: improve error desc
lklimek Feb 2, 2024
11791dc
chore: improve logging
lklimek Feb 2, 2024
4a0c564
chore(consensus): a bit better logging
lklimek Feb 5, 2024
3cac6e5
refactor: remove unused LastPrecommits
lklimek Feb 6, 2024
854b145
chore: minor fix of multierror
lklimek Feb 12, 2024
a7c7a44
chore(mempool): change locking of addNewTransaction
lklimek Feb 12, 2024
5c59e34
fix(p2p): EnqueueTimeout breaks unrelated channels
lklimek Feb 12, 2024
1065a66
refactor(mempool): relaxed locking of mempool addNewTransaction
lklimek Feb 12, 2024
b42b653
fix: wrong condition
lklimek Feb 12, 2024
5a05e1d
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Feb 12, 2024
5a27b68
Merge branch 'feat/relaxed-mempool-locking' into fix-mempool-spam
lklimek Feb 12, 2024
e2718ef
chore: fix condition again
lklimek Feb 12, 2024
8101f0c
Merge branch 'feat/relaxed-mempool-locking' into fix-mempool-spam
lklimek Feb 12, 2024
63743b6
fix(rpc): broadcastasync is broken due to invalid ctx cancellation
lklimek Feb 12, 2024
e75aeb2
chore(p2p): more logging of disconnect errors
lklimek Feb 13, 2024
03aa814
refactor(p2p): refactor routePeer and mConn shutdown
lklimek Feb 13, 2024
c90576e
chore(p2p): drait EnqueueTimeout chan safely
lklimek Feb 13, 2024
feeae96
fix(mempool): mempool size not decreased on RemoveTxByKey
lklimek Feb 13, 2024
5bf16e2
refactor(mempool): use tmsync.Waker for available txs notifications
lklimek Feb 14, 2024
1870ef9
fix(mempool): mark tx as delivered after it's sent
lklimek Feb 14, 2024
718339a
fix(p2p): peerManager.Disconnected context expires too soon
lklimek Feb 14, 2024
3a37576
doc(config): improve mempool.cache-size docs
lklimek Feb 14, 2024
eb3b0bb
Revert "fix(mempool): mark tx as delivered after it's sent"
lklimek Feb 14, 2024
7f254b9
chore: mempool channel rate limit to 5/sec
lklimek Feb 14, 2024
1d5f72f
chore(mempool): add some TODOs
lklimek Feb 14, 2024
52c6983
test(abciclient): test parallel execution of grpc abci client and server
lklimek Feb 15, 2024
c77d710
chore(mempool): remove unnecessary tx hash calculation
lklimek Feb 15, 2024
e843216
fix(mempool): cancel previous mempool run when starting new one
lklimek Feb 15, 2024
f7f7ce7
feat(p2p): channel recv rate limiting - not tested
lklimek Feb 16, 2024
38f9b36
chore: regenerate mocks
lklimek Feb 16, 2024
623706e
fix(mempool): panic due to uninitialized txsAvailable
lklimek Feb 16, 2024
54e00f7
feat(p2p): channel recv rate limiting - continued
lklimek Feb 16, 2024
0d1c114
chore: improve logging
lklimek Feb 21, 2024
a3c9635
chore: don't use go-deadlock in clist due to performance issues
lklimek Feb 23, 2024
50a8283
chore: increase log level to info for "sleeping" message
lklimek Feb 27, 2024
2aa6d6d
test(consensus): minor improvements to TestEmitNewValidBlockEventOnCo…
lklimek Mar 5, 2024
62ca27a
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 5, 2024
0c53728
chore(abciclient): fixes after merge
lklimek Mar 5, 2024
229c387
Squashed commit of the following:
lklimek Mar 5, 2024
ae74ce4
Revert "feat: socket client uses pririority queue to determine proces…
lklimek Mar 6, 2024
3c48f75
Revert "feat: abci client prometheus support"
lklimek Mar 6, 2024
8da9d89
Revert "feat: socket client prio queue improved"
lklimek Mar 6, 2024
20d767f
chore: revert priority queue - manual fixes
lklimek Mar 6, 2024
5995351
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 6, 2024
54f7951
test(e2e): increase TestApp_TxTooBig timeout to 2 mins
lklimek Mar 6, 2024
ca0b50f
chore: fix linter warnings
lklimek Mar 6, 2024
787ea9c
chore: fix linter warnings
lklimek Mar 6, 2024
40d36b1
chore: fix linter warnings
lklimek Mar 6, 2024
bb54a2f
Merge branch 'chore/fix-linter' into fix-mempool-spam
lklimek Mar 6, 2024
3cd0919
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 7, 2024
0aa9937
feat(p2p): throttled channel
lklimek Jan 11, 2024
dfab3a4
feat: limit mempool broadcast to 5/s
lklimek Jan 11, 2024
c06656c
feat(p2p): channel recv rate limiting - not tested
lklimek Feb 16, 2024
73286e9
feat(p2p): channel recv rate limiting - continued
lklimek Feb 16, 2024
c128637
chore(p2p): regen channel mocks
lklimek Mar 8, 2024
5ffb024
feat(config): mempool tx-send-rate-limit, tx-recv-rate-limit, tx-recv…
lklimek Mar 8, 2024
aa82ab9
chore: lint
lklimek Mar 8, 2024
7fef019
chore(mempool): burst recv twice as big as burst send
lklimek Mar 8, 2024
1c1631b
chore: lint
lklimek Mar 8, 2024
7d6aba7
chore: remove not needed log
lklimek Mar 8, 2024
9d537f0
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 12, 2024
ae5d8a6
chore: fix after merge
lklimek Mar 12, 2024
50dfc1c
Merge remote-tracking branch 'origin/v0.14-dev' into feat/rate-limiti…
lklimek Mar 12, 2024
e75088d
chore: fixes after merge
lklimek Mar 12, 2024
f7e507d
revert(kvstore): kvstore ctx.Done() checks are not needed
lklimek Mar 12, 2024
d2bf391
refactor(p2p): move chan descs to p2p.channel_params and tune priorities
lklimek Jan 12, 2024
cc6bfde
chore: fix after merge
lklimek Mar 12, 2024
5a10b36
Merge branch 'refactor/move-channel-definitions' into fix-mempool-spam
lklimek Mar 12, 2024
33f54c2
chore(p2p): remove some logs
lklimek Mar 12, 2024
9e5cf6c
chore(statesync): fix linter issues - remove unused consts
lklimek Mar 12, 2024
a90f1b1
Merge branch 'refactor/move-channel-definitions' into fix-mempool-spam
lklimek Mar 12, 2024
5b44f5a
chore: self-review
lklimek Mar 12, 2024
3749b9d
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 12, 2024
5fb90a7
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 13, 2024
39dedb6
chore: fix linter issues
lklimek Mar 13, 2024
4a4e28b
Merge remote-tracking branch 'origin/v0.14-dev' into fix-mempool-spam
lklimek Mar 13, 2024
8e527cd
chore: lint
lklimek Mar 13, 2024
2fb9bf7
fix(sync): race condition in ConcurrentSlice debug
lklimek Mar 13, 2024
9eeddf9
fix(consensus): invalid block height gossiped to lagging peer
lklimek Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ type MempoolConfig struct {
MaxTxsBytes int64 `mapstructure:"max-txs-bytes"`

// Size of the cache (used to filter transactions we saw earlier) in transactions
// Should be much bigger than mempool size.
CacheSize int `mapstructure:"cache-size"`

// Do not remove invalid transactions from the cache (default: false)
Expand Down
1 change: 1 addition & 0 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ size = {{ .Mempool.Size }}
max-txs-bytes = {{ .Mempool.MaxTxsBytes }}

# Size of the cache (used to filter transactions we saw earlier) in transactions
# Should be much bigger than mempool size.
cache-size = {{ .Mempool.CacheSize }}

# Do not remove invalid transactions from the cache (default: false)
Expand Down
20 changes: 11 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-kit/kit v0.12.0
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/protobuf v1.5.3
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/golangci/golangci-lint v1.55.2
github.com/google/btree v1.1.2 // indirect
github.com/google/gopacket v1.1.19
Expand Down Expand Up @@ -89,6 +89,7 @@ require (
github.com/go-pkgz/expirable-cache v0.0.3 // indirect
github.com/go-pkgz/rest v1.5.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
Expand All @@ -101,6 +102,7 @@ require (
github.com/nunnatsa/ginkgolinter v0.14.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
Expand All @@ -122,10 +124,10 @@ require (
github.com/Antonboom/errname v0.1.12 // indirect
github.com/Antonboom/nilnil v0.1.7 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/DataDog/zstd v1.4.1 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/alexkohler/prealloc v1.0.0 // indirect
github.com/alingse/asasalint v0.0.11 // indirect
Expand All @@ -140,7 +142,7 @@ require (
github.com/butuzov/ireturn v0.2.2 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
Expand Down Expand Up @@ -203,7 +205,7 @@ require (
github.com/julz/importas v0.1.0 // indirect
github.com/kisielk/errcheck v1.6.3 // indirect
github.com/kisielk/gotool v1.0.0 // indirect
github.com/klauspost/compress v1.15.10 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kulti/thelper v0.6.3 // indirect
github.com/kunwardeep/paralleltest v1.0.8 // indirect
Expand All @@ -217,7 +219,7 @@ require (
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
github.com/mgechev/revive v1.3.4 // indirect
Expand All @@ -236,7 +238,7 @@ require (
github.com/pkg/profile v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v1.4.5 // indirect
github.com/prometheus/client_model v0.2.0
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a
github.com/prometheus/common v0.37.0
github.com/prometheus/procfs v0.8.0 // indirect
github.com/quasilyte/go-ruleguard v0.4.0 // indirect
Expand Down Expand Up @@ -302,7 +304,7 @@ require (
github.com/jonboulle/clockwork v0.3.0
github.com/oasisprotocol/oasis-core/go v0.2202.5
github.com/sasha-s/go-deadlock v0.3.1
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/go-amino v0.16.0
github.com/tyler-smith/go-bip39 v1.1.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
Expand Down
36 changes: 22 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 h1:3ZBs7LAezy8gh0uECsA6CGU43FF3zsx5f4eah5FxTMA=
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0/go.mod h1:rZLTje5A9kFBe0pzhpe2TdhRniBF++PRHQuRpR8esVc=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
Expand Down Expand Up @@ -160,8 +161,9 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4=
github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ=
github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc=
Expand Down Expand Up @@ -397,11 +399,13 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM=
Expand Down Expand Up @@ -462,8 +466,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
Expand Down Expand Up @@ -565,8 +569,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8=
github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo=
github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -619,8 +623,9 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA=
github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
Expand Down Expand Up @@ -734,8 +739,9 @@ github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y=
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
Expand All @@ -757,6 +763,8 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs=
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
Expand Down Expand Up @@ -793,7 +801,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
Expand Down Expand Up @@ -852,8 +859,9 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk=
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8=
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk=
github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM=
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/block_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *blockExecutor) ensureProcess(ctx context.Context, rs *cstypes.RoundStat
block := rs.ProposalBlock
crs := rs.CurrentRoundState
if crs.Params.Source != sm.ProcessProposalSource || !crs.MatchesBlock(block.Header, round) {
c.logger.Debug("CurrentRoundState is outdated, executing ProcessProposal", "crs", crs)
c.logger.Trace("CurrentRoundState is outdated, executing ProcessProposal", "crs", crs)
uncommittedState, err := c.blockExec.ProcessProposal(ctx, block, round, c.committedState, true)
if err != nil {
return fmt.Errorf("ProcessProposal abci method: %w", err)
Expand Down
5 changes: 5 additions & 0 deletions internal/consensus/gossip_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ func shouldProposalBeGossiped(rs cstypes.RoundState, prs *cstypes.PeerRoundState
}

func shouldBlockPartsBeGossiped(rs cstypes.RoundState, prs *cstypes.PeerRoundState, isValidator bool) bool {
if rs.Height != prs.Height || rs.Round < prs.Round {
return false
}

if isValidator && rs.ProposalBlockParts.HasHeader(prs.ProposalBlockPartSetHeader) {
return true
}

return prs.HasCommit && rs.ProposalBlockParts != nil
}

Expand Down
4 changes: 3 additions & 1 deletion internal/consensus/peer_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type PeerState struct {
func NewPeerState(logger log.Logger, peerID types.NodeID) *PeerState {
return &PeerState{
peerID: peerID,
logger: logger,
logger: logger.With("peer", peerID),
PRS: cstypes.PeerRoundState{
Round: -1,
ProposalPOLRound: -1,
Expand Down Expand Up @@ -483,6 +483,8 @@ func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) {
ps.mtx.Lock()
defer ps.mtx.Unlock()

ps.logger.Trace("apply new round step message", "peer", ps.peerID, "msg", msg.String())

// ignore duplicates or decreases
if CompareHRS(msg.Height, msg.Round, msg.Step, ps.PRS.Height, ps.PRS.Round, ps.PRS.Step) <= 0 {
return
Expand Down
10 changes: 5 additions & 5 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,18 +723,18 @@ func (cs *State) handleTimeout(
ti timeoutInfo,
stateData *StateData,
) {
cs.logger.Trace("received tock", "timeout", ti.Duration, "height", ti.Height, "round", ti.Round, "step", ti.Step)

// timeouts must be for current height, round, step
if ti.Height != stateData.Height || ti.Round < stateData.Round || (ti.Round == stateData.Round && ti.Step < stateData.Step) {
cs.logger.Debug("ignoring tock because we are ahead",
"height", stateData.Height,
"round", stateData.Round,
"step", stateData.Step.String(),
cs.logger.Trace("ignoring tock because we are ahead",
"timeout", ti.Duration, "tock_height", ti.Height, "tock_round", ti.Round, "tock_step", ti.Step,
"height", stateData.Height, "round", stateData.Round, "step", stateData.Step.String(),
)
return
}

cs.logger.Trace("received tock", "timeout", ti.Duration, "height", ti.Height, "round", ti.Round, "step", ti.Step)

// the timeout will now cause a state transition
cs.mtx.Lock()
defer cs.mtx.Unlock()
Expand Down
1 change: 1 addition & 0 deletions internal/consensus/state_add_prop_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func (c *AddProposalBlockPartAction) addProposalBlockPart(
"proposal_height", stateData.ProposalBlock.Height,
"hash", stateData.ProposalBlock.Hash(),
"round_height", stateData.RoundState.GetHeight(),
"num_txs", len(stateData.ProposalBlock.Txs),
)

c.eventPublisher.PublishCompleteProposalEvent(stateData.CompleteProposalEvent())
Expand Down
Loading
Loading