3

I have started own private network with clique consensus algorithm in GETH. Regardless of miners now sealer will do the job and I have period:5. Difficulty is set 0 initially but over time it is going to be increased.

So when it reaches to around 100's of billion , does that going to affect the performance? At that level of difficulty will the miners keep appearing every 5 sec?

1 Answer 1

3

In Clique Proof-of-Authority consensus algorithm the difficulty does not increase with the chain lenght (unlike the Proof-of-Work). In fact the term of "difficulty" is not relevant in PoA as there is no puzzle solving. This term is still used as a block property to meet the yellow paper specification, but we prefer to talk about block score rather than "difficulty" (see why below).

Let's see the Clique EIP where the difficulty is defined :

difficulty: Contains the standalone score of the block to derive the quality 
of a chain.
Must be DIFF_NOTURN if BLOCK_NUMBER % SIGNER_COUNT != SIGNER_INDEX
Must be DIFF_INTURN if BLOCK_NUMBER % SIGNER_COUNT == SIGNER_INDEX

With :

DIFF_NOTURN: Block score (difficulty) for blocks containing out-of-turn signatures.
Suggested 1 since it just needs to be an arbitrary baseline constant.
DIFF_INTURN: Block score (difficulty) for blocks containing in-turn 
signatures.
Suggested 2 to show a slight preference over out-of-turn signatures.

Difficulty is equal to either 1 or 2 and refers to the quality of the chain. The default difficulty should be set to 0x1 in the genesis file.

In Clique PoA, the proposed blocks have a weight and the sealers have a turn. When it is the turn of a sealer, this one will have the privilege of proposing a block with a difficulty (weight) of 2. Such a block is privileged by the network compared to those of weight 1 proposed by "out-of-turn" sealers. This process improves the security of the consensus algorithm and therefore the security of the chain.

To conclude, your PoA blockchain should continue to forge blocks every 5 seconds as long as all your sealers are active. If an "in-turn" validator is offline, the block will be broadcasted with a short delay of rand(SIGNER_COUNT * 500ms) (SIGNER_COUNT = number of sealers).

2
  • 1
    That is interesting. This seems like I won't be facing the slow mining issue as in PoW algorithm over time when difficulty increased to some billions or trillions. Whatever the difficulty number the signer keeps mining it in every 5 seconds of interval forever if everything runs under control. Please correct me if I am wrong.
    – NinjaMAN
    Apr 1, 2021 at 3:12
  • 1
    In PoA, the difficulty has not this exponential impact on block period we could see in PoW. Furthermore it cannot growth, difficulty is either 1 or 2, as explained in the answer. So yes, your chain will continue mining blocks with an interval of 5 seconds for ever.
    – clement
    Apr 1, 2021 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.