Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
9 stars 0 forks source link

Underflow on startup with debug builds in zq2devnet #1645

Closed rrw-zilliqa closed 3 weeks ago

rrw-zilliqa commented 1 month ago

If you attempt to join a node to zq2_devnet with a debug build, you will get a subtraction underflow error in consensus.rs:121 because there's no max supply specified in the config file. With a release build, it will simply underflow.

We should probably check for such things explicitly, and also fix the config file.

86667 commented 4 weeks ago

Im not seeing the same behavior at head of main, and the total_native_token_supply should be defaulted. Do you remember which commit you saw this on and do you still have the config file?

86667 commented 3 weeks ago

Merged code to perform safer checked_sub() when initialising zero account - https://github.com/Zilliqa/zq2/pull/1662

I can only assume that the issue seen by @rrw-zilliqa was due to a config which specified sum(genesis_deposits) + sum(genesis_accounts) > total_native_token_supple. Closing issue @rrw-zilliqa please re-open if this doesnt seem correct.