Skip to content

Commit f1346ef

Browse files
committed
feat: upgrade mainnet state-lens/ics23/ics23 clients
1 parent c2c6c2c commit f1346ef

File tree

4 files changed

+18
-49
lines changed

4 files changed

+18
-49
lines changed

deployments/deployments.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
"state-lens/ics23/ics23": {
260260
"address": "0x2c5b55a11fad1d169b83df21d886ce0797f3a83d",
261261
"height": 22236429,
262-
"commit": "2d6ccbaaf8dcb6d282e8e499584de937f9719066"
262+
"commit": "c2c6c2c8e11910ccd5ca6bc3db1055364a21af8a"
263263
},
264264
"state-lens/ics23/smt": {
265265
"address": "0xd411236ab864284374ae95b23b747b97bfca9207",
@@ -421,7 +421,7 @@
421421
"state-lens/ics23/ics23": {
422422
"address": "0x2c5b55a11fad1d169b83df21d886ce0797f3a83d",
423423
"height": 15699439,
424-
"commit": "2d6ccbaaf8dcb6d282e8e499584de937f9719066"
424+
"commit": "c2c6c2c8e11910ccd5ca6bc3db1055364a21af8a"
425425
},
426426
"state-lens/ics23/smt": {
427427
"address": "0xd411236ab864284374ae95b23b747b97bfca9207",
@@ -529,7 +529,7 @@
529529
"state-lens/ics23/ics23": {
530530
"address": "0x2c5b55a11fad1d169b83df21d886ce0797f3a83d",
531531
"height": 392724,
532-
"commit": "2d6ccbaaf8dcb6d282e8e499584de937f9719066"
532+
"commit": "c2c6c2c8e11910ccd5ca6bc3db1055364a21af8a"
533533
},
534534
"state-lens/ics23/smt": {
535535
"address": "0xd411236ab864284374ae95b23b747b97bfca9207",

evm/contracts/clients/StateLensIcs23Ics23Client.sol

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ struct Header {
2828
bytes l2ConsensusState;
2929
}
3030

31-
struct LegacyClientState {
32-
string l2ChainId;
33-
uint32 l1ClientId;
34-
uint32 l2ClientId;
35-
uint64 l2LatestHeight;
36-
bytes32 contractAddress;
37-
}
38-
3931
struct ClientState {
4032
string l2ChainId;
4133
uint32 l1ClientId;
@@ -133,7 +125,7 @@ contract StateLensIcs23Ics23Client is
133125

134126
address public immutable IBC_HANDLER;
135127

136-
mapping(uint32 => LegacyClientState) private legacyClientStates;
128+
uint256 private _deprecatedLegacyClientStates;
137129
mapping(uint32 => mapping(uint64 => ConsensusState)) private consensusStates;
138130

139131
mapping(uint32 => ClientState) private clientStates;
@@ -153,30 +145,6 @@ contract StateLensIcs23Ics23Client is
153145
__Pausable_init();
154146
}
155147

156-
function migrateClientStateToV1(
157-
uint32[] calldata clientIds
158-
) public restricted {
159-
for (uint256 i = 0; i < clientIds.length; i++) {
160-
LegacyClientState storage legacyState =
161-
legacyClientStates[clientIds[i]];
162-
ClientState storage newState = clientStates[clientIds[i]];
163-
164-
newState.l2ChainId = legacyState.l2ChainId;
165-
newState.l1ClientId = legacyState.l1ClientId;
166-
newState.l2ClientId = legacyState.l2ClientId;
167-
newState.l2LatestHeight = legacyState.l2LatestHeight;
168-
newState.version = uint256(1);
169-
newState.state = ExtraV1({
170-
storeKey: IBCStoreLib.WASMD_MODULE_STORE_KEY,
171-
keyPrefixStorage: abi.encodePacked(
172-
IBCStoreLib.WASMD_CONTRACT_STORE_PREFIX,
173-
legacyState.contractAddress,
174-
IBCStoreLib.IBC_UNION_COSMWASM_COMMITMENT_PREFIX
175-
)
176-
}).encode();
177-
}
178-
}
179-
180148
function createClient(
181149
address,
182150
uint32 clientId,

evm/scripts/Deploy.s.sol

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,20 +1559,11 @@ contract UpgradeStateLensIcs23Ics23Client is VersionedScript {
15591559
address immutable deployer;
15601560
address immutable sender;
15611561
uint256 immutable privateKey;
1562-
uint32[] public clientIds;
15631562

15641563
constructor() {
15651564
deployer = vm.envAddress("DEPLOYER");
15661565
sender = vm.envAddress("SENDER");
15671566
privateKey = vm.envUint("PRIVATE_KEY");
1568-
1569-
// uint256[] memory u256ClientIds = vm.envUint("CLIENT_IDS", ",");
1570-
1571-
// clientIds = new uint32[](u256ClientIds.length);
1572-
1573-
// for (uint256 i = 0; i < u256ClientIds.length; ++i) {
1574-
// clientIds[i] = uint32(u256ClientIds[i]);
1575-
// }
15761567
}
15771568

15781569
function getDeployed(
@@ -1605,10 +1596,6 @@ contract UpgradeStateLensIcs23Ics23Client is VersionedScript {
16051596
stateLensIcs23Ics23Client.upgradeToAndCall(
16061597
newImplementation, new bytes(0)
16071598
);
1608-
// abi.encodeWithSelector(
1609-
// StateLensIcs23Ics23Client.migrateClientStateToV1.selector,
1610-
// clientIds
1611-
// )
16121599

16131600
vm.stopBroadcast();
16141601
}

flake.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,21 @@
346346
unset LD_LIBRARY_PATH
347347
EOF
348348
349+
echo "patched cast"
350+
349351
chmod +x $out/bin/cast
352+
353+
mv $out/bin/forge $out/bin/forge-cursed
354+
355+
cat <<EOF >> $out/bin/forge
356+
export LD_LIBRARY_PATH=${lib.makeLibraryPath [ super.stdenv.cc.cc.lib ]}
357+
$out/bin/forge-cursed "\$@"
358+
unset LD_LIBRARY_PATH
359+
EOF
360+
361+
chmod +x $out/bin/forge
362+
363+
echo "patched forge"
350364
'';
351365
});
352366

0 commit comments

Comments
 (0)