-
Notifications
You must be signed in to change notification settings - Fork 179
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
Refactor provider broadcast #4744
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4744 +/- ##
==========================================
- Coverage 55.62% 55.57% -0.05%
==========================================
Files 931 932 +1
Lines 86292 86370 +78
==========================================
+ Hits 47996 47997 +1
- Misses 34665 34742 +77
Partials 3631 3631
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
broadcasted = true | ||
} | ||
} | ||
broadcasted, err := e.providerEngine.BroadcastExecutionReceipt( |
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.
this looks like the only use of the returned boolean, and that is only for logging. Does it still make sense to return this boolean? If we still want this in the log, can we not move the logging inside of BroadcastExecutionReceipt
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.
Yes, it's only used for logging for now. And yes, we could move the logging to the provider engine, but it's not hurt to still return the boolean. I'd like to keep as is so that we don't have to introduce additional logging just to know whether it's broadcasted. It's simple to just merge the broadcaster along with other property of the receipts, so that it's easy to search for the receipt.
@@ -471,29 +464,11 @@ func (e *Engine) executeBlock( | |||
return | |||
} | |||
|
|||
// if the receipt is for a sealed block, then no need to broadcast it. | |||
lastSealed, err := e.state.Sealed().Head() |
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.
This is the only place where protocol state is being used, which is to check if a result can be skipped for broadcasting if it's already sealed.
After moving this check to provider engine, the ingestion engine no long depend on protocol state, therefore the protocol state can be removed from the engine
@@ -785,6 +744,7 @@ func TestBlocksArentExecutedMultipleTimes_multipleBlockEnqueue(t *testing.T) { | |||
} | |||
|
|||
func TestBlocksArentExecutedMultipleTimes_collectionArrival(t *testing.T) { | |||
unittest.SkipUnless(t, unittest.TEST_FLAKY, "To be fixed later") |
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.
this test will be refactored in the follow up PR
broadcasted = true | ||
} | ||
} | ||
broadcasted, err := e.providerEngine.BroadcastExecutionReceipt( |
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.
Yes, it's only used for logging for now. And yes, we could move the logging to the provider engine, but it's not hurt to still return the boolean. I'd like to keep as is so that we don't have to introduce additional logging just to know whether it's broadcasted. It's simple to just merge the broadcaster along with other property of the receipts, so that it's easy to search for the receipt.
This PR move the condition of "whether EN should broadcast execution result" from ingestion engine to provider engine, which reduce the ingestion engine complexity.