Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
refactor: implement 'solidity-ibc-eureka' interfaces (#83)
Browse files Browse the repository at this point in the history
* deps(contracts): added solidity-ibc-eureka

* imp: added remapping

* imp: removed old interface

* refactor: major refactor

* refactor: fixed SP1 Contract

* refactor: more

* refactor: more

* refactor: regenerated abi

* fix: clippy

* imp: regen

* imp: working

* docs: updated README.md

* docs: updated

* refactor: refactored updateClient

* tests: simplify and fix

* refactor: rust

* refactor: test passing

* imp: regerated mock stuff

* imp: improved justfile

* imp: justfile

* style: ran forge fmt

* deps: updated contracts

* imp: fixed stuff

* refactor: improve

* imp: tests

* rename

* imp: removed mock fixtures

* imp: removing mock fixtures

* imp: removed verify_membership fixtures

* test: should be good to go

* style: ran 'forge fmt'

* imp: regenerated abi

* test: imp

* imp: improved public api

* imp: membership rust

* test: membership test improved

* test: improved test

* imp: abi generated again

* imp: attempt to fix rust

* refactor: light block in genesis

* imp: regenerated fixtures

* test: Membership test fixed

* imp: attempt to fix

* test: all tests passing

* deps: bumped ibc-go to v8.4

* lint

* lint: solhint

* imp: implemented ILightClient
  • Loading branch information
srdtrk authored Jul 29, 2024
1 parent 1dffbb0 commit 3ebeb04
Show file tree
Hide file tree
Showing 51 changed files with 1,702 additions and 1,308 deletions.
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"code-complexity": ["error", 8],
"code-complexity": ["error", 11],
"compiler-version": ["error", ">=0.8.25"],
"func-name-mixedcase": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async-trait = "0.1.80"
hex = "0.4.3"
prost = { version = "0.12", default-features = false }
futures = "0.3"
serde_with = { version = "3.9.0", features = ["hex"] }

[patch.crates-io]
sha2-v0-9-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-v0.9.8" }
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<div align="center">

[![Github Actions][gha-badge]][gha]
[![Foundry][foundry-badge]][foundry]
[![SP1][sp1-badge]][sp1]
[![License: MIT][license-badge]][license]
</div>

[gha]: https://github.com/cosmos/sp1-ics07-tendermint/actions
[gha-badge]: https://github.com/cosmos/sp1-ics07-tendermint/actions/workflows/e2e.yml/badge.svg
[foundry]: https://getfoundry.sh/
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
[sp1]: https://github.com/succinctlabs/sp1
[sp1-badge]: https://img.shields.io/badge/Built%20with-SP1-1D4351.svg
[license]: https://opensource.org/licenses/MIT
[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg

Expand Down Expand Up @@ -58,14 +58,15 @@ This project contains the following programs
| `membership` | As consensus states are added to the client, they can be used for proof verification by relayers wishing to prove packet flow messages against a particular height on the counterparty. This uses the `verify_membership` and `verify_non_membership` methods on the tendermint client. ||
| `uc-and-membership` | This is a program that combines `update-client` and `membership` to update the client, and prove membership of packet flow messages against the new consensus state. ||
| `misbehaviour` | In case, the malicious subset of the validators exceeds the trust level of the client; then the client can be deceived into accepting invalid blocks and the connection is no longer secure. The tendermint client has some mitigations in place to prevent this. ||
| `upgrade-client` | The chain which this light client is tracking can elect to write a special pre-determined key in state to allow the light client to update its client state (e.g. with a new chain ID or revision). ||

## Requirements

- [Rust](https://rustup.rs/)
- [SP1](https://succinctlabs.github.io/sp1/getting-started/install.html)
- [Foundry](https://book.getfoundry.sh/getting-started/installation)
- [Bun](https://bun.sh/)
- [Just](https://just.systems/man/en/) (recommended)
- [Just](https://just.systems/man/en/)

Foundry typically uses git submodules to manage contract dependencies, but this template uses Node.js packages (via Bun) because submodules don't scale. You can install the contracts dependencies by running the following command:

Expand Down Expand Up @@ -155,7 +156,8 @@ just test-foundry
There are several end-to-end tests in the `e2e/interchaintestv8` directory. These tests are written in Go and use the [`interchaintest`](https://github.com/strangelove-ventures/interchaintest) library. It spins up a local Ethereum and a Tendermint network and runs the tests found in [`e2e/interchaintestv8/sp1_ics07_test.go`](e2e/interchaintestv8/sp1_ics07_test.go). Some of the tests use the prover network to generate the proofs, so you need to provide your SP1 network private key to `.env` for these tests to pass.
> If you are running on a mac with an M chip, you will need to do the following:
> [!NOTE]
> If you are running on a Mac with an M chip, you will need to do the following:
> - Set up Rosetta
> - Enable Rosetta for Docker (in Docker Desktop: Settings -> General -> enable "Use Rosetta for x86_64/amd64 emulation on Apple Silicon")
> - Pull the foundry image with the following command:
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit 3ebeb04

Please sign in to comment.