From 0d630d4c336103e8a7b1026937504e0eb40b81a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Fran=C3=A7a?= Date: Thu, 10 Oct 2024 00:39:03 +0100 Subject: [PATCH] fix --- l2-contracts/contracts/ConsensusRegistry.sol | 10 ++++++++-- .../contracts/interfaces/IConsensusRegistry.sol | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/l2-contracts/contracts/ConsensusRegistry.sol b/l2-contracts/contracts/ConsensusRegistry.sol index de5af6340..ea34afb48 100644 --- a/l2-contracts/contracts/ConsensusRegistry.sol +++ b/l2-contracts/contracts/ConsensusRegistry.sol @@ -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; @@ -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; @@ -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; diff --git a/l2-contracts/contracts/interfaces/IConsensusRegistry.sol b/l2-contracts/contracts/interfaces/IConsensusRegistry.sol index a5e017484..0b2c2efce 100644 --- a/l2-contracts/contracts/interfaces/IConsensusRegistry.sol +++ b/l2-contracts/contracts/interfaces/IConsensusRegistry.sol @@ -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;