ExocoreNetwork / exocore

5 stars 9 forks source link

feat(assets): load genesis state #25

Closed MaxMustermann2 closed 2 months ago

MaxMustermann2 commented 3 months ago

The x/assets module should load the genesis state from disk for the network to successfully bootstrap with the rPOS process. This pull request makes that happen.

The genesis state is structured as follows:

{
"params": {...}
"client_chains": [{...}, {...}, {...}],
"tokens": [{...},{...}],
"deposits": [
    {
        "staker": "stakerID_lzIDhex",
        "deposits": [
            {
                 "asset_id": "assetAddress_lzIDhex",
                 "info": {....}
            }, {...}
        ]
    }, {...}
]}

At genesis, the module should load:

The stateless validation follows this algorithm:

For each staker deposit entry, we check:

Within each list of deposits indexed by assetID per stakerID, we check for each assetID: