You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 883f6e8
Browse filesBrowse the repository at this point in the historyBrowse files
Hard-code the state sync trust period per chain (#4679)
State sync's trust period has been a per-node `[statesync] trust-period`
setting, defaulting to 168h. It has to stay below the unbonding time so
that the validators who signed the trusted header are still slashable,
so cutting the unbonding time from 21 to 7 days
([CON-381](https://linear.app/seilabs/issue/CON-381/reduce-21-days-unbonding-time-to-7-days))
would depend on every operator editing their config.toml. A governance
param ([#4677](#4677),
closed) does not fit either: a node that state syncs cannot learn the
value without first trusting an RPC server for it. So the value now
lives in the binary.
`config.StateSyncTrustPeriod(chainID)` returns the period from a
per-chain table: 112h on pacific-1, atlantic-2 and arctic-1, which all
run a 21-day unbonding time today and stay below the planned 7 days, and
168h, the old default, on any other chain, such as the docker localnet.
`Reactor.initStateProvider` passes it to both the RPC and the P2P state
providers. The `TrustPeriod` field, its default and its `ValidateBasic`
check are removed from `StateSyncConfig`, and `trust-period` is removed
from the config.toml template and the docker configs.
Consensus and state are untouched, so no upgrade handler is needed; the
change should be backported to release/v6.8 so the whole network ships
the same value. A config.toml that still sets `trust-period` keeps
loading and the value is ignored, so an existing override stops
applying: a node that state synced from an old trust height under a
longer configured period now needs a trust height less than 112h old, or
it fails with `ErrOldHeaderExpired`.
`seid start` logs a warning when `trust-period` is still set to a value
other than the chain's built-in period, naming the chain ID, the
configured value and the period in use, so the ignored override does not
go unnoticed; nothing is logged for a matching value or an absent key.
The old template wrote `trust-period = "168h0m0s"`, so most existing
nodes on pacific-1, atlantic-2 and arctic-1 will log it on every start,
whether or not state sync is enabled, until the line is removed.
`seid tendermint light --trusting-period` keeps its own 168h flag
default. Validated with the `sei-tendermint/config`,
`internal/statesync` and `sei-cosmos/server` tests, the config
characterization suites in `cmd/seid/cmd` and `testutil/configtest`, and
a `seid start` on a pacific-1 home that still sets the old default.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
logger.Warn("statesync.trust-period is set in config.toml, but state sync uses the trust period built into seid for this chain; the setting is ignored and can be removed",
0 commit comments