Skip to content

Commit a442d95

Browse files
AntonAndellizyak
andauthoredFeb 12, 2024
807 add client specific hashing on ack and packet data (#825)
* feat: hash depending on client type * feat: add IBC prefix for ics-08 clients and bugfixes (#826) * feat: Add revision number to light client heights Add revision number but for now do not add support for resseting chain height * revert to using two clients * feat: add IBC prefix for ics-08 clients and bugfixes * fix: hash ack value before sending to verify membership for ics8 client --------- Co-authored-by: izyak <lbackup887@gmail.com> --------- Co-authored-by: izyak <lbackup887@gmail.com>
1 parent 6bed165 commit a442d95

File tree

315 files changed

+21630
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+21630
-168
lines changed
 

‎contracts/javascore/ibc/src/intTest/java/ibc/core/integration/IBCIntegrationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void setup() throws Exception {
6464
@Test
6565
@Order(0)
6666
void registerClient() {
67-
getClientInterface(owner).registerClient(clientType, mockLightClient._address());
67+
getClientInterface(owner).registerClient(clientType, mockLightClient._address(), 0);
6868
}
6969

7070
@Test

‎contracts/javascore/ibc/src/main/java/ibc/ics02/client/IBCClient.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import ibc.icon.score.util.Logger;
44
import ibc.icon.score.util.NullChecker;
55
import ibc.ics24.host.IBCHost;
6+
import ibc.ics24.host.IBCStore;
67
import icon.ibc.interfaces.ILightClient;
78
import icon.ibc.structs.messages.MsgCreateClient;
89
import icon.ibc.structs.messages.MsgUpdateClient;
@@ -16,9 +17,10 @@ public class IBCClient extends IBCHost {
1617

1718
static Logger logger = new Logger("ibc-core");
1819

19-
public void registerClient(String clientType, Address lightClient) {
20+
public void registerClient(String clientType, Address lightClient, int hashType) {
2021
Context.require(clientRegistry.get(clientType) == null, "Already registered.");
2122
clientRegistry.set(clientType, lightClient);
23+
IBCStore.hashType.set(clientType, hashType);
2224
}
2325

2426
public String _createClient(MsgCreateClient msg) {
@@ -32,6 +34,7 @@ public String _createClient(MsgCreateClient msg) {
3234
clientTypes.set(clientId, msg.getClientType());
3335
clientImplementations.set(clientId, lightClientAddr);
3436
btpNetworkId.set(clientId, msg.getBtpNetworkId());
37+
// hashMethod.set(clientId, msg.getHashMethod());
3538

3639
ILightClient client = getClient(clientId);
3740
client.createClient(clientId, msg.getClientState(), msg.getConsensusState());

0 commit comments

Comments
 (0)