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

feat!: remove genesis time from genesis state (#1851) #1988

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Jun 23, 2023

Cherry-pick #1851 to the v1.x release branch

Closes celestiaorg#1757

Prior to this PR, the mint module contained a placeholder `genesis_time`
in genesis state. It ignored the placeholder and used the block time for
the block height `1` as the "genesis time". This PR removes the
placeholder and that mechanism.

```diff
      "minter": {
        "inflation_rate": "0.080000000000000000",
        "annual_provisions": "0.000000000000000000",
-       "genesis_time": "2023-06-22T18:46:11.873883Z",
        "previous_block_time": null,
        "bond_denom": "utia"
      }
```

After this PR, `genesis_time` in the mint module is set to the chain's
genesis time which is the root level `genesis_time` specified in
genesis.json. Genesis.json is created on chain initialization (i.e.
`celestia-appd init chain-id`).

This is breaking b/c it modifies a state transition for the mint module
state and removes a field from the `Minter` state.

Now there is only one `genesis_time` in genesis.json:

```shell
$ ./scripts/build-run-single-node.sh

$ cat /var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/celestia_app_XXXXXXXXXXXXX.wYBu5mwm/config/genesis.json | grep genesis_time -A 3 -B 3
{
  "genesis_time": "2023-06-23T16:13:24.719488Z",
  "chain_id": "private",
  "initial_height": "1",
  "consensus_params": {
```

Additionally it gets set correctly in mint module state

```shell
$ ./build/celestia-appd query mint genesis-time
2023-06-23 16:13:24.719488 +0000 UTC
```

---------

Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com>
@rootulp rootulp added the consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules label Jun 23, 2023
@rootulp rootulp self-assigned this Jun 23, 2023
@rootulp rootulp requested a review from rach-id June 23, 2023 18:38
@MSevey MSevey requested a review from a team June 23, 2023 18:38
evan-forbes
evan-forbes previously approved these changes Jun 23, 2023
@evan-forbes
Copy link
Member

looks like the proto has to be regenerated

x/blob/types/params.pb.go | 2 +-
x/qgb/types/query.pb.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

ERROR:

Protobuf generated code requires update (either tools or .proto files may have changed).
Ensure your tools are up-to-date, re-run 'make proto-gen' and update this PR.

@rootulp rootulp enabled auto-merge (squash) June 23, 2023 19:04
@rootulp rootulp merged commit b45d916 into celestiaorg:v1.x Jun 23, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants