input-output-hk / jormungandr

privacy voting blockchain node
https://input-output-hk.github.io/jormungandr/
Apache License 2.0
365 stars 132 forks source link

misleading error when running jormungandr with genesis block exceeding 255 initial funds #1033

Open cleverca22 opened 4 years ago

cleverca22 commented 4 years ago
[testnet@testnet-deployer:~/jormungandr-performance/static]$ jq < /tmp/testrun/genesis.yaml '.initial[0].fund | length'
255 
Oct 25 12:06:36.920 INFO Starting jormungandr 0.7.0-rc1 (, release, linux [x86_64]) - [rustc 1.38.0 (625451e37 2019-09-23)],
Oct 25 12:06:36.921 WARN Node started without path to the stored secret keys (not a stake pool or a BFT leader), task: init
Oct 25 12:06:36.921 INFO storing blockchain in memory, task: init
Oct 25 12:06:36.926 WARN No trusted peers joinable to bootstrap the network, task: bootstrap
Oct 25 12:06:36.927 INFO starting task, task: client-query
Oct 25 12:06:36.927 INFO adding P2P Topology module: trusted-peers, task: network

with 255 initial funds, it works

[testnet@testnet-deployer:~/jormungandr-performance/static]$ jq < /tmp/testrun/genesis.yaml '.initial[0].fund | length'
256
Oct 25 12:08:00.034 INFO Starting jormungandr 0.7.0-rc1 (, release, linux [x86_64]) - [rustc 1.38.0 (625451e37 2019-09-23)],
Oct 25 12:08:00.034 WARN Node started without path to the stored secret keys (not a stake pool or a BFT leader), task: init
Oct 25 12:08:00.034 INFO storing blockchain in memory, task: init
Error while loading the legacy blockchain state
 |-> Error while creating the initial ledger out of the block0
 |-> Error or Invalid account
 |-> Account does not exist

with 256 initial funds, it fails to load the block0 file

NicolasDP commented 4 years ago

can you give us the 2 genesis files?

rinor commented 4 years ago

If you are using format (1): (1)

initial:
  - fund:
      - address: ca1shz8a85d3xhu76n0k9s99ss8v69nf8dnqagly4ljndzr9pqyg6ktu7kyv3v
        value: 10000000000000000
      - address: ca1sk6pmqy3lfrr7kq4afmywn5hl9prurwy7xfqejjgazlg9r5nnmk26h5fr8k
        value: 10000000000000000
      - address: ca1s5rkmsfsra5chatzcjmdmh5nsu8rpar6x2ly3gr85q332ckr4quqvlpscpr
        value: 10000000000000000
...

try (2)

(2)

initial:
  - fund:
      - address: ca1shz8a85d3xhu76n0k9s99ss8v69nf8dnqagly4ljndzr9pqyg6ktu7kyv3v
        value: 10000000000000000
  - fund:
      - address: ca1sk6pmqy3lfrr7kq4afmywn5hl9prurwy7xfqejjgazlg9r5nnmk26h5fr8k
        value: 10000000000000000
  - fund:
      - address: ca1s5rkmsfsra5chatzcjmdmh5nsu8rpar6x2ly3gr85q332ckr4quqvlpscpr
        value: 10000000000000000
  - fund:
...

in format (1) probably jcli genesis encode is truncating the funds.

cleverca22 commented 4 years ago

256: https://gist.github.com/a687d35f9ca61fef708c760d2bef5b90 255: https://gist.github.com/29b6873cd3052fed0ce6a961ed4a6530

NicolasDP commented 4 years ago

thanks, @rinor is right. Did you gather this information from the documentation @rinor ?

rinor commented 4 years ago

@NicolasDP no, it is from https://github.com/input-output-hk/jormungandr/issues/579.