forked from dydxprotocol/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experimental mempool: Backport cometbft#1558 and cometbft#1584 to 0.3…
…4.x (cometbft#1630) * Backports cometbft#1558 and cometbft#1584 to 0.37.x (cometbft#1611) Backports cometbft#1558 and cometbft#1584 to 0.38.x (cometbft#1592) * mempool: Limit gossip connections to persistent and non-persistent peers (experimental) (cometbft#1584) * Experimental - Reduce # of connections effectively used to gossip transactions out (cometbft#1558) * maxpeers for mempool * mempool: fix max_peers bcast routine active flag * Use semaphore to limit concurrency * Rename MaxPeers to MaxOutboundPeers * Add max_outbound_peers to config toml template * Rename in error message * Renams the parameter to highlight its experimental nature. Extend the AddPeer method to return an error. Moves the semaphone to outside the broadcast routine * reverting the addition of error to AddPeer. It fails if the context is done and handling this case will be done some other time, when an actual context is passed into acquire. * reverting the addition of error to AddPeer. It fails if the context is done and handling this case will be done some other time, when an actual context is passed into acquire. * Fixing lint issue * renaming semaphore to something more meaningful * make default value 0, which is the same as the current behavior. 10 is the recommended value. * adding new flag to manifest.go * Adding changelog * Improve the description of the parameter in the generated config file. * Add metric to track the current number of active connections. * Change metric to gauge type and rename it. * e2e: Allow disabling the PEX reactor on all nodes in the testnet * Apply suggestions from code review * Update config/config.go comment * fix lint error * Improve config description * Rename metric (remove experimental prefix) * Add unit test * Improve unit test * Update mempool/reactor.go comment --------- * Updating test file, leaving it broken for now * mempool: Limit gossip connections to persistent and non-persistent peers (experimental) (cometbft#1584) * Ignore persistent peers from limiting of outbound connections * Update 1558-experimental-gossip-limiting.md Update changeling * Fix typo in mempool/metrics.go * Use two independent configs and semaphores for persistent and non-persistent peers * Forgot to rename in test * Update metric description * Rename semaphores * Add comment to unit test --------- * Reverting to old way of reporting errors * Reverting change that shouldn't have been included in cherry-pick * Reverting tests to use older functions * fix rebase merge --------- Co-authored-by: Adi Seredinschi <adizere@gmail.com> Co-authored-by: Ethan Buchman <ethan@coinculture.info> Co-authored-by: Daniel Cason <daniel.cason@informal.systems> Co-authored-by: hvanz <hernan.vanzetto@gmail.com> Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Sergio Mena <sergio@informal.systems> * Comment that feature only applies to v0 mempool * Fix new metric * This commit makes the test be the same as in main, that is, it ignores the order of transactions in the receiving reactor. (cometbft#1629) * Update .changelog/unreleased/improvements/1558-experimental-gossip-limiting.md Co-authored-by: Thane Thomson <connect@thanethomson.com> --------- Co-authored-by: Adi Seredinschi <adizere@gmail.com> Co-authored-by: Ethan Buchman <ethan@coinculture.info> Co-authored-by: Daniel Cason <daniel.cason@informal.systems> Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: lasaro <lasaro@informal.systems> Co-authored-by: Thane Thomson <connect@thanethomson.com>
- Loading branch information
1 parent
65f7a2f
commit 6ef19db
Showing
12 changed files
with
165 additions
and
17 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
.changelog/unreleased/improvements/1558-experimental-gossip-limiting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- `[mempool]` Add experimental feature to limit the number of persistent peers and non-persistent | ||
peers to which the node gossip transactions (only for "v0" mempool). | ||
([\#1558](https://github.com/cometbft/cometbft/pull/1558), | ||
([\#1584](https://github.com/cometbft/cometbft/pull/1584)) | ||
- `[config]` Add mempool parameters `experimental_max_gossip_connections_to_persistent_peers` and | ||
`experimental_max_gossip_connections_to_non_persistent_peers` for limiting the number of peers to | ||
which the node gossip transactions. | ||
([\#1558](https://github.com/cometbft/cometbft/pull/1558)) | ||
([\#1584](https://github.com/cometbft/cometbft/pull/1584)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters