Update PoolAddressManager to not take signer bnb address as pool address
Problem
At the moment, statechain pool address management, it will take the signer_bnb_address
as the pool address , which is used to mock how TSS works.
When Statechain start, it will pick one of the active validator's signer_bnb_address
, as the pool address, when statechain block height reach the block height specified in RotateAt
, then it will choose the next active validator, and take their signer_bnb_address
as the next pool address, in the mean time move all the existing asset to the next pool.
When statechain generate txOut , it will specify which signer should sign the tx , and broadcast to binance chain. Assuming No Signer will share their private key, thus their signer_bnb_address
will be totally different
If there are multiple signer running at the same time, there will only have one signer sign and send the txOut to binance chain.
All these logic works fine if we are using private key signer. However TSS works differently.
Assume we have four thornodes working at the same time, TSS will need to have at least three of the nodes to sign the same txout, otherwise TSS will fail to sign it, and result in the tx can't be send.
Solution
- persist
PoolAddresses
struct into statechain's data store. (use hex encoded public key to represent the address) - Write
PoolAddresses
into genesis file, thus when statechain start up , it already know what current pool address is. - Update
NextPool
memo, instead of updatesigner_bnb_address
we will updatePoolAddresses
structure - Update signer to disregard the PoolAddress field in TxOut