-
Notifications
You must be signed in to change notification settings - Fork 83
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
[EASY] Improve logging for submitting transactions #3158
Conversation
Requesting re-review due to non-trivial addition to the PR. |
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
if let Some(id) = get_task_local_storage() { | ||
tokio::task::spawn(REQUEST_ID.scope(id, future)) | ||
} else { | ||
tokio::task::spawn(future) |
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.
If the request id is not found maybe we should at least log that, as the intention of the caller of spawn_task_with_request_id() function is not fulfilled.
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.
Mmmh, maybe the function name is not great then. The expectation is not that there has to be a request id set. But rather to ensure that we'd use the same id if it is.
Description
There was a wish to associate MEV blocker request logs with transactions sent by the driver. This is currently not possible for 2 reasons:
/settle
handler spawns a new task to make sure transactions get cancelled (if needed) even when the autopilot terminates the request. Unfortunately how we pass aroundrequest_ids
(which could also be used to associated these logs) is very convoluted and was overlooked here. Since the spawned task has its request_id variable not populated it generates a new id which does not match the original id.Changes
request_id
,solver
andmempool
type/settle
task in a way that preserves the originalrequest_id
Reference slack thread