hyperlane-xyz / hyperlane-monorepo

The home for Hyperlane core contracts, sdk packages, and other infrastructure
https://hyperlane.xyz
Other
246 stars 282 forks source link

Checker bytecode hashes should be generated from source code #1961

Open yorhodes opened 1 year ago

yorhodes commented 1 year ago

The currently static bytecode hashes in the checker https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/44b26ff70189861bd2948336c40735b63038bb6c/typescript/sdk/src/consts/bytecode.ts should be retrieved from factory.bytecode https://docs.ethers.org/v5/api/contract/contract-factory/#ContractFactory--properties we may need to use getDeployTransaction for immutables which affect the bytecode https://docs.ethers.org/v5/api/contract/contract-factory/#ContractFactory--methods

yorhodes commented 1 year ago

all of these uses should be updated as well https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/44b26ff70189861bd2948336c40735b63038bb6c/typescript/sdk/src/core/HyperlaneCoreChecker.ts#L93

nambrot commented 1 year ago

Do we need #1927 before this? Otherwise i can see it anoying that changing source code rn causes the checker to complain

yorhodes commented 1 year ago

Do we need #1927 before this? Otherwise i can see it anoying that changing source code rn causes the checker to complain

imo its a good thing that checker complains deployer & govern should also resolve but maybe that is the resolution to #1927

nambrot commented 1 year ago

yeah i would wanna understand how common deploy flows happen first before causing source code changes in bytecode to force remedy rn

asaj commented 1 year ago

Do we need #1927 before this? Otherwise i can see it anoying that changing source code rn causes the checker to complain

imo its a good thing that checker complains deployer & govern should also resolve but maybe that is the resolution to #1927

I like this