Add debug logs for provider creation #5478
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.
Now and then, there are some timeouts in EDR Hardhat tests (example) related to the provider initialization in a
beforeEach
hook.This seems super weird to me. That before each only has two async operations: a call to
createHardhatNetworkProvider
and aserver.listen()
call a bit below that. I'm completely sure that the alchemy provider (which is the one with the timeout) doesn't use the server, so the only async operation is the provider creation.But
createHardhatNetworkProvider
is async just because it calls themakeTracingConfig
function, which loads some build info files. I doubt that this is the function that is causing a 50s timeout, so the alternative is that there's something weird going on now and then withEdrProviderWrapper.create
.The easiest way to evaluate this theory is to add some debug logs, and to add
DEBUG="hardhat:core:hardhat-network:*"
in EDR's CI. This won't produce any results until a new version of Hardhat is released and a new timeout is hit (it doesn't happen often), but this is not urgent so this is fine.