Skip to content

Commit

Permalink
Merge pull request #252 from hyperledger-labs/misc-docs
Browse files Browse the repository at this point in the history
misc: fix some docs

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Feb 21, 2024
2 parents 5284476 + 3ffc0f9 commit 6d2ed66
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ DISCLAIMER: This project is still under development and has not been audited.

## Supported Light Client

You can deploy a Light Client that implements [the IClient interface](./contracts/core/02-client/ILightClient.sol) to [integrate with ibc-solidity](./docs/architecture.md#light-client).
You can deploy a Light Client that implements [the ILightClient interface](./contracts/core/02-client/ILightClient.sol) to [integrate with ibc-solidity](./docs/architecture.md#light-client).

Here are some such examples:
- [IBFT 2.0 Light Client](./contracts/clients/IBFT2Client.sol)
- [Tendermint Light Client](https://github.com/datachainlab/tendermint-sol/tree/use-ibc-sol-hmy)
- [Mock Client](./contracts/clients/MockClient.sol)
- [LCP(TEE) Client](https://github.com/datachainlab/lcp-solidity)
- [Localhost Client](./contracts/clients/LocalhostClient.sol)

## IBC relayer support

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

- [Architecture Overview](./architecture.md)
- [IBFT 2.0 Light Client spec](./ibft2-light-client.md)
- [ADRs](./adr)
2 changes: 1 addition & 1 deletion docs/adr/adr-001.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Implemented

## Summary

This document describes a proposal to reduce the ibc-solidity UpdateClient gas cost. The current UpdateClient gas cost is high due to several inefficient and non-critical operations that are unnecessary after the handshake, such as proto-decode and updating client commitments. These operations are offloaded from on-chain transactions to off-chain, allowing state and commitment updates to be separated. As a result, MockClient's UpdateClient costs were reduced from 126,635 to 39,892, saving approximately 86,000 gas.
This document describes a proposal to reduce the ibc-solidity UpdateClient gas cost. The current UpdateClient gas cost is high due to several inefficient and non-critical operations that are unnecessary after the handshake, such as proto-decode and updating client commitments. By offloading these operations from on-chain to off-chain, and by enabling the separation of state and commitment updates, we have achieved a reduction of approximately 86,000 gas in the MockClient, from 126,635 gas to 39,892 gas.

## Context

Expand Down
5 changes: 3 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ contracts/
04-channel/ … ics-04
24-host/ … ics-24
25-handler/ … ics-25
26-router/ … ics-26
proto/ … code generated by solidity-protobuf
```

Expand Down Expand Up @@ -74,7 +75,7 @@ You can support any light client via developing a contract that implements [ILig

The registered light client can be instantiated by `createClient`, which can be used to verify the handshake process to establish connections and channels.

Different from ibc-go, the light client contract keeps the state in own contract storage in ibc-solidity. This is an optimization based on the high cost of serialization state and read/write storage in solidity. For this reason, `createClient` and `updateClient` only return a commitment.
Different from ibc-go, the light client contract keeps the state in own contract storage in ibc-solidity. This is an optimization based on the high cost of serialization state and read/write storage in solidity. For this reason, `createClient` and `updateClient` only return a commitment instead of the state.

## Applications

Expand Down Expand Up @@ -142,4 +143,4 @@ The packet sending flow using the `EchoApp` is the following:

Also, an App can define callback functions for state transitions in the channel handshake. See [IIBCModule interface](../contracts/core/26-router/IIBCModule.sol) for more details.

Further example implementations are [ICS-20 implementation](../contracts/apps/20-transfer) and a [tutorial](https://labs.hyperledger.org/yui-docs/yui-ibc-solidity/minitoken/overview) that describes e2e packet relay using a small IBC-App called minitoken.
Further example implementations are [ICS-20 implementation](../contracts/apps/20-transfer) and a [tutorial](https://labs.hyperledger.org/yui-docs/yui-ibc-solidity/minitoken/overview) that describes e2e packet relay using a simple IBC-App called minitoken.

0 comments on commit 6d2ed66

Please sign in to comment.