-
Notifications
You must be signed in to change notification settings - Fork 13
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: Implement ReorgDetector V2 #34
Conversation
# Conflicts: # cmd/run.go # reorgdetector/mock_eth_client.go
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.
A part from the coments, missing the starting logic were blocks that were added by subscribers are checked before start adding blocks (those blocks may be old and conisdered final, but have wrong hashes). This is reasonable to happen when restarting the node
# Conflicts: # aggoracle/e2e_test.go # cmd/run.go # reorgdetector/reorgdetector.go # reorgdetector/reorgdetector_test.go
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestBlockMap(t *testing.T) { |
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.
func TestBlockMap(t *testing.T) { | |
func TestHeadersList(t *testing.T) { |
trackedBlocks[string(k)] = newBlockMap(blocks...) | ||
} | ||
// Update the tracked blocks in the DB | ||
if err := rd.updateTrackedBlocksDB(ctx, id, hdrs); err != nil { |
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.
I don't understand why this is needed? Is it possible that is a left over from refactoring?
Update: understood, that the update is meant to delete in case the hdrs
map removed some entities. It's a bit counter intuitive that this doesn't happen while doing the deletes, but being able to do it on the deletion would complicate the DB handling. LGTM, maybe in the future we move to SQLite and can improve this
|
No description provided.