-
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
base: neo
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## neo #318 +/- ##
============================================
- Coverage 70.56% 68.52% -2.04%
- Complexity 2457 2460 +3
============================================
Files 275 288 +13
Lines 15288 16339 +1051
Branches 2269 2382 +113
============================================
+ Hits 10788 11197 +409
- Misses 3581 4180 +599
- Partials 919 962 +43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a0061b
to
00a6a24
Compare
.github/workflows/build-and-test.yml
Outdated
@@ -64,7 +62,8 @@ jobs: | |||
DEST_DIR="arkanalyzer" | |||
MAX_RETRIES=10 | |||
RETRY_DELAY=3 # Delay between retries in seconds | |||
BRANCH="neo/2025-04-14" | |||
#BRANCH="neo/2025-04-14" | |||
BRANCH="lipen/grpc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace before merge
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.