IQuorum

Git Source

Inherits: IConsensus

A consensus model controlled by a small, immutable set of n validators.

You can know the value of n by calling the numOfValidators function.

Upon construction, each validator is assigned a unique number between 1 and n. These numbers are used internally instead of addresses for gas optimization reasons.

You can list the validators in the quorum by calling the validatorById function for each ID from 1 to n.

Functions

numOfValidators

Get the number of validators.

function numOfValidators() external view returns (uint256);

validatorId

Get the ID of a validator.

Validators have IDs greater than zero.

Non-validators are assigned to ID zero.

function validatorId(address validator) external view returns (uint256);

Parameters

NameTypeDescription
validatoraddressThe validator address

validatorById

Get the address of a validator by its ID.

Validator IDs range from 1 to N, the total number of validators.

Invalid IDs map to address zero.

function validatorById(uint256 id) external view returns (address);

Parameters

NameTypeDescription
iduint256The validator ID

numOfValidatorsInFavorOf

Get the number of validators in favor of a claim.

function numOfValidatorsInFavorOf(
    address appContract,
    uint256 lastProcessedBlockNumber,
    bytes32 outputsMerkleRoot
) external view returns (uint256);

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
outputsMerkleRootbytes32The outputs Merkle root

Returns

NameTypeDescription
<none>uint256Number of validators in favor of claim

isValidatorInFavorOf

Check whether a validator is in favor of a claim.

Assumes the provided ID is valid.

function isValidatorInFavorOf(
    address appContract,
    uint256 lastProcessedBlockNumber,
    bytes32 outputsMerkleRoot,
    uint256 id
) external view returns (bool);

Parameters

NameTypeDescription
appContractaddressThe application contract address
lastProcessedBlockNumberuint256The number of the last processed block
outputsMerkleRootbytes32The outputs Merkle root
iduint256The ID of the validator

Returns

NameTypeDescription
<none>boolWhether validator is in favor of claim