-
Notifications
You must be signed in to change notification settings - Fork 17
Add Protobuf/gRPC-based EtsIR loader #318
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
Open
Lipen
wants to merge
35
commits into
neo
Choose a base branch
from
lipen/grpc
base: neo
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.
Open
Conversation
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## neo #318 +/- ##
============================================
- Coverage 70.56% 69.55% -1.02%
- Complexity 2457 2459 +2
============================================
Files 275 285 +10
Lines 15288 16094 +806
Branches 2269 2378 +109
============================================
+ Hits 10788 11194 +406
- Misses 3581 3937 +356
- Partials 919 963 +44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a0061b
to
00a6a24
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduces a Protobuf-based EtsIR loader that communicates with the local ArkAnalyzer gRPC server, replacing the previous JSON-based approach.
Currently, this PR contains two different implementations of Protobuf models of EtsIR: auto-generated (via Gradle plugin that wraps
protoc
) and manual-written (withkotlinx-serialization-protobuf
).protoc
) from.proto
models.In addition, this PR contains the implementation of an HTTP client (using Ktor) for sending requests to a HTTP ArkAnalyzer server, internally using either JSON or ProtoBuf format. This shows the benefits of having the proto-model written with kotlinx-serialization, and not standalone auto-generated files. However, currently there is no simple way of easily switching between HTTP and gRPC protocols, so by using Ktor as a client, we are limited to HTTP-based solutions --- most importantly, from the ArkAnalyzer side as well, where we already began integrating gRPC server (after discussing that gRPC is indeed more suitable and future-proof for our means). Thus, we probably end up deleting all Ktor-related code from this PR, and the kx-serialization model as well, since it can't be (easily) used in auto-generated gRPC client/server stubs instead of the auto-generated messages.
Overall, we have two possible final solutions:
protoc
) Java classes for model, Kotlin type-safe wrappers, auto-generated gRPC client/server stubs. Works with Java 8.Note: the description above mentions both client and server, though in this particular PR we only have to introduce a client for the ArkAnalyzer gRPC server. However, the same arguments will be applicable when we are going to develop the USVM server for the type inference. This PR is just a playground for all these possibilities.