use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createPreUnityParentBlockHeaderValidator.
public ParentBlockHeaderValidator createPreUnityParentBlockHeaderValidator() {
List<DependentBlockHeaderRule> rules = Arrays.asList(new BlockNumberRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
Map<Seal, List<DependentBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, rules);
unityRules.put(Seal.PROOF_OF_STAKE, rules);
return new ParentBlockHeaderValidator(unityRules);
}
use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createNonceSeedDifficultyValidator.
public GreatGrandParentBlockHeaderValidator createNonceSeedDifficultyValidator() {
List<GreatGrandParentDependantBlockHeaderRule> posRules = Collections.singletonList(new UnityDifficultyRule(this));
Map<Seal, List<GreatGrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_STAKE, posRules);
return new GreatGrandParentBlockHeaderValidator(unityRules);
}
use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createBlockHeaderValidator.
public BlockHeaderValidator createBlockHeaderValidator() {
List<BlockHeaderRule> powRules = Arrays.asList(new HeaderSealTypeRule(), new FutureBlockRule(), new AionExtraDataRule(this.getConstants().getMaximumExtraDataSize()), new EnergyConsumedRule(), new AionPOWRule(), new EquihashSolutionRule(this.getEquihashValidator()));
List<BlockHeaderRule> posRules = Arrays.asList(new HeaderSealTypeRule(), new FutureBlockRule(), new AionExtraDataRule(this.getConstants().getMaximumExtraDataSize()), new EnergyConsumedRule(), new SignatureRule());
Map<Seal, List<BlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, powRules);
unityRules.put(Seal.PROOF_OF_STAKE, posRules);
return new BlockHeaderValidator(unityRules);
}
use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createUnityParentBlockHeaderValidator.
public ParentBlockHeaderValidator createUnityParentBlockHeaderValidator() {
List<DependentBlockHeaderRule> PoWrules = Arrays.asList(new BlockNumberRule(), new ParentOppositeTypeRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
List<DependentBlockHeaderRule> PoSrules = Arrays.asList(new BlockNumberRule(), new ParentOppositeTypeRule(), new StakingBlockTimeStampRule(), new TimeStampRule(), new EnergyLimitRule(getConstants().getEnergyDivisorLimitLong(), getConstants().getEnergyLowerBoundLong()));
Map<Seal, List<DependentBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, PoWrules);
unityRules.put(Seal.PROOF_OF_STAKE, PoSrules);
return new ParentBlockHeaderValidator(unityRules);
}
Aggregations