From bcebb18190fc172d777c5542baba2eab3f5d4af6 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 16:28:05 +0800 Subject: [PATCH 01/42] chore: update v3.0.0 meta --- .../referentMetadataHashes.json | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/scripts/orbit-versioner/referentMetadataHashes.json b/scripts/orbit-versioner/referentMetadataHashes.json index 0bb73044..65d788e4 100644 --- a/scripts/orbit-versioner/referentMetadataHashes.json +++ b/scripts/orbit-versioner/referentMetadataHashes.json @@ -1,4 +1,58 @@ { + "v3.0.0":{ + "eth": { + "Inbox": [ + "1220a8e6c35fe4090e6f290c91615dff206bf292ff3ef98713aa72da6ba65f48", + "1220ae2e9b8ab3513d7c2bce41d0cd7e738751340a043030ee880915bec6f3e5" + ], + "Outbox": [ + "1220e5f8ce06235750d407a30ba6a949de60886062a846bea52bb65e0d34f11e", + "12205743a26881f654a05b125ff9bf145327c68b6d5ab30f9201926fd0de57ca" + ], + "SequencerInbox": [ + "122099c68e0c4fc9caadfc7a0b2c4b436644dc6aba460ffc31489167885e22f2", + "122038e99cf4eb42b1bd091544a0482c80ae5681aaff1e73e5b858eba14b3289" + ], + "Bridge": [ + "1220bae7eaf18c61f7d8559a1edc92b1ee8dea4400c55ec0b1b0c4df659b4984", + "1220a21db9d1c105cea300448647867f48dc194bd84b4ac5452c7532acb850e4" + ] + }, + "erc20": { + "Inbox": [ + "12201b7c440f00a6f6c1cac2b1b7273b28b716d71fc9a59d033d5424cd326aa6", + "1220265f869376b6c520445ee90b23fc3e870282a128759593a36018a4b154b4" + ], + "Outbox": [ + "1220fd62bd1cf925b2618d01c259e2123459674bc5fe8b1432a4dc8aa3b7affe", + "12203107dfc7dba114f418f026d5d8a974bb47263d948207dc0c305e65ad3714" + ], + "SequencerInbox": [ + "122099c68e0c4fc9caadfc7a0b2c4b436644dc6aba460ffc31489167885e22f2", + "122038e99cf4eb42b1bd091544a0482c80ae5681aaff1e73e5b858eba14b3289" + ], + "Bridge": [ + "12208618f0361aadde6e5ed67aec672032b5d03593fc75ed8adf89145ee93fc3", + "12200ffc0009dbe213082c30b6db421b75a0f6bf2f69011875f2b1c3d0423afb" + ] + }, + "RollupProxy": [ + "1220c50f3bd10cc10c9d6a7e3c77a603ea076a398bfabf2598ec9e1d71302b8c", + "12209bf2c0238c2505716be0e1d04df7889d4edb5024e1ba28c8c320a9287abf" + ], + "RollupAdminLogic": [ + "12201b1f12c1dedf74ff792cdd420011c650d657ae97ae48a1ecb2f81ecc86d9", + "122079a2eee6b69c780f4b6d641fceaab53e1a7c4dd0fe1510ed52555779445a" + ], + "RollupUserLogic": [ + "1220adac40079ee3a5b023334745bf53c80fdb89f53847bb69953dd97b277c66", + "1220f955cb8523efeeee460da93d0463abf4ef78c2c2cb44d89f516dbbcac7ff" + ], + "ChallengeManager": [ + "1220be58ff753a772f5eac411153528470a00d3296a9952fd0d965a20c027d34", + "12207d5df4a80d58a52352e9efc07a006f66c944826899b9419b94d6deb8c4e1" + ] + }, "v2.1.0": { "eth": { "Inbox": [ From 0e9f4db2ea1de8a424b82771c96f204fa7264d97 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 16:47:26 +0800 Subject: [PATCH 02/42] feat: add any --- scripts/orbit-versioner/orbitVersioner.ts | 27 ++++++----------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index ee713568..e2f00cba 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -167,25 +167,9 @@ function _canBeUpgradedToTargetVersion( if (targetVersion === 'v2.1.0') { supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], - Outbox: [ - 'v1.1.0', - 'v1.1.1', - 'v1.2.0', - 'v1.2.1', - 'v1.3.0', - 'v2.0.0', - 'v2.1.0', - ], + Outbox: ['any'], Bridge: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], - RollupProxy: [ - 'v1.1.0', - 'v1.1.1', - 'v1.2.0', - 'v1.2.1', - 'v1.3.0', - 'v2.0.0', - 'v2.1.0', - ], + RollupProxy: ['any'], RollupAdminLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], RollupUserLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], ChallengeManager: ['v1.2.1', 'v1.3.0'], @@ -194,9 +178,9 @@ function _canBeUpgradedToTargetVersion( } else if (targetVersion === 'v1.2.1') { supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], - Outbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], + Outbox: ['any'], Bridge: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], - RollupProxy: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], + RollupProxy: ['any'], RollupAdminLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], RollupUserLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], ChallengeManager: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], @@ -211,6 +195,9 @@ function _canBeUpgradedToTargetVersion( for (const [contract, supportedSourceVersions] of Object.entries( supportedSourceVersionsPerContract )) { + if (supportedSourceVersions.includes('any')) { + continue + } if (!supportedSourceVersions.includes(currentVersions[contract]!)) { // found contract that can't be upgraded to target version console.log('Cannot upgrade', contract, 'to', targetVersion) From 42d28de2e761123eaaab94cedfda73dc3b49e74e Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 16:47:50 +0800 Subject: [PATCH 03/42] docs: comments --- scripts/orbit-versioner/orbitVersioner.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index e2f00cba..869898e3 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -165,6 +165,7 @@ function _canBeUpgradedToTargetVersion( let supportedSourceVersionsPerContract: { [key: string]: string[] } = {} if (targetVersion === 'v2.1.0') { + // v2.1.0 will upgrade rollup logics and challenge manager supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], Outbox: ['any'], @@ -176,6 +177,7 @@ function _canBeUpgradedToTargetVersion( SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], } } else if (targetVersion === 'v1.2.1') { + // v1.2.1 will upgrade sequencer inbox and challenge manager supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], Outbox: ['any'], From fcedcf554576bd4ad0f996bb235792ee89c53a9b Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 16:55:59 +0800 Subject: [PATCH 04/42] chore: add rei hashes --- scripts/orbit-versioner/orbitVersioner.ts | 23 ++++++++++++------- .../referentMetadataHashes.json | 10 +++++++- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 869898e3..246a5e66 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -31,6 +31,7 @@ interface RollupHashes { RollupAdminLogic: string[] RollupUserLogic: string[] ChallengeManager: string[] + RollupEventInbox: string[] } interface MetadataHashesByVersion { [version: string]: MetadataHashesByNativeToken & RollupHashes @@ -65,14 +66,10 @@ async function main() { const bridge = IBridge__factory.connect(bridgeAddress, provider) const seqInboxAddress = await bridge.sequencerInbox() const rollupAddress = await bridge.rollup() - const outboxAddress = await IRollupCore__factory.connect( - rollupAddress, - provider - ).outbox() - const challengeManagerAddress = await IRollupCore__factory.connect( - rollupAddress, - provider - ).challengeManager() + const rollup = IRollupCore__factory.connect(rollupAddress, provider) + const outboxAddress = await rollup.outbox() + const challengeManagerAddress = await rollup.challengeManager() + const rollupEventInboxAddress = await rollup.rollupEventInbox() // get metadata hashes const metadataHashes: { [key: string]: string } = { @@ -92,6 +89,10 @@ async function main() { await _getLogicAddress(bridgeAddress, provider), provider ), + RollupEventInbox: await _getMetadataHash( + await _getLogicAddress(rollupEventInboxAddress, provider), + provider + ), RollupProxy: await _getMetadataHash(rollupAddress, provider), RollupAdminLogic: await _getMetadataHash( await _getLogicAddress(rollupAddress, provider), @@ -133,6 +134,10 @@ function _checkForPossibleUpgrades(currentVersions: { [key: string]: string | null }) { const targetVersionsDescending = [ + { + version: 'v3.0.0', + actionName: 'XXX', + }, { version: 'v2.1.0', actionName: 'NitroContracts2Point1Point0UpgradeAction', @@ -170,6 +175,7 @@ function _canBeUpgradedToTargetVersion( Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], Outbox: ['any'], Bridge: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], + RollupEventInbox: ['any'], RollupProxy: ['any'], RollupAdminLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], RollupUserLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], @@ -182,6 +188,7 @@ function _canBeUpgradedToTargetVersion( Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], Outbox: ['any'], Bridge: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], + RollupEventInbox: ['any'], RollupProxy: ['any'], RollupAdminLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], RollupUserLogic: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1'], diff --git a/scripts/orbit-versioner/referentMetadataHashes.json b/scripts/orbit-versioner/referentMetadataHashes.json index 65d788e4..3ccbc29c 100644 --- a/scripts/orbit-versioner/referentMetadataHashes.json +++ b/scripts/orbit-versioner/referentMetadataHashes.json @@ -1,5 +1,5 @@ { - "v3.0.0":{ + "v3.0.0": { "eth": { "Inbox": [ "1220a8e6c35fe4090e6f290c91615dff206bf292ff3ef98713aa72da6ba65f48", @@ -16,6 +16,10 @@ "Bridge": [ "1220bae7eaf18c61f7d8559a1edc92b1ee8dea4400c55ec0b1b0c4df659b4984", "1220a21db9d1c105cea300448647867f48dc194bd84b4ac5452c7532acb850e4" + ], + "RollupEventInbox": [ + "12202e329e1a0c9bb43dce08dd86f50a25f359bac1bbd58289ad7319cb11e151", + "1220a4508e3924bc48413d05ae71f986fa09f67b9edf853b56ea3e6ed4a5b847" ] }, "erc20": { @@ -34,6 +38,10 @@ "Bridge": [ "12208618f0361aadde6e5ed67aec672032b5d03593fc75ed8adf89145ee93fc3", "12200ffc0009dbe213082c30b6db421b75a0f6bf2f69011875f2b1c3d0423afb" + ], + "RollupEventInbox": [ + "1220ee8677b4eafaaeb1fc21515e42f0fecb06859156ef43489514be59e3d4bd", + "1220bea5022b33ad40c8720af015ab790b465b5e2f8ad9ff7dae140292f60448" ] }, "RollupProxy": [ From b5858f5a1de09b9c81b2204d109506406c17d256 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 17:06:20 +0800 Subject: [PATCH 05/42] fix: type --- scripts/orbit-versioner/orbitVersioner.ts | 2 +- .../referentMetadataHashes.json | 78 ++++++++++++------- 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 246a5e66..5ce32c9e 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -21,6 +21,7 @@ interface BridgeHashes { Outbox: string[] SequencerInbox: string[] Bridge: string[] + RollupEventInbox: string[] } interface MetadataHashesByNativeToken { eth: BridgeHashes @@ -31,7 +32,6 @@ interface RollupHashes { RollupAdminLogic: string[] RollupUserLogic: string[] ChallengeManager: string[] - RollupEventInbox: string[] } interface MetadataHashesByVersion { [version: string]: MetadataHashesByNativeToken & RollupHashes diff --git a/scripts/orbit-versioner/referentMetadataHashes.json b/scripts/orbit-versioner/referentMetadataHashes.json index 3ccbc29c..a241d88e 100644 --- a/scripts/orbit-versioner/referentMetadataHashes.json +++ b/scripts/orbit-versioner/referentMetadataHashes.json @@ -78,7 +78,8 @@ "Bridge": [ "12206c38d558afd13c030589dace1d3b4f8d157625dfc5f1ee771258bbf86c5d", "12202046bd5adb858c77c93e2b65a31b8f11b3f381d5055793f137e085421542" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -96,7 +97,8 @@ "Bridge": [ "122091f2b3a26837eb7f6ae1ee1395e00da6a57a8923d02f716ccaebf4348167", "12202b5d5c431949e42cc0f94ae888b71651bdbd6aad7d357822e0b769a9310d" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "1220039b2791e4013e004cd51e37e19e1137184e0a7f5dec2621e721140c54ba", @@ -132,7 +134,8 @@ "Bridge": [ "1220506ed7ef8395a03cfb43943c618809bd281b51ea77ecd261aed28bb30a8d", "12201a9f67fb3c7f5bfec02931dc84a6854b5cb012b0746f1476e2c0a03cdafb" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -150,7 +153,8 @@ "Bridge": [ "12203ff1e011449147ed6c37be48c3ee711841c26d4edb6eec8f48144eac53c7", "12200597a9ae76302c33df923d6ed948d9378de1e91f0c351cf3b1c0410fad28" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "1220c1a242275798d8f2e0b3a59eea6aea18c580869c70ad2fbf232f106e4ce5", @@ -186,7 +190,8 @@ "Bridge": [ "1220ba7a1cededf660a42a7377a73bb0d14a4397581fcbb24bebdd45d63810c2", "1220cf8a2df9168c7d5af713d037a7a686dc8face22911e8979f91a80e8c1560" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -204,7 +209,8 @@ "Bridge": [ "1220f587e602015bef05909a3dc4d3f302450c6b00ea429653353e9c6a202972", "12204de6c5de92ad43eb67bffc52cab35d3bfe43bdbe1c92a87b47c52c4219fe" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "12201b31c429a0e4c8b02c3e9ecc213345054112368bf2c3821ae941dd87167c", @@ -240,7 +246,8 @@ "Bridge": [ "1220ba7a1cededf660a42a7377a73bb0d14a4397581fcbb24bebdd45d63810c2", "1220c3c76b4863c78b535187aa58b9b008b260271e5be20b6319095c61fa1f62" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -258,7 +265,8 @@ "Bridge": [ "1220f587e602015bef05909a3dc4d3f302450c6b00ea429653353e9c6a202972", "12202ba4687d78116ae8629782b0ccc8e70f30db90127cc1ee45a07dadbab544" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "12201f644f13efd6c7b8c4ef216106f36b132e19c811eeb8cee47de7e96b69d5", @@ -294,7 +302,8 @@ "Bridge": [ "1220fc415098f1984b6eb0036bf74d4c58c8f2aecced4f9aa23bc8f1ec40a763", "12202c5ff330f1a94e5bb5b2e35bdc74b9b974d83de9f9705f82ed0f23e74816" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -312,7 +321,8 @@ "Bridge": [ "1220608c64e88e11ca7c69079c15d6e7a635d96c8c450b764d917d39c39d927a", "12200feb0990fb1e40d8b046a8996b213f9ee17c5e9a707d81f49b65d1fb9403" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "122050d53014317e8cdb5c3e4f6737c818a3257250f410e29949414733539236", @@ -348,7 +358,8 @@ "Bridge": [ "122036229552e25569ee81b36ff0079ed482a0f5114c34695a273717057e68b7", "12203cb53c06e3d38f5055af396f234d714307935d59ca28459db5226efad4d0" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -366,7 +377,8 @@ "Bridge": [ "1220acaca6cc8d40714063ec21646cf3fb554ba0394dc105b80d1c758ae649ee", "1220611c0f41c29b817325b2d56fbd2d81ce85b6458fab21ed9f950ad47db5dd" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "122045d1669737d3f66bbfc5cb21688cdbc2decfc09897811ac43760f60bfdc1", @@ -402,7 +414,8 @@ "Bridge": [ "122036229552e25569ee81b36ff0079ed482a0f5114c34695a273717057e68b7", "12203cb53c06e3d38f5055af396f234d714307935d59ca28459db5226efad4d0" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": [ @@ -420,7 +433,8 @@ "Bridge": [ "1220acaca6cc8d40714063ec21646cf3fb554ba0394dc105b80d1c758ae649ee", "1220611c0f41c29b817325b2d56fbd2d81ce85b6458fab21ed9f950ad47db5dd" - ] + ], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "122045d1669737d3f66bbfc5cb21688cdbc2decfc09897811ac43760f60bfdc1", @@ -452,13 +466,15 @@ ], "Bridge": [ "12201fc2f62f301cacfe134a078470b95e8ac19b8ac3be1ae1c76208c3da5e45" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "122060f5deee0a99bbc2c2d0731e05f3c9710ab8e2c75e0cbc20f8935a93229d" @@ -486,13 +502,15 @@ ], "Bridge": [ "1220a48ff3a66ec9a49bf00ab4d639b5f224664d4cf9ee281ee5feb2111c43bf" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "122060f5deee0a99bbc2c2d0731e05f3c9710ab8e2c75e0cbc20f8935a93229d" @@ -520,13 +538,15 @@ ], "Bridge": [ "1220a866b4912045c6c37c22a163c767d0d623c89bec19b9daba7e0208beee06" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "12202ed603dc21970c25521fb1c7854b938f777a8157233615740ea445d17d08" @@ -554,13 +574,15 @@ ], "Bridge": [ "1220711f146678e425a300d270a5f9c04973e720a2571efa5f0ec557c81e750c" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "1220aeae77513137259801b7ab6793936907a0e6897fd62899007329b9a2e33f" @@ -588,13 +610,15 @@ ], "Bridge": [ "12208d5132810e8d5b98491e43f5a09f382935a7c32e395c98416ee408e6742b" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": [ "1220c810c2a8b0f7c41e29d1351996102968a231fa74a467bdcbba66c06a4c0e" @@ -622,13 +646,15 @@ ], "Bridge": [ "122058d67ed2766b0236b5d54528534f6bf055a580c8cb1694f76b78ad2dd6b3" - ] + ], + "RollupEventInbox": ["n/a"] }, "erc20": { "Inbox": ["n/a"], "Outbox": ["n/a"], "SequencerInbox": ["n/a"], - "Bridge": ["n/a"] + "Bridge": ["n/a"], + "RollupEventInbox": ["n/a"] }, "RollupProxy": ["n/a"], "RollupAdminLogic": [ From a3887a489aa6709122e687bbd39fc7671642531d Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 17:45:26 +0800 Subject: [PATCH 06/42] feat: check fee token --- scripts/orbit-versioner/orbitVersioner.ts | 43 +++++++++++++++++------ 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 5ce32c9e..70c13646 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -116,10 +116,15 @@ async function main() { console.log('\nMetadataHashes of deployed contracts:', metadataHashes, '\n') } + let isFeeTokenChain = false const versions: { [key: string]: string | null } = {} // get and print version per bridge contract Object.keys(metadataHashes).forEach(key => { - versions[key] = _getVersionOfDeployedContract(metadataHashes[key]) + const { version, isErc20 } = _getVersionOfDeployedContract( + metadataHashes[key] + ) + versions[key] = version + if (isErc20) isFeeTokenChain = true console.log( `Version of deployed ${key}: ${versions[key] ? versions[key] : 'unknown'}` ) @@ -127,12 +132,15 @@ async function main() { // TODO: make this more generic to support other other upgrade paths in the future // TODO: also check osp - _checkForPossibleUpgrades(versions) + _checkForPossibleUpgrades(versions, isFeeTokenChain) } -function _checkForPossibleUpgrades(currentVersions: { - [key: string]: string | null -}) { +function _checkForPossibleUpgrades( + currentVersions: { + [key: string]: string | null + }, + isFeeTokenChain: boolean +) { const targetVersionsDescending = [ { version: 'v3.0.0', @@ -149,7 +157,13 @@ function _checkForPossibleUpgrades(currentVersions: { ] for (const target of targetVersionsDescending) { - if (_canBeUpgradedToTargetVersion(target.version, currentVersions)) { + if ( + _canBeUpgradedToTargetVersion( + target.version, + currentVersions, + isFeeTokenChain + ) + ) { console.log( `This deployment can be upgraded to ${target.version} using ${target.actionName}` ) @@ -164,7 +178,8 @@ function _canBeUpgradedToTargetVersion( targetVersion: string, currentVersions: { [key: string]: string | null - } + }, + isFeeTokenChain: boolean ): boolean { console.log('\nChecking if deployment can be upgraded to', targetVersion) @@ -217,7 +232,10 @@ function _canBeUpgradedToTargetVersion( return true } -function _getVersionOfDeployedContract(metadataHash: string): string | null { +function _getVersionOfDeployedContract(metadataHash: string): { + version: string | null + isErc20: boolean +} { for (const [version] of Object.entries(referentMetadataHashes)) { // check if given hash matches any of the referent hashes for specific version const versionHashes = referentMetadataHashes[version] @@ -230,11 +248,16 @@ function _getVersionOfDeployedContract(metadataHash: string): string | null { ...versionHashes.ChallengeManager, ] + const erc20Hashes = [...Object.values(versionHashes.erc20).flat()] + if (allHashes.includes(metadataHash)) { - return version + if (erc20Hashes.includes(metadataHash)) { + return { version, isErc20: true } + } + return { version, isErc20: false } } } - return null + return { version: null, isErc20: false } } async function _getMetadataHash( From 3a33b97932316087be814ab5607930b90e42ca3e Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 17:48:06 +0800 Subject: [PATCH 07/42] feat: v3 upgrade check --- scripts/orbit-versioner/orbitVersioner.ts | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 70c13646..ac0f5b31 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -144,7 +144,7 @@ function _checkForPossibleUpgrades( const targetVersionsDescending = [ { version: 'v3.0.0', - actionName: 'XXX', + actionName: 'BOLD UpgradeAction', }, { version: 'v2.1.0', @@ -184,7 +184,40 @@ function _canBeUpgradedToTargetVersion( console.log('\nChecking if deployment can be upgraded to', targetVersion) let supportedSourceVersionsPerContract: { [key: string]: string[] } = {} - if (targetVersion === 'v2.1.0') { + if (targetVersion === 'v3.0.0') { + // v3.0.0 will upgrade bridge, inbox, rollupEventInbox, outbox, sequencerInbox, rollup logics, challengeManager + supportedSourceVersionsPerContract = { + Inbox: [ + 'v1.1.0', + 'v1.1.1', + 'v1.2.0', + 'v1.2.1', + 'v1.3.0', + 'v2.0.0', + 'v2.1.0', + ], + Outbox: ['any'], + Bridge: [ + 'v1.1.0', + 'v1.1.1', + 'v1.2.0', + 'v1.2.1', + 'v1.3.0', + 'v2.0.0', + 'v2.1.0', + ], + RollupEventInbox: ['any'], + RollupProxy: ['any'], + RollupAdminLogic: ['v2.0.0', 'v2.1.0'], + RollupUserLogic: ['v2.0.0', 'v2.1.0'], + ChallengeManager: ['v2.0.0', 'v2.1.0'], + SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], + } + if (isFeeTokenChain) { + // cannot upgrade erc20 orbit chains from v1 to v3 right now due to a storage diff + supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0'] + } + } else if (targetVersion === 'v2.1.0') { // v2.1.0 will upgrade rollup logics and challenge manager supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], From 71e2bf194c2ef603dc9f890b36cfdbfc2aa92a37 Mon Sep 17 00:00:00 2001 From: gzeon Date: Wed, 8 Jan 2025 18:18:01 +0800 Subject: [PATCH 08/42] docs: bold upgrade draft --- README.md | 4 + .../foundry/contract-upgrades/3.0.0/README.md | 87 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 scripts/foundry/contract-upgrades/3.0.0/README.md diff --git a/README.md b/README.md index 6a9f3c82..991c04c8 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ _This section is also referenced in the documentation on ["How to upgrade ArbOS For ArbOS upgrades, a common pre-requisite is to deploy new Nitro contracts to the parent chain of your Orbit chain before scheduling the ArbOS upgrade. These contracts include the rollup logic, fraud proof contracts, and interfaces for interacting with Nitro precompiles. The scripts and instructions in this repository are meant for Orbit chain owners to upgrade the aforementioned contracts, set the new WASM module root, and then schedule the ArbOS upgrade. +### Nitro contracts 3.0.0 (for [BoLD](https://docs.arbitrum.io/how-arbitrum-works/bold/gentle-introduction)) + +The [`nitro-contracts 3.0.0` upgrade guide](scripts/foundry/contract-upgrades/3.0.0) will use the [BOLDUpgradeAction](https://github.com/OffchainLabs/nitro-contracts/blob/main/src/rollup/BOLDUpgradeAction.sol) from the [nitro-contract](https://github.com/OffchainLabs/nitro-contracts) repo. There are no associated ArbOS upgrade for BoLD. + ### Nitro contracts 2.1.0 (for [ArbOS 32 Bianca](https://docs.arbitrum.io/run-arbitrum-node/arbos-releases/arbos32)) The [`nitro-contracts 2.1.0` upgrade action](scripts/foundry/contract-upgrades/2.1.0) will deploy `nitro-contracts v2.1.0` contracts to your Orbit's parent chain. Note that this action will only work for chains with `nitro-contracts v1.2.1` or `nitro-contracts v1.3.0`. diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md new file mode 100644 index 00000000..57d3a265 --- /dev/null +++ b/scripts/foundry/contract-upgrades/3.0.0/README.md @@ -0,0 +1,87 @@ +# Nitro contracts 3.0.0 upgrade + +To upgrade to Nitro contracts 3.0.0 (BoLD), you will need to use the [BOLDUpgradeAction](https://github.com/OffchainLabs/nitro-contracts/blob/main/src/rollup/BOLDUpgradeAction.sol) from the [nitro-contract](https://github.com/OffchainLabs/nitro-contracts) repo. + +BOLDUpgradeAction will perform the following actions: + +1. Upgrade bridge, inbox, rollupEventInbox, outbox, sequencerInbox to v3.0.0 +2. Deploy new v3.0.0 BoLD challenge manager +3. Migrate v2 rollup into a new v3.0.0 rollup address +4. Setup the rollup according to the new config and use the latest confirmed assertion on the old rollup as genesis of the new rollup + +Note that contracts without code changes are not upgraded. It is normal to have some contracts still in the old version after the upgrade as they are equivalent to the new version. There are no associated ArbOS upgrade for this version. + +## Requirements + +This upgrade only support upgrading from the following [nitro-contract release](https://github.com/OffchainLabs/nitro-contracts/releases): + +- Inbox: v1.1.0 - v2.1.0 inclusive +- Outbox: any +- SequencerInbox: v1.2.1 - v2.1.0 inclusive +- Bridge + - eth chain: v1.1.0 - v2.1.0 inclusive + - custom-fee token chain: v2.0.0 - v2.1.0 inclusive +- RollupProxy: v1.1.0 - v2.1.0 inclusive +- RollupAdminLogic: v2.0.0 - v2.1.0 inclusive +- RollupUserLogic: v2.0.0 - v2.1.0 inclusive +- ChallengeManager: v2.0.0 - v2.1.0 inclusive + +Please refer to the top [README](../../README.md) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. + +## How to use it + +1. Clone nitro-contract repo +``` +$ git clone https://github.com/OffchainLabs/nitro-contracts.git +$ cd nitro-contracts +``` + +2. Checkout the v3.0.0 tag +``` +$ git checkout v3.0.0 +``` + +3. Install yarn dependencies +``` +$ yarn install +``` + +4. In `scripts/files/configs`, create a new config file +``` +$ cp scripts/files/configs/arb1.ts scripts/files/configs/yourchain.ts +``` + +5. Edit `scripts/files/configs/yourchain.ts`, be very careful as they will override existing configs + +6. Setup .env in project root, make sure CONFIG_NETWORK_NAME is same as the config name (e.g. yourchain) +``` +$ cp .env-sample .env +``` + +7. Run the prepare script, this will deploy the actions. L1_PRIV_KEY does not need to be the chain owner. +``` +$ L1_PRIV_KEY=xxx INFURA_KEY=xxx ETHERSCAN_API_KEY=xxx yarn script:bold-prepare --network {mainnet|arb1|base|arbSepolia} +... +Verified contract BOLDUpgradeAction successfully. +Deployed contracts written to: scripts/files/sepoliaDeployedContracts.json +Done. +``` + +8. Make sure everything is configured correctly. It would be nice to temporarily shutdown all validators. + +9. Run the populate lookup script, this will store the last confirmed assertion on-chain for the next step. +``` +$ L1_PRIV_KEY=$(cast wallet private-key --account arbl1) yarn script:bold-populate-lookup +... +Done. +``` + +10. Run the upgrade script. If the L1_PRIV_KEY is not the chain owner, it will print the upgrade payload. Execute the payload with the chain owner. +``` +$ L1_PRIV_KEY=xxx yarn script:bold-local-execute +eoa with executor role: 0x6EC62D826aDc24AeA360be9cF2647c42b9Cdb19b +upgrade executor: 0x5FEe78FE9AD96c1d8557C6D6BB22Eb5A61eeD315 +execute(...) call to upgrade executor: 0x1cff79cd000000000000000000000000f8199ca3702c09c78b957d4d820311125753c6d2000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a4ebe03a93000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030000000000000000000000008a8f0a24d7e58a76fc8f77bb68c7c902b91e182e00000000000000000000000087630025e63a30ecf9ca9d580d9d95922fea6af0000000000000000000000000c32b93e581db6ebc50c08ce381143a259b92f1ed00000000000000000000000000000000000000000000000000000000 +``` + +## FAQ From 2466ef658da9aa6b8c96f8dc70076be1b455de52 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:27:00 -0500 Subject: [PATCH 09/42] add version path --- scripts/orbit-versioner/orbitVersioner.ts | 40 +++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index ac0f5b31..9d32cb27 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -146,6 +146,10 @@ function _checkForPossibleUpgrades( version: 'v3.0.0', actionName: 'BOLD UpgradeAction', }, + { + version: 'v2.1.2', + actionName: 'NitroContracts2Point1Point2UpgradeAction', + }, { version: 'v2.1.0', actionName: 'NitroContracts2Point1Point0UpgradeAction', @@ -215,9 +219,41 @@ function _canBeUpgradedToTargetVersion( } if (isFeeTokenChain) { // cannot upgrade erc20 orbit chains from v1 to v3 right now due to a storage diff - supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0'] + supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0', 'v2.1.2'] + } + } else if (targetVersion === 'v2.1.2') { + // v2.1.2 will upgrade the ERC20Bridge contract to set decimals in storage + // v2.1.2 is only required for custom fee token chains + // only necessary if ERC20Bridge is < v2.0.0 + // must have performed v2.1.0 upgrade first + if (!isFeeTokenChain) { + supportedSourceVersionsPerContract = { + Inbox: [], + Outbox: [], + Bridge: [], + RollupEventInbox: [], + RollupProxy: [], + RollupAdminLogic: [], + RollupUserLogic: [], + ChallengeManager: [], + SequencerInbox: [], + } } - } else if (targetVersion === 'v2.1.0') { + else { + supportedSourceVersionsPerContract = { + Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], + Outbox: ['any'], + Bridge: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], + RollupEventInbox: ['any'], + RollupProxy: ['any'], + RollupAdminLogic: ['v2.1.0'], + RollupUserLogic: ['v2.1.0'], + ChallengeManager: ['v2.1.0'], + SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], + } + } + } + else if (targetVersion === 'v2.1.0') { // v2.1.0 will upgrade rollup logics and challenge manager supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], From 318b4bae8e19ca6233c869ab0730fc2245d692ff Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:43:28 -0500 Subject: [PATCH 10/42] fmt --- scripts/orbit-versioner/orbitVersioner.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 9d32cb27..5dc17024 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -238,8 +238,7 @@ function _canBeUpgradedToTargetVersion( ChallengeManager: [], SequencerInbox: [], } - } - else { + } else { supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], Outbox: ['any'], @@ -252,8 +251,7 @@ function _canBeUpgradedToTargetVersion( SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], } } - } - else if (targetVersion === 'v2.1.0') { + } else if (targetVersion === 'v2.1.0') { // v2.1.0 will upgrade rollup logics and challenge manager supportedSourceVersionsPerContract = { Inbox: ['v1.1.0', 'v1.1.1', 'v1.2.0', 'v1.2.1', 'v1.3.0'], From dd6ccddddb376916278e603b413c7efd466b8249 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:13:28 -0500 Subject: [PATCH 11/42] add action --- ...troContracts2Point1Point2UpgradeAction.sol | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol diff --git a/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol new file mode 100644 index 00000000..3568135e --- /dev/null +++ b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; + +interface IERC20Bridge { + function nativeToken() external view returns (address); +} + +interface IERC20Bridge_v2 { + function nativeTokenDecimals() external view returns (uint8); +} + +interface IERC20Bridge_v2_patch { + function forceEighteenDecimalsPatch() external; +} + +/** + * @title DeployNitroContracts2Point1Point2UpgradeActionScript + * @notice Force the ERC20Bridge contract to set nativeTokenDecimals to 18. + * Will revert if the bridge is not an ERC20Bridge. + * Will revert if ERC20Bridge is not v1.x.x + */ +contract NitroContracts2Point1Point2UpgradeAction { + address public immutable newBridgeImpl; + + constructor(address _newBridgeImpl) { + require( + Address.isContract(_newBridgeImpl), + "NitroContracts2Point1Point2UpgradeAction: _newBridgeImpl is not a contract" + ); + + newBridgeImpl = _newBridgeImpl; + } + + function perform(address bridge, ProxyAdmin proxyAdmin) external { + // ensure the bridge is an ERC20Bridge + try IERC20Bridge(bridge).nativeToken() returns (address) {} + catch { + revert("NitroContracts2Point1Point2UpgradeAction: bridge is not an ERC20Bridge"); + } + + // ensure the bridge is v1.x.x + try IERC20Bridge_v2(address(bridge)).nativeTokenDecimals() returns (uint8) { + revert("NitroContracts2Point1Point2UpgradeAction: bridge is not v1.x.x"); + } catch {} + + // upgrade to the new implementation and call forceEighteenDecimalsPatch + proxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable((bridge))), + newBridgeImpl, + abi.encodeCall(IERC20Bridge_v2_patch.forceEighteenDecimalsPatch, ()) + ); + + // ensure decimals were set to 18 + require(IERC20Bridge_v2((bridge)).nativeTokenDecimals() == 18, "decimals not set to 18"); + } +} From 7104ba60944a9b6be02decf96eb126d411f8a426 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:54:35 -0500 Subject: [PATCH 12/42] fix --- .gas-snapshot | 2 +- test/signatures/NitroContracts2Point1Point2UpgradeAction | 4 ++++ test/storage/NitroContracts2Point1Point2UpgradeAction | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/signatures/NitroContracts2Point1Point2UpgradeAction create mode 100644 test/storage/NitroContracts2Point1Point2UpgradeAction diff --git a/.gas-snapshot b/.gas-snapshot index f309fb6a..a2d0eb71 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1 +1 @@ -UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 165) \ No newline at end of file +UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 189) \ No newline at end of file diff --git a/test/signatures/NitroContracts2Point1Point2UpgradeAction b/test/signatures/NitroContracts2Point1Point2UpgradeAction new file mode 100644 index 00000000..08041872 --- /dev/null +++ b/test/signatures/NitroContracts2Point1Point2UpgradeAction @@ -0,0 +1,4 @@ +{ + "newBridgeImpl()": "28b07406", + "perform(address,address)": "857d1ab7" +} diff --git a/test/storage/NitroContracts2Point1Point2UpgradeAction b/test/storage/NitroContracts2Point1Point2UpgradeAction new file mode 100644 index 00000000..1ec5dc07 --- /dev/null +++ b/test/storage/NitroContracts2Point1Point2UpgradeAction @@ -0,0 +1,6 @@ + +╭------+------+------+--------+-------+----------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++================================================+ +╰------+------+------+--------+-------+----------╯ + From 3c99af2d7e22b69bc65b19c90ca5759bb7a86b48 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:06:23 -0500 Subject: [PATCH 13/42] snapshot --- .gas-snapshot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gas-snapshot b/.gas-snapshot index a2d0eb71..f309fb6a 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1 +1 @@ -UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 189) \ No newline at end of file +UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 165) \ No newline at end of file From 65cbb33e0d2628177ee24127041855d917780ee6 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:54:34 -0500 Subject: [PATCH 14/42] add tests --- foundry.toml | 2 +- package.json | 1 + ...oContracts2Point1Point2UpgradeAction.t.sol | 116 ++++++++++++++++++ yarn.lock | 50 +++++++- 4 files changed, 166 insertions(+), 3 deletions(-) create mode 100644 test/unit/NitroContracts2Point1Point2UpgradeAction.t.sol diff --git a/foundry.toml b/foundry.toml index f5e41c07..3117eb62 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,5 +6,5 @@ test = 'test' cache_path = 'cache_forge' solc_version = '0.8.16' optimizer_runs = 2000 -fs_permissions = [{ access = "read", path = "node_modules/@arbitrum/"}, { access = "read", path = "node_modules/@openzeppelin/"},{ access = "read-write", path = "./scripts/foundry"}] +fs_permissions = [{ access = "read", path = "node_modules/@offchainlabs/"},{ access = "read", path = "node_modules/@arbitrum/"}, { access = "read", path = "node_modules/@openzeppelin/"},{ access = "read-write", path = "./scripts/foundry"}] script = 'scripts' diff --git a/package.json b/package.json index f225d7fd..fd06f90d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@arbitrum/nitro-contracts-1.2.1": "npm:@arbitrum/nitro-contracts@1.2.1", "@arbitrum/nitro-contracts-1.3.0": "npm:@arbitrum/nitro-contracts@1.3.0", "@arbitrum/nitro-contracts-2.1.0": "npm:@arbitrum/nitro-contracts@2.1.0", + "@arbitrum/nitro-contracts-2.1.2": "npm:godzillaba-nitro-contracts-2-1-2", "@arbitrum/token-bridge-1.2.2": "npm:@arbitrum/token-bridge-contracts@1.2.2", "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.0", diff --git a/test/unit/NitroContracts2Point1Point2UpgradeAction.t.sol b/test/unit/NitroContracts2Point1Point2UpgradeAction.t.sol new file mode 100644 index 00000000..6dc14082 --- /dev/null +++ b/test/unit/NitroContracts2Point1Point2UpgradeAction.t.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "forge-std/Test.sol"; + +import {Bridge, IOwnable} from "@arbitrum/nitro-contracts-2.1.2/src/bridge/Bridge.sol"; +import { + ERC20Bridge as ERC20Bridge_2_1_2, + IOwnable as IOwnable_2_1_2 +} from "@arbitrum/nitro-contracts-2.1.2/src/bridge/ERC20Bridge.sol"; +import { + ERC20Bridge as ERC20Bridge_2_1_0, + IOwnable as IOwnable_2_1_0 +} from "@arbitrum/nitro-contracts-2.1.0/src/bridge/ERC20Bridge.sol"; +import { + ERC20Bridge as ERC20Bridge_1_3_0, + IOwnable as IOwnable_1_3_0 +} from "@arbitrum/nitro-contracts-1.3.0/src/bridge/ERC20Bridge.sol"; +import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import {NitroContracts2Point1Point2UpgradeAction} from + "../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; +import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol"; +import {DeploymentHelpersScript} from "../../scripts/foundry/helper/DeploymentHelpers.s.sol"; + +interface IUpgradeExecutorExtended is IUpgradeExecutor { + function initialize(address admin, address[] memory executors) external; +} + +contract FakeToken { + uint256 public decimals = 18; +} + +contract NitroContracts2Point1Point2UpgradeActionTest is Test, DeploymentHelpersScript { + IUpgradeExecutorExtended upgradeExecutor; + + address fakeToken; + + ProxyAdmin proxyAdmin; + + ERC20Bridge_2_1_2 newBridgeImpl; + + address ethBridge; + address erc20Bridge_2_1_0; + address erc20Bridge_1_3_0; + + NitroContracts2Point1Point2UpgradeAction action; + + address fakeRollup = 0x822F75d77182fa8Fc17232E511d3A2abf98c7907; + + function setUp() public { + // deploy a proxy admin + proxyAdmin = new ProxyAdmin(); + + // deploy an upgrade executor + address[] memory execs = new address[](1); + execs[0] = address(this); + upgradeExecutor = IUpgradeExecutorExtended( + address( + new TransparentUpgradeableProxy( + deployBytecodeFromJSON( + "/node_modules/@offchainlabs/upgrade-executor/build/contracts/src/UpgradeExecutor.sol/UpgradeExecutor.json" + ), + address(proxyAdmin), + "" + ) + ) + ); + upgradeExecutor.initialize(address(this), execs); + + proxyAdmin.transferOwnership(address(upgradeExecutor)); + + // deploy a fake token + fakeToken = address(new FakeToken()); + + // deploy ERC20Bridge v2.1.2 implementation + newBridgeImpl = new ERC20Bridge_2_1_2(); + + // deploy an ETH Bridge + ethBridge = address(new TransparentUpgradeableProxy(address(new Bridge()), address(proxyAdmin), "")); + Bridge(ethBridge).initialize(IOwnable(fakeRollup)); // pretend the test contract is the rollup + + // deploy an ERC20Bridge on v2.1.0 + erc20Bridge_2_1_0 = + address(new TransparentUpgradeableProxy(address(new ERC20Bridge_2_1_0()), address(proxyAdmin), "")); + ERC20Bridge_2_1_0(erc20Bridge_2_1_0).initialize(IOwnable_2_1_0(fakeRollup), fakeToken); + + // deploy an ERC20Bridge on v1.3.0 + erc20Bridge_1_3_0 = + address(new TransparentUpgradeableProxy(address(new ERC20Bridge_1_3_0()), address(proxyAdmin), "")); + ERC20Bridge_1_3_0(erc20Bridge_1_3_0).initialize(IOwnable_1_3_0(fakeRollup), fakeToken); + + // deploy the upgrade action + action = new NitroContracts2Point1Point2UpgradeAction(address(newBridgeImpl)); + } + + function testShouldRevertOnEth() public { + vm.expectRevert("NitroContracts2Point1Point2UpgradeAction: bridge is not an ERC20Bridge"); + upgradeExecutor.execute(address(action), abi.encodeCall(action.perform, (ethBridge, proxyAdmin))); + } + + function testShouldRevertOnV2() public { + vm.expectRevert("NitroContracts2Point1Point2UpgradeAction: bridge is not v1.x.x"); + upgradeExecutor.execute(address(action), abi.encodeCall(action.perform, (erc20Bridge_2_1_0, proxyAdmin))); + } + + function testShouldUpgradeAndSetDecimals() public { + upgradeExecutor.execute(address(action), abi.encodeCall(action.perform, (erc20Bridge_1_3_0, proxyAdmin))); + + assertEq( + proxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(erc20Bridge_1_3_0))), + address(newBridgeImpl) + ); + assertEq(ERC20Bridge_2_1_2(address(erc20Bridge_1_3_0)).nativeTokenDecimals(), 18); + } +} diff --git a/yarn.lock b/yarn.lock index 61489f8f..0832aab1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,6 +43,17 @@ patch-package "^6.4.7" solady "0.0.182" +"@arbitrum/nitro-contracts-2.1.2@npm:godzillaba-nitro-contracts-2-1-2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/godzillaba-nitro-contracts-2-1-2/-/godzillaba-nitro-contracts-2-1-2-2.1.2.tgz#0d53830b7a150c2cd5f41e7356fd75d45ca45037" + integrity sha512-prHc/FsXoqgLULV1QdmRp6TB01TI0W0hszItvrMUUJ3PqCGmqQNbQHrImJdsTKaFygM0LS1GwyHbPGEToX4Rgg== + dependencies: + "@offchainlabs/upgrade-executor" "1.1.0-beta.0" + "@openzeppelin/contracts" "4.5.0" + "@openzeppelin/contracts-upgradeable" "4.5.2" + patch-package "^6.4.7" + solady "0.0.182" + "@arbitrum/nitro-contracts@1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-1.1.1.tgz#2d8a2f9ab757bb7654562aebe435bff833c4b98d" @@ -2659,8 +2670,43 @@ ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.4: ethereum-cryptography "^0.1.3" rlp "^2.2.4" -"ethers-v5@npm:ethers@^5.7.2", ethers@^5.7.1, ethers@^5.7.2: - name ethers-v5 +"ethers-v5@npm:ethers@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +ethers@^5.7.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== From 5f0831c8872dba1d89919898e1fa1da1188105b9 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:32:11 -0500 Subject: [PATCH 15/42] readme --- .../foundry/contract-upgrades/2.1.0/README.md | 2 +- .../foundry/contract-upgrades/2.1.2/README.md | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 scripts/foundry/contract-upgrades/2.1.2/README.md diff --git a/scripts/foundry/contract-upgrades/2.1.0/README.md b/scripts/foundry/contract-upgrades/2.1.0/README.md index eafe344a..99c055f5 100644 --- a/scripts/foundry/contract-upgrades/2.1.0/README.md +++ b/scripts/foundry/contract-upgrades/2.1.0/README.md @@ -44,7 +44,7 @@ Also, expectation is that rollup being upgraded currently uses official ArbOS20 ## How to use it -1. Setup .env according to the example files, make sure you have everything correctly defined. The script will do some sanity checks but not everything can be checked. The .env file must be in project root for recent foundary versions. +1. Setup .env according to the example files, make sure you have everything correctly defined. The script will do some sanity checks but not everything can be checked. The .env file must be in project root for recent foundry versions. > [!CAUTION] > The .env file must be in project root. diff --git a/scripts/foundry/contract-upgrades/2.1.2/README.md b/scripts/foundry/contract-upgrades/2.1.2/README.md new file mode 100644 index 00000000..8a34896c --- /dev/null +++ b/scripts/foundry/contract-upgrades/2.1.2/README.md @@ -0,0 +1,85 @@ +# Nitro contracts 2.1.2 upgrade + +> [!CAUTION] +> This upgrade is only necessary for custom fee token chains with an `ERC20Bridge` contract below version `< v2.0.0`. +> If your chain uses the parent chain's native asset for fees, or your `ERC20Bridge` is already at `v2.0.0` or above, do not perform this upgrade. +> The rest of this document assumes the chain satisfies the above. + +These scripts empower `NitroContracts2Point1Point2UpgradeAction` action contract which performs upgrade to [2.1.2 release](https://github.com/OffchainLabs/nitro-contracts/releases/tag/v2.1.2) of Nitro contracts for existing Orbit chains. Predeployed instances of the upgrade action exists on the chains listed in the following section. + +Upgrading to `v2.1.2` is REQUIRED before upgrading to `v3.0.0`. Upgrading to `v2.1.0` is REQUIRED before upgrading to `v2.1.0`. + +NitroContracts2Point1Point2UpgradeAction will perform the following action: + +1. Upgrade the `ERC20Bridge` contract to `v2.1.2` +1. Force `nativeTokenDecimals` to 18 + +It is assumed that the native token has 18 decimals, since this was a requirement for deploying a custom fee token chain prior to `v2.0.0`. + +## Requirements + +This upgrade only support upgrading from the following [nitro-contract release](https://github.com/OffchainLabs/nitro-contracts/releases): + +- Inbox: v1.1.0 - v1.3.0 inclusive +- Outbox: v1.1.0 - v1.3.0 inclusive +- SequencerInbox: v1.2.1 - v2.1.0 inclusive +- Bridge: v1.1.0 - v1.3.0 inclusive +- RollupProxy: v1.1.0 - v2.1.0 inclusive +- RollupAdminLogic: v2.1.0 +- RollupUserLogic: v2.1.0 +- ChallengeManager: v2.1.0 + +Please refer to the top [README](../../README.md) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. + +## Deployed instances + +### Mainnets +- L1 Mainnet: TODO +- L2 Arb1: TODO +- L2 Nova: TODO +- L2 Base: TODO + +### Testnets +- L1 Sepolia: TODO +- L1 Holesky: TODO +- L2 ArbSepolia: TODO +- L2 BaseSepolia: TODO + +## How to use it + +1. Setup .env according to the example files, make sure you have everything correctly defined. The script will do some sanity checks but not everything can be checked. The .env file must be in project root for recent foundry versions. + +> [!CAUTION] +> The .env file must be in project root. + +2. (Skip this step if you can use the deployed instances of action contract) + `DeployNitroContracts2Point1Point2UpgradeActionScript.s.sol` script deploys templates, and upgrade action itself. It can be executed in this directory like this: + +```bash +forge script --sender $DEPLOYER --rpc-url $PARENT_CHAIN_RPC --broadcast --slow DeployNitroContracts2Point1Point2UpgradeActionScript -vvv --verify --skip-simulation +# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from +``` + +As a result, all templates and upgrade action are deployed. Note the last deployed address - that's the upgrade action. + +3. `ExecuteNitroContracts2Point1Point2Upgrade.s.sol` script uses previously deployed upgrade action to execute the upgrade. It makes following assumptions - L1UpgradeExecutor is the rollup owner, and there is an EOA which has executor rights on the L1UpgradeExecutor. Proceed with upgrade using the owner account (the one with executor rights on L1UpgradeExecutor): + +```bash +forge script --sender $EXECUTOR --rpc-url $PARENT_CHAIN_RPC --broadcast ExecuteNitroContracts2Point1Point2UpgradeScript -vvv +# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from +``` + +If you have a multisig as executor, you can still run the above command without broadcasting to get the payload for the multisig transaction. + +4. That's it, upgrade has been performed. You can make sure it has successfully executed by checking the native token decimals. + +```bash +# should return 18 +cast call --rpc-url $PARENT_CHAIN_RPC $BRIDGE "nativeTokenDecimals()(uint8)" +``` + +## FAQ + +### Q: intrinsic gas too low when running foundry script + +A: try to add -g 1000 to the command From 5b0f67b02b5a267820d608169cc17f307a5fc3f5 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:42:35 -0500 Subject: [PATCH 16/42] deployment script --- ...oContracts2Point1Point2UpgradeAction.s.sol | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol diff --git a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol new file mode 100644 index 00000000..058b2bcf --- /dev/null +++ b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import {DeploymentHelpersScript} from "../../helper/DeploymentHelpers.s.sol"; +import { + NitroContracts2Point1Point2UpgradeAction +} from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; + +/** + * @title DeployNitroContracts2Point1Point2UpgradeActionScript + * @notice This script deploys the ERC20Bridge contract and NitroContracts2Point1Point2UpgradeAction contract. + */ +contract DeployNitroContracts2Point1Point2UpgradeActionScript is DeploymentHelpersScript { + function run() public { + vm.startBroadcast(); + + // deploy new RollupUserLogic contract from v2.1.0 + address newBridgeImpl = deployBytecodeFromJSON( + "/node_modules/@arbitrum/nitro-contracts-2.1.2/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json" + ); + + // deploy upgrade action + new NitroContracts2Point1Point2UpgradeAction(newBridgeImpl); + + vm.stopBroadcast(); + } +} From 002c89818cdae1bd0cc485c2d8d5968114f14d7d Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:52:00 -0500 Subject: [PATCH 17/42] execution script --- .../contract-upgrades/2.1.2/.env.sample | 6 +++ ...teNitroContracts2Point1Point2Upgrade.s.sol | 44 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/foundry/contract-upgrades/2.1.2/.env.sample create mode 100644 scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol diff --git a/scripts/foundry/contract-upgrades/2.1.2/.env.sample b/scripts/foundry/contract-upgrades/2.1.2/.env.sample new file mode 100644 index 00000000..eba03a66 --- /dev/null +++ b/scripts/foundry/contract-upgrades/2.1.2/.env.sample @@ -0,0 +1,6 @@ +## These env vars are used for ExecuteNitroContracts2Point1Point2UpgradeScript + +UPGRADE_ACTION_ADDRESS= +INBOX_ADDRESS= +PROXY_ADMIN_ADDRESS= +PARENT_UPGRADE_EXECUTOR_ADDRESS= \ No newline at end of file diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol new file mode 100644 index 00000000..c397b03c --- /dev/null +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.16; + +import "forge-std/Script.sol"; +import { + NitroContracts2Point1Point2UpgradeAction, + ProxyAdmin +} from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; +import {IInboxBase} from "@arbitrum/nitro-contracts-1.2.1/src/bridge/IInboxBase.sol"; +import {IERC20Bridge} from "@arbitrum/nitro-contracts-2.1.2/src/bridge/IERC20Bridge.sol"; +import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol"; + +/** + * @title ExecuteNitroContracts1Point2Point1UpgradeScript + * @notice This script executes nitro contracts 2.1.0 upgrade through UpgradeExecutor + */ +contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { + function run() public { + + NitroContracts2Point1Point2UpgradeAction upgradeAction = + NitroContracts2Point1Point2UpgradeAction(vm.envAddress("UPGRADE_ACTION_ADDRESS")); + + IInboxBase inbox = IInboxBase(vm.envAddress("INBOX_ADDRESS")); + + address bridge = address(inbox.bridge()); + + vm.startBroadcast(); + + // prepare upgrade calldata + ProxyAdmin proxyAdmin = ProxyAdmin(vm.envAddress("PROXY_ADMIN_ADDRESS")); + bytes memory upgradeCalldata = + abi.encodeCall(NitroContracts2Point1Point2UpgradeAction.perform, (bridge, proxyAdmin)); + + // execute the upgrade + // action checks prerequisites, and script will fail if the action reverts + IUpgradeExecutor executor = IUpgradeExecutor(vm.envAddress("PARENT_UPGRADE_EXECUTOR_ADDRESS")); + executor.execute(address(upgradeAction), upgradeCalldata); + + // sanity check, full checks are done on-chain by the upgrade action + require(IERC20Bridge(bridge).nativeTokenDecimals() == 18, "Unexpected native token decimals"); + + vm.stopBroadcast(); + } +} From 6fc72a00b3e71cfd50dfaa07ced204239ef1f2ca Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:53:03 -0500 Subject: [PATCH 18/42] format --- .../DeployNitroContracts2Point1Point2UpgradeAction.s.sol | 5 ++--- .../2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol | 1 - scripts/foundry/creator-upgrades/1.2.1/output/1.json | 2 +- scripts/foundry/creator-upgrades/1.2.1/output/1337.json | 2 +- scripts/foundry/creator-upgrades/1.2.1/output/42161.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/1.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/11155111.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/42161.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/421614.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/42170.json | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol index 058b2bcf..b7f99812 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol @@ -2,9 +2,8 @@ pragma solidity 0.8.16; import {DeploymentHelpersScript} from "../../helper/DeploymentHelpers.s.sol"; -import { - NitroContracts2Point1Point2UpgradeAction -} from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; +import {NitroContracts2Point1Point2UpgradeAction} from + "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; /** * @title DeployNitroContracts2Point1Point2UpgradeActionScript diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol index c397b03c..2961fbcb 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -16,7 +16,6 @@ import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecu */ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { function run() public { - NitroContracts2Point1Point2UpgradeAction upgradeAction = NitroContracts2Point1Point2UpgradeAction(vm.envAddress("UPGRADE_ACTION_ADDRESS")); diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/1.json b/scripts/foundry/creator-upgrades/1.2.1/output/1.json index d5cfb46c..bf86fbb5 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/1.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/1.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000007efcb76d0e2e776a298aaa603d433336e5f8b6ab000000000000000000000000383f16fb2809a56fc639c1ee2c93ad2aa7ee130a00000000000000000000000031faaab44e74eb408d1fc69a14806b4b9ca09da2000000000000000000000000302275067251f5fcdb9359bda735fd8f7a4a54c000000000000000000000000019431dc37098877486532250fb3158140717c00c", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a0000000000000000000000001c6accd9d66f3b993928e7439c9a2d67b94a445f000000000000000000000000958985cf2c54f99ba4a599221a8090c1f9cee9a50000000000000000000000001162084c3c6575121146582db5be43189e8cee6b00000000000000000000000013be515e44eefaf3ebefad684f1fbb574ac0a4940000000000000000000000002a6dd4433ffa96dc1755814fc0d9cc83a5f68dec", "updateRollupCreatorTemplatesCalldata": "0xac9a97b40000000000000000000000001135265fe014d3fa32b3507e325642b92affeaeb00000000000000000000000057ea090ac0554d174ae0e2855b460e84a1a7c2210000000000000000000000001d901dd7a5efe421c3c437b147040e5af22e6a430000000000000000000000000ae4dd666748bf0f6db5c149eab1d8ad27820a6a000000000000000000000000660ea1675f7323dc3ba0c8ddfb593225eb01e3c10000000000000000000000006c21303f5986180b1394d2c89f3e883890e2867b0000000000000000000000002b0e04dc90e3fa58165cb41e2834b44a56e766af0000000000000000000000009cad81628ab7d8e239f1a5b497313341578c5f710000000000000000000000002e31291fa573db3dfeae00c9bd1806b73c7185c8" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/1337.json b/scripts/foundry/creator-upgrades/1.2.1/output/1337.json index 785a6d5d..22ad429a 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/1337.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/1337.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000004e5b65fb12d4165e22f5861d97a33ba45c006114000000000000000000000000457f2a773d9ebd5eadd5d014db162749a1ea92eb0000000000000000000000009df23e34ac13a7145eba1164660e701839197b1b0000000000000000000000009f1ece352ce8d540738ccb38aa3fa3d44d00a2590000000000000000000000000bdad990640a488400565fe6fb1d879ffe12da37", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a000000000000000000000000217788c286797d56cd59af5e493f3699c39cbbe80000000000000000000000006ca66235758bccd08a4d1612662482f08fab93470000000000000000000000000f1f89aaf1c6fdb7ff9d361e4388f5f3997f12a800000000000000000000000060571c8f4b52954a24a5e7306d435e951528d963000000000000000000000000b075b82c7a23e0994df4793422a1f03dbcf9136f", "updateRollupCreatorTemplatesCalldata": "0xac9a97b40000000000000000000000005e36aa9caaf5f708fca5c04d2d4c776a62b2b2580000000000000000000000002766e96f90f9f027835e0c00c04c8119c635ce02000000000000000000000000037b11bb930dbb7c875ce459eeff69fc2e9fd40d0000000000000000000000009c2ed9f57d053fdfaecbf1b6dfd7c97e2e340b84000000000000000000000000f7ec0b16a45dc99ae21bfa8b4b737d1d61ca9fa4000000000000000000000000dfb681cc1f2c180c2131bb4deb46642d6258b0ff000000000000000000000000bd4cc2f69ffd94b5f62dcc5a27c2eb805093fc0d000000000000000000000000a80482dddb7f8b9dcc24a1cd13488e3379a1456800000000000000000000000092f58045ffb1c00a7b9486b9d2a55d316380cb45" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/42161.json b/scripts/foundry/creator-upgrades/1.2.1/output/42161.json index 507add51..a9e3e652 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/42161.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/42161.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000002a6dd4433ffa96dc1755814fc0d9cc83a5f68dec0000000000000000000000007a299ad29499736994aa3a9afa3f476445faeb2c0000000000000000000000007efcb76d0e2e776a298aaa603d433336e5f8b6ab00000000000000000000000018fd37a4fb9e1f06d9383958afd236771f15a8cb000000000000000000000000302275067251f5fcdb9359bda735fd8f7a4a54c0", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a000000000000000000000000b23214f241bdeb275f7dcbfbb1ea79349101d4b000000000000000000000000018ed2d5bf7c5943bfd20a2995b9879e30c9e8dda0000000000000000000000008f6406781cc955398c45a48dcefeebdb2c8e2caa000000000000000000000000f40c24ba346aa459ed28e196d4a46cf17174bd6c00000000000000000000000013be515e44eefaf3ebefad684f1fbb574ac0a494", "updateRollupCreatorTemplatesCalldata": "0xac9a97b400000000000000000000000019431dc37098877486532250fb3158140717c00c000000000000000000000000b20107bfb36d3b5aca534acafbd8857b10b402a80000000000000000000000005ca988f213efbcb86ed7e2aacb0c15c91e648f8d000000000000000000000000ee9e5546a11cb5b4a86e92da05f2ef75c26e47540000000000000000000000000ae4dd666748bf0f6db5c149eab1d8ad27820a6a000000000000000000000000660ea1675f7323dc3ba0c8ddfb593225eb01e3c10000000000000000000000006c21303f5986180b1394d2c89f3e883890e2867b0000000000000000000000002b0e04dc90e3fa58165cb41e2834b44a56e766af00000000000000000000000090d68b056c411015eae3ec0b98ad94e2c91419f1" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/1.json b/scripts/foundry/creator-upgrades/1.2.2/output/1.json index d5570972..3011dac7 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/1.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/1.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec400000000000000000000000060d9a46f24d5a35b95a78dd3e793e55d94ee0660000000000000000000000000f39a8a43cffa0513cc057d290fa3e7a57dcd8d46", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000a96b7f9e20a1f6e11815d4af08d911b21cb380ec0000000000000000000000008de0fb2651fdd10975088ae61a71cac6d372063d", "to": "0xE60081476E505F14C231a7efa47e607ff50dAEB5" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json b/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json index d2a92dd6..34103571 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000007edb2dfbeef9417e0454a80c51ee0c034e45a570000000000000000000000000757143a7ed0dc76499607c7e5b0771965ae1fe06", "retryableSenderCalldata": "0x99a88ec40000000000000000000000002e9da5298ce57818caf96735bdcf900215c25d060000000000000000000000005d0e7fd5fca46aca13e475c070aa3e2f8eb01925", "to": "0xE58B76B21A98334CFD7FD6757102efe029E62Ed0" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/42161.json b/scripts/foundry/creator-upgrades/1.2.2/output/42161.json index f213f5ec..d6db95b3 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/42161.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/42161.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000002f5624dc8800dfa0a82ac03509ef8bb8e7ac000e00000000000000000000000052d5181dd67ac17176127e670e5baee4d47c6c9e", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000f9fbfc857d51ff51fedd4ea88efc29039871dccf0000000000000000000000009ea06b8753bca071a5c57002ab84598577fb08c1", "to": "0xBE95d0EE267f3E90606537b1C8A6Fb36d2DC1Ce6" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/421614.json b/scripts/foundry/creator-upgrades/1.2.2/output/421614.json index 4e5695c1..3418ce2e 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/421614.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/421614.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec400000000000000000000000056c486d3786fa26cc61473c499a36eb9cc1fbd8e000000000000000000000000ec43416728f656ac5b7d860236bb102e2abe0f88", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000a665705700774a40b73b4e3509ae01c7ef05ba0f0000000000000000000000009308a1264ab831002821971ac5fa342c4f775637", "to": "0x8E112dd87E71Ac9061caA2ccC2513027C3cF5D90" -} \ No newline at end of file +} diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/42170.json b/scripts/foundry/creator-upgrades/1.2.2/output/42170.json index 7cee8514..b4895a0e 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/42170.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/42170.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000008b9d9490a68b1f16ac8a21ddae5fd7ab9d708c140000000000000000000000004998b99dd376a0cfff0e4b7f1ee0056f79910e64", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000841a23c7c4e20515eaf03debd8ab60f12b5cc13e000000000000000000000000e60081476e505f14c231a7efa47e607ff50daeb5", "to": "0x211A5579D21e1938b2B5ff87a3F7896933543E97" -} \ No newline at end of file +} From ee126998dfa0e3af64c629835d726ad9dbba3816 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:53:54 -0500 Subject: [PATCH 19/42] Revert "format" This reverts commit 6fc72a00b3e71cfd50dfaa07ced204239ef1f2ca. --- .../DeployNitroContracts2Point1Point2UpgradeAction.s.sol | 5 +++-- .../2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol | 1 + scripts/foundry/creator-upgrades/1.2.1/output/1.json | 2 +- scripts/foundry/creator-upgrades/1.2.1/output/1337.json | 2 +- scripts/foundry/creator-upgrades/1.2.1/output/42161.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/1.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/11155111.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/42161.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/421614.json | 2 +- scripts/foundry/creator-upgrades/1.2.2/output/42170.json | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol index b7f99812..058b2bcf 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol @@ -2,8 +2,9 @@ pragma solidity 0.8.16; import {DeploymentHelpersScript} from "../../helper/DeploymentHelpers.s.sol"; -import {NitroContracts2Point1Point2UpgradeAction} from - "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; +import { + NitroContracts2Point1Point2UpgradeAction +} from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; /** * @title DeployNitroContracts2Point1Point2UpgradeActionScript diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol index 2961fbcb..c397b03c 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -16,6 +16,7 @@ import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecu */ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { function run() public { + NitroContracts2Point1Point2UpgradeAction upgradeAction = NitroContracts2Point1Point2UpgradeAction(vm.envAddress("UPGRADE_ACTION_ADDRESS")); diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/1.json b/scripts/foundry/creator-upgrades/1.2.1/output/1.json index bf86fbb5..d5cfb46c 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/1.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/1.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000007efcb76d0e2e776a298aaa603d433336e5f8b6ab000000000000000000000000383f16fb2809a56fc639c1ee2c93ad2aa7ee130a00000000000000000000000031faaab44e74eb408d1fc69a14806b4b9ca09da2000000000000000000000000302275067251f5fcdb9359bda735fd8f7a4a54c000000000000000000000000019431dc37098877486532250fb3158140717c00c", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a0000000000000000000000001c6accd9d66f3b993928e7439c9a2d67b94a445f000000000000000000000000958985cf2c54f99ba4a599221a8090c1f9cee9a50000000000000000000000001162084c3c6575121146582db5be43189e8cee6b00000000000000000000000013be515e44eefaf3ebefad684f1fbb574ac0a4940000000000000000000000002a6dd4433ffa96dc1755814fc0d9cc83a5f68dec", "updateRollupCreatorTemplatesCalldata": "0xac9a97b40000000000000000000000001135265fe014d3fa32b3507e325642b92affeaeb00000000000000000000000057ea090ac0554d174ae0e2855b460e84a1a7c2210000000000000000000000001d901dd7a5efe421c3c437b147040e5af22e6a430000000000000000000000000ae4dd666748bf0f6db5c149eab1d8ad27820a6a000000000000000000000000660ea1675f7323dc3ba0c8ddfb593225eb01e3c10000000000000000000000006c21303f5986180b1394d2c89f3e883890e2867b0000000000000000000000002b0e04dc90e3fa58165cb41e2834b44a56e766af0000000000000000000000009cad81628ab7d8e239f1a5b497313341578c5f710000000000000000000000002e31291fa573db3dfeae00c9bd1806b73c7185c8" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/1337.json b/scripts/foundry/creator-upgrades/1.2.1/output/1337.json index 22ad429a..785a6d5d 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/1337.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/1337.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000004e5b65fb12d4165e22f5861d97a33ba45c006114000000000000000000000000457f2a773d9ebd5eadd5d014db162749a1ea92eb0000000000000000000000009df23e34ac13a7145eba1164660e701839197b1b0000000000000000000000009f1ece352ce8d540738ccb38aa3fa3d44d00a2590000000000000000000000000bdad990640a488400565fe6fb1d879ffe12da37", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a000000000000000000000000217788c286797d56cd59af5e493f3699c39cbbe80000000000000000000000006ca66235758bccd08a4d1612662482f08fab93470000000000000000000000000f1f89aaf1c6fdb7ff9d361e4388f5f3997f12a800000000000000000000000060571c8f4b52954a24a5e7306d435e951528d963000000000000000000000000b075b82c7a23e0994df4793422a1f03dbcf9136f", "updateRollupCreatorTemplatesCalldata": "0xac9a97b40000000000000000000000005e36aa9caaf5f708fca5c04d2d4c776a62b2b2580000000000000000000000002766e96f90f9f027835e0c00c04c8119c635ce02000000000000000000000000037b11bb930dbb7c875ce459eeff69fc2e9fd40d0000000000000000000000009c2ed9f57d053fdfaecbf1b6dfd7c97e2e340b84000000000000000000000000f7ec0b16a45dc99ae21bfa8b4b737d1d61ca9fa4000000000000000000000000dfb681cc1f2c180c2131bb4deb46642d6258b0ff000000000000000000000000bd4cc2f69ffd94b5f62dcc5a27c2eb805093fc0d000000000000000000000000a80482dddb7f8b9dcc24a1cd13488e3379a1456800000000000000000000000092f58045ffb1c00a7b9486b9d2a55d316380cb45" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.1/output/42161.json b/scripts/foundry/creator-upgrades/1.2.1/output/42161.json index a9e3e652..507add51 100644 --- a/scripts/foundry/creator-upgrades/1.2.1/output/42161.json +++ b/scripts/foundry/creator-upgrades/1.2.1/output/42161.json @@ -5,4 +5,4 @@ "updateBridgeErc20TemplatesCalldata": "0x1bb7c6cc0000000000000000000000002a6dd4433ffa96dc1755814fc0d9cc83a5f68dec0000000000000000000000007a299ad29499736994aa3a9afa3f476445faeb2c0000000000000000000000007efcb76d0e2e776a298aaa603d433336e5f8b6ab00000000000000000000000018fd37a4fb9e1f06d9383958afd236771f15a8cb000000000000000000000000302275067251f5fcdb9359bda735fd8f7a4a54c0", "updateBridgeEthTemplatesCalldata": "0xd94d6e0a000000000000000000000000b23214f241bdeb275f7dcbfbb1ea79349101d4b000000000000000000000000018ed2d5bf7c5943bfd20a2995b9879e30c9e8dda0000000000000000000000008f6406781cc955398c45a48dcefeebdb2c8e2caa000000000000000000000000f40c24ba346aa459ed28e196d4a46cf17174bd6c00000000000000000000000013be515e44eefaf3ebefad684f1fbb574ac0a494", "updateRollupCreatorTemplatesCalldata": "0xac9a97b400000000000000000000000019431dc37098877486532250fb3158140717c00c000000000000000000000000b20107bfb36d3b5aca534acafbd8857b10b402a80000000000000000000000005ca988f213efbcb86ed7e2aacb0c15c91e648f8d000000000000000000000000ee9e5546a11cb5b4a86e92da05f2ef75c26e47540000000000000000000000000ae4dd666748bf0f6db5c149eab1d8ad27820a6a000000000000000000000000660ea1675f7323dc3ba0c8ddfb593225eb01e3c10000000000000000000000006c21303f5986180b1394d2c89f3e883890e2867b0000000000000000000000002b0e04dc90e3fa58165cb41e2834b44a56e766af00000000000000000000000090d68b056c411015eae3ec0b98ad94e2c91419f1" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/1.json b/scripts/foundry/creator-upgrades/1.2.2/output/1.json index 3011dac7..d5570972 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/1.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/1.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec400000000000000000000000060d9a46f24d5a35b95a78dd3e793e55d94ee0660000000000000000000000000f39a8a43cffa0513cc057d290fa3e7a57dcd8d46", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000a96b7f9e20a1f6e11815d4af08d911b21cb380ec0000000000000000000000008de0fb2651fdd10975088ae61a71cac6d372063d", "to": "0xE60081476E505F14C231a7efa47e607ff50dAEB5" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json b/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json index 34103571..d2a92dd6 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/11155111.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000007edb2dfbeef9417e0454a80c51ee0c034e45a570000000000000000000000000757143a7ed0dc76499607c7e5b0771965ae1fe06", "retryableSenderCalldata": "0x99a88ec40000000000000000000000002e9da5298ce57818caf96735bdcf900215c25d060000000000000000000000005d0e7fd5fca46aca13e475c070aa3e2f8eb01925", "to": "0xE58B76B21A98334CFD7FD6757102efe029E62Ed0" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/42161.json b/scripts/foundry/creator-upgrades/1.2.2/output/42161.json index d6db95b3..f213f5ec 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/42161.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/42161.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000002f5624dc8800dfa0a82ac03509ef8bb8e7ac000e00000000000000000000000052d5181dd67ac17176127e670e5baee4d47c6c9e", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000f9fbfc857d51ff51fedd4ea88efc29039871dccf0000000000000000000000009ea06b8753bca071a5c57002ab84598577fb08c1", "to": "0xBE95d0EE267f3E90606537b1C8A6Fb36d2DC1Ce6" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/421614.json b/scripts/foundry/creator-upgrades/1.2.2/output/421614.json index 3418ce2e..4e5695c1 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/421614.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/421614.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec400000000000000000000000056c486d3786fa26cc61473c499a36eb9cc1fbd8e000000000000000000000000ec43416728f656ac5b7d860236bb102e2abe0f88", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000a665705700774a40b73b4e3509ae01c7ef05ba0f0000000000000000000000009308a1264ab831002821971ac5fa342c4f775637", "to": "0x8E112dd87E71Ac9061caA2ccC2513027C3cF5D90" -} +} \ No newline at end of file diff --git a/scripts/foundry/creator-upgrades/1.2.2/output/42170.json b/scripts/foundry/creator-upgrades/1.2.2/output/42170.json index b4895a0e..7cee8514 100644 --- a/scripts/foundry/creator-upgrades/1.2.2/output/42170.json +++ b/scripts/foundry/creator-upgrades/1.2.2/output/42170.json @@ -3,4 +3,4 @@ "creatorCalldata": "0x99a88ec40000000000000000000000008b9d9490a68b1f16ac8a21ddae5fd7ab9d708c140000000000000000000000004998b99dd376a0cfff0e4b7f1ee0056f79910e64", "retryableSenderCalldata": "0x99a88ec4000000000000000000000000841a23c7c4e20515eaf03debd8ab60f12b5cc13e000000000000000000000000e60081476e505f14c231a7efa47e607ff50daeb5", "to": "0x211A5579D21e1938b2B5ff87a3F7896933543E97" -} +} \ No newline at end of file From ce4d8f617e692753571fad169c4876e6d93ef812 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:54:25 -0500 Subject: [PATCH 20/42] reformat --- .../DeployNitroContracts2Point1Point2UpgradeAction.s.sol | 5 ++--- .../2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol index 058b2bcf..b7f99812 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol @@ -2,9 +2,8 @@ pragma solidity 0.8.16; import {DeploymentHelpersScript} from "../../helper/DeploymentHelpers.s.sol"; -import { - NitroContracts2Point1Point2UpgradeAction -} from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; +import {NitroContracts2Point1Point2UpgradeAction} from + "../../../../contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol"; /** * @title DeployNitroContracts2Point1Point2UpgradeActionScript diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol index c397b03c..2961fbcb 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -16,7 +16,6 @@ import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecu */ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { function run() public { - NitroContracts2Point1Point2UpgradeAction upgradeAction = NitroContracts2Point1Point2UpgradeAction(vm.envAddress("UPGRADE_ACTION_ADDRESS")); From 5d856349ac751d1845a420a0a635309a91f2f3ab Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:57:05 -0500 Subject: [PATCH 21/42] tight broadcast --- .../2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol index 2961fbcb..844ecdae 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -23,8 +23,6 @@ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { address bridge = address(inbox.bridge()); - vm.startBroadcast(); - // prepare upgrade calldata ProxyAdmin proxyAdmin = ProxyAdmin(vm.envAddress("PROXY_ADMIN_ADDRESS")); bytes memory upgradeCalldata = @@ -33,11 +31,11 @@ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { // execute the upgrade // action checks prerequisites, and script will fail if the action reverts IUpgradeExecutor executor = IUpgradeExecutor(vm.envAddress("PARENT_UPGRADE_EXECUTOR_ADDRESS")); + vm.startBroadcast(); executor.execute(address(upgradeAction), upgradeCalldata); + vm.stopBroadcast(); // sanity check, full checks are done on-chain by the upgrade action require(IERC20Bridge(bridge).nativeTokenDecimals() == 18, "Unexpected native token decimals"); - - vm.stopBroadcast(); } } From 24159ec875c30f88ee7148c0e670b63bd24798ac Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:25:09 -0500 Subject: [PATCH 22/42] Update README.md --- scripts/foundry/contract-upgrades/2.1.2/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/README.md b/scripts/foundry/contract-upgrades/2.1.2/README.md index 8a34896c..78294fe2 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/README.md +++ b/scripts/foundry/contract-upgrades/2.1.2/README.md @@ -2,14 +2,16 @@ > [!CAUTION] > This upgrade is only necessary for custom fee token chains with an `ERC20Bridge` contract below version `< v2.0.0`. +> > If your chain uses the parent chain's native asset for fees, or your `ERC20Bridge` is already at `v2.0.0` or above, do not perform this upgrade. +> > The rest of this document assumes the chain satisfies the above. -These scripts empower `NitroContracts2Point1Point2UpgradeAction` action contract which performs upgrade to [2.1.2 release](https://github.com/OffchainLabs/nitro-contracts/releases/tag/v2.1.2) of Nitro contracts for existing Orbit chains. Predeployed instances of the upgrade action exists on the chains listed in the following section. +These scripts deploy and execute the `NitroContracts2Point1Point2UpgradeAction` contract which allows Orbit chains to upgrade to [2.1.2 release](https://github.com/OffchainLabs/nitro-contracts/releases/tag/v2.1.2). Predeployed instances of the upgrade action exist on the chains listed in the following section. -Upgrading to `v2.1.2` is REQUIRED before upgrading to `v3.0.0`. Upgrading to `v2.1.0` is REQUIRED before upgrading to `v2.1.0`. +Upgrading to `v2.1.2` is REQUIRED before upgrading to `v3.0.0`. Upgrading to `v2.1.0` is REQUIRED before upgrading to `v2.1.2`. -NitroContracts2Point1Point2UpgradeAction will perform the following action: +`NitroContracts2Point1Point2UpgradeAction` will perform the following action: 1. Upgrade the `ERC20Bridge` contract to `v2.1.2` 1. Force `nativeTokenDecimals` to 18 @@ -47,7 +49,7 @@ Please refer to the top [README](../../README.md) `Check Version and Upgrade Pat ## How to use it -1. Setup .env according to the example files, make sure you have everything correctly defined. The script will do some sanity checks but not everything can be checked. The .env file must be in project root for recent foundry versions. +1. Setup .env according to the example files, make sure you have everything correctly defined. The .env file must be in project root for recent foundry versions. > [!CAUTION] > The .env file must be in project root. From 8257ee5199455e2b6f10a327e2a279c81216f382 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:32:59 -0500 Subject: [PATCH 23/42] misc --- .../NitroContracts2Point1Point2UpgradeAction.sol | 16 +++++++++------- ...itroContracts2Point1Point2UpgradeAction.s.sol | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol index 3568135e..41267f22 100644 --- a/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol +++ b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol @@ -18,8 +18,8 @@ interface IERC20Bridge_v2_patch { } /** - * @title DeployNitroContracts2Point1Point2UpgradeActionScript - * @notice Force the ERC20Bridge contract to set nativeTokenDecimals to 18. + * @title NitroContracts2Point1Point2UpgradeAction + * @notice Upgrade the bridge to ERC20Bridge v2.1.2 and force it to set nativeTokenDecimals to 18. * Will revert if the bridge is not an ERC20Bridge. * Will revert if ERC20Bridge is not v1.x.x */ @@ -39,20 +39,22 @@ contract NitroContracts2Point1Point2UpgradeAction { // ensure the bridge is an ERC20Bridge try IERC20Bridge(bridge).nativeToken() returns (address) {} catch { + // nativeToken() reverted, so it's not an ERC20Bridge revert("NitroContracts2Point1Point2UpgradeAction: bridge is not an ERC20Bridge"); } // ensure the bridge is v1.x.x try IERC20Bridge_v2(address(bridge)).nativeTokenDecimals() returns (uint8) { + // nativeTokenDecimals() didn't revert, so it must be v2.x.x revert("NitroContracts2Point1Point2UpgradeAction: bridge is not v1.x.x"); } catch {} // upgrade to the new implementation and call forceEighteenDecimalsPatch - proxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable((bridge))), - newBridgeImpl, - abi.encodeCall(IERC20Bridge_v2_patch.forceEighteenDecimalsPatch, ()) - ); + proxyAdmin.upgradeAndCall({ + proxy: TransparentUpgradeableProxy(payable((bridge))), + implementation: newBridgeImpl, + data: abi.encodeCall(IERC20Bridge_v2_patch.forceEighteenDecimalsPatch, ()) + }); // ensure decimals were set to 18 require(IERC20Bridge_v2((bridge)).nativeTokenDecimals() == 18, "decimals not set to 18"); diff --git a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol index b7f99812..d71c81be 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/DeployNitroContracts2Point1Point2UpgradeAction.s.sol @@ -13,7 +13,7 @@ contract DeployNitroContracts2Point1Point2UpgradeActionScript is DeploymentHelpe function run() public { vm.startBroadcast(); - // deploy new RollupUserLogic contract from v2.1.0 + // deploy new ERC20Bridge contract from v2.1.2 address newBridgeImpl = deployBytecodeFromJSON( "/node_modules/@arbitrum/nitro-contracts-2.1.2/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json" ); From 31287a29232812ea720b79275063d1efb5637c8e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:36:47 -0500 Subject: [PATCH 24/42] fix --- .gas-snapshot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gas-snapshot b/.gas-snapshot index f309fb6a..a6f2bd62 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1 +1,4 @@ +NitroContracts2Point1Point2UpgradeActionTest:testShouldRevertOnEth() (gas: 61684) +NitroContracts2Point1Point2UpgradeActionTest:testShouldRevertOnV2() (gas: 65683) +NitroContracts2Point1Point2UpgradeActionTest:testShouldUpgradeAndSetDecimals() (gas: 91928) UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 165) \ No newline at end of file From 89aad884a3b6b825396fdc94cacf00827a8848fc Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:55:37 -0500 Subject: [PATCH 25/42] postUpgradeInit --- .../NitroContracts2Point1Point2UpgradeAction.sol | 4 ++-- package.json | 2 +- test/unit/test-unit.bash | 2 +- yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol index 41267f22..c09f5156 100644 --- a/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol +++ b/contracts/parent-chain/contract-upgrades/NitroContracts2Point1Point2UpgradeAction.sol @@ -14,7 +14,7 @@ interface IERC20Bridge_v2 { } interface IERC20Bridge_v2_patch { - function forceEighteenDecimalsPatch() external; + function postUpgradeInit() external; } /** @@ -53,7 +53,7 @@ contract NitroContracts2Point1Point2UpgradeAction { proxyAdmin.upgradeAndCall({ proxy: TransparentUpgradeableProxy(payable((bridge))), implementation: newBridgeImpl, - data: abi.encodeCall(IERC20Bridge_v2_patch.forceEighteenDecimalsPatch, ()) + data: abi.encodeCall(IERC20Bridge_v2_patch.postUpgradeInit, ()) }); // ensure decimals were set to 18 diff --git a/package.json b/package.json index fd06f90d..56842756 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@arbitrum/nitro-contracts-1.2.1": "npm:@arbitrum/nitro-contracts@1.2.1", "@arbitrum/nitro-contracts-1.3.0": "npm:@arbitrum/nitro-contracts@1.3.0", "@arbitrum/nitro-contracts-2.1.0": "npm:@arbitrum/nitro-contracts@2.1.0", - "@arbitrum/nitro-contracts-2.1.2": "npm:godzillaba-nitro-contracts-2-1-2", + "@arbitrum/nitro-contracts-2.1.2": "npm:godzillaba-nitro-contracts@2.1.2-0", "@arbitrum/token-bridge-1.2.2": "npm:@arbitrum/token-bridge-contracts@1.2.2", "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.0", diff --git a/test/unit/test-unit.bash b/test/unit/test-unit.bash index 03887ba6..01ea5059 100755 --- a/test/unit/test-unit.bash +++ b/test/unit/test-unit.bash @@ -14,7 +14,7 @@ fi foundryFiles=$(ls ./test/unit/**/*.t.sol 2>/dev/null) if [ -n "$foundryFiles" ]; then - forge test --match-path "test/unit/*.t.sol" + forge test --match-path "test/unit/*.t.sol" -vvv code=$? fi diff --git a/yarn.lock b/yarn.lock index 0832aab1..86565f7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,10 +43,10 @@ patch-package "^6.4.7" solady "0.0.182" -"@arbitrum/nitro-contracts-2.1.2@npm:godzillaba-nitro-contracts-2-1-2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/godzillaba-nitro-contracts-2-1-2/-/godzillaba-nitro-contracts-2-1-2-2.1.2.tgz#0d53830b7a150c2cd5f41e7356fd75d45ca45037" - integrity sha512-prHc/FsXoqgLULV1QdmRp6TB01TI0W0hszItvrMUUJ3PqCGmqQNbQHrImJdsTKaFygM0LS1GwyHbPGEToX4Rgg== +"@arbitrum/nitro-contracts-2.1.2@npm:godzillaba-nitro-contracts@2.1.2-0": + version "2.1.2-0" + resolved "https://registry.yarnpkg.com/godzillaba-nitro-contracts/-/godzillaba-nitro-contracts-2.1.2-0.tgz#ad1cdc81bc4b8ddf047c17a5aad87399427fb55d" + integrity sha512-NgIaiNCyFLHci/KNfjo9cODpBTQMgMz97aNqyMhuxLe2EQu1QxIIKB55Y+tnqzs7GRIMUC1cL8MZrevmQuNlgA== dependencies: "@offchainlabs/upgrade-executor" "1.1.0-beta.0" "@openzeppelin/contracts" "4.5.0" From f91ef8a4e0c15c42224bffa57b73b63c4b35de7e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:54:45 -0500 Subject: [PATCH 26/42] main readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 991c04c8..9670d5ac 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,18 @@ For ArbOS upgrades, a common pre-requisite is to deploy new Nitro contracts to t The [`nitro-contracts 3.0.0` upgrade guide](scripts/foundry/contract-upgrades/3.0.0) will use the [BOLDUpgradeAction](https://github.com/OffchainLabs/nitro-contracts/blob/main/src/rollup/BOLDUpgradeAction.sol) from the [nitro-contract](https://github.com/OffchainLabs/nitro-contracts) repo. There are no associated ArbOS upgrade for BoLD. +### Nitro contracts 2.1.2 + +The [`nitro-contracts 2.1.2` upgrade guide](scripts/foundry/contract-upgrades/2.1.2) will patch the `ERC20Bridge` with a storage layout fix. + +This upgrade is only required if: + +1. The chain has a custom native token; AND +1. The chain was originally deployed before `v2.0.0`; AND +1. The chain wishes to upgrade to `v3.0.0` + +Do not perform this upgrade if the above requirements aren't met. + ### Nitro contracts 2.1.0 (for [ArbOS 32 Bianca](https://docs.arbitrum.io/run-arbitrum-node/arbos-releases/arbos32)) The [`nitro-contracts 2.1.0` upgrade action](scripts/foundry/contract-upgrades/2.1.0) will deploy `nitro-contracts v2.1.0` contracts to your Orbit's parent chain. Note that this action will only work for chains with `nitro-contracts v1.2.1` or `nitro-contracts v1.3.0`. From 88f14c0e6f6c076d6e244eb566f9762aaa26a7ca Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:59:53 -0500 Subject: [PATCH 27/42] Update scripts/foundry/contract-upgrades/3.0.0/README.md Co-authored-by: gzeon --- scripts/foundry/contract-upgrades/3.0.0/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md index 57d3a265..eedbcc94 100644 --- a/scripts/foundry/contract-upgrades/3.0.0/README.md +++ b/scripts/foundry/contract-upgrades/3.0.0/README.md @@ -44,6 +44,7 @@ $ git checkout v3.0.0 3. Install yarn dependencies ``` $ yarn install +$ yarn build:all ``` 4. In `scripts/files/configs`, create a new config file From 44a61771dbe1e06527240e9db4b304f0acd84be5 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:01:11 -0500 Subject: [PATCH 28/42] readme tweak --- scripts/foundry/contract-upgrades/3.0.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md index eedbcc94..5820844e 100644 --- a/scripts/foundry/contract-upgrades/3.0.0/README.md +++ b/scripts/foundry/contract-upgrades/3.0.0/README.md @@ -41,7 +41,7 @@ $ cd nitro-contracts $ git checkout v3.0.0 ``` -3. Install yarn dependencies +3. Install dependencies and build contracts ``` $ yarn install $ yarn build:all From e09a00b7e5659632776e5ab5c5c31a51aed1248a Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:17:08 -0500 Subject: [PATCH 29/42] note --- scripts/foundry/contract-upgrades/2.1.2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/README.md b/scripts/foundry/contract-upgrades/2.1.2/README.md index 78294fe2..93bdc584 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/README.md +++ b/scripts/foundry/contract-upgrades/2.1.2/README.md @@ -1,7 +1,7 @@ # Nitro contracts 2.1.2 upgrade > [!CAUTION] -> This upgrade is only necessary for custom fee token chains with an `ERC20Bridge` contract below version `< v2.0.0`. +> This is a patch version and is only necessary for custom fee token chains with an `ERC20Bridge` contract below version `< v2.0.0`. > > If your chain uses the parent chain's native asset for fees, or your `ERC20Bridge` is already at `v2.0.0` or above, do not perform this upgrade. > From 3c80dd39921dabb93a4ffa2e00728de8d2796b84 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:17:44 -0500 Subject: [PATCH 30/42] Update scripts/foundry/contract-upgrades/3.0.0/README.md --- scripts/foundry/contract-upgrades/3.0.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md index 5820844e..97ded770 100644 --- a/scripts/foundry/contract-upgrades/3.0.0/README.md +++ b/scripts/foundry/contract-upgrades/3.0.0/README.md @@ -72,7 +72,7 @@ Done. 9. Run the populate lookup script, this will store the last confirmed assertion on-chain for the next step. ``` -$ L1_PRIV_KEY=$(cast wallet private-key --account arbl1) yarn script:bold-populate-lookup +$ L1_PRIV_KEY=xxx yarn script:bold-populate-lookup ... Done. ``` From d7a8f01c3fddd0c684d38a0df8eb3db4dd02ef3e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:27:14 -0500 Subject: [PATCH 31/42] add 2.1.2 to 3.0.0 allowed versions --- scripts/foundry/contract-upgrades/2.1.2/README.md | 2 +- scripts/foundry/contract-upgrades/3.0.0/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/README.md b/scripts/foundry/contract-upgrades/2.1.2/README.md index 93bdc584..1a7e07f0 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/README.md +++ b/scripts/foundry/contract-upgrades/2.1.2/README.md @@ -31,7 +31,7 @@ This upgrade only support upgrading from the following [nitro-contract release]( - RollupUserLogic: v2.1.0 - ChallengeManager: v2.1.0 -Please refer to the top [README](../../README.md) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. +Please refer to the top [README](/README.md#check-version-and-upgrade-path) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. ## Deployed instances diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md index 97ded770..2b1898e7 100644 --- a/scripts/foundry/contract-upgrades/3.0.0/README.md +++ b/scripts/foundry/contract-upgrades/3.0.0/README.md @@ -20,13 +20,13 @@ This upgrade only support upgrading from the following [nitro-contract release]( - SequencerInbox: v1.2.1 - v2.1.0 inclusive - Bridge - eth chain: v1.1.0 - v2.1.0 inclusive - - custom-fee token chain: v2.0.0 - v2.1.0 inclusive + - custom-fee token chain: v2.0.0 - v2.1.2 inclusive - RollupProxy: v1.1.0 - v2.1.0 inclusive - RollupAdminLogic: v2.0.0 - v2.1.0 inclusive - RollupUserLogic: v2.0.0 - v2.1.0 inclusive - ChallengeManager: v2.0.0 - v2.1.0 inclusive -Please refer to the top [README](../../README.md) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. +Please refer to the top [README](/README.md#check-version-and-upgrade-path) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. ## How to use it From 6656dcb7c124aa546dbae620a346118dc10786a2 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:24:09 -0500 Subject: [PATCH 32/42] typo --- .../2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol index 844ecdae..2643b5f5 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol +++ b/scripts/foundry/contract-upgrades/2.1.2/ExecuteNitroContracts2Point1Point2Upgrade.s.sol @@ -12,7 +12,7 @@ import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecu /** * @title ExecuteNitroContracts1Point2Point1UpgradeScript - * @notice This script executes nitro contracts 2.1.0 upgrade through UpgradeExecutor + * @notice This script executes nitro contracts 2.1.2 upgrade through UpgradeExecutor */ contract ExecuteNitroContracts2Point1Point2UpgradeScript is Script { function run() public { From be1c247ab664614bcdde87d1b9f8d50af020659f Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 4 Feb 2025 00:13:29 +0900 Subject: [PATCH 33/42] fix: disable custom fee token chain support for v3 for now --- scripts/orbit-versioner/orbitVersioner.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index ac0f5b31..ed683915 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -216,6 +216,8 @@ function _canBeUpgradedToTargetVersion( if (isFeeTokenChain) { // cannot upgrade erc20 orbit chains from v1 to v3 right now due to a storage diff supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0'] + // TODO: remove this later, but the script does not custom fee token chain yet + supportedSourceVersionsPerContract.Bridge = [] } } else if (targetVersion === 'v2.1.0') { // v2.1.0 will upgrade rollup logics and challenge manager From a87dfb24fef530bca8b140492e2234f7aae20db0 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:52:07 -0600 Subject: [PATCH 34/42] replace npm package --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 56842756..51b2ef62 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@arbitrum/nitro-contracts-1.2.1": "npm:@arbitrum/nitro-contracts@1.2.1", "@arbitrum/nitro-contracts-1.3.0": "npm:@arbitrum/nitro-contracts@1.3.0", "@arbitrum/nitro-contracts-2.1.0": "npm:@arbitrum/nitro-contracts@2.1.0", - "@arbitrum/nitro-contracts-2.1.2": "npm:godzillaba-nitro-contracts@2.1.2-0", + "@arbitrum/nitro-contracts-2.1.2": "npm:@arbitrum/nitro-contracts@2.1.2", "@arbitrum/token-bridge-1.2.2": "npm:@arbitrum/token-bridge-contracts@1.2.2", "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 86565f7c..33b2e028 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,10 +43,10 @@ patch-package "^6.4.7" solady "0.0.182" -"@arbitrum/nitro-contracts-2.1.2@npm:godzillaba-nitro-contracts@2.1.2-0": - version "2.1.2-0" - resolved "https://registry.yarnpkg.com/godzillaba-nitro-contracts/-/godzillaba-nitro-contracts-2.1.2-0.tgz#ad1cdc81bc4b8ddf047c17a5aad87399427fb55d" - integrity sha512-NgIaiNCyFLHci/KNfjo9cODpBTQMgMz97aNqyMhuxLe2EQu1QxIIKB55Y+tnqzs7GRIMUC1cL8MZrevmQuNlgA== +"@arbitrum/nitro-contracts-2.1.2@npm:@arbitrum/nitro-contracts@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-2.1.2.tgz#ee06cdaa55941850c9921e5d0542379234047071" + integrity sha512-kOAep2l///8xBP9fUj843pxoCBiCWH7zL+Qc0pRy3llbE7s4TNI54tiycjuobbYT9geJ01tFvCLWF+pSe+q7DA== dependencies: "@offchainlabs/upgrade-executor" "1.1.0-beta.0" "@openzeppelin/contracts" "4.5.0" From feaff5598d370e13ad209eeb62d594587768f9c3 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:15:35 -0600 Subject: [PATCH 35/42] metadata hashes --- .../referentMetadataHashes.json | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/scripts/orbit-versioner/referentMetadataHashes.json b/scripts/orbit-versioner/referentMetadataHashes.json index a241d88e..69aca1ba 100644 --- a/scripts/orbit-versioner/referentMetadataHashes.json +++ b/scripts/orbit-versioner/referentMetadataHashes.json @@ -61,6 +61,68 @@ "12207d5df4a80d58a52352e9efc07a006f66c944826899b9419b94d6deb8c4e1" ] }, + "v2.1.2": { + "eth": { + "Inbox": [ + "1220628e60c87e41de8e6a81e185b46d287cde8c08a6428c975b93f51625154e", + "122091702e735e50f68dac5823e925b473ebcc2fb5f7a3e16423a6b66ae3e41f" + ], + "Outbox": [ + "1220d72bec3b88f0c24d7071c836c8b7bae617bfcb4ba8257b31d08513327c3e", + "1220a71c0b2b1bb378b4e87b3d74997da580d1aeddfa0020bf7828e35ac6e461" + ], + "SequencerInbox": [ + "1220808ebb88e683cd824929d0402cad1483444601cb2684e3cfaaaeed19ac57", + "12200b70d39c8af70cc4bbc2b5720d07462c71f7284b1e45497748c5118bb338" + ], + "Bridge": [ + "122064054196f2755fb5f47e6097337338d1e194d98c5954455caa8b7baf8e5d", + "12206c38d558afd13c030589dace1d3b4f8d157625dfc5f1ee771258bbf86c5d" + ], + "RollupEventInbox": [ + "12207d19a28e7f0e10a9b2eb981ce3da9fceb0fe3e7644296a1bb96e3c96cbc8", + "122083a34bbde14e9dec4a2f310a86f137fe593f771ab544d81c02bf11b957c6" + ] + }, + "erc20": { + "Inbox": [ + "1220554d1f2e24c9e4d69b248f0dd3a38201a778c4de8dfdeb6c9603141cf39c", + "1220b619f34ba272ec72ca2035fc421c7dd2bc6f98ff5f8a9cdeda227076bac5" + ], + "Outbox": [ + "1220b6f57428af8be2dd64e9c538a09dc180519aae4ba146ec1c30d632f1d2b5", + "122065c63281532ea50f5bde466e32959b8197898044c1677fa59f725f274ff2" + ], + "SequencerInbox": [ + "1220808ebb88e683cd824929d0402cad1483444601cb2684e3cfaaaeed19ac57", + "12200b70d39c8af70cc4bbc2b5720d07462c71f7284b1e45497748c5118bb338" + ], + "Bridge": [ + "1220e960459b981dbc4d07204a7a2305085824f5a8787332d5649a5b64b1c098", + "122015780c5a69efd79a90adc3c14919c8a776c3acdc3575261bf44f3d54f2b6" + ], + "RollupEventInbox": [ + "12207d19a28e7f0e10a9b2eb981ce3da9fceb0fe3e7644296a1bb96e3c96cbc8", + "122083a34bbde14e9dec4a2f310a86f137fe593f771ab544d81c02bf11b957c6" + ] + }, + "RollupProxy": [ + "1220bab353bebd2841fa52caf85916c15589ea2750f92da55e48857dc5190a73", + "1220039b2791e4013e004cd51e37e19e1137184e0a7f5dec2621e721140c54ba" + ], + "RollupAdminLogic": [ + "1220234108252d432aa9102cd74587054f02d4911560a43b4cada21493e410a8", + "1220839876227496412329143261f9aee68b0488c8443af858067961fa782617" + ], + "RollupUserLogic": [ + "1220e522aeb65ca50fd75e371d71357f5aaf5d6bfc0a68fe6939eab69d97030e", + "12209d2c30d4500f07983f4c3ae838cdc93cdf73f3daf90d4dbd3288f072b2d1" + ], + "ChallengeManager": [ + "12203d3c8fc40e3acb1cd932cf29519fe01da37b3e32a8670a81760f4ecf9497", + "1220a10b85e7c0f109a0a569ed2fe7e8603230eaa7d5df62f1531f548fe0eff8" + ] + }, "v2.1.0": { "eth": { "Inbox": [ From 12f8088b8cc4a52b5925a5ba318c2cd46bf9e62b Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 17:28:45 +0800 Subject: [PATCH 36/42] chore: no bold upgrade --- README.md | 4 - .../foundry/contract-upgrades/3.0.0/README.md | 88 ------------------- scripts/orbit-versioner/orbitVersioner.ts | 83 ++++++++--------- 3 files changed, 43 insertions(+), 132 deletions(-) delete mode 100644 scripts/foundry/contract-upgrades/3.0.0/README.md diff --git a/README.md b/README.md index 9670d5ac..d5123ec9 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,6 @@ _This section is also referenced in the documentation on ["How to upgrade ArbOS For ArbOS upgrades, a common pre-requisite is to deploy new Nitro contracts to the parent chain of your Orbit chain before scheduling the ArbOS upgrade. These contracts include the rollup logic, fraud proof contracts, and interfaces for interacting with Nitro precompiles. The scripts and instructions in this repository are meant for Orbit chain owners to upgrade the aforementioned contracts, set the new WASM module root, and then schedule the ArbOS upgrade. -### Nitro contracts 3.0.0 (for [BoLD](https://docs.arbitrum.io/how-arbitrum-works/bold/gentle-introduction)) - -The [`nitro-contracts 3.0.0` upgrade guide](scripts/foundry/contract-upgrades/3.0.0) will use the [BOLDUpgradeAction](https://github.com/OffchainLabs/nitro-contracts/blob/main/src/rollup/BOLDUpgradeAction.sol) from the [nitro-contract](https://github.com/OffchainLabs/nitro-contracts) repo. There are no associated ArbOS upgrade for BoLD. - ### Nitro contracts 2.1.2 The [`nitro-contracts 2.1.2` upgrade guide](scripts/foundry/contract-upgrades/2.1.2) will patch the `ERC20Bridge` with a storage layout fix. diff --git a/scripts/foundry/contract-upgrades/3.0.0/README.md b/scripts/foundry/contract-upgrades/3.0.0/README.md deleted file mode 100644 index 2b1898e7..00000000 --- a/scripts/foundry/contract-upgrades/3.0.0/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Nitro contracts 3.0.0 upgrade - -To upgrade to Nitro contracts 3.0.0 (BoLD), you will need to use the [BOLDUpgradeAction](https://github.com/OffchainLabs/nitro-contracts/blob/main/src/rollup/BOLDUpgradeAction.sol) from the [nitro-contract](https://github.com/OffchainLabs/nitro-contracts) repo. - -BOLDUpgradeAction will perform the following actions: - -1. Upgrade bridge, inbox, rollupEventInbox, outbox, sequencerInbox to v3.0.0 -2. Deploy new v3.0.0 BoLD challenge manager -3. Migrate v2 rollup into a new v3.0.0 rollup address -4. Setup the rollup according to the new config and use the latest confirmed assertion on the old rollup as genesis of the new rollup - -Note that contracts without code changes are not upgraded. It is normal to have some contracts still in the old version after the upgrade as they are equivalent to the new version. There are no associated ArbOS upgrade for this version. - -## Requirements - -This upgrade only support upgrading from the following [nitro-contract release](https://github.com/OffchainLabs/nitro-contracts/releases): - -- Inbox: v1.1.0 - v2.1.0 inclusive -- Outbox: any -- SequencerInbox: v1.2.1 - v2.1.0 inclusive -- Bridge - - eth chain: v1.1.0 - v2.1.0 inclusive - - custom-fee token chain: v2.0.0 - v2.1.2 inclusive -- RollupProxy: v1.1.0 - v2.1.0 inclusive -- RollupAdminLogic: v2.0.0 - v2.1.0 inclusive -- RollupUserLogic: v2.0.0 - v2.1.0 inclusive -- ChallengeManager: v2.0.0 - v2.1.0 inclusive - -Please refer to the top [README](/README.md#check-version-and-upgrade-path) `Check Version and Upgrade Path` on how to determine your current nitro contracts version. - -## How to use it - -1. Clone nitro-contract repo -``` -$ git clone https://github.com/OffchainLabs/nitro-contracts.git -$ cd nitro-contracts -``` - -2. Checkout the v3.0.0 tag -``` -$ git checkout v3.0.0 -``` - -3. Install dependencies and build contracts -``` -$ yarn install -$ yarn build:all -``` - -4. In `scripts/files/configs`, create a new config file -``` -$ cp scripts/files/configs/arb1.ts scripts/files/configs/yourchain.ts -``` - -5. Edit `scripts/files/configs/yourchain.ts`, be very careful as they will override existing configs - -6. Setup .env in project root, make sure CONFIG_NETWORK_NAME is same as the config name (e.g. yourchain) -``` -$ cp .env-sample .env -``` - -7. Run the prepare script, this will deploy the actions. L1_PRIV_KEY does not need to be the chain owner. -``` -$ L1_PRIV_KEY=xxx INFURA_KEY=xxx ETHERSCAN_API_KEY=xxx yarn script:bold-prepare --network {mainnet|arb1|base|arbSepolia} -... -Verified contract BOLDUpgradeAction successfully. -Deployed contracts written to: scripts/files/sepoliaDeployedContracts.json -Done. -``` - -8. Make sure everything is configured correctly. It would be nice to temporarily shutdown all validators. - -9. Run the populate lookup script, this will store the last confirmed assertion on-chain for the next step. -``` -$ L1_PRIV_KEY=xxx yarn script:bold-populate-lookup -... -Done. -``` - -10. Run the upgrade script. If the L1_PRIV_KEY is not the chain owner, it will print the upgrade payload. Execute the payload with the chain owner. -``` -$ L1_PRIV_KEY=xxx yarn script:bold-local-execute -eoa with executor role: 0x6EC62D826aDc24AeA360be9cF2647c42b9Cdb19b -upgrade executor: 0x5FEe78FE9AD96c1d8557C6D6BB22Eb5A61eeD315 -execute(...) call to upgrade executor: 0x1cff79cd000000000000000000000000f8199ca3702c09c78b957d4d820311125753c6d2000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a4ebe03a93000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000030000000000000000000000008a8f0a24d7e58a76fc8f77bb68c7c902b91e182e00000000000000000000000087630025e63a30ecf9ca9d580d9d95922fea6af0000000000000000000000000c32b93e581db6ebc50c08ce381143a259b92f1ed00000000000000000000000000000000000000000000000000000000 -``` - -## FAQ diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 0ce80eb8..05771b08 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -142,10 +142,11 @@ function _checkForPossibleUpgrades( isFeeTokenChain: boolean ) { const targetVersionsDescending = [ - { - version: 'v3.0.0', - actionName: 'BOLD UpgradeAction', - }, + // DISABLING BOLD UPGRADE FOR NOW + // { + // version: 'v3.0.0', + // actionName: 'BOLD UpgradeAction', + // }, { version: 'v2.1.2', actionName: 'NitroContracts2Point1Point2UpgradeAction', @@ -188,42 +189,44 @@ function _canBeUpgradedToTargetVersion( console.log('\nChecking if deployment can be upgraded to', targetVersion) let supportedSourceVersionsPerContract: { [key: string]: string[] } = {} - if (targetVersion === 'v3.0.0') { - // v3.0.0 will upgrade bridge, inbox, rollupEventInbox, outbox, sequencerInbox, rollup logics, challengeManager - supportedSourceVersionsPerContract = { - Inbox: [ - 'v1.1.0', - 'v1.1.1', - 'v1.2.0', - 'v1.2.1', - 'v1.3.0', - 'v2.0.0', - 'v2.1.0', - ], - Outbox: ['any'], - Bridge: [ - 'v1.1.0', - 'v1.1.1', - 'v1.2.0', - 'v1.2.1', - 'v1.3.0', - 'v2.0.0', - 'v2.1.0', - ], - RollupEventInbox: ['any'], - RollupProxy: ['any'], - RollupAdminLogic: ['v2.0.0', 'v2.1.0'], - RollupUserLogic: ['v2.0.0', 'v2.1.0'], - ChallengeManager: ['v2.0.0', 'v2.1.0'], - SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], - } - if (isFeeTokenChain) { - // cannot upgrade erc20 orbit chains from v1 to v3 right now due to a storage diff - supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0', 'v2.1.2'] - // TODO: remove this later, but the script does not custom fee token chain yet - supportedSourceVersionsPerContract.Bridge = [] - } - } else if (targetVersion === 'v2.1.2') { + // DISABLING BOLD UPGRADE FOR NOW + // if (targetVersion === 'v3.0.0') { + // // v3.0.0 will upgrade bridge, inbox, rollupEventInbox, outbox, sequencerInbox, rollup logics, challengeManager + // supportedSourceVersionsPerContract = { + // Inbox: [ + // 'v1.1.0', + // 'v1.1.1', + // 'v1.2.0', + // 'v1.2.1', + // 'v1.3.0', + // 'v2.0.0', + // 'v2.1.0', + // ], + // Outbox: ['any'], + // Bridge: [ + // 'v1.1.0', + // 'v1.1.1', + // 'v1.2.0', + // 'v1.2.1', + // 'v1.3.0', + // 'v2.0.0', + // 'v2.1.0', + // ], + // RollupEventInbox: ['any'], + // RollupProxy: ['any'], + // RollupAdminLogic: ['v2.0.0', 'v2.1.0'], + // RollupUserLogic: ['v2.0.0', 'v2.1.0'], + // ChallengeManager: ['v2.0.0', 'v2.1.0'], + // SequencerInbox: ['v1.2.1', 'v1.3.0', 'v2.0.0', 'v2.1.0'], + // } + // if (isFeeTokenChain) { + // // cannot upgrade erc20 orbit chains from v1 to v3 right now due to a storage diff + // supportedSourceVersionsPerContract.Bridge = ['v2.0.0', 'v2.1.0', 'v2.1.2'] + // // TODO: remove this later, but the script does not custom fee token chain yet + // supportedSourceVersionsPerContract.Bridge = [] + // } + // } else + if (targetVersion === 'v2.1.2') { // v2.1.2 will upgrade the ERC20Bridge contract to set decimals in storage // v2.1.2 is only required for custom fee token chains // only necessary if ERC20Bridge is < v2.0.0 From cf136f502e6c3ab4bd790b95bab22cddf6fc67ae Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 17:30:51 +0800 Subject: [PATCH 37/42] chore: also remove v3 hashes --- .../referentMetadataHashes.json | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/scripts/orbit-versioner/referentMetadataHashes.json b/scripts/orbit-versioner/referentMetadataHashes.json index 69aca1ba..cc9b1b9f 100644 --- a/scripts/orbit-versioner/referentMetadataHashes.json +++ b/scripts/orbit-versioner/referentMetadataHashes.json @@ -1,66 +1,4 @@ { - "v3.0.0": { - "eth": { - "Inbox": [ - "1220a8e6c35fe4090e6f290c91615dff206bf292ff3ef98713aa72da6ba65f48", - "1220ae2e9b8ab3513d7c2bce41d0cd7e738751340a043030ee880915bec6f3e5" - ], - "Outbox": [ - "1220e5f8ce06235750d407a30ba6a949de60886062a846bea52bb65e0d34f11e", - "12205743a26881f654a05b125ff9bf145327c68b6d5ab30f9201926fd0de57ca" - ], - "SequencerInbox": [ - "122099c68e0c4fc9caadfc7a0b2c4b436644dc6aba460ffc31489167885e22f2", - "122038e99cf4eb42b1bd091544a0482c80ae5681aaff1e73e5b858eba14b3289" - ], - "Bridge": [ - "1220bae7eaf18c61f7d8559a1edc92b1ee8dea4400c55ec0b1b0c4df659b4984", - "1220a21db9d1c105cea300448647867f48dc194bd84b4ac5452c7532acb850e4" - ], - "RollupEventInbox": [ - "12202e329e1a0c9bb43dce08dd86f50a25f359bac1bbd58289ad7319cb11e151", - "1220a4508e3924bc48413d05ae71f986fa09f67b9edf853b56ea3e6ed4a5b847" - ] - }, - "erc20": { - "Inbox": [ - "12201b7c440f00a6f6c1cac2b1b7273b28b716d71fc9a59d033d5424cd326aa6", - "1220265f869376b6c520445ee90b23fc3e870282a128759593a36018a4b154b4" - ], - "Outbox": [ - "1220fd62bd1cf925b2618d01c259e2123459674bc5fe8b1432a4dc8aa3b7affe", - "12203107dfc7dba114f418f026d5d8a974bb47263d948207dc0c305e65ad3714" - ], - "SequencerInbox": [ - "122099c68e0c4fc9caadfc7a0b2c4b436644dc6aba460ffc31489167885e22f2", - "122038e99cf4eb42b1bd091544a0482c80ae5681aaff1e73e5b858eba14b3289" - ], - "Bridge": [ - "12208618f0361aadde6e5ed67aec672032b5d03593fc75ed8adf89145ee93fc3", - "12200ffc0009dbe213082c30b6db421b75a0f6bf2f69011875f2b1c3d0423afb" - ], - "RollupEventInbox": [ - "1220ee8677b4eafaaeb1fc21515e42f0fecb06859156ef43489514be59e3d4bd", - "1220bea5022b33ad40c8720af015ab790b465b5e2f8ad9ff7dae140292f60448" - ] - }, - "RollupProxy": [ - "1220c50f3bd10cc10c9d6a7e3c77a603ea076a398bfabf2598ec9e1d71302b8c", - "12209bf2c0238c2505716be0e1d04df7889d4edb5024e1ba28c8c320a9287abf" - ], - "RollupAdminLogic": [ - "12201b1f12c1dedf74ff792cdd420011c650d657ae97ae48a1ecb2f81ecc86d9", - "122079a2eee6b69c780f4b6d641fceaab53e1a7c4dd0fe1510ed52555779445a" - ], - "RollupUserLogic": [ - "1220adac40079ee3a5b023334745bf53c80fdb89f53847bb69953dd97b277c66", - "1220f955cb8523efeeee460da93d0463abf4ef78c2c2cb44d89f516dbbcac7ff" - ], - "ChallengeManager": [ - "1220be58ff753a772f5eac411153528470a00d3296a9952fd0d965a20c027d34", - "12207d5df4a80d58a52352e9efc07a006f66c944826899b9419b94d6deb8c4e1" - ] - }, "v2.1.2": { "eth": { "Inbox": [ From df1b03726b7320284d30c1c902fb2801bb565492 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 18:07:25 +0800 Subject: [PATCH 38/42] ci: use foundry stable --- .github/workflows/audit.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/test-e2e.yml | 6 +++--- .github/workflows/test-fork.yml | 2 +- .github/workflows/test.yml | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 19bf0d0a..5c06776c 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -20,7 +20,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn audit:ci diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 49892d4b..cdb99f4f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn && yarn build - run: yarn lint diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index b82f6e50..7929f1dd 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -25,7 +25,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn - run: cp .env.example .env && yarn test:e2e @@ -52,7 +52,7 @@ jobs: # - name: Install Foundry # uses: foundry-rs/foundry-toolchain@v1 # with: - # version: nightly + # version: stable # - run: yarn # - run: cp .env.example .env && yarn test:e2e @@ -80,7 +80,7 @@ jobs: # - name: Install Foundry # uses: foundry-rs/foundry-toolchain@v1 # with: - # version: nightly + # version: stable # - run: yarn # - run: cp .env.example .env && yarn test:e2e diff --git a/.github/workflows/test-fork.yml b/.github/workflows/test-fork.yml index d7a09dea..aef7dc1a 100644 --- a/.github/workflows/test-fork.yml +++ b/.github/workflows/test-fork.yml @@ -20,7 +20,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: ETH_FORK_URL=${{ secrets.ETH_FORK_URL }} ARB_FORK_URL=${{ secrets.ARB_FORK_URL }} yarn test:fork diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb1cf56e..1274f006 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn test:unit @@ -35,7 +35,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn test:sizes @@ -50,7 +50,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn test:gas-check @@ -65,7 +65,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn test:sigs @@ -80,7 +80,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: stable - run: yarn minimal-install - run: yarn test:storage From 98893aff944f65d02666f0067f6acaf60606578d Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 18:08:59 +0800 Subject: [PATCH 39/42] fix: lint --- scripts/orbit-versioner/orbitVersioner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/orbit-versioner/orbitVersioner.ts b/scripts/orbit-versioner/orbitVersioner.ts index 05771b08..09b55282 100644 --- a/scripts/orbit-versioner/orbitVersioner.ts +++ b/scripts/orbit-versioner/orbitVersioner.ts @@ -225,7 +225,7 @@ function _canBeUpgradedToTargetVersion( // // TODO: remove this later, but the script does not custom fee token chain yet // supportedSourceVersionsPerContract.Bridge = [] // } - // } else + // } else if (targetVersion === 'v2.1.2') { // v2.1.2 will upgrade the ERC20Bridge contract to set decimals in storage // v2.1.2 is only required for custom fee token chains From 2641402b59e2041639c11c2eecf43ed30afb38c0 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 18:20:01 +0800 Subject: [PATCH 40/42] test: remove pretty flag from inspect --- test/util/forge-inspect.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/util/forge-inspect.bash b/test/util/forge-inspect.bash index a4640ead..cce5fd58 100755 --- a/test/util/forge-inspect.bash +++ b/test/util/forge-inspect.bash @@ -18,12 +18,12 @@ for contractName in $contracts; do # if the file doesn't exist, create it if [ ! -f "$outputDir/$contractName" ]; then - forge inspect "$contractName" "$inspectType" --pretty > "$outputDir/$contractName" + forge inspect "$contractName" "$inspectType" > "$outputDir/$contractName" CHANGED=1 # if the file does exist, compare it else mv "$outputDir/$contractName" "$outputDir/$contractName-old" - forge inspect "$contractName" "$inspectType" --pretty > "$outputDir/$contractName" + forge inspect "$contractName" "$inspectType" > "$outputDir/$contractName" diff "$outputDir/$contractName-old" "$outputDir/$contractName" if [[ $? != "0" ]]; then CHANGED=1 From d744a657afb6cf8c014e3f20285d4eeca9cdff02 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 18:20:17 +0800 Subject: [PATCH 41/42] test: commit new format --- test/signatures/AddWasmCacheManagerAction | 16 +++++++--- test/signatures/EnableFastConfirmAction | 19 ++++++++---- .../NitroContracts1Point2Point1UpgradeAction | 22 ++++++++----- .../NitroContracts2Point1Point0UpgradeAction | 31 +++++++++++++------ .../NitroContracts2Point1Point2UpgradeAction | 13 +++++--- .../SetSequencerInboxMaxTimeVariationAction | 22 ++++++++----- .../UpgradeArbOSVersionAtTimestampAction | 16 +++++++--- 7 files changed, 95 insertions(+), 44 deletions(-) diff --git a/test/signatures/AddWasmCacheManagerAction b/test/signatures/AddWasmCacheManagerAction index d60470db..99103b94 100644 --- a/test/signatures/AddWasmCacheManagerAction +++ b/test/signatures/AddWasmCacheManagerAction @@ -1,5 +1,11 @@ -{ - "perform()": "b147f40c", - "targetArbOSVersion()": "fcb528a2", - "wasmCachemanager()": "b6763099" -} + +╭----------------------+------------╮ +| Method | Identifier | ++===================================+ +| perform() | b147f40c | +|----------------------+------------| +| targetArbOSVersion() | fcb528a2 | +|----------------------+------------| +| wasmCachemanager() | b6763099 | +╰----------------------+------------╯ + diff --git a/test/signatures/EnableFastConfirmAction b/test/signatures/EnableFastConfirmAction index a47b3e4a..10a5a175 100644 --- a/test/signatures/EnableFastConfirmAction +++ b/test/signatures/EnableFastConfirmAction @@ -1,6 +1,13 @@ -{ - "GNOSIS_COMPATIBILITY_FALLBACK_HANDLER()": "e9f250c1", - "GNOSIS_SAFE_1_3_0()": "acbd7fb4", - "GNOSIS_SAFE_PROXY_FACTORY()": "97ce5a2b", - "perform(address,address[],uint256,uint256)": "6214cbd9" -} + +╭--------------------------------------------+------------╮ +| Method | Identifier | ++=========================================================+ +| GNOSIS_COMPATIBILITY_FALLBACK_HANDLER() | e9f250c1 | +|--------------------------------------------+------------| +| GNOSIS_SAFE_1_3_0() | acbd7fb4 | +|--------------------------------------------+------------| +| GNOSIS_SAFE_PROXY_FACTORY() | 97ce5a2b | +|--------------------------------------------+------------| +| perform(address,address[],uint256,uint256) | 6214cbd9 | +╰--------------------------------------------+------------╯ + diff --git a/test/signatures/NitroContracts1Point2Point1UpgradeAction b/test/signatures/NitroContracts1Point2Point1UpgradeAction index c0ce1ae3..431521a3 100644 --- a/test/signatures/NitroContracts1Point2Point1UpgradeAction +++ b/test/signatures/NitroContracts1Point2Point1UpgradeAction @@ -1,7 +1,15 @@ -{ - "newChallengeManagerImpl()": "924ef096", - "newOsp()": "5c4bb63c", - "newSequencerInboxImpl()": "d268538a", - "newWasmModuleRoot()": "6741148c", - "perform(address,address)": "857d1ab7" -} + +╭---------------------------+------------╮ +| Method | Identifier | ++========================================+ +| newChallengeManagerImpl() | 924ef096 | +|---------------------------+------------| +| newOsp() | 5c4bb63c | +|---------------------------+------------| +| newSequencerInboxImpl() | d268538a | +|---------------------------+------------| +| newWasmModuleRoot() | 6741148c | +|---------------------------+------------| +| perform(address,address) | 857d1ab7 | +╰---------------------------+------------╯ + diff --git a/test/signatures/NitroContracts2Point1Point0UpgradeAction b/test/signatures/NitroContracts2Point1Point0UpgradeAction index cc15fe34..8d9f8bcc 100644 --- a/test/signatures/NitroContracts2Point1Point0UpgradeAction +++ b/test/signatures/NitroContracts2Point1Point0UpgradeAction @@ -1,10 +1,21 @@ -{ - "condOsp()": "acdf78b9", - "condRoot()": "828545a7", - "newChallengeManagerImpl()": "924ef096", - "newRollupAdminLogic()": "719c1d83", - "newRollupUserLogic()": "98ab2129", - "newWasmModuleRoot()": "6741148c", - "osp()": "f26a62c6", - "perform(address,address)": "857d1ab7" -} + +╭---------------------------+------------╮ +| Method | Identifier | ++========================================+ +| condOsp() | acdf78b9 | +|---------------------------+------------| +| condRoot() | 828545a7 | +|---------------------------+------------| +| newChallengeManagerImpl() | 924ef096 | +|---------------------------+------------| +| newRollupAdminLogic() | 719c1d83 | +|---------------------------+------------| +| newRollupUserLogic() | 98ab2129 | +|---------------------------+------------| +| newWasmModuleRoot() | 6741148c | +|---------------------------+------------| +| osp() | f26a62c6 | +|---------------------------+------------| +| perform(address,address) | 857d1ab7 | +╰---------------------------+------------╯ + diff --git a/test/signatures/NitroContracts2Point1Point2UpgradeAction b/test/signatures/NitroContracts2Point1Point2UpgradeAction index 08041872..b4427520 100644 --- a/test/signatures/NitroContracts2Point1Point2UpgradeAction +++ b/test/signatures/NitroContracts2Point1Point2UpgradeAction @@ -1,4 +1,9 @@ -{ - "newBridgeImpl()": "28b07406", - "perform(address,address)": "857d1ab7" -} + +╭--------------------------+------------╮ +| Method | Identifier | ++=======================================+ +| newBridgeImpl() | 28b07406 | +|--------------------------+------------| +| perform(address,address) | 857d1ab7 | +╰--------------------------+------------╯ + diff --git a/test/signatures/SetSequencerInboxMaxTimeVariationAction b/test/signatures/SetSequencerInboxMaxTimeVariationAction index 109f1edf..6445d04a 100644 --- a/test/signatures/SetSequencerInboxMaxTimeVariationAction +++ b/test/signatures/SetSequencerInboxMaxTimeVariationAction @@ -1,7 +1,15 @@ -{ - "delayBlocks()": "ad9c0c2e", - "delaySeconds()": "b752a7d1", - "futureBlocks()": "4f359a37", - "futureSeconds()": "2f1ec5e9", - "perform(address)": "b38ed43b" -} + +╭------------------+------------╮ +| Method | Identifier | ++===============================+ +| delayBlocks() | ad9c0c2e | +|------------------+------------| +| delaySeconds() | b752a7d1 | +|------------------+------------| +| futureBlocks() | 4f359a37 | +|------------------+------------| +| futureSeconds() | 2f1ec5e9 | +|------------------+------------| +| perform(address) | b38ed43b | +╰------------------+------------╯ + diff --git a/test/signatures/UpgradeArbOSVersionAtTimestampAction b/test/signatures/UpgradeArbOSVersionAtTimestampAction index fc6cfce5..e18cbf5e 100644 --- a/test/signatures/UpgradeArbOSVersionAtTimestampAction +++ b/test/signatures/UpgradeArbOSVersionAtTimestampAction @@ -1,5 +1,11 @@ -{ - "newArbOSVersion()": "0959267e", - "perform()": "b147f40c", - "upgradeTimestamp()": "921bd6f0" -} + +╭--------------------+------------╮ +| Method | Identifier | ++=================================+ +| newArbOSVersion() | 0959267e | +|--------------------+------------| +| perform() | b147f40c | +|--------------------+------------| +| upgradeTimestamp() | 921bd6f0 | +╰--------------------+------------╯ + From 8df41753ba3960183f14a8c7fbaedb3305a1d1af Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 24 Feb 2025 18:21:00 +0800 Subject: [PATCH 42/42] chore: deployments --- .../foundry/contract-upgrades/2.1.2/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/foundry/contract-upgrades/2.1.2/README.md b/scripts/foundry/contract-upgrades/2.1.2/README.md index 1a7e07f0..16b04a6c 100644 --- a/scripts/foundry/contract-upgrades/2.1.2/README.md +++ b/scripts/foundry/contract-upgrades/2.1.2/README.md @@ -36,16 +36,16 @@ Please refer to the top [README](/README.md#check-version-and-upgrade-path) `Che ## Deployed instances ### Mainnets -- L1 Mainnet: TODO -- L2 Arb1: TODO -- L2 Nova: TODO -- L2 Base: TODO +- L1 Mainnet: 0x78Ee30C74B3Ce1aeB38163Db3E7d769d9735542F +- L2 Arb1: 0x7D42F098e79DE006CFAB475cFD50BdF2310d7ae8 +- L2 Nova: 0xEb35A5E1B0FdBa925880A539Eac661907d43Ee07 +- L2 Base: 0x9d924ffE6D66ca0727657734a615CC9730925c49 ### Testnets -- L1 Sepolia: TODO -- L1 Holesky: TODO -- L2 ArbSepolia: TODO -- L2 BaseSepolia: TODO +- L1 Sepolia: 0xA8a3869A55Baf88f20B81bdbf54eDaC532b98369 +- L1 Holesky: 0x619a0B831d61b90a8585CE9B25077021f1fFa925 +- L2 ArbSepolia: 0x76A35A0c721A6bf53982f5a00ccb3AaDb184aD8E +- L2 BaseSepolia: 0xA5b663B60502ef6bFFe3e003A43d3E79AFB1aC1c ## How to use it