Asphere-xyz / bas-devnet-setup

14 stars 44 forks source link

Issues on authorizing new validator to propose and mine new blocks #23

Open tinenhao opened 1 year ago

tinenhao commented 1 year ago

Right now I have setup the Binance Application Sidechain (BAS) on my private network with the basic nodes (validator, bootnodes, rpc nodes etc). However, I am trying to setup an independent validator node (not part of the first 3 validator nodes as defined in the genesis config file) to join the network but I am facing the error of "unauthorized validator" and the node is thus not allowed to propose or mine any new blocks. So I was wondering how can I fix this. If I'm not wrong the way to go is get the current nodes to make a proposal to authorize the new node but im not exactly sure how to do this. Below are the exact steps I took to setup the new validator node on an independent server.

  1. Obtain blockchain binary file from bas-template-bsc
  2. Obtain exact same genesis file as the running blockchain
  3. Setup new miner with the following commands: ./geth --datadir miner1 init genesis.json ./geth --datadir miner1 account new
  4. Run the node with the following command: ./geth --bootnodes={bootnode_enode_address} --datadir "miner1" --verbosity=9 --networkid={network_id} --mine --allow-insecure-unlock --unlock 0 --password "./password.txt" --miner.etherbase={miner_address}

Screenshot of the logs attached below image

dmitry123 commented 1 year ago

This message means that you're validator's address is not inside validator set yet. It might happen due to following issues:

  1. Validator set is not updated yet because epoch is not changed (it happened once 1-24 hours depends on your configuration, for devnet it's 1 hour)
  2. New validator is not added into consensus validator set via governance

After setting up new validator you need to initiate governance process to add new validator and all the rest validators must sign their acceptance on it.

tinenhao commented 1 year ago

Hi, thank you for your reply! I managed to add new validator into consensus validator set. But I did it through geth attaching into each individual node and running clique.propose(validator address, true). Is there a more simple way to do it?

crpodev commented 5 months ago

Hi, thank you for your reply! I managed to add new validator into consensus validator set. But I did it through geth attaching into each individual node and running clique.propose(validator address, true). Is there a more simple way to do it?

can you give me more details? i am trying to add a new validator as well..

tinenhao commented 5 months ago
  1. setup new node
  2. peer with the other nodes to join the network (logs will show this node is not allowed to propose blocks)
  3. use 2/3 of the existing validators to propose addition of this validator to the network (can do on staking UI or manually entering each node and unning clique.propose(new node address, true)
  4. done
crpodev commented 5 months ago
  1. setup new node
  2. peer with the other nodes to join the network (logs will show this node is not allowed to propose blocks)
  3. use 2/3 of the existing validators to propose addition of this validator to the network (can do on staking UI or manually entering each node and unning clique.propose(new node address, true)
  4. done

thanks for your swift reply. i tried doing this from the start because i saw your first reply, but unfortunately every time i clique.propose i get ReferenceError: clique is not defined at :1:1(0)

tinenhao commented 5 months ago

Do it directly at the staking ui page and observe the rpc call made to validate nodes then you can manually call it yourself