Skip to content

feat: new validatoroptinhub contract#798

Merged
owen-eth merged 7 commits intomainfrom
optinrouter-new-registry-support
Sep 22, 2025
Merged

feat: new validatoroptinhub contract#798
owen-eth merged 7 commits intomainfrom
optinrouter-new-registry-support

Conversation

@owen-eth
Copy link
Copy Markdown
Contributor

@owen-eth owen-eth commented Sep 19, 2025

Describe your changes

New ValidatorOptInHub contract which allows future registry support/removal/updates.
-Backwards compatibility with OptInRouter, where the OptInRouter's vanilla address will be set to the Hub. Hub will then check every registry and return true if validator is registered in any of them. Existing AVS and Middleware addresses will be replaced to return false in the OptInRouter since they will be covered by the Hub check.
-IsValidatorOptedIn() now returns an array of booleans instead of the previous OptInStatus struct.
-areValidatorsOptedIn() now returns an array of boolean arrays instead of an array of OptInStatus structs.
-The new contract also contains additional isValidatorOptedIn**Any**, which just returns a single bool to signal whether a key is opted-in in any of the registries. The same pattern used in anareValidatorsOptedIn**Any** function which returns a list of bools to signal whether each key is opted-in in any of the registries

Issue ticket number and link

Fixes # (issue)

Checklist before requesting a review

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@owen-eth owen-eth changed the title feat: new validatoroptinhub to support future registry addition and easier use feat: new validatoroptinhub contract Sep 19, 2025
@owen-eth owen-eth requested a review from shaspitz September 19, 2025 19:53
Copy link
Copy Markdown
Contributor

@shaspitz shaspitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level design lgtm 👍

}

/// @notice Returns an array of bool lists indicating whether each validator pubkey is opted in to mev-commit.
function areValidatorsOptedIn(bytes[] calldata valBLSPubKeys) external view returns (bool[][] memory) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the caller know which registry corresponds to which bool for each pubkey?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considered adding a string label for read only purposes, but the caller can also just read the registries array to know the registry address at each index

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String label would be nice for UX purposes, but optional until there's a concrete need for it

Comment thread contracts/contracts/validator-registry/ValidatorOptInHub.sol
Comment thread contracts/l1-deployer-cli.sh Outdated
@@ -8,89 +8,67 @@ pragma solidity 0.8.26;
import {Script} from "forge-std/Script.sol";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo we should create an entirely new deployment script since we are introducing a new contract here. Separately we can create another file for updating the old registry to ref the new one for backwards compatibility

Copy link
Copy Markdown
Contributor

@shaspitz shaspitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@owen-eth owen-eth merged commit ca4e4e8 into main Sep 22, 2025
6 checks passed
@owen-eth owen-eth deleted the optinrouter-new-registry-support branch September 22, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants