We should be able to add the following config to TendermintConfig
- contract address
- contract chain id (if the same as local, then we will run as L1 instead of L2 sidechain (no need to support at the moment))
- enable epoch
And add a cmdline flag to provide RPC of external chain id.
When the node starts, check if the PoS is enabled, then the external chain id matches the RPC one.
In the node code, when a proposal for epoch change happens, we will
- locate a block of mainnet height = latest - 96 and its hash
- read the bonded validator set from the staking contract via RPC; the bonded validator set will be the new validator set
- send the proposal with the new validator set
When a validator receives a proposal for epoch change, we will
- check if the proposal's external block height >= latest - 128 and <= latest - 64. This prevents the proposer from arbitrarily setting a block for bonded validator
- read the bonded validator set from the staking contract via RPC, and compare it with proposal one
The proposal structure will be changed to add height and block hash fields.
We should be able to add the following config to TendermintConfig
And add a cmdline flag to provide RPC of external chain id.
When the node starts, check if the PoS is enabled, then the external chain id matches the RPC one.
In the node code, when a proposal for epoch change happens, we will
When a validator receives a proposal for epoch change, we will
The proposal structure will be changed to add height and block hash fields.