Skip to content

Commit

Permalink
feat(voyager)!: voyager v2
Browse files Browse the repository at this point in the history
wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

wip

normalize comments

wip

wip: cleanup

wip

wip

wip

wip: newtype chain id

wip: cleanup

wip

wip: cleanup

wip: cleanup

wip

wip

cleanup after rebase

wip

wip

wip: update movement protos & fmt

wip

wip

wip: typetagged magic

take that, move

wip: fmt

wip: more betterer codegen

wip

wip

wip

wip

feat: package modules and allow plugin conf

wip

fix: modules and plugins

wip: dev

wip: voyager-modules

wip: fix enabled option

wip: log format

wip: fix

wip

wip

wip: ws or http idc

wip

wip: yeet

wip: time to test in prod

wip: slight cleanup

wip: fix voyager.nix

wip: less exploding in cosmos-sdk chian module

wip: extract reconnecting client to library

wip: pain

wip: ? is dangerous

wip: oops

wip

wip: oops again

wip: moar logs

wip: check if packet already sent

wip: don't drop updates if queue is empty

wip: clean up clean up

everybody everywhere

wip

wip: no more splodey

wip: add wait until connectec to cometbft-rpc

wip: cleanup

wip: don't cancel on drop

ask me how long i spent figuring this out

wip: fix panic

wip

wip
  • Loading branch information
benluelo committed Sep 16, 2024
1 parent be596ba commit 61b5224
Show file tree
Hide file tree
Showing 363 changed files with 29,548 additions and 28,028 deletions.
9,511 changes: 5,490 additions & 4,021 deletions Cargo.lock

Large diffs are not rendered by default.

122 changes: 75 additions & 47 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ members = [

"hubble",

"lib/aptos-rpc",
"lib/beacon-api",
"lib/block-message",
"lib/chain-utils",
"lib/cometbft-rpc",

"lib/chain-utils",
"lib/gnark-key-parser",
"lib/gnark-mimc",
"lib/ibc-vm-rs",
Expand All @@ -32,7 +33,6 @@ members = [
"lib/poseidon-rs",
"lib/queue-msg",
"lib/queue-msg-macro",
"lib/relay-message",
"lib/scroll-api",
"lib/scroll-codec",
"lib/scroll-rpc",
Expand All @@ -41,13 +41,13 @@ members = [
"lib/ssz/tests-generator",
"lib/ssz-derive",
"lib/unionlabs",
"lib/voyager-message",
"lib/zktrie-rs",
"lib/voyager-message",

"lib/near/near-ibc",
"lib/near/near-light-client",
"lib/near/dummy-ibc-app",
"lib/near/near-ibc-tests",
# "lib/near/near-ibc-tests",

"lib/arbitrum-verifier",
"lib/cometbls-groth16-verifier",
Expand All @@ -68,14 +68,35 @@ members = [
"tools/devnet-utils",
"tools/parse-wasm-client-type",
"tools/tidy",
"tools/move-bindgen",
"lib/move-bindgen-derive",

"ucli",
"unionvisor",

"voyager",
"voyager/modules/chain/cosmos-sdk",
"voyager/modules/chain/ethereum",
"voyager/modules/chain/movement",

"voyager/modules/client/cometbls",
"voyager/modules/client/ethereum",

"voyager/modules/consensus/cometbls",
"voyager/modules/consensus/ethereum",

"voyager/modules/transaction/cosmos-sdk",
"voyager/modules/transaction/ethereum",
"voyager/modules/transaction/aptos",

"voyager/plugins/packet-filter",
"voyager/plugins/transaction-batch",

"drip",
"light-clients/movement/ics08-movement",
"lib/aptos-verifier",

"lib/reconnecting-jsonrpc-ws-client",
]

[workspace.package]
Expand All @@ -91,45 +112,45 @@ lto = "thin"
opt-level = 3

[workspace.dependencies]
aptos-verifier = { path = "lib/aptos-verifier", default-features = false }
arbitrum-verifier = { path = "lib/arbitrum-verifier", default-features = false }
beacon-api = { path = "lib/beacon-api", default-features = false }
block-message = { path = "lib/block-message", default-features = false }
chain-utils = { path = "lib/chain-utils", default-features = false }
cometbft-rpc = { path = "lib/cometbft-rpc", default-features = false }
cometbls-groth16-verifier = { path = "lib/cometbls-groth16-verifier", default-features = false }
contracts = { path = "generated/rust/contracts", default-features = false }
ethereum-light-client = { path = "light-clients/ethereum-light-client", default-features = false }
ethereum-verifier = { path = "lib/ethereum-verifier", default-features = false }
evm-in-cosmos-light-client = { path = "light-clients/evm-in-cosmos-light-client", default-features = false }
gnark-key-parser = { path = "lib/gnark-key-parser", default-features = false }
gnark-mimc = { path = "lib/gnark-mimc", default-features = false }
ibc-vm-rs = { path = "lib/ibc-vm-rs", default-features = false }
ics008-wasm-client = { path = "lib/ics-008-wasm-client", default-features = false }
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 }
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 }
queue-msg = { path = "lib/queue-msg", default-features = false }
queue-msg-macro = { path = "lib/queue-msg-macro", default-features = false }
relay-message = { path = "lib/relay-message", default-features = false }
scroll-api = { path = "lib/scroll-api", default-features = false }
scroll-codec = { path = "lib/scroll-codec", default-features = false }
scroll-rpc = { path = "lib/scroll-rpc", default-features = false }
scroll-verifier = { path = "lib/scroll-verifier", default-features = false }
serde-utils = { path = "lib/serde-utils", default-features = false }
ssz = { path = "lib/ssz", default-features = false }
ssz-derive = { path = "lib/ssz-derive", default-features = false }
tendermint-light-client = { path = "light-clients/tendermint-light-client", default-features = false }
tendermint-verifier = { path = "lib/tendermint-verifier", default-features = false }
token-factory-api = { path = "cosmwasm/token-factory-api", default-features = false }
ucs01-relay-api = { path = "cosmwasm/ucs01-relay-api", default-features = false }
unionlabs = { path = "lib/unionlabs", default-features = false }
voyager-message = { path = "lib/voyager-message", default-features = false }
zktrie = { path = "lib/zktrie-rs", default-features = false }
aptos-verifier = { path = "lib/aptos-verifier", default-features = false }
arbitrum-verifier = { path = "lib/arbitrum-verifier", default-features = false }
beacon-api = { path = "lib/beacon-api", default-features = false }
chain-utils = { path = "lib/chain-utils", default-features = false }
cometbft-rpc = { path = "lib/cometbft-rpc", default-features = false }
cometbls-groth16-verifier = { path = "lib/cometbls-groth16-verifier", default-features = false }
contracts = { path = "generated/rust/contracts", default-features = false }
ethereum-light-client = { path = "light-clients/ethereum-light-client", default-features = false }
ethereum-verifier = { path = "lib/ethereum-verifier", default-features = false }
gnark-key-parser = { path = "lib/gnark-key-parser", default-features = false }
gnark-mimc = { path = "lib/gnark-mimc", default-features = false }
ibc-vm-rs = { path = "lib/ibc-vm-rs", default-features = false }
ics008-wasm-client = { path = "lib/ics-008-wasm-client", default-features = false }
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 }
move-bindgen = { path = "tools/move-bindgen", default-features = false }
move-bindgen-derive = { path = "lib/move-bindgen-derive", 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 }
queue-msg = { path = "lib/queue-msg", default-features = false }
queue-msg-macro = { path = "lib/queue-msg-macro", default-features = false }
reconnecting-jsonrpc-ws-client = { path = "lib/reconnecting-jsonrpc-ws-client", default-features = false }
scroll-api = { path = "lib/scroll-api", default-features = false }
scroll-codec = { path = "lib/scroll-codec", default-features = false }
scroll-rpc = { path = "lib/scroll-rpc", default-features = false }
scroll-verifier = { path = "lib/scroll-verifier", default-features = false }
serde-utils = { path = "lib/serde-utils", default-features = false }
ssz = { path = "lib/ssz", default-features = false }
ssz-derive = { path = "lib/ssz-derive", default-features = false }
tendermint-light-client = { path = "light-clients/tendermint-light-client", default-features = false }
tendermint-verifier = { path = "lib/tendermint-verifier", default-features = false }
token-factory-api = { path = "cosmwasm/token-factory-api", default-features = false }
ucs01-relay-api = { path = "cosmwasm/ucs01-relay-api", default-features = false }
unionlabs = { path = "lib/unionlabs", default-features = false }
voyager-message = { path = "lib/voyager-message", default-features = false }
zktrie = { path = "lib/zktrie-rs", default-features = false }

# external dependencies
milagro_bls = { git = "https://github.com/Snowfork/milagro_bls", rev = "bc2b5b5e8d48b7e2e1bfaa56dc2d93e13cb32095", default-features = false }
Expand All @@ -143,9 +164,10 @@ ethers-contract-abigen = { git = "https://github.com/unionlabs/ethers-rs", branc
ethers-contract-derive = { git = "https://github.com/unionlabs/ethers-rs", branch = "ethers-core-wasm", default-features = false }
ethers-core = { git = "https://github.com/unionlabs/ethers-rs", branch = "ethers-core-wasm", default-features = false }

near-workspaces = { git = "https://github.com/unionlabs/near-workspaces-rs-union", branch = "near-ibc", default-features = false }

arbitrary = { version = "1.3.0", default-features = false }
# https://github.com/aptos-labs/aptos-core/pull/12636
aptos-crypto = { git = "https://github.com/unionlabs/aptos-core" }
aptos-rest-client = { git = "https://github.com/unionlabs/aptos-core" }
aptos-types = { git = "https://github.com/unionlabs/aptos-core" }
axum = { version = "0.6.20", default-features = false }
base64 = { version = "0.21", default-features = false }
bip32 = { version = "0.5.0", default-features = false }
Expand All @@ -171,7 +193,9 @@ futures = { version = "0.3.28", default-features = false }
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 }
jsonrpsee = { version = "0.24.2", default-features = false }
lazy_static = { version = "1.4.0", default-features = false }
move-core-types = { git = "https://github.com/unionlabs/aptos-core" }
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 Expand Up @@ -205,3 +229,7 @@ typenum = { version = "1.17.0", default-features = false }
[patch."crates-io"]
arbitrary = { git = "https://github.com/unionlabs/arbitrary" }
# parity-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }

# https://aptos.dev/en/build/sdks/rust-sdk
merlin = { git = "https://github.com/aptos-labs/merlin" }
x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1" }
12 changes: 11 additions & 1 deletion cosmwasm/ucs01-relay-api/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,20 @@ mod tests {
#[test]
fn serde_parses_memo() {
// let memo = "\"balls\": \"string\"";
let memo = "{\"forward\": {\"receiver\": \"[eth_addr]\",\"port\": \"[union-eth port]\",\"channel\": \"[union-eth channel]\",\"timeout\": \"1000000\",\"retries\": 0}}";
let memo = r#"{"forward": {"receiver": "[eth_addr]","port": "[union-eth port]","channel": "[union-eth channel]","timeout": "1000000","retries": 0}}"#;

let parsed = serde_json_wasm::from_str::<Memo>(memo).expect("works");

dbg!(parsed);
}

#[test]
fn serde_parses_memo_without_port_as_none() {
// let memo = "\"balls\": \"string\"";
let memo = r#"{"forward":{"channel":"channel-201","receiver":"2C96e52fCE14BAa13868CA8182f8A7903e4e76E0"}}"#;

let parsed = serde_json_wasm::from_str::<Memo>(memo).expect("works");

assert_eq!(parsed, Memo::None {})
}
}
2 changes: 1 addition & 1 deletion cosmwasm/ucs01-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sha2 = { workspace = true }
thiserror = { workspace = true }
token-factory-api = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, default-features = false, features = ["fmt", "ansi"] }
tracing-subscriber = { workspace = true }
ucs01-relay-api = { workspace = true }
unionlabs = { workspace = true }

Expand Down
6 changes: 3 additions & 3 deletions cosmwasm/ucs01-relay/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ use crate::{
state::{ChannelInfo, PfmRefundPacketKey, CHANNEL_INFO, IN_FLIGHT_PFM_PACKETS},
};

#[cfg(test)]
mod tests;

fn to_response<T>(
IbcReceiveResponse {
acknowledgement,
Expand Down Expand Up @@ -309,6 +312,3 @@ pub fn ibc_packet_timeout(
}),
}
}

#[cfg(test)]
mod tests;
1 change: 1 addition & 0 deletions cosmwasm/ucs01-relay/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
}

#[cfg(test)]
#[allow(deprecated)] // TODO: Remove usage of mock_info
mod tests {
use cosmwasm_std::{
testing::{message_info, mock_dependencies, mock_env},
Expand Down
10 changes: 5 additions & 5 deletions devnet-compose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
edition.workspace = true
license-file.workspace = true
name = "devnet-compose"
repository.workspace = true
version = "0.1.0"
edition = { workspace = true }
license-file = { workspace = true }
name = "devnet-compose"
repository = { workspace = true }
version = "0.1.0"

[dependencies]
cliclack = "0.2.5"
Expand Down
13 changes: 13 additions & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ anypb
anys
appchain
appchains
appetito
appmodule
appparams
aptos
Expand Down Expand Up @@ -306,6 +307,7 @@ bankkeeper
banktypes
bartio
baseapp
batchable
beacond
beacondata
beatae
Expand Down Expand Up @@ -353,6 +355,7 @@ brainer
builtins
bumpp
bunx
buon
byteorder
bytevec
cachix
Expand Down Expand Up @@ -794,6 +797,7 @@ misbehaviour
misbehiavor
mktemp
mmxyqu
moka
mollitia
monitonically
monniker
Expand Down Expand Up @@ -853,6 +857,7 @@ nums
numtide
observablehq
oceanlewis
octas
ofetch
offchain
omit
Expand Down Expand Up @@ -925,6 +930,7 @@ preimages
preprocessors
prerender
prerendered
prettyplease
prevote
prevotes
println
Expand Down Expand Up @@ -984,6 +990,7 @@ redelegating
redelegation
redelegations
reencode
reencoded
reentrancy
reexcute
reexecute
Expand Down Expand Up @@ -1069,6 +1076,7 @@ slurpfile
smallvec
snapshotter
snapshottypes
soketto
solomachine
sonner
spearbit
Expand Down Expand Up @@ -1228,6 +1236,7 @@ unbonded
unbonding
uncompr
uncons
unconstructable
undelegate
undelegations
unergonomic
Expand Down Expand Up @@ -1259,6 +1268,7 @@ unloadable
unmarshal
unmarshalling
unopinionated
unparse
unplugin
unprefixed
unsetting
Expand Down Expand Up @@ -1345,13 +1355,16 @@ xprv
xqxp
xsmfxu
yamlfmt
yoinked
ypyp
yqyp
yzmmzyfhxg
zellij
zerion
zeroize
zerolog
zetachain
zkevm
zkgm
zkps
zktrie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ We recommend running Voyager on a machine co-located with your chain's RPC nodes
},
"voyager": {
"num_workers": 4,
"laddr": "0.0.0.0:65534",
"laddr": "0.0.0.0:7717",
"queue": {
"type": "pg-queue",
"database_url": "postgres://user:password@127.0.0.1:5432/default",
Expand Down
Loading

0 comments on commit 61b5224

Please sign in to comment.