static int distanceFromInTurn(final BlockHeader header, final CliqueContext context) {
    final Address proposer = CliqueHelpers.getProposerOfBlock(header);
    final Collection<Address> validators =
        context.getValidatorProvider().getValidatorsAfterBlock(header);

    // validators is an ordered collection, but as it is a tree set the only way to get an "index"
    // is to walk the tree.
    int index = 0;
    for (final Address validator : validators) {
      if (validator.equals(proposer)) {
        break;
      }
      index++;
    }

    return (int) (header.getNumber() - index) % validators.size();
  }
Distance calculation from step 3 of the forck choice rule in EIP-3436

<p>` (header_number - validator_index) % validator_count `

@param header The block header to calculate distance
@param context The clique context, holding validators last validaion
@return the number of blocks from when the validator in that block was most recently "in turn"
consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueHelpers.java