Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2192 ics08 near light client #2254

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0e6627b
chore(unionlabs): move near lc types to correct location
aeryz Jun 20, 2024
ce36066
chore(near): generate proto
aeryz Jun 20, 2024
2811c48
chore(unionlabs): impl near light client protos
aeryz Jun 20, 2024
847c042
chore(unionlabs): add `model` to near proto types
aeryz Jun 24, 2024
76da3bf
feat(near-verifier): introduce the module
aeryz Jun 24, 2024
756db2e
feat(near-verifier): verify_state impl
aeryz Jun 24, 2024
fb3883c
chore(ics08-near): integrate `near-verifier`
aeryz Jun 24, 2024
a7211ef
chore(ics08-near): fix warnings
aeryz Jun 24, 2024
e3adb64
chore(near-lc): near lc on near compiles
aeryz Jun 29, 2024
577612a
fix(near): integration tests
aeryz Jul 2, 2024
7a3d897
chore(cometbls-ics08): split cometbls lc's by tech
aeryz Jul 2, 2024
58620c2
feat(cometbls-near): introduce cometbls near lc
aeryz Jul 2, 2024
5137d0a
chore(cometbls-near): use proto for states
aeryz Jul 3, 2024
59df1dd
chore(near): setup devnet
aeryz Jul 3, 2024
e6f95c0
wip: add near to voyager
benluelo Jul 3, 2024
1abc81f
chore(unionlabs): add `chain_id` to near `ClientState`
aeryz Jul 3, 2024
3317838
feat(chain-utils): near implementation compiles
aeryz Jul 4, 2024
83dce38
feat(voyager): near support
aeryz Jul 4, 2024
45c20fa
chore(near): devnet working
aeryz Jul 9, 2024
d03d51f
chore(near-verifier): convert asserts to errors
aeryz Jul 22, 2024
98ee630
chore(near): change balance proto from u64 to bytes
aeryz Jul 22, 2024
37b1351
chore(near-devnet): deploy ibc contract
aeryz Jul 22, 2024
a926d37
chore(ics08-near): add integration tests
aeryz Jul 22, 2024
4b4c8ee
chore(unionlabs): remove near feature gating
aeryz Jul 23, 2024
22b01c1
chore(near-verifier): remove `near-sdk` dep and use `near-account-id`
aeryz Jul 23, 2024
11cca6a
chore: implement poc-relayer
aeryz Jul 23, 2024
f3e51c4
chore(devnet-near): deploy contracts to named accounts
aeryz Jul 23, 2024
acbf537
chore: naming
aeryz Jul 23, 2024
9c74406
a lot of pain and failed verifications
aeryz Jul 23, 2024
80ab0dc
chore(near-verifier): add details to errors
aeryz Jul 24, 2024
40e374f
fix(ics08-near): membership verification
aeryz Jul 24, 2024
33d959d
chore(cometbls-near): disable non-native zk verification
aeryz Jul 24, 2024
ca8bce9
chore: update cometbls-near works
aeryz Jul 24, 2024
26526ab
chore: god near connopen works!!
aeryz Jul 24, 2024
4345af4
feat(cometbls-near): groth16 verifier with host functions
aeryz Jul 25, 2024
dbbcc0e
fix(near-ibc): make light clients capable of handling multiple clients
aeryz Jul 25, 2024
bc4a8d9
chore: fmt
aeryz Jul 26, 2024
fbd13ca
chore(ibc-vm): return error in VerifyClientMessage
aeryz Jul 27, 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
476 changes: 461 additions & 15 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ members = [

"light-clients/arbitrum-light-client",
"light-clients/berachain-light-client",
"light-clients/cometbls-light-client",
"light-clients/cometbls/ics08",
"light-clients/ethereum-light-client",
"light-clients/scroll-light-client",
"light-clients/tendermint-light-client",
Expand All @@ -70,11 +70,16 @@ members = [
"unionvisor",
"voyager",
"near/near-ibc",
"near/near-light-client",
"light-clients/near/near",
"near/dummy-ibc-app",
"near/near-ibc-tests",

"drip",
"near/near-ibc-tests",
"light-clients/near/ics08-near",
"lib/near-verifier",
"light-clients/cometbls/near",
"poc-relayer",
"near/test-circuit",
]

[workspace.package]
Expand Down Expand Up @@ -110,6 +115,7 @@ ics23 = { path = "lib/ics23", default-features = false }
linea-verifier = { path = "lib/linea-verifier", default-features = false }
linea-zktrie = { path = "lib/linea-zktrie", default-features = false }
macros = { path = "lib/macros", default-features = false }
near-verifier = { path = "lib/near-verifier", default-features = false }
pg-queue = { path = "lib/pg-queue", default-features = false }
poseidon-rs = { path = "lib/poseidon-rs", default-features = false }
protos = { path = "generated/rust/protos", default-features = false }
Expand Down Expand Up @@ -172,6 +178,7 @@ go-parse-duration = { version = "0.1.1", default-features = false }
hex = { version = "0.4.3", default-features = false }
hex-literal = { version = "0.4.1", default-features = false }
lazy_static = { version = "1.4.0", default-features = false }
near-account-id = { version = "1.0.0", default-features = false }
near-contract-standards = { version = "5.1.0", default-features = false }
near-sdk = { version = "5.1.0", default-features = false }
near-sdk-contract-tools = { version = "3.0.2", default-features = false }
Expand Down
21 changes: 18 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
./site/openapi.nix
./near/near.nix
./light-clients/ethereum-light-client/ethereum-light-client.nix
./light-clients/cometbls-light-client/cometbls-light-client.nix
./light-clients/cometbls/cometbls-light-client.nix
./light-clients/tendermint-light-client/tendermint-light-client.nix
./light-clients/scroll-light-client/scroll-light-client.nix
./light-clients/arbitrum-light-client/arbitrum-light-client.nix
Expand Down Expand Up @@ -333,11 +333,13 @@

goPkgs = import inputs.nixpkgs-go { inherit system; };
unstablePkgs = import inputs.nixpkgs-unstable { inherit system; };
packageOverrides = pkgs.callPackage ./python-packages.nix { };
python = pkgs.python3.override { inherit packageOverrides; };
in
{
_module = {
args = {
inherit nixpkgs dbg get-flake uniondBundleVersions goPkgs unstablePkgs mkCi;
inherit nixpkgs dbg get-flake uniondBundleVersions goPkgs unstablePkgs mkCi python;

gitRev =
if (builtins.hasAttr "rev" self) then self.rev else "dirty";
Expand Down Expand Up @@ -525,13 +527,26 @@
postgresql
emmet-language-server
nodePackages.graphqurl
nodePackages_latest.near-cli
nodePackages_latest.nodejs
nodePackages_latest.svelte-language-server
nodePackages_latest."@astrojs/language-server"
nodePackages_latest."@tailwindcss/language-server"
nodePackages_latest.typescript-language-server
nodePackages_latest.vscode-langservers-extracted
])
]) ++
(with pkgs; [
go
gopls
go-tools
gotools
])
++ [
(python.withPackages (py-pkgs: [
py-pkgs.nearup
]))
]

++ (with goPkgs; [
go
gopls
Expand Down
2 changes: 2 additions & 0 deletions generated/rust/protos/Cargo.toml

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

8 changes: 8 additions & 0 deletions generated/rust/protos/src/lib.rs

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

190 changes: 190 additions & 0 deletions generated/rust/protos/src/union.ibc.lightclients.near.v1.rs

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

1 change: 1 addition & 0 deletions lib/block-message/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub mod arbitrum;
pub mod berachain;
pub mod cosmos;
pub mod ethereum;
pub mod near;
pub mod scroll;
pub mod union;

Expand Down
32 changes: 32 additions & 0 deletions lib/block-message/src/chain/near.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use chain_utils::near::Near;
use queue_msg::Op;
use unionlabs::never::Never;

use crate::{
fetch::{AnyFetch, DoFetchBlockRange, Fetch, FetchBlockRange},
AnyChainIdentified, BlockMessage, ChainExt, Identified,
};

impl ChainExt for Near {
type Data = Never;

type Fetch = Never;

type Aggregate = Never;
}

impl DoFetchBlockRange<Near> for Near
where
AnyChainIdentified<AnyFetch>: From<Identified<Near, Fetch<Near>>>,
{
fn fetch_block_range(c: &Near, range: FetchBlockRange<Near>) -> Op<BlockMessage> {
// fetch(id(
// c.chain_id(),
// Fetch::<Near>::specific(FetchEvents {
// from_height: range.from_height,
// to_height: range.to_height,
// }),
// ))
todo!()
}
}
8 changes: 7 additions & 1 deletion lib/block-message/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use queue_msg::{
aggregate, conc, fetch, queue_msg, wait, HandleFetch, Op, QueueError, QueueMessage,
};
use tracing::instrument;
use unionlabs::ibc::core::client::height::IsHeight;
use unionlabs::{ibc::core::client::height::IsHeight, never::Never};

use crate::{
aggregate::{Aggregate, AggregateFetchBlockRange, AnyAggregate},
Expand Down Expand Up @@ -94,6 +94,12 @@ pub trait DoFetch<C: ChainExt>: Sized + Debug + Clone + PartialEq {
fn do_fetch(c: &C, _: Self) -> impl Future<Output = Op<BlockMessage>>;
}

impl<C: ChainExt> DoFetch<C> for Never {
fn do_fetch(_: &C, this: Self) -> impl Future<Output = Op<BlockMessage>> {
async move { match this {} }
}
}

pub trait DoFetchBlockRange<C: ChainExt>: ChainExt {
fn fetch_block_range(c: &C, range: FetchBlockRange<C>) -> Op<BlockMessage>;
}
Expand Down
Loading
Loading