Skip to content

Conversation

@pompon0
Copy link
Contributor

@pompon0 pompon0 commented Jan 8, 2026

TCP Multiplexer for sei giga. It is a replacement for sei-tendermint/internal/p2p/conn.MConnection. It will be used with autobahn only (currently unused). The high level overview of the protocol is described in package comment in mux/mux.go

Comment on lines +364 to +373
for kind, cfg := range m.cfg.Kinds {
remCfg, ok := handshake.Kinds[kind]
if !ok {
remCfg = &StreamKindConfig{}
}
inner.acceptsSem[kind] = min(cfg.MaxAccepts, remCfg.MaxConnects)
for range min(cfg.MaxConnects, remCfg.MaxAccepts) {
m.kinds[kind].connectsQueue <- inner.newConnectStream(kind)
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@pompon0 pompon0 changed the title Gprusak mux tcp multiplexer for sei giga Jan 13, 2026
@pompon0 pompon0 marked this pull request as ready for review January 13, 2026 16:04
Copy link
Collaborator

@codchen codchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logics themselves look good. Have a q about context


// NewMux constructs a new multipexer.
// Remember to spawn Mux.Run() afterwards.
func NewMux(cfg *Config) *Mux {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the input/output of this multiplexer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Streams of messages of fixed size. This will be used for p2p communication between nodes in giga (mainly consensus messages and block syncing). It is like a gRPC server/client, but with stricter semantics.

@pompon0 pompon0 enabled auto-merge (squash) January 21, 2026 16:07
@pompon0 pompon0 merged commit 65c8ad5 into main Jan 21, 2026
38 of 40 checks passed
@pompon0 pompon0 deleted the gprusak-mux branch January 21, 2026 16:37
yzang2019 added a commit that referenced this pull request Jan 21, 2026
* main:
  update: set MaxPacketMsgPayloadSize use MB unit (#2729)
  fix: set max packet msg payload default to 1MB (#2725)
  Add CI workflow to build libwasmvm dynamic libraries (#2724)
  Made tcp connection context-aware (#2718)
  tcp multiplexer for sei giga (#2679)
  [STO-237] remove unused cosmos invariants (#2719)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants