-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
validator update_time is valid but incorrect #3411
Comments
Hmmm, I think this pertains to the way the validator was created. When a validator is created via a https://github.com/cosmos/cosmos-sdk/blob/v0.30.0/x/staking/handler.go#L124-L132 validator := NewValidator(msg.ValidatorAddr, msg.PubKey, msg.Description)
commission := NewCommissionWithTime(
msg.Commission.Rate, msg.Commission.MaxRate,
msg.Commission.MaxChangeRate, ctx.BlockHeader().Time,
)
validator, err := validator.SetInitialCommission(commission)
if err != nil {
return err.Result()
} So this must only pertain to a local testnet? |
There's no other conceivable time we could use. The time being incorrect on a local testnet could be a bug in how the initial BFT time is set, but that should be filed in the Tendermint repository, not here. |
Closing, please open an issue on Tendermint |
Reopening this issue as it is indeed an SDK issue, namely: // InitChain implements the ABCI interface. It runs the initialization logic
// directly on the CommitMultiStore.
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
// ...
// initialize the deliver state and check state with ChainID and run initChain
app.setDeliverState(abci.Header{ChainID: req.ChainId})
app.setCheckState(abci.Header{ChainID: req.ChainId})
// ...
} Where we pass the header, there is no time. I suppose this should be the genesis time for block 0. |
Ah indeed, my mistake. |
Summary of Bug
when you start a network with one validator the commission
update_time
will default to a date that is technically Jan. 1, year 1. this is a valid but incorrect date.alternatively, it might be best to use either the "datetime" when the validator joins the network and establishes the expected commission data for the first time, or
null
.Steps to Reproduce
gaiacli query staking validator <address> --trust-node
commission.updateTime: 0001-01-01 00:00:00
thank you all!
For Admin Use
The text was updated successfully, but these errors were encountered: