-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(eventindexer): handle reorg #13841
Conversation
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.
Overall, this pull request looks good. The code changes are well written and the commit messages are descriptive.
The changes to the event indexer looks like it is handling a reorg in an efficient manner. The addition of the 'blockID' column to the events table also looks appropriate.
I have a few minor suggestions:
- In the save_block_proposed_event.go file, there is a comment that says "reorg detected". It might be worth adding a more descriptive comment here explaining what is happening and why.
- In the save_block_verified_event.go file, the address field is set to an empty string when saving the event. It might be worth adding a comment here to explain why this is necessary.
- The function names in the detect_and_handle_reorg.go file could be made more descriptive. For example, "detectReorgAndHandleEvent" might be more appropriate than "detectAndHandleReorg".
- In the 1666650599_create_events_table.sql file, it might be worth adding a comment explaining why the blockID column was added.
Codecov Report
@@ Coverage Diff @@
## main #13841 +/- ##
==========================================
- Coverage 47.45% 47.26% -0.19%
==========================================
Files 133 134 +1
Lines 3416 3459 +43
Branches 310 310
==========================================
+ Hits 1621 1635 +14
- Misses 1685 1710 +25
- Partials 110 114 +4
*This pull request uses carry forward flags. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
will merge in the morning since it will require me to deploy eventindexer migrations and stuff on A# |
handle reorg for relayer + eventindexer since david and i discovered
event.Raw.Removed
is unreliable, and fixed intaiko-client