Skip to content
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: reorg detector add warnings and store in DB the reorg detection #242

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

joanestebanr
Copy link
Contributor

@joanestebanr joanestebanr commented Feb 25, 2025

Description

  • Add warning if a reorg is detected
  • Add a row in table reorg_event with reorg details

Fixes #121

@joanestebanr joanestebanr changed the base branch from main to develop February 25, 2025 11:03
@joanestebanr joanestebanr changed the title Feat/reorg detector logs 121 feat: reorg detector add warnings and store in DB the reorg detection Feb 25, 2025
@joanestebanr joanestebanr self-assigned this Feb 25, 2025
@joanestebanr joanestebanr marked this pull request as ready for review February 25, 2025 12:09
DROP TABLE IF EXISTS reorg_event;

-- +migrate Up
CREATE TABLE reorg_event (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need some primary key for the table?

SubscriberID: id,
CurrentHash: currentHeader.Hash(),
TrackedHash: hdr.Hash,
ExtraData: struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the usage of ExtraData field? I don't see its value if it is only used on this place. I would say, just make these two regular fields in the ReorgEvent.

ExtraData interface{}
}

type eventReorgRow struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point of meddler is to not have struct conversion before saving it to the db, because he is the one that does that in the background. So, I would say we don't need this struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants