Closed varasev closed 5 years ago
Should the code of the block reward contract remain the same for every block reward contract address?
Should the code of the block reward contract remain the same for every block reward contract address?
The code can be completely different, but the ABI will always be the same.
OK. I asked because we do have the contract code config option. Maybe instead of several addresses and one contract code we should provide several pairs of address and code?
You mean the blockRewardContractCode
option? Unfortunately, the code passed to that option can only be pure
(can't work with contract's storage). We just need to have BlockReward
address switching like for the ValidatorSet
. The ABI interface for a new contract is assumed to be the same (i.e. the contract will still have the reward
function but probably with another code).
Yes, I meant that option. I'll leave one code for all addresses then.
I'll leave one code for all addresses then.
You mean ABI
, not code
I guess :)
The code can be different - this is the main meaning of this issue.
Well, this is what the config option is called in the code: block_reward_contract_code
. I guess it's a misnomer then and should have been called block_reward_contract_abi
?
No, we shouldn't touch the blockRewardContractCode
option (we won't use that): see the description of the blockRewardContractCode
here: https://wiki.parity.io/Pluggable-Consensus.html?q=blockRewardContractCode#aura
I had to refactor the contract code option but I kept the old overriding behaviour. So it should work as before.
Yes, OK.
Should the code of the block reward contract remain the same for every block reward contract address?
Sorry, misunderstood you initially. Yes, the blockRewardContractCode
option should have the same behavior as before.
In order to migrate
xDai
network to thePOSDAO
model we need to have themulti
option for theBlockReward
contract as for theValidatorSet
.At the moment we only have the
blockRewardContractTransition
option which has already been used: https://github.com/poanetwork/poa-chain-spec/blob/ef056eeb6412212bb183dd8ce361d80f650fccd7/spec.json#L21In addition to the
blockRewardContractAddress
andblockRewardContractTransition
I suppose to have an extrablockRewardContractTransitions
option in the following format: