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

refactor: Relocate message handler interface #543

Merged
merged 2 commits into from
Jul 2, 2024
Merged

refactor: Relocate message handler interface #543

merged 2 commits into from
Jul 2, 2024

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Jun 27, 2024

The MulticallHandler contract currently imports the SpokePool contract and experienced a bytecode change after the following unrelated commit:

86593c6

This resulted in its CREATE2 deployment address changing. The MulticallHandler doesn't actually need any of the SpokePool implementation or its dependencies, and it seems like we'd like the MulticallHandler to be deployed to the same address on as many chains as possible, so factor out the interface to a separate file to insulate it from any unintended modifications.

The MulticallHandler contract currently imports the SpokePool contract
and experienced a bytecode change after the following unrelated change:

86593c6

This change resulted in its CREATE2 deployment address changing. The
MulticallHandler doesn't actually need any of the SpokePool
implementation or its dependencies, and it seems like we'd like the
MulticallHandler to be deployed to the same address on as many chains as
possible, so factor out the interface to a separate file to insulate it
from any unintended changes.
@pxrl pxrl requested review from mrice32, bmzig and james-a-morris June 27, 2024 21:07
Copy link
Contributor

@bmzig bmzig left a comment

Choose a reason for hiding this comment

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

Could we also just do import { AcrossMessageHandler } from "../SpokePool.sol"; in MulticallHandler.sol? It also makes sense to add it to another file, so I'm fine with either.

@pxrl
Copy link
Contributor Author

pxrl commented Jun 27, 2024

Could we also just do import { AcrossMessageHandler } from "../SpokePool.sol"; in MulticallHandler.sol? It also makes sense to add it to another file, so I'm fine with either.

Good call - I hadn't thought of that. I tried it though and I can still get the resulting bytecode to change by making simple changes in contracts/upgradeable/MultiCallerUpgradeable.sol. I'm tbh surprised that it's so sensitive.

Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

Does this keep the MultiCallHandler create2 address the same?

Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Good call +1

@pxrl pxrl merged commit 1045d34 into master Jul 2, 2024
11 checks passed
@pxrl pxrl deleted the pxrl/multicall branch July 2, 2024 09:16
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.

4 participants