Request tracing without task local storage #3251
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Alternative to #3247
All of the context still applies to this PR.
But instead of looking up the request id from the task local storage we are now able to look it up from the tracing span.
When I introduced the request id feature I already wanted to have it work this way but I was not able to get it working.
Finally after some more research I figured out that this can be accomplished by implementing a custom tracing layer which makes the request id available for lookup later on.
Now the request id is easily available wherever a the current span or any of it's parents contains the request id.
This means we no longer have to worry about 2 different ways of making important data available when spawning a new task.
Changes
/settle
calls so we can associate rpc proxy logs with the solution we tried so submit/settle
handler is no longer needed => I removed it to make the code simplerHow to test
Ran local_node test with extra logging to make sure the request ids arrive in the http transport layer with and without request buffering. Since I used the e2e test for multiple winners again we try to submit 2 solutions.
without buffering (applies to mevblocker):
with buffering (applies to public mempool submissions):
Also added unit tests to show that we can correctly get the request_id from the tracing span under various conditions.