-
Notifications
You must be signed in to change notification settings - Fork 58
WIP Relayer for Solana #439
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
Draft
dhruvja
wants to merge
260
commits into
master
Choose a base branch
from
hyperspace-solana
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
260 commits
Select commit
Hold shift + click to select a range
f6b5f9f
added query channel, connection and proofs
dhruvja a7bbc60
added few more query methods
dhruvja eee35f5
replace sealable trie packages with public repo
dhruvja 0bfdae0
added channel whitelist
dhruvja 63e221a
added query for unreceived acks and packets
dhruvja 1e845f8
updated trie_key and added ids
dhruvja 2306e66
fix connectionId issue
dhruvja 7187ec2
added chain and packet accounts
dhruvja 1616fbb
updated storage and methods and added duplicate ibc dep
dhruvja 87f1058
added methods and conversions
dhruvja b67b6f9
refactor
dhruvja e73abd2
converting client and consensus state and added method to get latest …
dhruvja 2a5d6a1
added type conversions for messages
dhruvja a63137b
fixed issues and added few methods
dhruvja 1665409
added recv and send packets
dhruvja eddbcee
querying finality notifications
dhruvja afe4c6e
setup tests for solana cosmos
dhruvja 43c45fe
added mocks along with initialize client state method
dhruvja 4fd9e84
added query connection channels
dhruvja 003f021
test config and async sol program
dhruvja 9d0642f
added spawn blocking for sol rpc client
dhruvja d39dc16
testing wip
dhruvja 9bb6b7e
fix sync and fmt
dhruvja fb4c49f
wip
dhruvja 00acd2e
wip
dhruvja 02ed256
wip
dhruvja 88128f8
add mock solana light client
dhruvja 5578e26
fixed issues for token transfer
dhruvja 2d57d61
added send transfer
dhruvja 4901d83
changed rpc for devnet and added retry logic
dhruvja b5f8792
added docs for running solana cosmos tests locally
dhruvja d7aa062
adding branch info in instructions
dhruvja 53f0e44
fix issues with url and added instruction to compile wasm
dhruvja a182a2a
use git deps and retry tx logic
dhruvja d7ff1cc
Fix overflow (#464)
vmarkushin 976bfc9
Cosmos fixes and improvements; metric handling fix (#474)
vmarkushin e258cc9
Update Cargo.lock
vmarkushin 1c4a6bb
Update Cargo.lock
vmarkushin 47d6ee0
subxt update (#462)
kkast d775eb6
subxt update (#466)
kkast 19a0e26
added chunking and upgraded dependencies
dhruvja 4c8c6e0
added method for signature verification and deliver with accounts
dhruvja ec24275
wip
mina86 64cbe06
call deliver with account when message is received
dhruvja df7f81a
remove redundant files in hyperspace/solana
dhruvja a3bd718
clean up and remove unused vars
dhruvja e5a45d1
moved general methods to utils file
dhruvja 1c66e3e
fmt
dhruvja c442f0e
check receiver chain and source and perform transfer
dhruvja 802d49f
fix send transfer logic
dhruvja 5aff3ba
wip
mina86 14a8d75
wip
mina86 a829c5e
wip
mina86 6d3e9bd
use types crate from lts ibc
dhruvja 54e39cc
wip
mina86 8e746e7
fmt
mina86 246855f
review
mina86 be8ec1b
update dep
mina86 bbae5fd
rm unneccesary code
dhruvja 596ef1f
pull from upstream
dhruvja 0667cf9
Update light-clients/cf-guest-cw/Cargo.toml
mina86 06902a9
wip
mina86 2cfd17e
wip
mina86 c574456
Merge branch 'a' of https://github.com/mina86/composable-ibc into hyp…
dhruvja c07338e
added guest-chain light client
dhruvja 2a60fd8
implemented custom errors
dhruvja dd8252b
implement verification in clientdef trait
dhruvja 82767b1
add guest client to light client
dhruvja 0445be9
fix prootbuf derive
mina86 e01b6b3
fix to threadsafe
mina86 3d8b59b
deps
mina86 d821943
implement old ibc for cf-guest-cw
dhruvja 5fcb865
impl anyclientstate proto
dhruvja 1ecff56
Revert "Contract updates addressing the ibc-go wasm light client refa…
dhruvja 2556c50
wip
dhruvja fcb6180
change contract interface
mina86 e328ea8
deps
mina86 6aa1b17
wip
mina86 fed2e67
wasm state
mina86 b952e90
wip
dhruvja 165c1cb
update cosmwasm contract
dhruvja e5856e8
added unit test for testing client message payload
dhruvja e1e4946
fixed consensus state decoding
dhruvja 9eee178
update cosmwasm
dhruvja 5a2309d
implement guest blockchain cw light client
blasrodri 7b2b8f0
A (#484)
mina86 30789ef
validate-delay (#485)
mina86 bfa68d6
wasm from tm
dhruvja 708080e
fix
dhruvja 00f9c54
Fix inconsistencies and update dependencies
dhruvja 17f9b07
small changes
dhruvja 18b5bd7
fix updates in solana
dhruvja 8802199
small changes
dhruvja 78280a7
add signature chunking
dhruvja 88fd7b4
minor changes
dhruvja b1948bf
update deps
dhruvja c3347c8
fix ibc testkit
dhruvja ef4ad96
creating new connection in tests
dhruvja 3af7873
filter events
dhruvja 3d50c24
use arc mutex in solana client config
dhruvja 76317e2
add config for solana and replace pubkey with string
dhruvja 3fb9874
use latest version of solana ibc
dhruvja 253582d
update ibc rev
dhruvja c31eecc
Update guestchain dependencies (#492)
mina86 54340d3
ics02: fix error message when decoding consensus state
mina86 16e0430
ics02: fix formatting
mina86 215a808
hyperspace-core: fix testing feature
mina86 286dca8
pallet-ibc: use type URLs from upstream rather than redefining
mina86 f1af1a8
cf-guest: fix Protobuf implementation
mina86 fb1e2cd
icsxx-solana-cw: remove unused crate (#493)
mina86 7575ef3
Update emulated-light-client dependency
mina86 86d782b
add localnet config
dhruvja 6c71370
Merge branch 'hyperspace-solana' of https://github.com/ComposableFi/c…
dhruvja 585ea8a
fix relayer bugs and improve fetching events
dhruvja 60e224e
fix timeouts
dhruvja 8975fe0
updated structures and fixed bugs
dhruvja c6a4bc7
send user account during ack
dhruvja 75b394f
increase trusting period
dhruvja a50fea9
convert signer to string
dhruvja 9d89207
use height as never if rev no. is 0
dhruvja 09f7077
use commitment for query packet acknowledgements
dhruvja b432c7a
fetch unreceived acks from commitments
dhruvja 2cbbd2b
use token account from packet
dhruvja c729e0f
receiver should be token account owner
dhruvja 376341e
check token account on chain
dhruvja c7c40ec
get rid of panics
dhruvja a9ca328
fix seeds
dhruvja 7932fe3
some changes form vm
8685e43
fix merge conflicts
250c6e9
fix issues while receiving
dhruvja e2859ba
fix all merge conflicts
dhruvja b1db631
update timeouts
dhruvja c98dd22
avoid unwrap
dhruvja 15810de
panic when disconnects
dhruvja a4adfbe
make cosmos bullish again
dhruvja d590ed4
fetch all the packets for recv and send
dhruvja 202f3e5
logs
dhruvja 9cdf6ea
remove block header getter in query proof
dhruvja cba6912
use block header og
dhruvja 081968a
testing proof height
dhruvja 9c6ae71
use lts height on source
dhruvja 91dc30b
loop when submitting the update
dhruvja b8c15ed
fix infinite loop
dhruvja b839bc6
import duration
dhruvja f46cca9
add semicolon
dhruvja 4195510
get timeout height
dhruvja 0c466bf
upgrade solana-ibc
dhruvja 3753acb
logs
dhruvja 4ed1fec
rm unneccesary logging
dhruvja 487bbf5
add timeout height as never if revision number is 0
dhruvja c56718a
optimize
dhruvja cd95a48
parallelize signature tx
dhruvja dab6ea1
add signer
dhruvja 67b09a6
rm sig parallel
dhruvja 8b3a2d0
remove proof heights from channel end and connection end
dhruvja c9554d5
dont process all send or ack packets
dhruvja 0b32aa6
current block header for client state
dhruvja c601d50
make updates in ascending
dhruvja 0216dab
initialize client state using latest blockhash
dhruvja dd60b26
epoch with all validators and index based on that
dhruvja befc973
send mandatory update when epoch changes
dhruvja 4d3b177
send updates every interval
dhruvja db81e7d
get proof height for timeout
dhruvja c3c8f8b
fmt
dhruvja 94ec676
fix checking if channels are created
dhruvja 40f164e
add flag for handshake completed
dhruvja b8caee0
add solana mainnet config
dhruvja b319383
parallelize transactions
dhruvja 165aa4d
chuking for all tx
dhruvja 498af52
remove calling client update method
dhruvja 0355cec
fix time since last update
dhruvja 7b69379
add jito and batch all tx
dhruvja db49043
update dep of jito
dhruvja a1ffbb1
revert local path change
dhruvja fff3f5d
fix skipping for open init channel
dhruvja e729a4a
remove handshake complete
dhruvja 9074ecc
add handshake flag
dhruvja 528efd1
clear unneccesary things
dhruvja d4a814a
fix handshake completed
dhruvja 6b865dd
retry when fetching logs
dhruvja 3822a97
remove mainnet configs
dhruvja 33b965a
cf-guest: update upstream dependency (#495)
mina86 d0ac775
merge from solana-fees-token-mint branch
dhruvja e73fd42
fix epoch and merge from solana-fees-token-mint branch
dhruvja 202e2ad
revert toolchain version
dhruvja 085745b
reversing updates to be sent on cosmos
dhruvja 2002455
send multiple client update only to cosmos from solana
dhruvja 3288595
error handling while fetching events
dhruvja ee1df86
run single cosmos tx
dhruvja 706dda2
use epoch commitment instead of epoch id
dhruvja c45d02e
send update during epoch change
dhruvja 2ac70fb
skip only optional updates
dhruvja c011570
change tx type to jito and trusting period to 640000
dhruvja 59a01fb
fix issue with earliest block header in solana
dhruvja 5baf6ac
uncomment all signatures in solana
dhruvja 8341210
fix mandatory updates
dhruvja 553c584
sleep during updates
dhruvja 24d397f
fix sleep
dhruvja da07e7c
default update height to 0
dhruvja 5ba9765
logs for proofs
dhruvja 016077f
fix
dhruvja 5c96c5b
show proof at different height
dhruvja e5c1c23
increase CU for sigverify
dhruvja 4446085
get trie data from db
dhruvja 1938d15
fix query proofs
dhruvja 6698cdb
use jito
dhruvja 7868c12
log trie root
dhruvja fba4967
fix bug
dhruvja b97cd97
return latest trie if trie doesnt exist in indexer
dhruvja 4318b0b
process packets in chunks
dhruvja cb578d2
add trie db path in config
dhruvja 5983613
fix trie fetch
dhruvja 252b0e4
fetch block header only when proof matches
dhruvja e9879c9
simulate tx
dhruvja 9f67610
remove simulation
dhruvja 036bcf7
log encoded transactions
dhruvja 68655f8
logging signed tx
dhruvja 7d5833c
log encoded tx of all tx
dhruvja e5a5650
increase heap
dhruvja ec7c323
chunk only once
dhruvja ad2b0c0
fix ack
dhruvja 75d956a
increase chunk size to 4
dhruvja cf78efb
dont add trace prefix
dhruvja ba88365
add trace prefix only for recv
dhruvja 55a34e7
uncomment get trie
dhruvja 1b49449
dont fetch sequences if they are higher
dhruvja 4461fee
skip if maximum sequence is found
dhruvja a9acae1
use dep from git instead of locally
dhruvja 2dbd4f8
fetch validators from epoch
dhruvja dea9a6a
prevent repetitive client updates
dhruvja ce3eae3
not fetch ready packets
dhruvja 91be5b9
fix
dhruvja aa31749
fix
dhruvja 65607e5
test
dhruvja bbd2b16
revert test changes
dhruvja 2c10acb
improve logging
dhruvja e96d261
add migrate entrypoint to cw contract
dhruvja 71c3ee3
search ibc events using storage instead of program id
dhruvja ea1592c
reduce jito fees
dhruvja 20891ca
Contract updates addressing the ibc-go wasm light client refactoring …
misko9 ddb0c70
reducing fees and skipping tx which are errored
dhruvja ba5b179
use finalized for getting finality notifications
dhruvja 3ae10e9
remove priority fees
dhruvja 8956e4d
change solana block time to 0
dhruvja 17b2a0f
Copy `cf-guest` -> `icsxx-cf-solana`
vmarkushin bd05fde
update tm and port cf-guest to sdk50
dhruvja 299045c
port to sdk50
dhruvja 8c86ba9
use local deps
dhruvja 8634300
wip
dhruvja 20e99e5
fix sdk 50
dhruvja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| [package] | ||
| name = "hyperspace-solana" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
|
||
| [dependencies] | ||
| primitives = { path = "../primitives", package = "hyperspace-primitives" } | ||
|
|
||
| # crates.io | ||
| anyhow = "1.0.65" | ||
| futures = "0.3.21" | ||
| async-trait = "0.1.53" | ||
| log = "0.4.17" | ||
| hex = "0.4.3" | ||
| tokio = { version = "1.32.0", features = ["macros", "sync"] } | ||
| rs_merkle = "1.2.0" | ||
| codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] } | ||
| serde_json = "1.0.74" | ||
| derive_more = { version = "0.99", features = ["from"] } | ||
| serde = {version="1.0.137", features = ["derive"]} | ||
| tokio-stream = { version = "0.1.14", features = ["sync"]} | ||
| thiserror = "1.0.31" | ||
| itertools = "0.10.3" | ||
| prost = { version = "0.11" } | ||
| k256 = { version = "0.11.6", features = ["ecdsa-core", "ecdsa", "sha256"] } | ||
| tonic = { version = "0.8", features = ["tls", "tls-roots"] } | ||
| bech32 = "0.9.1" | ||
| bip32 = "0.4.0" | ||
| ed25519-zebra = { version = "3.1.0" } | ||
| tiny-bip39 = "1.0.0" | ||
| sha2 = "0.10.6" | ||
| ripemd = "0.1.3" | ||
| digest = "0.10.6" | ||
| quick_cache = "0.3.0" | ||
| rand = "0.8.5" | ||
| anchor-client = "0.28.0" | ||
|
|
||
| # composable | ||
| ibc = { path = "../../ibc/modules", features = [] } | ||
| ibc-proto = { path = "../../ibc/proto" } | ||
| ibc-primitives = { path = "../../contracts/pallet-ibc/primitives" } | ||
| ics07-tendermint = { path = "../../light-clients/ics07-tendermint" } | ||
| ics08-wasm = { path = "../../light-clients/ics08-wasm" } | ||
| ibc-rpc = { path = "../../contracts/pallet-ibc/rpc" } | ||
| pallet-ibc = { path = "../../contracts/pallet-ibc" } | ||
|
|
||
| tracing = "0.1.36" | ||
|
|
||
| # tendermint | ||
| tendermint = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false, features = [ | ||
| "secp256k1", | ||
| ] } | ||
| tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false } | ||
| tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false, features = [ | ||
| "http-client", | ||
| "websocket-client", | ||
| ] } | ||
| tendermint-light-client = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false, features = [ | ||
| "rpc-client", | ||
| "secp256k1", | ||
| "unstable", | ||
| # "testing" | ||
| ] } | ||
| tendermint-light-client-verifier = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false } | ||
|
|
||
| [features] | ||
| testing = [ | ||
| "primitives/testing" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| use anchor_client::anchor_lang::prelude::*; | ||
|
|
||
| pub struct LocalDeliver { | ||
| pub sender: AccountMeta, | ||
| pub storage: AccountMeta, | ||
| pub trie: AccountMeta, | ||
| pub system_program: AccountMeta, | ||
| } | ||
|
|
||
| impl LocalDeliver { | ||
| pub fn new(sender_key: Pubkey, storage_key: Pubkey, trie_key: Pubkey, system_program_key: Pubkey) -> Self { | ||
| let sender = AccountMeta::new(sender_key, true); | ||
| let storage = AccountMeta::new(storage_key, false); | ||
| let trie = AccountMeta::new(trie_key, false); | ||
| let system_program = AccountMeta::new_readonly(system_program_key, false); | ||
| Self { | ||
| sender, | ||
| storage, | ||
| trie, | ||
| system_program | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl ToAccountMetas for LocalDeliver { | ||
| fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta> { | ||
| let mut accounts = Vec::new(); | ||
| accounts.push(self.sender.clone()); | ||
| accounts.push(self.storage.clone()); | ||
| accounts.push(self.trie.clone()); | ||
| accounts.push(self.system_program.clone()); | ||
| accounts | ||
| } | ||
| } | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| use ibc::timestamp::ParseTimestampError; | ||
| use prost::DecodeError; | ||
|
|
||
| /// Error definitions for the cosmos client in accordance with the parachain's Error type. | ||
| #[derive(thiserror::Error, Debug)] | ||
| pub enum Error { | ||
| /// An error from the rpc interface | ||
| #[error("Rpc client error: {0}")] | ||
| RpcError(String), | ||
| /// Custom error | ||
| #[error("{0}")] | ||
| Custom(String), | ||
| /// Decode error | ||
| #[error("Decode error: {0}")] | ||
| DecodeError(#[from] DecodeError), | ||
| /// Encode error | ||
| #[error("Encode error: {0}")] | ||
| EncodeError(#[from] prost::EncodeError), | ||
| /// Parse timestamp error | ||
| #[error("Parse timestamp error: {0}")] | ||
| ParseTimestampError(#[from] ParseTimestampError), | ||
| /// Transfer error | ||
| #[error("IBC transfer error: {0}")] | ||
| TransferError(#[from] ibc::applications::transfer::error::Error), | ||
| /// Tendermint error | ||
| #[error("Tendermint error: {0}")] | ||
| TendermintError(#[from] tendermint::Error), | ||
| } | ||
|
|
||
| impl From<String> for Error { | ||
| fn from(error: String) -> Self { | ||
| Self::Custom(error) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| use anchor_client::anchor_lang::prelude::*; | ||
| use anchor_client::anchor_lang; | ||
|
|
||
| #[derive(Debug, Clone, PartialEq)] | ||
| pub struct Deliver { | ||
| pub messages: Vec<AnyCheck>, | ||
| } | ||
| impl borsh::ser::BorshSerialize for Deliver | ||
dhruvja marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| where | ||
| Vec<AnyCheck>: borsh::ser::BorshSerialize, | ||
| { | ||
| fn serialize<W: borsh::maybestd::io::Write>( | ||
| &self, | ||
| writer: &mut W, | ||
| ) -> ::core::result::Result<(), borsh::maybestd::io::Error> { | ||
| borsh::BorshSerialize::serialize(&self.messages, writer)?; | ||
| Ok(()) | ||
| } | ||
| } | ||
| impl borsh::de::BorshDeserialize for Deliver | ||
| where | ||
| Vec<AnyCheck>: borsh::BorshDeserialize, | ||
| { | ||
| fn deserialize( | ||
| reader: &mut &[u8], | ||
| ) -> ::core::result::Result<Self, borsh::maybestd::io::Error> { | ||
| Ok(Self { | ||
| messages: borsh::BorshDeserialize::deserialize(reader)?, | ||
| }) | ||
| } | ||
| } | ||
| impl anchor_lang::Discriminator for Deliver { | ||
| const DISCRIMINATOR: [u8; 8] = [250, 131, 222, 57, 211, 229, 209, 147]; | ||
dhruvja marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| impl anchor_lang::InstructionData for Deliver {} | ||
|
|
||
| #[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, PartialEq)] | ||
| pub struct AnyCheck { | ||
| pub type_url: String, | ||
| pub value: Vec<u8>, | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.