ExocoreNetwork / exocore

5 stars 9 forks source link

feat(operator): load genesis state #27

Closed MaxMustermann2 closed 2 months ago

MaxMustermann2 commented 3 months ago

This PR subsumes #25 within itself, and therefore should be merged after that one. For ease of review, this PR may be reviewed after the merge of #25 happens and this PR is rebased.

The x/operator 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:

{
    "operators": [
          {...}, {...}
    ],
    "operator_records": [
        {
            "operator_address": "exo1...",
            "chains": [
                {
                    "chain_id": "exocoretestnet_233-1",
                    "consensus_key": "0xFFFFAAA...."
                }, {...}
             ]
        }, {...}
    ]
}

At genesis, the module should:

The stateful validations performed are the same as the validations on a live chain, since all the calls are routed to those very functions.

The stateless validations are listed below.