consensus/parlia: hardfork block can be epoch block (#1964)
This commit is contained in:
parent
72ffb0cbed
commit
3fc9f750d1
@ -828,6 +828,13 @@ func (p *Parlia) prepareValidators(header *types.Header) error {
|
||||
}
|
||||
} else {
|
||||
header.Extra = append(header.Extra, byte(len(newValidators)))
|
||||
if p.chainConfig.IsOnLuban(header.Number) {
|
||||
voteAddressMap = make(map[common.Address]*types.BLSPublicKey, len(newValidators))
|
||||
var zeroBlsKey types.BLSPublicKey
|
||||
for _, validator := range newValidators {
|
||||
voteAddressMap[validator] = &zeroBlsKey
|
||||
}
|
||||
}
|
||||
for _, validator := range newValidators {
|
||||
header.Extra = append(header.Extra, validator.Bytes()...)
|
||||
header.Extra = append(header.Extra, voteAddressMap[validator].Bytes()...)
|
||||
@ -989,6 +996,13 @@ func (p *Parlia) verifyValidators(header *types.Header) error {
|
||||
return errMismatchingEpochValidators
|
||||
}
|
||||
validatorsBytes = make([]byte, validatorsNumber*validatorBytesLength)
|
||||
if p.chainConfig.IsOnLuban(header.Number) {
|
||||
voteAddressMap = make(map[common.Address]*types.BLSPublicKey, len(newValidators))
|
||||
var zeroBlsKey types.BLSPublicKey
|
||||
for _, validator := range newValidators {
|
||||
voteAddressMap[validator] = &zeroBlsKey
|
||||
}
|
||||
}
|
||||
for i, validator := range newValidators {
|
||||
copy(validatorsBytes[i*validatorBytesLength:], validator.Bytes())
|
||||
copy(validatorsBytes[i*validatorBytesLength+common.AddressLength:], voteAddressMap[validator].Bytes())
|
||||
|
@ -159,15 +159,11 @@ var (
|
||||
MoranBlock: big.NewInt(22107423),
|
||||
GibbsBlock: big.NewInt(23846001),
|
||||
PlanckBlock: big.NewInt(27281024),
|
||||
|
||||
// TODO modify blockNumber, make sure the blockNumber is not an integer multiple of 200 (epoch number)
|
||||
// TODO Caution !!! it should be very careful !!!
|
||||
LubanBlock: big.NewInt(29020050),
|
||||
PlatoBlock: big.NewInt(30720096),
|
||||
// TODO modify blockNumber, make sure HertzBlock=BerlinBlock=LondonBlock to enable Berlin and London EIPs
|
||||
BerlinBlock: big.NewInt(31302048),
|
||||
LondonBlock: big.NewInt(31302048),
|
||||
HertzBlock: big.NewInt(31302048),
|
||||
LubanBlock: big.NewInt(29020050),
|
||||
PlatoBlock: big.NewInt(30720096),
|
||||
BerlinBlock: big.NewInt(31302048),
|
||||
LondonBlock: big.NewInt(31302048),
|
||||
HertzBlock: big.NewInt(31302048),
|
||||
|
||||
Parlia: &ParliaConfig{
|
||||
Period: 3,
|
||||
@ -195,15 +191,11 @@ var (
|
||||
NanoBlock: big.NewInt(23482428),
|
||||
MoranBlock: big.NewInt(23603940),
|
||||
PlanckBlock: big.NewInt(28196022),
|
||||
|
||||
// TODO modify blockNumber, make sure the blockNumber is not an integer multiple of 200 (epoch number)
|
||||
// TODO Caution !!! it should be very careful !!!
|
||||
LubanBlock: big.NewInt(29295050),
|
||||
PlatoBlock: big.NewInt(29861024),
|
||||
// TODO modify blockNumber, make sure HertzBlock=BerlinBlock=LondonBlock to enable Berlin and London EIPs
|
||||
BerlinBlock: big.NewInt(31103030),
|
||||
LondonBlock: big.NewInt(31103030),
|
||||
HertzBlock: big.NewInt(31103030),
|
||||
LubanBlock: big.NewInt(29295050),
|
||||
PlatoBlock: big.NewInt(29861024),
|
||||
BerlinBlock: big.NewInt(31103030),
|
||||
LondonBlock: big.NewInt(31103030),
|
||||
HertzBlock: big.NewInt(31103030),
|
||||
|
||||
Parlia: &ParliaConfig{
|
||||
Period: 3,
|
||||
@ -231,12 +223,10 @@ var (
|
||||
NanoBlock: nil,
|
||||
MoranBlock: nil,
|
||||
PlanckBlock: nil,
|
||||
|
||||
// TODO
|
||||
LubanBlock: nil,
|
||||
PlatoBlock: nil,
|
||||
BerlinBlock: nil,
|
||||
HertzBlock: nil,
|
||||
LubanBlock: nil,
|
||||
PlatoBlock: nil,
|
||||
BerlinBlock: nil,
|
||||
HertzBlock: nil,
|
||||
|
||||
Parlia: &ParliaConfig{
|
||||
Period: 3,
|
||||
|
Loading…
Reference in New Issue
Block a user