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

Errors in InitGenesis #335

Closed
whylee259 opened this issue Dec 11, 2020 · 2 comments · Fixed by #338
Closed

Errors in InitGenesis #335

whylee259 opened this issue Dec 11, 2020 · 2 comments · Fixed by #338
Labels
bug Something isn't working
Milestone

Comments

@whylee259
Copy link

There exist errors in InitGenesis of the latest code.

  1. Using params before they are initialized.

  2. The LastCodeID is always zero after importing codes

@alpe alpe added the bug Something isn't working label Dec 11, 2020
@alpe alpe added this to the v0.14.0 milestone Dec 11, 2020
@alpe
Copy link
Contributor

alpe commented Dec 11, 2020

@whylee259 Thanks for reporting the 2 issues.

  1. Using params before they are initialized.

You are completely right with this. Good 👁️

  1. The LastCodeID is always zero after importing codes

🤔 I was not able to reproduce this issue. During the genesis code import the CodeID sequence is not incremented. Instead the sequences are seeded from the following genesis block later.

  "wasm": {
      "sequences": [
        {
          "id_key": "BGxhc3RDb2RlSWQ=",
          "value": "2"
        },
        {
          "id_key": "BGxhc3RDb250cmFjdElk",
          "value": "2"
        }
      ]
...

We kept this separate to not run into issues for new instances when a derived contract account exists (accidentally). This scenario could happen when a contract instance was manually removed from the initial state dump for example but the account not. It is not obvious to find the relation between them so keeping the gap via sequences was a design decision.

@alpe
Copy link
Contributor

alpe commented Dec 14, 2020

@whylee259 This issue was closed now by #338 which addresses the first point only. If you still have issues with the second one, feel free to open this issue again or let us know via discord. 🌷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants