forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(mempool): backport Lanes and DOG from upstream #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a24725d
feat(mempool)!: Add new `Contains` method to `Mempool` interface (#3659)
hvanz c48f0af
feat: add api to allow get unconfirmed_tx by hash (#3109)
mmsqe 875328a
fix(mempool): Update variables in `CListMempool` atomically (#3700)
hvanz 37226e3
squashed feature/mempool-qos into main
hvanz ecbb24f
docs(mempool/lanes): Update ADR with latest design changes (#4117)
hvanz f80606a
fix(test): Initialise all mempools with lane info from app (#4229)
hvanz d3d4fd6
test(mempool): Add benchmarks for blocking iterator (#4181)
hvanz 160761d
docs(mempool/lanes): Create guide for app developers (#4185)
hvanz 196cfb6
spec(mempool/dog): Add spec of Flood gossip protocol (#4476)
hvanz c2aafca
spec(mempool/dog): Add spec of DOG gossip protocol (#4477)
hvanz a1d4825
feat(mempool): Add new Dynamic Optimal Graph (DOG) gossip protocol (#…
hvanz 8c68b36
fix(mempool): Decreased the sleep in `TestDOGDisabledRoutes` (#4646)
jmalicevic b52e01c
fix(mempool/tests): Fixes flakiness in a test related to mempool lane…
jmalicevic 8ba4960
test(mempool): enhanced `TestReactorNoBroadcastToSender` (#4127)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/2803-mempool-NewCListMempool.md
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Add new parameter `lanesInfo *LanesInfo` to `NewCListMempool` | ||
| ([\#2803](https://github.com/cometbft/cometbft/issues/2803)) |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/2803-mempool-replace-iterator.md
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Removed `CListIterator`; use `BlockingIterator` instead | ||
| ([\#2803](https://github.com/cometbft/cometbft/issues/2803)). |
3 changes: 3 additions & 0 deletions
3
.changelog/v1.0.0/breaking-changes/2803-proto-mempool-lane.md
This file contains hidden or 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,3 @@ | ||
| - `[types/proto]` Extend `CheckTxResponse` with new `lane_id` field and `InfoResponse` with | ||
| `lane_priorities` and `default_lane` fields | ||
| ([#2803](https://github.com/cometbft/cometbft/issues/2803)) |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/2803-remove-TxsFront-TxsWaitChan.md
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Remove methods `TxsFront` and `TxsWaitChan` from `CListMempool`. They should be | ||
| replaced by the new iterators ([\#2803](https://github.com/cometbft/cometbft/issues/2803)). |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/3297-mempool-interface-senders.md
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Add new `GetSenders` method to `Mempool` interface, and `Senders` method to `Entry` | ||
| interface. ([#3297](https://github.com/cometbft/cometbft/issue/3297)). |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/3297-proto-mempool-message.md
This file contains hidden or 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,2 @@ | ||
| - `[proto]` Mempool proto version upgraded to `v2`. | ||
| ([#3297](https://github.com/cometbft/cometbft/issue/3297)). |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/3634-node-handshake-goapi.md
This file contains hidden or 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,2 @@ | ||
| - `[consensus/replay]` `Handshake` now takes an additional parameter of type `*abci.InfoResponse` as input | ||
| ([#3634](https://github.com/cometbft/cometbft/pull/3634)) |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/3659-mempool-add-contains-method.md
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Add a new `Contains` method to the `Mempool` interface. | ||
| ([\#3659](https://github.com/cometbft/cometbft/pull/3659)) |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/breaking-changes/3980-kvstore-new-application.md
This file contains hidden or 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,2 @@ | ||
| - `[kvstore]` Function `NewApplication` now has an extra `lanes map[string]uint32` parameter | ||
| ([\#3980](https://github.com/cometbft/cometbft/pull/3980)) |
3 changes: 3 additions & 0 deletions
3
.changelog/v1.0.0/bug-fixes/3694-mempool-update-variables-atomically.md
This file contains hidden or 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,3 @@ | ||
| - `[mempool]` Fix race condition when accessing entries by updating variables in | ||
| `CListMempool` atomically. | ||
| ([\#3694](https://github.com/cometbft/cometbft/issues/3694)) |
This file contains hidden or 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,4 @@ | ||
| - `[mempool/metrics]` Mark metrics `mempool_size` and `mempool_size_bytes` as | ||
| deprecated, as now they can be obtain, respectively, as the sum of | ||
| `mempool_lane_size` and `mempool_lane_bytes` | ||
| ([\#3506](https://github.com/cometbft/cometbft/issue/3506)). |
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Add Lanes to the mempool for providing Quality of Service guarantees | ||
| ([#2803](https://github.com/cometbft/cometbft/issues/2803)) |
This file contains hidden or 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,3 @@ | ||
| - `[types/proto]` Extend `CheckTxResponse` with new `lane_id` field and `InfoResponse` with | ||
| `lane_priorities` and `default_lane` fields | ||
| ([#2803](https://github.com/cometbft/cometbft/issues/2803)) |
This file contains hidden or 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,2 @@ | ||
| - `[rpc]` Add `unconfirmed_tx` to support query mempool transaction by transaction hash. | ||
| ([\#3079](https://github.com/cometbft/cometbft/pull/3079)) |
3 changes: 3 additions & 0 deletions
3
.changelog/v1.0.0/features/3297-config-mempool-dog-protocol.md
This file contains hidden or 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,3 @@ | ||
| - `[config]` For the DOG gossip protocol, add `dog_protocol_enabled`, `dog_target_redundancy`, | ||
| `dog_adjust_interval` to the `mempool` configuration section | ||
| ([\#3297](https://github.com/cometbft/cometbft/issues/3297)). |
This file contains hidden or 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,2 @@ | ||
| - `[mempool]` Add new Dynamic Optimal Graph (DOG) gossip protocol | ||
| ([#3297](https://github.com/cometbft/cometbft/issue/3297)). |
This file contains hidden or 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,2 @@ | ||
| - `[metrics]` Add new mempool metrics `DisabledRoutes` and `Redundancy` for the DOG protocol | ||
| ([#3297](https://github.com/cometbft/cometbft/issue/3297)). |
2 changes: 2 additions & 0 deletions
2
.changelog/v1.0.0/features/3297-proto-mempool-dog-protocol.md
This file contains hidden or 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,2 @@ | ||
| - `[proto]` Add new proto messages `HaveTx` and `ResetRoute` for the mempool DOG protocol | ||
| ([#3297](https://github.com/cometbft/cometbft/issue/3297)). |
This file contains hidden or 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,2 @@ | ||
| - `[metrics]` Add new mempool metrics `lane_size`, `lane_bytes`, and `tx_life_span` | ||
| ([#3506](https://github.com/cometbft/cometbft/issue/3506)). |
This file contains hidden or 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,2 @@ | ||
| - `[e2e]` Added support for mempool lanes in e2e. | ||
| ([#3622](https://github.com/cometbft/cometbft/pull/3622)) |
This file contains hidden or 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,2 @@ | ||
| - `[kvstore]` Extended `CheckTx` in kvstoreApp to support mempool lanes. | ||
| ([#3622](https://github.com/cometbft/cometbft/pull/3622)) |
This file contains hidden or 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,2 @@ | ||
| - `[node]` Move the ABCI `Info` call from the `Handshake` function to the `NewNodeWithCliParams` function. | ||
| ([#3634](https://github.com/cometbft/cometbft/pull/3634)) |
This file contains hidden or 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,3 @@ | ||
| - `[e2e]` Add `load_lane_weights` option to manifest for generating transactions with | ||
| lanes picked randomly and proportional to their weight. | ||
| ([\#3825](https://github.com/cometbft/cometbft/pull/3825)). |
This file contains hidden or 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,2 @@ | ||
| - `[e2e]` Add `lanes` and `no_lanes` to manifest to customize the list of lanes the app should use | ||
| ([#4005](https://github.com/cometbft/cometbft/issues/4005)) |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leveldb is still supported in v1? Pebble is just defult in newly generated configs?
Btw do you have any benchmarks or anything that you could share regarding decision to move to pebble as default storage.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only pebble is supported but it's still possible to use any database:https://github.com/cometbft/cometbft/blob/main/UPGRADING.md#db-changesSome of the reasons for this decision are here (from 2023) and more recently here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hvanz Does that mean we only need to use the goleveldb build flag with v1, without requiring any custom implementation (e.g., DB interface modifications, DefaultDBProvider overrides, etc.)?
We’re currently evaluating Pebble, but migrating would be a major effort. We’d prefer to avoid mixing implementations for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, ignore my previous message. Those changes are not in v1.0.1. You would only need to set
db_backend = "goleveldb". See here: https://github.com/InjectiveLabs/cometbft/blob/hvanz/v1.0.1%2Blanes%2Bdog/docs/references/config/config.toml.md#db_backendThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also there is a document we wrote as Upgrading guidelines to v1.0 which might have some other helpful insights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmarcetic We tested Pebble when exploring changing the database key layout and pruning + compaction.
We had reports from other teams about Pebble's superiors performance compared to goleveldb. More than that golevelDB is not maintained anymore.
In our local tests, our app was not really storage bound but the numbers we got from multiple runs indicated Pebble was slightly better:
https://github.com/cometbft/cometbft/blob/main/docs/references/storage/README.md#pebble vs . https://github.com/cometbft/cometbft/blob/main/docs/references/storage/README.md#local-1node .
The dealbreaker was the fact that Pebble is able to actually compact data without us intructing it to.
Namely, for golevelDB , in v1.x you now have an explicit call to
db.Compactwhen you prune. This will now actually delete the files on disk (unlike before where pruning was not doing this). Pebble does not need that call.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jmalicevic @hvanz
Btw we also have the same results from benchmarking Leveldb vs. PebbleDB: lower CPU, RAM, and IO utilization and faster read/write (mostly reads due to improved caching).