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

refactor: implement 'solidity-ibc-eureka' interfaces #83

Merged
merged 48 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b13b1c9
deps(contracts): added solidity-ibc-eureka
srdtrk Jul 27, 2024
44a14ea
imp: added remapping
srdtrk Jul 27, 2024
b06c5ea
imp: removed old interface
srdtrk Jul 27, 2024
4d90b4d
refactor: major refactor
srdtrk Jul 27, 2024
d0d0930
refactor: fixed SP1 Contract
srdtrk Jul 27, 2024
6b2c7d0
refactor: more
srdtrk Jul 27, 2024
1cfe183
refactor: more
srdtrk Jul 27, 2024
7094434
refactor: regenerated abi
srdtrk Jul 27, 2024
d4f19b1
fix: clippy
srdtrk Jul 27, 2024
2ee14c9
imp: regen
srdtrk Jul 27, 2024
7a7531b
imp: working
srdtrk Jul 27, 2024
e36fd26
docs: updated README.md
srdtrk Jul 27, 2024
22a1758
docs: updated
srdtrk Jul 27, 2024
f6fffc2
refactor: refactored updateClient
srdtrk Jul 27, 2024
0b484ac
tests: simplify and fix
srdtrk Jul 27, 2024
2813fb1
refactor: rust
srdtrk Jul 28, 2024
60a95e1
refactor: test passing
srdtrk Jul 28, 2024
d59f45c
imp: regerated mock stuff
srdtrk Jul 28, 2024
8ef75ce
imp: improved justfile
srdtrk Jul 28, 2024
30b1ad4
imp: justfile
srdtrk Jul 28, 2024
30ecd75
style: ran forge fmt
srdtrk Jul 28, 2024
85cbf67
deps: updated contracts
srdtrk Jul 28, 2024
ca54c24
imp: fixed stuff
srdtrk Jul 28, 2024
1d9dc06
refactor: improve
srdtrk Jul 28, 2024
6869d97
imp: tests
srdtrk Jul 29, 2024
05be9e8
rename
srdtrk Jul 29, 2024
d4b49ed
imp: removed mock fixtures
srdtrk Jul 29, 2024
705534d
imp: removing mock fixtures
srdtrk Jul 29, 2024
07a2325
imp: removed verify_membership fixtures
srdtrk Jul 29, 2024
6d274ad
test: should be good to go
srdtrk Jul 29, 2024
8474d6c
style: ran 'forge fmt'
srdtrk Jul 29, 2024
0690443
imp: regenerated abi
srdtrk Jul 29, 2024
6c5cb48
test: imp
srdtrk Jul 29, 2024
b2eaa3e
imp: improved public api
srdtrk Jul 29, 2024
9af98fe
imp: membership rust
srdtrk Jul 29, 2024
7aeb02d
test: membership test improved
srdtrk Jul 29, 2024
838494a
test: improved test
srdtrk Jul 29, 2024
01b7ec3
imp: abi generated again
srdtrk Jul 29, 2024
c1e6f4c
imp: attempt to fix rust
srdtrk Jul 29, 2024
534a806
refactor: light block in genesis
srdtrk Jul 29, 2024
a682c25
imp: regenerated fixtures
srdtrk Jul 29, 2024
8e56c54
test: Membership test fixed
srdtrk Jul 29, 2024
6658653
imp: attempt to fix
srdtrk Jul 29, 2024
b147e89
test: all tests passing
srdtrk Jul 29, 2024
c5ef51e
deps: bumped ibc-go to v8.4
srdtrk Jul 29, 2024
9feadef
lint
srdtrk Jul 29, 2024
a52816f
lint: solhint
srdtrk Jul 29, 2024
d24b16e
imp: implemented ILightClient
srdtrk Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading