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

feat: distinct function selector for new domain on RoutingISM #5219

Open
wants to merge 8 commits into
base: audit-q1-2025
Choose a base branch
from

Conversation

yorhodes
Copy link
Member

@yorhodes yorhodes commented Jan 20, 2025

Description

Introduces a new function selector add for adding new domains to a Routing ISM (reverts if this domain already exists). This allows us to have distinct role-based access control for add and set on an AccessManager instance.

Drive-by Changes

Adds batch variants of set and add.

Related issues

Backward compatibility

Yes

Testing

Unit Tests

Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: a5ea9d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/core Minor
@hyperlane-xyz/helloworld Patch
@hyperlane-xyz/sdk Patch
@hyperlane-xyz/infra Patch
@hyperlane-xyz/cli Patch
@hyperlane-xyz/widgets Patch
@hyperlane-xyz/ccip-server Patch
@hyperlane-xyz/github-proxy Patch
@hyperlane-xyz/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yorhodes yorhodes changed the title Implement distinct fn for new domain on RoutingISM feat: distinct function selector for new domain on RoutingISM Jan 20, 2025
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (audit-q1-2025@b36bf0c). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             audit-q1-2025    #5219   +/-   ##
================================================
  Coverage                 ?   77.72%           
================================================
  Files                    ?      104           
  Lines                    ?     2137           
  Branches                 ?      192           
================================================
  Hits                     ?     1661           
  Misses                   ?      455           
  Partials                 ?       21           
Components Coverage Δ
core 87.80% <0.00%> (?)
hooks 79.57% <0.00%> (?)
isms 83.72% <0.00%> (?)
token 90.90% <0.00%> (?)
middlewares 79.80% <0.00%> (?)

for (uint256 i = 0; i < _length; ++i) {
_set(_domains[i], address(__modules[i]));
}
_set(_domains, __modules);

Check warning

Code scanning / Olympix Integrated Security

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests Medium

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests
IInterchainSecurityModule[] calldata __modules
) internal {
require(_domains.length == __modules.length, "length mismatch");
uint256 _length = _domains.length;

Check notice

Code scanning / Olympix Integrated Security

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
) internal {
require(_domains.length == __modules.length, "length mismatch");
uint256 _length = _domains.length;
for (uint256 i = 0; i < _length; ++i) {

Check notice

Code scanning / Olympix Integrated Security

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
) internal {
require(_domains.length == __modules.length, "length mismatch");
uint256 _length = _domains.length;
for (uint256 i = 0; i < _length; ++i) {

Check notice

Code scanning / Olympix Integrated Security

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low

Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
}

function _add(uint32 _domain, address _module) internal {
require(!_modules.contains(_domain), "Domain already exists");

Check warning

Code scanning / Olympix Integrated Security

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests Medium

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests
uint32[] calldata _domains,
IInterchainSecurityModule[] calldata __modules
) external onlyOwner {
require(_domains.length == __modules.length, "length mismatch");

Check warning

Code scanning / Olympix Integrated Security

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests Medium

Test functions fail to verify specific revert reasons, potentially missing important contract behavior validation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/missing-revert-reason-tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

1 participant