-
Notifications
You must be signed in to change notification settings - Fork 73
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
Introduce BackEnd gRPC server #565
Conversation
Add base unary grpc support Add EthBackEnd server [WIP]
Handle double explicit/implicit shutdown calls Drain completion queue in scheduler after shutdown Add unit tests
Rename flag
Codecov Report
@@ Coverage Diff @@
## master #565 +/- ##
==========================================
+ Coverage 81.16% 81.53% +0.37%
==========================================
Files 154 165 +11
Lines 13221 13624 +403
==========================================
+ Hits 10731 11109 +378
- Misses 2490 2515 +25
Continue to review full report at Codecov.
|
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.
Running node_test
on this branch under AddressSanitizer fails on my MacBook:
address_sanitizer.log
On the master branch 7dc531d node_test
works fine for me under ASAN.
That doesn't necessarily mean that this change introduces any memory issues, but I'd hate to lose the ability to run tests under sanitizers. Also perhaps we should prioritize and implement Issue #295. IMHO it's very important, but I have been postponing implementing it, mea culpa.
It seems the same problem reported in google/sanitizers#1317 and grpc/grpc#21838. I'm going to reproduce and try the suggested solutions (hope at least one works).
I agree we need to find a solution to avoid losing such ability. |
I've just tried to reproduce the issue on my Linux machine running Clang using libc++ with both ASAN and UB enabled, but stumbled upon this llvm/llvm-project#16778. Removing UB I've got a different error: |
I've added ASAN/TSAN suppression definitions in our CMake to avoid grpc/grpc#19224 without need to rebuild gRPC libraries as suggested in grpc/grpc#22325 |
Add barebone gRPC server test
…ilkworm into backend_grpc_server
node/silkworm/rpc/backend_server.cpp
Outdated
|
||
namespace silkworm::rpc { | ||
|
||
inline types::H128* new_H128_from_bytes(const uint8_t* bytes) { |
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.
const uint8_t*
is fine here because this function is only used internally. However, were we to make it public, I'd use gsl::span<const uint8_t, 16>
.
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.
Ok, fair enough. There are also other Silkworm public APIs where such change should be considered, e.g. silkworm::endian
This PR adds:
Key points:
scheduler
thread (implemented usingasio::io_context
) is dedicated to process all the asynchronous notifications and handle RPC operations, another one (completion runner
) waits indefinitely for the next completion tag from CQ and disptches the tag processor to the schedulerDetails:
This is a high-level class diagram (partial):