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

feat: core gRPC services #842

Merged
merged 58 commits into from
Sep 15, 2023
Merged

feat: core gRPC services #842

merged 58 commits into from
Sep 15, 2023

Conversation

rnbguy
Copy link
Collaborator

@rnbguy rnbguy commented Aug 24, 2023

Closes: #686

Description

This PR implements IBC core gRPC services for ibc-rs using context trait definitions.

This implementation aimed to leverage ValidationContext only. But some extensions were needed. So QueryContext is created extending the original ValidationContext.

Projects using ibc-rs can implement ValidationContext and QueryContext and have IBC core gRPC services for free.

A feature flag grpc is introduced to (en/dis)able this feature accordingly.


PR author checklist:

  • Create PR to add a QueryContext impl for MockContext
  • Update doc strings
  • Remove grpc from default feature set
  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 0.14% and project coverage change: -3.20% ⚠️

Comparison is base (d8d4973) 71.48% compared to head (9ebe9e5) 68.28%.
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #842      +/-   ##
==========================================
- Coverage   71.48%   68.28%   -3.20%     
==========================================
  Files         124      129       +5     
  Lines       14979    15856     +877     
==========================================
+ Hits        10707    10827     +120     
- Misses       4272     5029     +757     
Files Changed Coverage Δ
crates/ibc/src/core/context.rs 50.00% <ø> (ø)
crates/ibc/src/core/ics04_channel/error.rs 26.08% <ø> (ø)
crates/ibc/src/services/core/channel.rs 0.00% <0.00%> (ø)
crates/ibc/src/services/core/client.rs 0.00% <0.00%> (ø)
crates/ibc/src/services/core/connection.rs 0.00% <0.00%> (ø)
crates/ibc/src/services/error.rs 0.00% <0.00%> (ø)
...ibc/src/core/ics02_client/handler/create_client.rs 84.50% <100.00%> (-0.63%) ⬇️

... and 113 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Farhad-Shabani
Copy link
Member

Also, can you add a unclog as well?

@Farhad-Shabani
Copy link
Member

I'd like to circle in @keppel as well. It would be awesome to have your input and see if this aligns with what you've been looking for earlier.

crates/ibc/src/services/core/client.rs Outdated Show resolved Hide resolved
crates/ibc/src/services/core/client.rs Outdated Show resolved Hide resolved
crates/ibc/src/services/core/context.rs Outdated Show resolved Hide resolved
rnbguy and others added 5 commits September 12, 2023 10:53
Co-authored-by: Philippe Laferrière <plafer@protonmail.com>
Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com>
will be fixed in separate PR
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Member

@Farhad-Shabani Farhad-Shabani left a comment

Choose a reason for hiding this comment

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

Thanks @rnbguy for taking care of this PR 🙏🏻

@Farhad-Shabani Farhad-Shabani merged commit c17ff9d into main Sep 15, 2023
13 checks passed
@Farhad-Shabani Farhad-Shabani deleted the rano/grpc-services branch September 15, 2023 12:50
Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
* add grpc service dependencies

* client service implementation

* connection service implementation

* channel service implementation

* finish grpc service implementations

* QueryContext under grpc feature

* fix no-default-features lints

* use domain types

* return query block height

* happy lint

* immut router in validate

* client and connection param service

* implement upgrade service

* fix upgrade context

* rename struct fields and generics

* remove UpgradeValidationContext trait bound

* cargo fmt and clippy

* add ProvableContext

* add proofs to client service

* add proofs to connection service

* add proofs to channel service

* remove redundant trait method

* refactor ProvableContext trait bounds

* refactor service structs

* add service doc

* add context docs

* from impl for tonic status

* remove redundant map_errs

* fix cargo doc lint

* remove irrelevant comments

* handle empty sequence list

* a general variant of PackerError

* polish comments and logging

* remove grpc from default features

* mv grpc feature gated code under service

* mv files

* update mod files

* update prelude

* happy cargo doc

* happy cargo fmt

* support latest_height flag

* rm redundant trait method

* comment on grpc feature

* todo comment for pagination

* update client_status query

* rm redundant trait method

* add changelog entry

* nitpick

* rm allowed_clients

* update client params query

* update error message

Co-authored-by: Philippe Laferrière <plafer@protonmail.com>
Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com>

* revert immut ref on validate

will be fixed in separate PR

* rm tracing use

* document thread-safe params

* point changelog entry to issue

* rm FromStr from prelude

* doc strings with correct explanations

* rm reexports

---------

Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com>
Co-authored-by: Philippe Laferrière <plafer@protonmail.com>
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.

Investigate exposing an API which implements IBC gRPC queries
3 participants