Open DimaStebaev opened 1 year ago
Added to 2.3, as a fix is small and crucial for upgrading mainnet IMA
After discussion with D3, Stan - nice to have in 2.3, but could be postponed to 2.4 due to its not planned in 2.3 to upgrade IMA contract
ima 2.1.0-beta.2
Test strategy:
1) Check that if there is no manifest file, upgrade script will print that there is no manifest
2) Check that upgrade script detect <network_name>.json
files, and not only unknown-X.json
Versions: IMA: 2.1.0-beta.2
Result: 1) Script is telling that there is no ProxyAdmin address in manifest, not that there is no manifest
➜ proxy git:(2.1.0-beta.2) ✗ npx hardhat run migrations/upgradeMainnet.ts --network custom
Error: No ProxyAdmin was found in the network manifest at getManifestAdmin (/root/Workspace/IMA/proxy/node_modules/@openzeppelin/hardhat-upgrades/src/admin.ts:65:11)
2) Upgrade script correctly detects networkID via file name
➜ proxy git:(2.1.0-beta.2) ✗ ll .openzeppelin
total 512K
-rw-r--r-- 1 root root 430K Feb 23 17:55 mainnet.json
-rw-r--r-- 1 root root 704 Feb 20 18:11 project.json
-rw-r--r-- 1 root root 76K Feb 23 18:09 sepolia.json
➜ proxy git:(2.1.0-beta.2) ✗ npx hardhat run migrations/upgradeMainnet.ts --network custom
Will mark updated version as 2.1.0-beta.2
Prepare upgrade of MessageProxyForMainnet
...
Summary: First case should be fixed further, second is good.
The bug description There are 3 places where asynchronous functions are called wrong
It causes wrong behavior when a manifest file is not present.
Besides the manifest filename is generated incorrectly for globally known networks such as mainnet, goerli, sepolia, et cetera. https://github.com/skalenetwork/IMA/blob/bbe0c0d452c189f39a8c6bf9f1ca9a03db52128b/proxy/migrations/generateManifest.ts#L137
Probably the
manifestSetup
function is relevant only for actions on schain but it is used in upgrade script for mainnet smart contracts. https://github.com/skalenetwork/IMA/blob/bbe0c0d452c189f39a8c6bf9f1ca9a03db52128b/proxy/migrations/upgradeMainnet.ts#L69To Reproduce Run upgrade of IMA mainnet smart contracts
Expected behavior Smart contracts are upgraded.
Screenshots
Desktop:
Smartphone:
Additional context The issue is present for IMA
2.0.0-beta.16
.