-
Notifications
You must be signed in to change notification settings - Fork 703
Use promises in the ExecutionRecorder interface #4186
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4186 +/- ##
==========================================
- Coverage 33.41% 33.17% -0.25%
==========================================
Files 461 461
Lines 55901 55910 +9
==========================================
- Hits 18681 18549 -132
- Misses 33921 34115 +194
+ Partials 3299 3246 -53 |
❌ 7 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
bragaigor
left a comment
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.
Do we still need to implement ExecutionRecorder methods for ExecutionRPCServer? Something like:
func (c *ExecutionRPCServer) RecordBlockCreation(
ctx context.Context,
pos arbutil.MessageIndex,
msg *arbostypes.MessageWithMetadata,
wasmTargets []rawdb.WasmTarget,
) (*execution.RecordResult, error) {
return c.executionRecorder.RecordBlockCreation(ctx, pos, msg, wasmTargets).Await(ctx)
}and same for PrepareForRecord? But then we would need to add executionRecorder to ExecutionRPCServer or modify ExecutionClient. Or that's be part of another PR? CC: @diegoximenes
|
@bragaigor yes, definitely, but I didn't want to do it in the same PR to keep changes short and granular; this PR is just a part of NIT-4063 (see the description) |
|
@pmikolajczyk41 got it, apologies I missread the description. Also prefers smaller increment PRs |
bragaigor
left a comment
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.
LGTM
execution/gethexec/node.go
Outdated
| ) (*execution.RecordResult, error) { | ||
| return n.Recorder.RecordBlockCreation(ctx, pos, msg, wasmTargets) | ||
| ) containers.PromiseInterface[*execution.RecordResult] { | ||
| return stopwaiter.LaunchPromiseThread(n.ExecEngine, func(ctx context.Context) (*execution.RecordResult, 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.
Nothing to do about this right now, this is more a question to @tsahee when he reviews this PR 🙂.
Since Promises/LaunchPromiseThread/etc are not a golang native way to handle concurrency, it is not clear to me what would be the ideal scenario here.
It is not clear to me why StopWaiter.LaunchPromiseThread accepts a ThreadLauncher (a StopWaiter "implements" a ThreadLauncher), while StopWaiter.LaunchThread doesn't, for example.
Here ExecutionEngine's StopWaiter is being used to launch a thread in ExecutionNode, and the ctx related to this thread is being used to interact with RecordingDatabase.
Not sure if there is an issue with this.
Make
execution.ExecutionRecorderinterface use promise API:ExecutionClientinterfaceTo keep things simple and avoid nesting threads we abandon
BlockRecorderimplementingExecutionRecorderinterface. It is enough that theExecutionNodeimplements it.part of NIT-4063