-
Notifications
You must be signed in to change notification settings - Fork 140
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
Inherit req ctx when saving state #2241
Conversation
Now instead of conensus sending async message to blockchain and then polling the chan for it to finish, we use DI to directly call the blockchain service through an interface. This commit starts this work by removing the genesis events so its now handled synchronously from consensus layer.
This commit injects the BlockBuilder (the validator package) into the cometbft.Service and calls it directly, removing the need for NewSlot, BuiltBeaconBlock and BuiltSidecars events. It was tricky to get DI working but eventually I found out that injecting services through an interface with generic params or return types is most likely not supported by the DI library. I don't think this is documented anywhere, but you get a runtime panic from DI once it can't assemble a dependecy based on the interface definition. The solution here was to rely on only concrete types, but this meant some additional struct generics needed to be added to the cometbft.Service.
Now we have separate go files for each abci call we want to handle and this cleans up the code nicely and makes it easier to read and traverse the code.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2241 +/- ##
==========================================
- Coverage 30.70% 30.68% -0.02%
==========================================
Files 331 331
Lines 15387 15394 +7
Branches 20 20
==========================================
Hits 4724 4724
- Misses 10346 10353 +7
Partials 317 317
|
f24b4f9
to
93b38d2
Compare
This PR updates the cometbft.Service so now the
context.Context
that gets passed into the main abci handlers will be used instead of context.Background