-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Move V2 wrapped providers to v3 #5810
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
// the AutomaticGasPrice for it unless there are provider extenders. | ||
// The reason for this is that some extenders (like hardhat-ledger's) might | ||
// do the signing themselves, and that needs the gas price to be set. | ||
if (isResolvedHttpNetworkConfig(this.#networkConfig)) { |
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.
I need a double-check on this because, based on the V2 comment description above, I'm not entirely sure whether this "if condition" is correct. I'll update the V2 description as soon as I confirm the correct code.
Original implementation at this link
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.
I think it's correct, but we can ask Pato or John if you want to be absolutely sure before merging.
...src/internal/builtin-plugins/network-manager/json-rpc-request-modifiers/chain-id/chain-id.ts
Outdated
Show resolved
Hide resolved
v-next/hardhat/src/internal/builtin-plugins/network-manager/hook-handlers/network.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Patricio Palladino <[email protected]>
…dhat into move-providers-to-v3
...builtin-plugins/network-manager/json-rpc-request-modifiers/gas-properties/fixed-gas-price.ts
Show resolved
Hide resolved
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.
Nice work! I left some comments, but I think most of them can be addressed later (we just need to create issues to track them). Also, I find using assertHardhatInvariant
after each request a bit annoying. We could simplify things by adding type guards for the RPC methods and exposing them as utilities.
Related Issues
See the
NOTE
section in this issueChanges
The current PR implements:
All the code has been ported while maintaining most of the original structure in both the source code and the tests; therefore, there are no significant changes in the logic.
Additional work
While porting the
accounts provider
I discovered that there are quite a few missing functionalities that are not currently implemented in V3. For example:@nomicfoundation/ethereumjs-util
,@nomicfoundation/ethereumjs-tx
, etc. Example:FeeMarketEIP1559Transaction
.See here, search for
@nomicfoundation/
to see all the importst
defined types that need to be defined because currently they are not available in V3, for example in this file (not all of them are needed).account
property in the network configuration is a straightforward task, but there are a lot of tests to port, like in this fileI think this should be split into multiple PRs since these side tasks, while related to moving the providers, are dependencies rather than the main focus.
How could the work be re-organized:
Notes on the implementation
this
in various parts of the code, rather than passing the same variables multiple times.TODOs
from the V2 code, I kept them asTODOs
. I marked them asTODO: from V2 -