-
Notifications
You must be signed in to change notification settings - Fork 171
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
Support plugins #2051
Open
rianhughes
wants to merge
17
commits into
main
Choose a base branch
from
rianhughes/plugin2
base: main
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
Support plugins #2051
Conversation
This file contains 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
rianhughes
force-pushed
the
rianhughes/plugin2
branch
2 times, most recently
from
August 14, 2024 08:49
01f84c5
to
c08159a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2051 +/- ##
==========================================
- Coverage 78.45% 78.26% -0.19%
==========================================
Files 100 103 +3
Lines 9240 9294 +54
==========================================
+ Hits 7249 7274 +25
- Misses 1353 1377 +24
- Partials 638 643 +5 ☔ View full report in Codecov by Sentry. |
kirugan
reviewed
Aug 28, 2024
rianhughes
force-pushed
the
rianhughes/plugin2
branch
from
September 25, 2024 07:34
840fab1
to
48a55b2
Compare
derrix060
reviewed
Sep 25, 2024
I'd suggest to add some documentations so that users are aware of this feature |
rianhughes
force-pushed
the
rianhughes/plugin2
branch
from
September 26, 2024 08:23
4876c71
to
b09ab5f
Compare
weiihann
approved these changes
Sep 26, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Sep 27, 2024
kirugan
reviewed
Oct 2, 2024
kirugan
reviewed
Oct 2, 2024
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 implements plugin support. Any plugin that follows the JunoPlugin interface can plug into Juno.
Whenever Juno syncs a new block, the
block
,state-update
andclasses
are sent to the plugin. Specifically, NewBlock() is calledNewBlock(block *core.Block, stateUpdate *core.StateUpdate, newClasses map[felt.Felt]core.Class) error
Whenver Juno reverts a block, it will send the
block
andstate-update
of the current height "N", the reverted height "N-1", as well as the "reverse state diff" that brings you from N to N-1. Specifically, RevertBlock() is calledRevertBlock(from, to *BlockAndStateUpdate, reverseStateDiff *core.StateDiff) error
Note: the code coverage is below the threshold. The main chunk of code that hasn't been tested is the Load() function. A simple plugin that only prints when a function has been called can be quite large (~37Mb+), so it doesn't seem feasible to include a dummy plugin/
.so
file for the purpose of increasing the code coverage. However, the Load function was tested manually and it seems to work just fine (see here for example plugin)