Skip to content

Commit

Permalink
imp: used the same client sequence for all client types (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk authored Jan 16, 2025
1 parent e792331 commit ecf77a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Install SP1 toolchain
if: (steps.cache-relayer.outputs.cache-hit != 'true')
run: |
curl -L https://raw.githubusercontent.com/succinctlabs/sp1/v3.4.0/sp1up/install | bash
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up --token ${{ secrets.GITHUB_TOKEN }}
~/.sp1/bin/cargo-prove prove --version
Expand Down
8 changes: 4 additions & 4 deletions contracts/ICSCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ contract ICSCore is IICS02Client, IICS04Channel, IICS02ClientErrors, Initializab
/// @dev risk of storage collisions when using with upgradeable contracts.
/// @param channels Mapping of client identifiers to channels
/// @param clients Mapping of client identifiers to light client contracts
/// @param nextClientSeq Mapping of client types to the next client sequence
/// @param nextClientSeq The next sequence number for the next client identifier
/// @custom:storage-location erc7201:ibc.storage.ICSCore
struct ICSCoreStorage {
mapping(string clientId => Channel) channels;
mapping(string clientId => ILightClient) clients;
mapping(string clientType => uint32) nextClientSeq;
uint32 nextClientSeq;
}

/// @notice ERC-7201 slot for the ICSCore storage
Expand Down Expand Up @@ -56,8 +56,8 @@ contract ICSCore is IICS02Client, IICS04Channel, IICS02ClientErrors, Initializab

require(IBCIdentifiers.validateClientType(clientType), IBCInvalidClientType(clientType));

uint32 seq = $.nextClientSeq[clientType];
$.nextClientSeq[clientType] = seq + 1;
uint32 seq = $.nextClientSeq;
$.nextClientSeq = seq + 1;
return string.concat(clientType, "-", Strings.toString(seq));
}

Expand Down

0 comments on commit ecf77a0

Please sign in to comment.