-
Notifications
You must be signed in to change notification settings - Fork 710
Handle roll backs in MELValidator and BlockValidator #4360
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: raul/mel-block-validator-enabled
Are you sure you want to change the base?
Handle roll backs in MELValidator and BlockValidator #4360
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## raul/mel-block-validator-enabled #4360 +/- ##
====================================================================
- Coverage 28.96% 28.95% -0.02%
====================================================================
Files 497 497
Lines 58774 58835 +61
====================================================================
+ Hits 17022 17033 +11
- Misses 38647 38701 +54
+ Partials 3105 3101 -4 |
❌ 55 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
arbnode/mel/runner/mel.go
Outdated
| } | ||
|
|
||
| type MELValidator interface { | ||
| Rewind(parentChainBlockNumber uint64) |
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.
Is this the parent chain block number we want to rewind to?
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.
yep
arbnode/mel/runner/mel.go
Outdated
| return err | ||
| } | ||
| if m.melValidator != nil { | ||
| m.melValidator.Rewind(parentChainBlockNumber) |
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.
This introduces a circular dependency. It would be more idiomatic if the mel validator can subscribe to a channel and we send over that channel to anyone that cares about rewinding. That way, the runner does not need to know anything about validation
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.
makes sense, I added this change
This PR adds required code to handle the rollbacks in MEL and Block validators during a reorg (L1 or L2 or both). Whenever a reorg is detected MELValidator (if) is rollbacked first and then the BlockValidator (if).
Resolves NIT-4480