Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Misleading Documentation #852

Open
wants to merge 1 commit into
base: consensus-fix-review
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions l2-contracts/contracts/ConsensusRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ contract ConsensusRegistry is IConsensusRegistry, Initializable, Ownable2StepUpg
/// @dev A mapping of node owners => nodes.
mapping(address => Node) public nodes;
/// @dev A mapping for enabling efficient lookups when checking whether a given attester public key exists.
/// @dev Initially, the mappings mark the public keys used by the attesters in the current committee. However,
/// @dev after calling the changeAttesterKey functions, the mappings might also contain public keys of attesters
/// @dev that will only be part of the committee once the contract owner updates the attestersCommit state variable.
mapping(bytes32 => bool) public attesterPubKeyHashes;
/// @dev A mapping for enabling efficient lookups when checking whether a given validator public key exists.
/// @dev Initially, the mappings mark the public keys used by the validators in the current committee. However,
/// @dev after calling the changeValidatorKey functions, the mappings might also contain public keys of validators
/// @dev that will only be part of the committee once the contract owner updates the validatorsCommit state variable.
mapping(bytes32 => bool) public validatorPubKeyHashes;
/// @dev Counter that increments with each new commit to the attester committee.
uint32 public attestersCommit;
Expand Down Expand Up @@ -293,7 +299,7 @@ contract ConsensusRegistry is IConsensusRegistry, Initializable, Ownable2StepUpg
emit ValidatorsCommitted(validatorsCommit);
}

/// @notice Returns an array of `AttesterAttr` structs representing the current attester committee.
/// @notice Returns an array of `CommitteeAttester` structs representing the current attester committee.
/// @dev Collects active and non-removed attesters based on the latest commit to the committee.
function getAttesterCommittee() public view returns (CommitteeAttester[] memory) {
uint256 len = nodeOwners.length;
Expand All @@ -318,7 +324,7 @@ contract ConsensusRegistry is IConsensusRegistry, Initializable, Ownable2StepUpg
return committee;
}

/// @notice Returns an array of `ValidatorAttr` structs representing the current attester committee.
/// @notice Returns an array of `CommitteeValidator` structs representing the current attester committee.
/// @dev Collects active and non-removed validators based on the latest commit to the committee.
function getValidatorCommittee() public view returns (CommitteeValidator[] memory) {
uint256 len = nodeOwners.length;
Expand Down
4 changes: 2 additions & 2 deletions l2-contracts/contracts/interfaces/IConsensusRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ pragma solidity ^0.8.20;
interface IConsensusRegistry {
/// @dev Represents a consensus node.
/// @param attesterLastUpdateCommit The latest `attestersCommit` where the node's attester attributes were updated.
/// @param validatorLastUpdateCommit The latest `validatorsCommit` where the node's validator attributes were updated.
/// @param nodeOwnerIdx Index of the node owner within the array of node owners.
/// @param attesterLatest Attester attributes to read if `node.attesterLastUpdateCommit` < `attestersCommit`.
/// @param attesterSnapshot Attester attributes to read if `node.attesterLastUpdateCommit` == `attestersCommit`.
/// @param validatorLastUpdateCommit The latest `validatorsCommit` where the node's validator attributes were updated.
/// @param validatorLatest Validator attributes to read if `node.validatorLastUpdateCommit` < `validatorsCommit`.
/// @param validatorSnapshot Validator attributes to read if `node.validatorLastUpdateCommit` == `validatorsCommit`.
/// @param nodeOwnerIdx Index of the node owner within the array of node owners.
struct Node {
uint32 attesterLastUpdateCommit;
uint32 validatorLastUpdateCommit;
Expand Down
Loading