diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index ae9b0b5af0..2cd2aa1a70 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -107,10 +107,9 @@ func (w *wizard) makeGenesis() { genesis.Difficulty = big.NewInt(1) genesis.GasLimit = 10000000 genesis.Config.Bor = ¶ms.BorConfig{ - Period: 1, - ProducerInterval: 60, - ProducerDelay: 5, - Epoch: 30000, + Period: 1, + ProducerDelay: 5, + Epoch: 60, } // We also need the initial list of signers diff --git a/contracts/validatorset/contract/BorValidatorSet.sol b/contracts/validatorset/contract/BorValidatorSet.sol new file mode 100644 index 0000000000..093c8deecc --- /dev/null +++ b/contracts/validatorset/contract/BorValidatorSet.sol @@ -0,0 +1,48 @@ +pragma solidity 0.5.9; + +import { ValidatorSet } from "./ValidatorSet.sol"; + +contract BorValidatorSet is ValidatorSet { + /// Issue this log event to signal a desired change in validator set. + /// This will not lead to a change in active validator set until + /// finalizeChange is called. + /// + /// Only the last log event of any block can take effect. + /// If a signal is issued while another is being finalized it may never + /// take effect. + /// + /// _parentHash here should be the parent block hash, or the + /// signal will not be recognized. + event InitiateChange(bytes32 indexed _parentHash, address[] _newSet); + + /// Called when an initiated change reaches finality and is activated. + /// Only valid when msg.sender == SYSTEM (EIP96, 2**160 - 2). + /// + /// Also called when the contract is first enabled for consensus. In this case, + /// the "change" finalized is the activation of the initial set. + function finalizeChange() external { + + } + + /// Reports benign misbehavior of validator of the current validator set + /// (e.g. validator offline). + function reportBenign(address validator, uint256 blockNumber) external { + + } + + /// Reports malicious misbehavior of validator of the current validator set + /// and provides proof of that misbehavor, which varies by engine + /// (e.g. double vote). + function reportMalicious(address validator, uint256 blockNumber, bytes calldata proof) external { + + } + + /// Get current validator set (last enacted or initial if no changes ever made) with current stake. + function getValidators() external view returns (address[] memory, uint256[] memory) { + address[] memory d = new address[](1); + d[0] = 0x9fB29AAc15b9A4B7F17c3385939b007540f4d791; + uint256[] memory p = new uint256[](1); + p[0] = 10; + return (d, p); + } +} \ No newline at end of file diff --git a/contracts/validatorset/contract/contract_ValidatorSet_sol_ValidatorSet.abi b/contracts/validatorset/contract/ValidatorSet.abi similarity index 100% rename from contracts/validatorset/contract/contract_ValidatorSet_sol_ValidatorSet.abi rename to contracts/validatorset/contract/ValidatorSet.abi diff --git a/contracts/validatorset/contract/contract_ValidatorSet_sol_ValidatorSet.bin b/contracts/validatorset/contract/ValidatorSet.bin similarity index 100% rename from contracts/validatorset/contract/contract_ValidatorSet_sol_ValidatorSet.bin rename to contracts/validatorset/contract/ValidatorSet.bin diff --git a/params/config.go b/params/config.go index 6b4c1e7987..744165dd9d 100644 --- a/params/config.go +++ b/params/config.go @@ -229,9 +229,8 @@ func (c *CliqueConfig) String() string { // BorConfig is the consensus engine configs for Matic bor based sealing. type BorConfig struct { Period uint64 `json:"period"` // Number of seconds between blocks to enforce - ProducerInterval uint64 `json:"producerInterval"` // Number of seconds between change in block producer interval to enforce ProducerDelay uint64 `json:"producerDelay"` // Number of seconds delay between two producer interval - Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint + Epoch uint64 `json:"epoch"` // Epoch length to proposer ValidatorContract string `json:"validatorContract"` // Validator set contract }