8000 mempool: Add push-pull gossip protocol (CAT) by hvanz · Pull Request #1472 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mempool: Add push-pull gossip protocol (CAT) #1472

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

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
094c671
Add CAT mempool reactor
hvanz Oct 5, 2023
a13d6de
Add missing changes to rpc/core/mempool.go
hvanz Oct 7, 2023
2c39819
e2e: Add MempoolReactor to manifest
hvanz Oct 7, 2023
4c60b82
Merge branch 'main' into experimental/cat
hvanz Oct 11, 2023
e310c6d
+ update cat reactor following merge
hvanz Oct 11, 2023
01b3e2e
Fix lint
hvanz Oct 11, 2023
034a980
Revert to fix lint
hvanz Oct 11, 2023
0e68188
More fixes
hvanz Oct 11, 2023
6d09bbb
make proto-gen
hvanz Oct 11, 2023
f1a0594
Add SyncReactor interface
hvanz Oct 12, 2023
47a232d
Refactor MempoolTx into CListEntry to fix lint
hvanz Oct 13, 2023
1d0622d
Add IsEmpty method to CListEntry
hvanz Oct 13, 2023
a53fe88
Increase defaultGossipDelay and remove jitter
hvanz Oct 13, 2023
0e926aa
e2e: Add pex_reactor and log_level to manifest
hvanz Oct 17, 2023
a3c3495
Merge branch 'main' into experimental/cat
hvanz Nov 8, 2023
3c3c48d
Rename (mempool_)reactor to gossip_protocol
hvanz Nov 8, 2023
1060ed6
Merge branch 'main' into experimental/cat
hvanz Nov 10, 2023
251e8a9
Merge branch 'main' into experimental/cat
hvanz Jan 8, 2024
4d0a1d1
Merge branch 'main' into experimental/cat
hvanz Jan 8, 2024
8d7941b
Fix lints
hvanz Jan 8, 2024
cebcb9c
Reuse node.WaitSyncP2PReactor instead of mempool.SyncReactor
hvanz Jan 8, 2024
24cd785
fix spelling
hvanz Jan 8, 2024
27c85b6
make mockery
hvanz Jan 8, 2024
c37ff73
Add required comments to proto messages
hvanz Jan 8, 2024
03fc5ed
Fix lint
hvanz Jan 8, 2024
8124ad0
Merge branch 'main' into experimental/cat
hvanz Jan 8, 2024
4040010
make proto-gen
hvanz Jan 8, 2024
2ba6d7a
Fix lint: import order
hvanz Jan 8, 2024
af22351
Merge branch 'main' into experimental/cat
hvanz Jan 9, 2024
927c0a0
No need to SetLogger again
hvanz Jan 9, 2024
3dc7b60
Assign the correct base reactor
hvanz Jan 9, 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
28 changes: 28 additions & 0 deletions api/cometbft/mempool/v1/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,51 @@ package v1
import (
"fmt"

"github.com/cometbft/cometbft/types"
"github.com/cosmos/gogoproto/proto"
)

var (
_ types.Wrapper = &Txs{}
_ types.Wrapper = &SeenTx{}
_ types.Wrapper = &WantTx{}
_ types.Unwrapper = &Message{}
)

// Wrap implements the p2p Wrapper interface and wraps a mempool message.
func (m *Txs) Wrap() proto.Message {
mm := &Message{}
mm.Sum = &Message_Txs{Txs: m}
return mm
}

// Wrap implements the p2p Wrapper interface and wraps a mempool seen tx message.
func (m *SeenTx) Wrap() proto.Message {
mm := &Message{}
mm.Sum = &Message_SeenTx{SeenTx: m}
return mm
}

// Wrap implements the p2p Wrapper interface and wraps a mempool want tx message.
func (m *WantTx) Wrap() proto.Message {
mm := &Message{}
mm.Sum = &Message_WantTx{WantTx: m}
return mm
}

// Unwrap implements the p2p Wrapper interface and unwraps a wrapped mempool
// message.
func (m *Message) Unwrap() (proto.Message, error) {
switch msg := m.Sum.(type) {
case *Message_Txs:
return m.GetTxs(), ni 624F l

case *Message_SeenTx:
return m.GetSeenTx(), nil

case *Message_WantTx:
return m.GetWantTx(), nil

default:
return nil, fmt.Errorf("unknown message: %T", msg)
}
Expand Down
Loading
0