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

fix(contracts): InterchainAccountRouter minor audit remediation #4581

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented Sep 27, 2024

Description

  • disabled the ICARouter's ability to change hook given that the user doesn't expect the hook to change after they deploy their ICA account. Hook is not part of the derivation like ism on the destination chain and hence, cannot be configured custom by the user.

Drive-by changes

  • MailboxClient events for hook and ism setting
  • ProtocolFee events for setting beneficiary and owner

Related issues

Backward compatibility

No

Testing

Unit tests

Copy link

changeset-bot bot commented Sep 27, 2024

⚠️ No Changeset found

Latest commit: 842bced

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.93%. Comparing base (bf53f08) to head (842bced).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4581      +/-   ##
==========================================
+ Coverage   73.89%   73.93%   +0.03%     
==========================================
  Files         100      100              
  Lines        1421     1427       +6     
  Branches      180      180              
==========================================
+ Hits         1050     1055       +5     
- Misses        350      351       +1     
  Partials       21       21              
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 76.41% <100.00%> (+0.70%) ⬆️
isms 79.20% <ø> (ø)
token 88.23% <ø> (ø)
middlewares 77.58% <100.00%> (+0.19%) ⬆️

Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

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

my mental model for events is to surface data that is cumulative/not a constant time view call
dont feel strongly but this seems superfluous
I dont think we will ever build an indexer for these?

Copy link
Member

Choose a reason for hiding this comment

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

imo it would be quite simplifying if we just treated this like a normal router
theres not really a big cost of just deploying your own if you cant enroll on an existing set

Copy link
Member

Choose a reason for hiding this comment

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

but probably not the place to make this change

@aroralanuk
Copy link
Contributor Author

my mental model for events is to surface data that is cumulative/not a constant time view call dont feel strongly but this seems superfluous I dont think we will ever build an indexer for these?

is hookset not something we can use in the validator if say the merkle hook gets updated in the future?

Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

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

all lgtm except the only initializing change, please revert

Comment on lines +164 to +168
function setHook(
address _hook
) public override onlyInitializing onlyContractOrNull(_hook) onlyOwner {
hook = IPostDispatchHook(_hook);
}
Copy link
Member

Choose a reason for hiding this comment

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

I dont agree that this should be onlyInitializing

_router,
_body,
new bytes(0),
hook
Copy link
Member

Choose a reason for hiding this comment

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

this is a good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants