Skip to content
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

block.TimeIotaMs is 0 on exported genesis #6446

Closed
4 tasks
michaelfig opened this issue Jun 16, 2020 · 7 comments
Closed
4 tasks

block.TimeIotaMs is 0 on exported genesis #6446

michaelfig opened this issue Jun 16, 2020 · 7 comments
Assignees
Labels

Comments

@michaelfig
Copy link
Contributor

Summary of Bug

After exporting and reinitialising the chain the consensus_params.block.time_iota_ms value is 0. This fails when restarting the chain with the new genesis.json.

Version

v0.34.4-0.20200511222341-80be50319ca5

Steps to Reproduce

  1. gaiad export --for-zero-height > newgenesis.json
  2. gaiad unsafe-reset-all
  3. cp newgenesis.json ~/.gaiad/config/genesis.json
  4. gaiad start

Fails with:

block.TimeIotaMs must be greater than 0. Got 0.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

Yes, this is because we're not saving/exporting Block.TimeIotaMs -- I intentionally didn't include this because this value really isn't meant to change. I guess we have no choice but to include it.

@jgimeno do you think you have the bandwidth to take this on? It should be pretty straight forward.

@alexanderbez alexanderbez added this to the v0.39 milestone Jun 16, 2020
@jgimeno
Copy link
Contributor

jgimeno commented Jun 25, 2020

Ok, I think we have two options here.

  1. When exporting search for this value in the genesis file (maybe a little bit ugly just for one value?) or 2. provide this value in the abci.ConsensusParams from tendermint that is included in abci.RequestInitChain (but I saw a comment that this specific field is not shared with the application).

@aaronc , @alexanderbez , @alessio opinions?

@alexanderbez
Copy link
Contributor

@jgimeno it's a one-line fix:

diff --git a/server/export.go b/server/export.go
index 672432ad0..ff3f9be5f 100644
--- a/server/export.go
+++ b/server/export.go
@@ -75,8 +75,9 @@ func ExportCmd(ctx *Context, cdc codec.JSONMarshaler, appExporter AppExporter) *
                        doc.Validators = validators
                        doc.ConsensusParams = &tmtypes.ConsensusParams{
                                Block: tmtypes.BlockParams{
-                                       MaxBytes: cp.Block.MaxBytes,
-                                       MaxGas:   cp.Block.MaxGas,
+                                       MaxBytes:   cp.Block.MaxBytes,
+                                       MaxGas:     cp.Block.MaxGas,
+                                       TimeIotaMs: doc.ConsensusParams.Block.TimeIotaMs,
                                },
                                Evidence: tmtypes.EvidenceParams{
                                        MaxAgeNumBlocks: cp.Evidence.MaxAgeNumBlocks,

@jgimeno
Copy link
Contributor

jgimeno commented Jun 25, 2020

Oh yes, the doc was there :D

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 6, 2020
@michaelfig
Copy link
Contributor Author

Marked as done and merged. I'm closing.

@RaulBernal
Copy link

Quick question @jgimeno
It should be fixed for SDK v.0.46.1 & Tendermint v0.34.21 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants