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

Chain Runtime implementation #364

Merged
merged 66 commits into from
Nov 23, 2020
Merged

Chain Runtime implementation #364

merged 66 commits into from
Nov 23, 2020

Conversation

romac
Copy link
Member

@romac romac commented Nov 5, 2020

Closes: #330
Depends on: #401

Description

Critical Files

  • relayer/src/chain.rs
  • relayer/src/chain/cosmos.rs
  • relayer/src/chain/handle.rs
  • relayer/src/chain/handle/prod.rs
  • relayer/src/chain/runtime.rs

For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@romac romac marked this pull request as draft November 5, 2020 16:36
Base automatically changed from adi/346_V0_implementation to master November 12, 2020 10:14
@romac romac marked this pull request as ready for review November 19, 2020 14:22
Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still reviewing..

Comment on lines +103 to +104
let _id = config.id.clone();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _id = config.id.clone();

relayer/src/chain/runtime.rs Show resolved Hide resolved
relayer/src/chain/runtime.rs Show resolved Hide resolved
relayer/src/chain/cosmos.rs Show resolved Hide resolved
@romac
Copy link
Member Author

romac commented Nov 20, 2020

This is currently blocked because tonic (the gRPC implementation we use) is currently still using hyper 0.13 which in turn depends on Tokio 0.2. This means that we cannot issue gRPC queries from within a Tokio 0.3 runtime.

I will take a stab at getting tonic to use the dev 0.14 version of hyper next week.

@romac romac added the A: blocked Admin: blocked by another (internal/external) issue or PR label Nov 20, 2020
@romac romac removed the A: blocked Admin: blocked by another (internal/external) issue or PR label Nov 23, 2020
@romac
Copy link
Member Author

romac commented Nov 23, 2020

Unblocked this by depending on:

This is all a bit of mess at the moment, and it's not clear when any of those libs will get a new release. We are perhaps going to have to push/help on that front directly.

@ancazamfir
Copy link
Collaborator

ancazamfir commented Nov 23, 2020

I opened #410 to collect followup from this PR.
Tested client create, update, connection and channel handshakes.
I think we are good to merge.

Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks Romain!!!

@romac romac merged commit 5f71413 into master Nov 23, 2020
@romac romac deleted the romac/chain-runtime branch November 23, 2020 17:20
@romac romac mentioned this pull request Nov 24, 2020
5 tasks
@adizere adizere mentioned this pull request Nov 26, 2020
5 tasks
adizere added a commit that referenced this pull request Nov 27, 2020
adizere added a commit that referenced this pull request Dec 3, 2020
* Attemptin integration at the level of Chain trait

* Removed rpc client from trait Chain

* Removed ChainConfig from trait Chain

* Minor fixes as follow-up from #364

* Impl generic runtime instantiation.

* Migrated CLIs to use generic runtime spawn.

* Added mock light client. First test (incomplete impl).

* Almost ready to send_tx (mock has to be mutable).

* Added chain executor.

* Mutable chain in send_tx, simplified spawn.After review w/ Anca & Romain

* impl CosmosSDKChain cleanup

* Adapted mock context, ICS18 & 26 to correct abstractions.

* Cleaned up Msg trait, added const TYPE_URL.

* Basic light client impl to complete create client test.

* Removed clippy allow exception

* Updated changelog

* Revert "Updated changelog"

This reverts commit 43bd008.
In anticipation of merging master into this dev branch..

* Redid the changelog

* After Anca's comments
adizere added a commit that referenced this pull request Dec 11, 2020
adizere added a commit that referenced this pull request Dec 11, 2020
…es (#448)

* Starting refactor for Connection & Channel relayer objects

* Make chain handle object-safe via dyn_clone.

* Went back to clone() method [h/t Romain for suggesting clone_trait_object!]

* Refactoring Connection and ForeignClient

* Added tests for client update

* Added height check in ForeignClient update tests

* Removed useless test/code

* Added changelog entry

* Consolidating names (cf. review of #364).

* Added more semantic deps
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Started v0 impl: re-arranging handlers + initialization.

* Clean up chain handle, prepare for generic client creation.

* Trying different boundaries of abstraction b/t ForeignClient and ChainHandle.

* Version one: introduced assemble_ methods to construct chain-specific data types

* Removed signer from foreign client config

* FMT quick fix

* Client ID parsing

* Use  ibc::ics24_host::identifier::ChainId instead of its tendermint counterpart

* More error handling and split into modules

* Move prod handle in its own module

* Cleanup

* Overhaul subscriptions handling

* Add struct to represent a batch of events

* Move SplitResults trait into its own module

* WIP: More handle inputs

* Better errors

* Implement `query` in chain runtime

* Assemble client state and consensus state in runtime

* Launch light clients

* Light Block

* Remove unused file

* Rename two handle inputs

* Rename Chain::ics_query to Chain::query

* Store the domain MerkleProof in QueryResponse instead of the raw MerkleProof

* Implement all chain methods in runtime + handle

* Chain methods should return their Self types

* Use light client to build consensus state

* Use light client to retrieve and build header

* Comment out currently unused code

* Formatting

* Make keybase field of CosmosSDKChain private

* Fix tests

* Properly spawn runtime

* Revert 2afa90f

* Allow a ChainId to not include version number, default to 0

* Upgrade Tokio to version 0.3

* WIP: event monitor

* Syncify EventMonitor

* Cleanup

* Use shared Tokio runtime to `block_on` instead of spawning new one

* Cleanup

* Nest event_handler and event_monitor modules under event module

* WIP: event bus

* Cleanup

* Fix build issue

* Add tests for event bus

* Cleanup

* Update listen command

* Point to tendermint-rs branch with Tokio 0.3

* Remove unused downcast_* methods

* Re-enable some lints

* Cleanup

* Use tendermint-rs master

* Depend on tendermint-rs prost-dev branch

* Formatting

* Deserialize client queries in Any types, temp fix for validator set

Co-authored-by: Adi Seredinschi <[email protected]>
Co-authored-by: Anca Zamfir <[email protected]>
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Attemptin integration at the level of Chain trait

* Removed rpc client from trait Chain

* Removed ChainConfig from trait Chain

* Minor fixes as follow-up from informalsystems#364

* Impl generic runtime instantiation.

* Migrated CLIs to use generic runtime spawn.

* Added mock light client. First test (incomplete impl).

* Almost ready to send_tx (mock has to be mutable).

* Added chain executor.

* Mutable chain in send_tx, simplified spawn.After review w/ Anca & Romain

* impl CosmosSDKChain cleanup

* Adapted mock context, ICS18 & 26 to correct abstractions.

* Cleaned up Msg trait, added const TYPE_URL.

* Basic light client impl to complete create client test.

* Removed clippy allow exception

* Updated changelog

* Revert "Updated changelog"

This reverts commit 43bd008.
In anticipation of merging master into this dev branch..

* Redid the changelog

* After Anca's comments
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
…es (informalsystems#448)

* Starting refactor for Connection & Channel relayer objects

* Make chain handle object-safe via dyn_clone.

* Went back to clone() method [h/t Romain for suggesting clone_trait_object!]

* Refactoring Connection and ForeignClient

* Added tests for client update

* Added height check in ForeignClient update tests

* Removed useless test/code

* Added changelog entry

* Consolidating names (cf. review of informalsystems#364).

* Added more semantic deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chain Runtime
4 participants