-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ehtereum<->Centauri integration test; hyperspace-ethereum CLI (#51)
* scripts: add docker-compose to execute ethereum devnet * add cosmos chain * Diamond pattern (EIP-2535) Use [ERC-2535: Diamonds, Multi-Facet Proxy](https://eips.ethereum.org/EIPS/eip-2535) to make IBC contracts more flexible in terms of upgradability and deployment Instead of one contract (OwnableIBCHandler) that inherits all other contract handlers (IBCClientHandler, IBCConnectionHandler, ...), we now deploy each of the handlers separately and register their functions in the Diamond contract. It allows to deploy as many contracts as possible not depending on the code size anymore * Improve ICS Ethereum light client integration Refactored the light-clients/icsxx-ethereum and hyperspace/ethereum modules to improve ICS Ethereum light client integration. The integration tests are updated to accommodate these changes. Also, a new module 'verify' was added to the project to streamline verifying processes. The hyperspace module's dependencies and Cargo.toml file also saw updates. These changes were necessary to refine the function and increase efficiency in the codebase, making it easier to manage and navigate through. Finally, an empty file named jwt.rs got added to manage Json Web Tokens but awaits population. * Add Ethereum-Cosmos tests and correctly decode light client state New test file `ethereum_cosmos.rs` was added under `hyperspace/testsuite/tests` to test integration of Ethereum and Cosmos. Fixed light client state decoding in Ethereum `ibc_provider.rs`. Update client event creation was included along with a create client event handler. Further, additional log filtering for key Ethereum events useful for the IBC (Inter-Blockchain Communication) was added. Additionally, couple of methods were moved out of the `#[cfg(test)]` normalization blocks, making them available outside of testing. Some TODO comments were also addressed, that mainly handled function implementations and debugging of values. The integration tests include behaviors such as setting up clients, connection and channel setup, tests with different packet timeouts and connection delays. * Remove deprecated IBCClientHandler and repurpose ICS23 light client ICS23 light client was repurposed to handle chain state retrieval and updating. The IBCClientHandler contract, which used ICS23 light client, is removed due to redundancy. IBCClientHandler was initially used for delegate calls to contracts implementing `IIBCClient`. However, with architectural improvements and updates, this operation is no longer necessary, hence removing the contract for better lean code management. Subsequently, the ICS23 client is equipped with prefixing and key formatting methods to retrieve consensus data effectively. This enhances the performance of the IBC client and simplifies operations involving Ethermint and Substrate light clients. In addition to the file changes above: - Introduced the function parse_ethereum_events to handle parsing of Ethereum events. - Functions on ibc_provider.rs have been refactored to accommodate the above changes. - Improved error handling and log message content. - Updated address indexing in events for better searchability. - Tests have been improved to suit the updated codebase. * disable verification * return client error in eth relayer instead of palic or unwrap. (#48) * "Add dynamic handling of client consensus state and improve logging" This commit adds dynamic handling of client consensus state in ibc_provider.rs and improves logging across different modules. Previously, for certain IBC events the provider was not returning if the Ethereum IBC event was not found, leading to undesired behaviors. Now, after each IBC event processing, an appropriate response is always returned, improving the robustness. Additionally, incorrect log entries have been amended, while superfluous log entries have been streamlined, enhancing debugging capabilities. Finally, erroneous static client consensus handling has been replaced by dynamic queries, increasing flexibility and correctness. * Use client error instead of unwrap and expect in ibc provider (#49) * use client error in ibc provider * more replacement of unwrap to ClientError * replace in query_client_update_time_and_height * remove few unwrap and use ClientError * update 1 more fn query_client_id_from_tx_hash to replace unwrap * more changes to return ClientError instead of unwrap or expect * remove all panic, unwrap and expect and return ClientError ibc provider * Improve Ethereum provider functionality and update dependencies This update includes several changes to improve the functionality of the Ethereum provider, as well as an update of dependencies. Specific changes include the removal of unnecessary log info calls and the addition of debug level logging to capture events. Additionally, the calculation of the 'from' and 'to' values for block processing has been streamlined. Dependencies for the Ethereum provider, such as 'anyhow', have also been updated to the latest versions. The update also includes a fix to ensure that the mock Ethereum client has the correct commitment sequences. This was necessary to ensure the Ethereum provider operates optimally, with relevant debug info being captured. The dependency updates ensure compatibility and security, and the mock client fix ensures accurate testing results. * update sync-committee deps * add script for generating ABI and update ABI * Add commands for ethereum client * add a default config * remove `prev_state` from client * update configs; clarify jwtsecret not found error * Client error across hyperspace eth (#50) * update chain.rs to provide more info into client error * update client_state_from_abi_token, replaced all unwrap * update consensus_state_from_abi_token * update tm_header_from_abi_token --------- Signed-off-by: Vladislav <[email protected]> Co-authored-by: Vladislav <[email protected]> * disable parachain chains * disable storage layout * generate ics20-bank ABI * add a check for empty client state * little refactor * Remove unused BLS verification related code --------- Signed-off-by: Vladislav <[email protected]> Co-authored-by: Blas Rodriguez Irizar <[email protected]> Co-authored-by: rust.dev <[email protected]>
- Loading branch information
1 parent
b0dd6a9
commit 8e3d8f0
Showing
76 changed files
with
6,873 additions
and
3,837 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ authors = ["Seun Lanlege <[email protected]>", "David Salami <wizdave97@gmai | |
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[build-dependencies] | ||
anyhow = "1.0.66" | ||
anyhow = "1.0.75" | ||
once_cell = "1.16.0" | ||
subxt-codegen = { package = "codegen", path = "../../../utils/subxt/codegen" } | ||
tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread"] } | ||
|
This file contains 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,19 @@ | ||
type = "cosmos" | ||
name = "centauri" | ||
rpc_url = "http://127.0.0.1:26657/" | ||
grpc_url = "http://127.0.0.1:9090/" | ||
websocket_url = "ws://127.0.0.1:26657/websocket" | ||
chain_id = "centauri-testnet-1" | ||
client_id = "07-tendermint-0" | ||
connection_id = "connection-18" | ||
account_prefix = "centauri" | ||
fee_denom = "stake" | ||
fee_amount = "4000" | ||
gas_limit = 9223372036854775806 | ||
store_prefix = "ibc" | ||
max_tx_size = 200000 | ||
wasm_code_id = "4c7504846b7c35e1b7dfc62f9347fcb98fec95aecede9822a745ce14d6973ced" | ||
channel_whitelist = [["channel-8", "transfer"]] | ||
mnemonic = "sense state fringe stool behind explain area quit ugly affair develop thumb clinic weasel choice atom gesture spare sea renew penalty second upon peace" | ||
skip_optional_client_updates = true | ||
max_packets_to_process = 200 |
This file contains 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,17 @@ | ||
type = "ethereum" | ||
http_rpc_url = "http://localhost:8545/" | ||
ws_rpc_url = "ws://127.0.0.1:8546/" | ||
beacon_rpc_url = "http://localhost:3500/" | ||
private_key_path = "hyperspace/ethereum/keys/0x73db010c3275eb7a92e5c38770316248f4c644ee" | ||
max_block_weight = 1 | ||
name = "ethereum_client" | ||
client_id = "08-wasm-22" | ||
connection_id = "connection-0" | ||
channel_whitelist = [["channel-0", "transfer"]] | ||
commitment_prefix = "6962632f" | ||
diamond_address = "0x4a976e25cde9d022007f7f02889901b382038237" | ||
tendermint_address = "0xa6915519ec2cbc4e7eea7912673c885fc1f156ca" | ||
bank_address = "0x87b47d11cdc84e3c3cb70b34dde1235c0862b68e" | ||
diamond_facets = [["IBCClient", "0x10b57a97dad42b87185f39fc653939c89abda030"], ["IBCConnection", "0x163f4a54af24d13151f231fb74ef5cbc642d05a7"], ["IBCChannelHandshake", "0x5078d1a1240bcbca0f67ba25f07c66b85ab86d37"], ["IBCPacket", "0xc0a2f84324ddf94f4d5af8b507ffefb9016fcdaa"], ["IBCQuerier", "0x98f6789f22e1066dcd128ca99a859acf4821f834"], ["DiamondCutFacet", "0xc1e3b960d3db95ea5a4f2b7c91ba28b2222d5484"], ["DiamondLoupeFacet", "0x4dccf8ac3a04b9d7f294047ebc6481ed9d8fbab6"], ["OwnershipFacet", "0x0fce292ea5fbf749d8ef31412dbc8ac5841ba66d"]] | ||
client_type = "07-tendermint" | ||
jwt_secret_path = "/Users/vmark/work/eth-pos-devnet/execution/jwtsecret" |
This file contains 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 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 |
---|---|---|
|
@@ -6,7 +6,7 @@ authors = ["Seun Lanlege <[email protected]>", "David Salami <wizdave97@gmai | |
|
||
[dependencies] | ||
tokio = { version = "1.19.2", features = ["macros", "sync", "time", "rt-multi-thread"] } | ||
clap = { version = "3.2.22", features = ["derive"] } | ||
clap = { version = "4.4.2", features = ["derive"] } | ||
anyhow = "1.0.66" | ||
hyperspace-core = { path = "./core" } | ||
toml = "0.7.3" | ||
|
This file contains 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 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 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 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 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 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 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 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 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
Oops, something went wrong.