10000 bring cat mempool to parity with main by faddat · Pull Request #1971 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bring cat mempool to parity with main #1971

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 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
4ffbf16
document the cat mempool
faddat Jan 5, 2024
7e3afb3
Merge branch 'experimental/cat' into HEAD
faddat Jan 5, 2024
a06cadb
Merge branch 'faddat/document-cat' of https://github.com/faddat/comet…
faddat Jan 5, 2024
1e3e1b6
Merge branch 'main' into faddat/document-cat
faddat Jan 5, 2024
94d7739
do the proto rebuild
faddat Jan 5, 2024
7c2bdd0
mempool reactor
faddat Jan 5, 2024
850f069
make needed changes to cat and nop
faddat Jan 6, 2024
adc7bd7
cat mempool maybe complete
faddat Jan 6, 2024
c8b9ab8
fixes
faddat Jan 6, 2024
e524288
cleanup .proto and chang a complex if to a switch
faddat Jan 6, 2024
3715cbc
update spelling
faddat Jan 6, 2024
cea603d
make mocks
faddat Jan 6, 2024
eda9d4b
Merge branch 'main' into faddat/document-cat
faddat Jan 7, 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
30 changes: 17 additions & 13 deletions api/cometbft/mempool/v1/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ import (
"github.com/cosmos/gogoproto/proto"
)

// 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
type Unwrapper interface {
Unwrap() (proto.Message, error)
}

// 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(), nil
func (m *Message_Txs) Unwrap() (proto.Message, error) {
return m.Txs, nil
}

func (m *Message_SeenTx) Unwrap() (proto.Message, error) {
return m.SeenTx, nil
}

default:
return nil, fmt.Errorf("unknown message: %T", msg)
func (m *Message_WantTx) Unwrap() (proto.Message, error) {
return m.WantTx, nil
}

func (m *Message) Unwrap() (proto.Message, error) {
if unwrapper, ok := m.Sum.(Unwrapper); ok {
return unwrapper.Unwrap()
}
return nil, fmt.Errorf("unknown message: %T", m.Sum)
}
Loading
0