use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createVRFValidator.
public GrandParentBlockHeaderValidator createVRFValidator() {
List<GrandParentDependantBlockHeaderRule> posRules = Collections.singletonList(new VRFProofRule());
Map<Seal, List<GrandParentDependantBlockHeaderRule>> vrfProofRules = new EnumMap<>(Seal.class);
vrfProofRules.put(Seal.PROOF_OF_STAKE, posRules);
return new GrandParentBlockHeaderValidator(vrfProofRules);
}
use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createBlockHeaderValidatorForImport.
public BlockHeaderValidator createBlockHeaderValidatorForImport() {
List<BlockHeaderRule> powRules = Arrays.asList(new HeaderSealTypeRule(), new AionExtraDataRule(this.getConstants().getMaximumExtraDataSize()), new EnergyConsumedRule(), new AionPOWRule(), new EquihashSolutionRule(this.getEquihashValidator()));
List<BlockHeaderRule> posRules = Arrays.asList(new HeaderSealTypeRule(), 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 createPreUnityGrandParentHeaderValidator.
public GrandParentBlockHeaderValidator createPreUnityGrandParentHeaderValidator() {
List<GrandParentDependantBlockHeaderRule> powRules = Collections.singletonList(new AionDifficultyRule(this));
Map<Seal, List<GrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, powRules);
return new GrandParentBlockHeaderValidator(unityRules);
}
use of org.aion.zero.impl.types.BlockHeader.Seal in project aion by aionnetwork.
the class ChainConfiguration method createUnityGreatGrandParentHeaderValidator.
public GreatGrandParentBlockHeaderValidator createUnityGreatGrandParentHeaderValidator() {
List<GreatGrandParentDependantBlockHeaderRule> powRules = Collections.singletonList(new UnityDifficultyRule(this));
List<GreatGrandParentDependantBlockHeaderRule> posRules = Arrays.asList(new UnityDifficultyRule(this), new StakingSeedRule());
Map<Seal, List<GreatGrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_WORK, powRules);
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 createNonceSeedValidator.
public GreatGrandParentBlockHeaderValidator createNonceSeedValidator() {
List<GreatGrandParentDependantBlockHeaderRule> posRules = Collections.singletonList(new StakingSeedCreationRule());
Map<Seal, List<GreatGrandParentDependantBlockHeaderRule>> unityRules = new EnumMap<>(Seal.class);
unityRules.put(Seal.PROOF_OF_STAKE, posRules);
return new GreatGrandParentBlockHeaderValidator(unityRules);
}
Aggregations