Closed deepthiskumar closed 9 months ago
@deepthiskumar when you are back -- can you add a bit more details here?
I've looked into this. My findings are the following:
src/app/runtime_genesis_ledger/runtime_genesis_ledger.ml
to produce the tar file from a config JSON with accounts.{
"genesis": {
"genesis_state_timestamp": "2023-10-17T16:01:01Z"
},
"ledger": {
"hash": "3NKm9dYH5TtyjQXccBBD7WQNezQnNuShCU6396CrpvwGeh7udhos"
}
}
Let me know if you need me to look into something else or give more details. @deepthiskumar @michal0mina
I now have a script to automate the process of using a config file with the genesis ledger accounts as well as both staking ledger accounts and producing the tar files for each of these ledgers and a new config file referencing the Merkle root hash of these ledgers instead of the accounts.
However, I noticed that the runtime config doesn't allow specifying the hash of the ledger for the staking ledgers, it only allows specifying accounts, so this needs to be changed. The logic used to load the staking ledger is the same as the genesis one, so this should be simply a matter of adding the possibility of specifying the hash on both staking ledgers in the config file.
Today I will create a PR with both of these changes.
Config file passed as daemon argument consists of genesis ledger as a list of accounts. These accounts can grow (mainnet now has over 200k accounts). This can take up significant boot-up time during which the daemon is unresponsive. The config file has options to take the merkle root or a name of the ledger instead. With these options, the daemon will look for files with a specific name locally as well as in an s3 bucket that's currently hardcoded.
The task for this issue is to test the two functionalities (using
Hash
andName
) in runtime config. The ledger can be generated by the daemon using a list of accounts first. Or preferably, one could create an app to do ledger generation using account list (just extracting the same piece of code the daemon uses) instead of running the daemon. I believe, https://github.com/MinaProtocol/mina/blob/berkeley/src/app/runtime_genesis_ledger/runtime_genesis_ledger.ml does this but needs to be confirmed.Update: Script: takes config file with ledgers (incluuding both the staking ledgers) with account list as input and generate as output the corresponding tars and a config file that refers to these files (instead of list of accounts)