Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a7787f6
added self-declared addresses to handshake
pompon0 Feb 25, 2026
69ff8e5
Merge remote-tracking branch 'origin/main' into gprusak-pex
pompon0 Feb 26, 2026
811f86d
self addr
pompon0 Feb 26, 2026
9954688
pex addrs in handshake
pompon0 Feb 26, 2026
5cd87bc
just 1 addr
pompon0 Feb 26, 2026
d0f363b
error logging in newPeerManager
pompon0 Feb 26, 2026
ba4fdba
caching isPublic
pompon0 Feb 26, 2026
32aee27
removed selfID from peerManagerInner
pompon0 Feb 26, 2026
24820ff
asdf
pompon0 Feb 26, 2026
4e896ef
tests
pompon0 Feb 27, 2026
3580e31
flag for enabling pex on handshake
pompon0 Feb 27, 2026
337ecd8
compilation
pompon0 Feb 27, 2026
3b5cb73
added tests
pompon0 Feb 27, 2026
a0d36ab
removed dead branch handling opaque url
pompon0 Mar 2, 2026
17e9433
move PexOnHandshake after authentication
pompon0 Mar 2, 2026
350afac
poolConn
pompon0 Mar 2, 2026
d853866
Merge branch 'gprusak-less-addrs' into gprusak-stablehash
pompon0 Mar 2, 2026
1a0c532
thoughts
pompon0 Mar 2, 2026
731df5e
Merge remote-tracking branch 'origin/main' into gprusak-pex
pompon0 Mar 2, 2026
0995acf
Merge remote-tracking branch 'origin/main' into gprusak-stablehash
pompon0 Mar 3, 2026
3bfaac6
WIP
pompon0 Mar 3, 2026
80b414b
before combining dialing and out
pompon0 Mar 4, 2026
939d986
need to figure out how to limit churn on outbound connections
pompon0 Mar 4, 2026
1b8921b
pool revamp almost ready, rotation supported
pompon0 Mar 5, 2026
9ce0937
before moving pex to peerManager
pompon0 Mar 5, 2026
ed0d6a2
WIP, peermanager doesn't look very well
pompon0 Mar 5, 2026
7c620ce
seems complete
pompon0 Mar 6, 2026
cfdd0f7
some updates to router
pompon0 Mar 6, 2026
8cd71d9
pex addrs management
pompon0 Mar 7, 2026
3f2d104
new idea
pompon0 Mar 9, 2026
d0242c8
wip
pompon0 Mar 9, 2026
c5a4c31
some tweaks
pompon0 Mar 9, 2026
1ce1d01
applied comments
pompon0 Mar 9, 2026
653a1e8
another version
pompon0 Mar 10, 2026
9cf0d63
more documentation
pompon0 Mar 10, 2026
9ad8ba9
parallel addr resolution
pompon0 Mar 10, 2026
6fd9896
fixed router tests
pompon0 Mar 10, 2026
8d98d13
tests WIP
pompon0 Mar 10, 2026
d17db5f
tests WIP
pompon0 Mar 11, 2026
800ed3c
tests refactored
pompon0 Mar 11, 2026
0f26cab
more tests
pompon0 Mar 11, 2026
80a1c11
last test
pompon0 Mar 11, 2026
8209c02
pm tests are back
pompon0 Mar 11, 2026
143df90
pm tests are back
pompon0 Mar 11, 2026
b1c0b8b
fixed defaults
pompon0 Mar 11, 2026
c79bd81
fixed multi-address dialing
pompon0 Mar 16, 2026
4792b80
test fixes
pompon0 Mar 16, 2026
498175d
Merge remote-tracking branch 'origin/main' into gprusak-pex
pompon0 Mar 16, 2026
3ca76c9
Merge branch 'gprusak-pex' into gprusak-stablehash
pompon0 Mar 16, 2026
ef3a829
spurious log
pompon0 Mar 16, 2026
1df96a7
fixed lint
pompon0 Mar 16, 2026
43986ef
deflaking statesync test
pompon0 Mar 16, 2026
7f522a2
simplified the dial test
pompon0 Mar 16, 2026
7df80d9
applied comments
pompon0 Mar 16, 2026
466643c
Merge branch 'main' into gprusak-stablehash
pompon0 Mar 16, 2026
32fdea7
Merge branch 'main' into gprusak-stablehash
pompon0 Mar 17, 2026
6acbaeb
fixed peermanager priority function
pompon0 Mar 17, 2026
48d0d13
Merge branch 'main' into gprusak-stablehash
pompon0 Mar 17, 2026
4d907fe
Merge branch 'main' into gprusak-stablehash
pompon0 Mar 18, 2026
d5e0d3d
Merge branch 'main' into gprusak-stablehash
pompon0 Mar 19, 2026
63acf63
logs for CI
pompon0 Mar 19, 2026
72bbb0b
Merge branch 'gprusak-stablehash' of https://github.com/sei-protocol/…
pompon0 Mar 19, 2026
f521915
wip
pompon0 Mar 19, 2026
10520dc
Merge remote-tracking branch 'origin/main' into gprusak-stablehash
pompon0 Mar 19, 2026
732de04
rename
pompon0 Mar 19, 2026
9f53aaa
fixed net_info
pompon0 Mar 19, 2026
87f793d
applied codex comments
pompon0 Mar 19, 2026
f5490e4
rename to Router
pompon0 Mar 19, 2026
f0eaca2
stupid lint
pompon0 Mar 19, 2026
5ec3d34
fixed incorrect peer killing
pompon0 Mar 19, 2026
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
14 changes: 5 additions & 9 deletions sei-tendermint/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ type P2PConfig struct {
// MaxOutboundConnections limits the number of outbound connections to regular (non-persistent) peers.
// It should be significantly lower than MaxConnections, unless
// the node is supposed to have a small number of connections altogether.
MaxOutboundConnections uint
MaxOutboundConnections *uint `mapstructure:"max-outbound-connections"`

// MaxIncomingConnectionAttempts rate limits the number of incoming connection
// attempts per IP address.
Expand Down Expand Up @@ -703,14 +703,10 @@ type P2PConfig struct {
// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
func DefaultP2PConfig() *P2PConfig {
return &P2PConfig{
ListenAddress: "tcp://127.0.0.1:26656",
ExternalAddress: "",
UPNP: false,
MaxConnections: 100,
// TODO(gprusak): decrease to 10, once PEX is improved to:
// * exchange both inbound and outbound connections information
// * exchange information on handshake as well.
MaxOutboundConnections: 100,
ListenAddress: "tcp://127.0.0.1:26656",
ExternalAddress: "",
UPNP: false,
MaxConnections: 100,
MaxIncomingConnectionAttempts: 100,
FlushThrottleTimeout: 100 * time.Millisecond,
MaxPacketMsgPayloadSize: 1000000,
Expand Down
15 changes: 0 additions & 15 deletions sei-tendermint/internal/p2p/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ type NodeAddress struct {
Port uint16
}

var cgnat = netip.MustParsePrefix("100.64.0.0/10")

// IsPublic checks if the address is routable from the public internet.
// It is good enough to exclude internal addresses of cloud providers.
// As a simplification, it treats non-IP Hostnames (DNS addresses) as public.
// TODO(gprusak): DNS addresses should be eliminated from PEX entirely - all
// addresses should be resolved locally and only then advertised to peers.
func (a NodeAddress) IsPublic() bool {
ip, err := netip.ParseAddr(a.Hostname)
if err != nil {
return true
}
return ip.IsGlobalUnicast() && !ip.IsPrivate() && !cgnat.Contains(ip.Unmap())
}

// ParseNodeAddress parses a node address URL into a NodeAddress, normalizing
// and validating it.
func ParseNodeAddress(urlString string) (NodeAddress, error) {
Expand Down
16 changes: 0 additions & 16 deletions sei-tendermint/internal/p2p/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"

"github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils/require"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils/tcp"
"github.com/sei-protocol/sei-chain/sei-tendermint/types"
Expand Down Expand Up @@ -278,21 +277,6 @@ func TestNodeAddress_String(t *testing.T) {
}
}

func TestNodeAddress_IsPublic(t *testing.T) {
rng := utils.TestRng()
id := makeNodeID(rng)
testcases := map[string]bool{
"192.168.1.10": false,
"93.184.216.34": true,
"example.com": true,
"100.64.0.1": false,
}
for hostname, isPublic := range testcases {
addr := NodeAddress{NodeID: id, Hostname: hostname, Port: defaultPort}
require.Equal(t, isPublic, addr.IsPublic())
}
}

func TestNodeAddress_Validate(t *testing.T) {
id := types.NodeID("00112233445566778899aabbccddeeff00112233")
testcases := []struct {
Expand Down
6 changes: 3 additions & 3 deletions sei-tendermint/internal/p2p/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ func (ch *Channel[T]) send(msg T, queues ...*Queue[sendMsg]) {
}

func (ch *Channel[T]) Send(msg T, to types.NodeID) {
c, ok := ch.router.peerManager.Conns().Get(to)
c, ok := GetAny(ch.router.peerManager.Conns(), to)
if !ok {
logger.Debug("dropping message for unconnected peer", "peer", to, "channel", ch.desc.ID)
return
}
if _, contains := c.peerChannels[ch.desc.ID]; !contains {
if _, contains := c.Channels[ch.desc.ID]; !contains {
// reactor tried to send a message across a channel that the
// peer doesn't have available. This is a known issue due to
// how peer subscriptions work:
Expand All @@ -98,7 +98,7 @@ func (ch *Channel[T]) Send(msg T, to types.NodeID) {
func (ch *Channel[T]) Broadcast(msg T) {
var queues []*Queue[sendMsg]
for _, c := range ch.router.peerManager.Conns().All() {
if _, ok := c.peerChannels[ch.desc.ID]; ok {
if _, ok := c.Channels[ch.desc.ID]; ok {
queues = append(queues, c.sendQueue)
}
}
Expand Down
Loading
Loading