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

Pre-processing improvements #92

Merged
merged 9 commits into from
Feb 16, 2024

Conversation

ssd04
Copy link
Contributor

@ssd04 ssd04 commented Feb 6, 2024

  • cleanup old code
  • move events logic from facade to eventsHandler
  • return early if duplicated event

@ssd04 ssd04 self-assigned this Feb 6, 2024
@ssd04 ssd04 marked this pull request as ready for review February 7, 2024 10:02
"block hash", events.Hash,
pushEvents := data.BlockEvents{
Hash: eventsData.Hash,
ShardID: eventsData.Header.GetShardID(),
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expectedNumRedisEvents := 3 // one redis events per push, revert, finalized
expectedNumRedisEvents := 3 // one redis event per push, revert, finalized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@iulianpascalau iulianpascalau self-requested a review February 16, 2024 13:24
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ssd04 ssd04 merged commit 09ed246 into feat/publisher-refactor Feb 16, 2024
2 checks passed
@ssd04 ssd04 deleted the processing-checks-improvements branch February 16, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants