Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ type P2PConfig struct {
HandshakeTimeout Duration `toml:"handshake_timeout"`
DialTimeout Duration `toml:"dial_timeout"`
DialInterval Duration `toml:"dial_interval"`
AcceptInterval Duration `toml:"accept_interval"`

QueueType string `toml:"queue_type"`
}
Expand Down
7 changes: 7 additions & 0 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func TestWriteReadRoundTrip(t *testing.T) {
original.EVM.HTTPPort = 9545
original.EVM.EnabledLegacySeiApis = []string{"sei_getLogs", "sei_getBlockByNumber"}
original.Storage.StateStore.KeepRecent = 50000
original.Network.P2P.AcceptInterval = Dur(25 * time.Millisecond)

if err := WriteConfigToDir(original, dir); err != nil {
t.Fatalf("WriteConfigToDir: %v", err)
Expand Down Expand Up @@ -357,6 +358,12 @@ func TestWriteReadRoundTrip(t *testing.T) {
if loaded.Storage.StateStore.KeepRecent != 50000 {
t.Errorf("state_store.keep_recent: got %d, want 50000", loaded.Storage.StateStore.KeepRecent)
}
// WriteConfigToDir regenerates config.toml wholesale from the legacy structs,
// so a p2p key missing from legacyP2P is silently dropped rather than
// preserved. Pin this one: seid reverts to a 1/s accept rate without it.
if got := loaded.Network.P2P.AcceptInterval; got != Dur(25*time.Millisecond) {
t.Errorf("p2p.accept_interval: got %v, want 25ms", got)
}
if loaded.Network.RPC.ListenAddress != testRPCAddr {
t.Errorf("rpc.listen_address: got %q", loaded.Network.RPC.ListenAddress)
}
Expand Down
1 change: 1 addition & 0 deletions defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func baseDefaults() *SeiConfig {
HandshakeTimeout: Dur(10 * time.Second),
DialTimeout: Dur(3 * time.Second),
DialInterval: Dur(10 * time.Second),
AcceptInterval: Dur(10 * time.Millisecond),
QueueType: "simple-priority",
},
},
Expand Down
3 changes: 3 additions & 0 deletions legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type legacyP2P struct {
HandshakeTimeout Duration `toml:"handshake-timeout"`
DialTimeout Duration `toml:"dial-timeout"`
DialInterval Duration `toml:"dial-interval"`
AcceptInterval Duration `toml:"accept-interval"`
QueueType string `toml:"queue-type"`
}

Expand Down Expand Up @@ -431,6 +432,7 @@ func (cfg *SeiConfig) toLegacyTendermint() legacyTendermintConfig {
HandshakeTimeout: cfg.Network.P2P.HandshakeTimeout,
DialTimeout: cfg.Network.P2P.DialTimeout,
DialInterval: cfg.Network.P2P.DialInterval,
AcceptInterval: cfg.Network.P2P.AcceptInterval,
QueueType: cfg.Network.P2P.QueueType,
},

Expand Down Expand Up @@ -767,6 +769,7 @@ func fromLegacy(tm legacyTendermintConfig, app legacyAppConfig) *SeiConfig {
HandshakeTimeout: tm.P2P.HandshakeTimeout,
DialTimeout: tm.P2P.DialTimeout,
DialInterval: tm.P2P.DialInterval,
AcceptInterval: tm.P2P.AcceptInterval,
QueueType: tm.P2P.QueueType,
},
},
Expand Down
Loading