-
Notifications
You must be signed in to change notification settings - Fork 10
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
Pre-processing improvements #92
Pre-processing improvements #92
Conversation
ssd04
commented
Feb 6, 2024
•
edited
Loading
edited
- cleanup old code
- move events logic from facade to eventsHandler
- return early if duplicated event
This reverts commit 0be9123.
"block hash", events.Hash, | ||
pushEvents := data.BlockEvents{ | ||
Hash: eventsData.Hash, | ||
ShardID: eventsData.Header.GetShardID(), |
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 there any chance here to have the header nil, resulting in a panic?
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.
no, there is a header check in events interceptor
@@ -252,29 +280,16 @@ func (eh *eventsHandler) HandleBlockScrs(blockScrs data.BlockScrs) { | |||
} | |||
|
|||
// HandleBlockEventsWithOrder will handle full block events received from observer | |||
func (eh *eventsHandler) HandleBlockEventsWithOrder(blockTxs data.BlockEventsWithOrder) { | |||
func (eh *eventsHandler) handleBlockEventsWithOrder(blockTxs data.BlockEventsWithOrder) { |
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.
update comment with lower case
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.
updated comment
@@ -715,6 +715,6 @@ func testNotifierWithWebsockets_AllEvents(t *testing.T, observerType string) { | |||
|
|||
integrationTests.WaitTimeout(t, wg, time.Second*4) | |||
|
|||
assert.Equal(t, numEvents, len(notifier.RedisClient.GetEntries())) | |||
assert.Equal(t, numEvents, len(notifier.RedisClient.GetEntries())) | |||
expectedNumRedisEvents := 3 // one redis events per push, revert, finalized |
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.
expectedNumRedisEvents := 3 // one redis events per push, revert, finalized | |
expectedNumRedisEvents := 3 // one redis event per push, revert, finalized |
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.
👍
@@ -10,8 +10,7 @@ import ( | |||
|
|||
// EventsFacadeHandler defines the behavior of a facade handler needed for events group | |||
type EventsFacadeHandler interface { | |||
HandlePushEventsV2(events data.ArgsSaveBlockData) error | |||
HandlePushEventsV1(events data.SaveBlockData) error | |||
HandlePushEvents(events data.ArgsSaveBlockData) error |
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.
👍