Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support external contract/chain to update validator set #67

Open
qizhou opened this issue Apr 8, 2022 · 0 comments
Open

Support external contract/chain to update validator set #67

qizhou opened this issue Apr 8, 2022 · 0 comments
Assignees

Comments

@qizhou
Copy link

qizhou commented Apr 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants