Open
Conversation
…d full uint8 range
chasebrownn
reviewed
Apr 8, 2026
Collaborator
chasebrownn
left a comment
There was a problem hiding this comment.
Just a few minor thoughts - nothing crazy.
Comment on lines
+245
to
+247
| function isDelegated(address validatorAddress) external view returns (bool) { | ||
| return _isDelegated(validatorAddress); | ||
| } |
Collaborator
There was a problem hiding this comment.
Do we want this to return true if a validator retires? Seems this state does not change if there is an unstake or burn of the validator.
Comment on lines
+136
to
+140
| function setValidatorRegion(address validatorAddress, uint8 region) external onlyOwner { | ||
| _checkConsensusNFTOwner(validatorAddress); | ||
| validators[validatorAddress].region = region; | ||
| emit ValidatorRegionUpdated(validatorAddress, region); | ||
| } |
Collaborator
There was a problem hiding this comment.
Should we sanitize region for invalid regions? I know we're only supporting 0-8 currently, but that leaves 9-255 as possible invalid inputs that could throw things off.
| false, | ||
| isDelegated, | ||
| stakeVersion | ||
| blsPubkey, validatorAddress, PENDING_EPOCH, uint32(0), ValidatorStatus.Staked, false, stakeVersion, uint8(0) |
Collaborator
There was a problem hiding this comment.
Do we not want to copy over the existing region value to the new validator?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core feature
uint8 region(GSMA region identifier) toValidatorInfostruct, packed into the existing storage slotsetValidatorRegion(address, uint8)governance function withonlyOwner+ ConsensusNFT ownership checkValidatorRegionUpdated(address indexed, uint8)eventisDelegatedrefactorbool isDelegatedfromValidatorInfostruct to prevent storage slot overflow when addingregionisDelegated(address) viewfunction that checksdelegations[addr].delegator != address(0)_processGenesis(delegation records are set duringdelegateStake, not genesis)Events
indexedtoRewardsClaimed(address indexed claimant, uint256 rewards)indexedtoValidatorRegionUpdated(address indexed validatorAddress, uint8 region)Removed:
EpochGasTargetEpochGasTarget.sol,IEpochGasTarget.sol, andEpochGasTargetTest.t.solDeployments.solanddeployments.jsonDocumentation
design.mdcovering region mapping,setValidatorRegion, and shuffle algorithminvariants.mdTests
setValidatorRegionacross all validator statuses (Active, Staked, PendingActivation, PendingExit, Exited)ValidatorInfoconstructors in tests to reflect struct change (isDelegated->stakeVersion,region)