DKGValidator allows performing a full validation of DKG result, including checking the format of fields in the result, declared selected group members, and signatures of operators supporting the result. The operator submitting the result should perform the validation using a free contract call before submitting the result to ensure their result is valid and can not be challenged. All other network operators should perform validation of the submitted result using a free contract call and challenge the result if the validation fails.
uint256 groupSizeSize of a group in the threshold relay.
uint256 groupThresholdThe minimum number of group members needed to interact according to the protocol to produce a relay entry. The adversary can not learn anything about the key as long as it does not break into groupThreshold+1 of members.
uint256 activeThresholdThe minimum number of active and properly behaving group members
during the DKG needed to accept the result. This number is higher
than groupThreshold to keep a safety margin for members becoming
inactive after DKG so that the group can still produce a relay
entry.
uint256 signatureByteSizeSize in bytes of a single signature produced by operator supporting DKG result.
contract SortitionPool sortitionPoolconstructor(contract SortitionPool _sortitionPool) publicfunction validate(struct BeaconDkg.Result result, uint256 seed, uint256 startBlock) external view returns (bool isValid, string errorMsg)Performs a full validation of DKG result, including checking the format of fields in the result, declared selected group members, and signatures of operators supporting the result.
| Name | Type | Description |
|---|---|---|
| result | struct BeaconDkg.Result | |
| seed | uint256 | seed used to start the DKG and select group members |
| startBlock | uint256 | DKG start block |
| Name | Type | Description |
|---|---|---|
| isValid | bool | true if the result is valid, false otherwise |
| errorMsg | string | validation error message; empty for a valid result |
function validateFields(struct BeaconDkg.Result result) public pure returns (bool isValid, string errorMsg)Performs a static validation of DKG result fields: lengths, ranges, and order of arrays.
| Name | Type | Description |
|---|---|---|
| isValid | bool | true if the result is valid, false otherwise |
| errorMsg | string | validation error message; empty for a valid result |
function validateGroupMembers(struct BeaconDkg.Result result, uint256 seed) public view returns (bool)Performs validation of group members as declared in DKG result against group members selected by the sortition pool.
| Name | Type | Description |
|---|---|---|
| result | struct BeaconDkg.Result | |
| seed | uint256 | seed used to start the DKG and select group members |
| Name | Type | Description |
|---|---|---|
| [0] | bool | true if group members matches; false otherwise |
function validateSignatures(struct BeaconDkg.Result result, uint256 startBlock) public view returns (bool)Performs validation of signatures supplied in DKG result.
Note that this function does not check if addresses which
supplied signatures supporting the result are the ones selected
to the group by sortition pool. This function should be used
together with validateGroupMembers.
| Name | Type | Description |
|---|---|---|
| result | struct BeaconDkg.Result | |
| startBlock | uint256 | DKG start block |
| Name | Type | Description |
|---|---|---|
| [0] | bool | true if group members matches; false otherwise |
function validateMembersHash(struct BeaconDkg.Result result) public pure returns (bool)Performs validation of hashed group members that actively took part in DKG.
| Name | Type | Description |
|---|---|---|
| result | struct BeaconDkg.Result | DKG result |
| Name | Type | Description |
|---|---|---|
| [0] | bool | true if result's group members hash matches with the one that is challenged. |