-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add flag to ignore unknown EIP-2718 types when forking #2995
Comments
This issue is also being tracked on Linear. We use Linear to manage our development process, but we keep the conversations on Github. LINEAR-ID: 63ce06f8-76ab-40ec-8fdc-3fda8f581808 |
Hey @feuGeneA any opinion on this? Can I move on to create a PR if this approach is ok? |
Hi @gzeoneth . Thank you for the thoughtful and complete submission. I've just solicited more input from the team. We'll follow up soon. |
Would really like to be able to fork chains like arbitrum with the introduction of arbitrum nitro. |
This issue has been added to our internal backlog. I can't say when we'll be able to prioritize it. But I can say that the more interest is shown here, the more likely we are to work on it sooner rather than later :) |
Hey, i assumed it was supported to fork arbitrum rinkeby for testing... I am surprised it does not work :( (i based my entire work on this working) |
just fyi you can use this as a workaround for now
|
Yes I also need this. I am trying to test on a fork of Wanchain and am having the same issue. Thanks! |
looks great. works with hardhat_reset.
|
I have upload a patch file here if you don't want to install my package, this is also compatible with a few more hardhat version e.g. 2.9.9, 2.10.2 |
This is absolutely needed, Arbitrum is starting to be one of the most active networks after Ethereum Mainnet. Thanks @gzeoneth for providing an interim solution, will give it a try! |
Definitely a needed change. I am still getting the error: Error HH604: Error running JSON-RPC server: Unknown transaction type 106, set --fork-ignore-unknown-tx-type true to ignore after applying the patch. |
Patch works for me. Any update on this making it into an official release? |
|
My infura and quicknodes Arbitrum mainnet RPC's stopped forking on Friday with this issue. I'm going to try the patch now, just showing interest @0xyqrz. Thanks everyone. |
How can this be used with hardhat tests? |
see the first post you can use my patched hardhat or apply the patch file |
@feuGeneA 👍 interest. thanks! |
The patch is not working for me when using
Before applying the patch
After applying the patch + adding
Using hardhat |
working fine with me, do you have a sample script? |
where exactly are we supposed to add this aforementioned file if trying to run hardhat tests? Since the Arbitrum nitro upgrade I have installed the patch, as well as followed the steps laid out above but keep getting an |
I have no idea why it is not working, you can try this alternative patch where it always ignore unknown tx type. |
but which file are we adding the above stipulation to? |
Fixed a few bug with 2.10.2-gzeon-e972f1dda, you can use this patch file In hardhat.confg.ts you need something like
Then it should work when using the hardhat network. |
None of the linked patches work when trying to set This issue has caused me no shortage of headaches and has been really frustrating for my team. I hope this gets resolved soon, but in the meantime, for anyone desperate to get this working and sick of patches breaking, after you apply one of the patches, inside of change:
to:
If you want to have a copy that is persistent across compilations so you can fork this repo and have it, just change To give some info that might help with a real solution: Its a bit of a pain to debug, but by the time The fact that the docs don't mention that major chains like arbitrum can't be forked properly (on the contrary they make it sound like anything with an infura node works fine) is an absolute joke and wasted a whole week of my time before finding this issue. At the bare minimum there should be a clear error message, especially considering there have been reports of this going back over two whole months, and numerous issues have been closed as duplicates. I really hope they add a disclaimer somewhere so more devs don't waste their time on this. |
@zbirenbaum mind to share your setup / repo that's not working with the above patches? Myself and a few others have been able to use it with hardhat.config but since I am not that familiar with hardhat I probably have missed something. It seems that hardhat will initialize the fork with the config but then do another hardhat_reset to change the blocknumber, but it won't have the ignore flag set, so I have to fix it by removing the ability to change the ignore flag using hardhat_reset gzeoneth@e972f1d, but it might have caused issue in other codepath. Also @feuGeneA I think there are enough interest is shown here, when can we get a proper fix? |
I'll make a proper patch file tomorrow and upload the repo, it's late here rn |
We'll definitely prioritize this. Sorry everyone for not responding sooner! Since a lot of you are struggling with this, maybe we can publish a |
Any news on this? The patches do not work for me :( |
With the 2.11.2 patch, and most of the others I believe, if you have
defined in your hardhat config, |
Getting this kind of error right now. What should I do?
This is my package.json file |
@QuiNoah00 you don't need the patch if you are installing my npm package |
For anyone still struggling with this, I found a way to set up your project with the 2.11.2 patch here so that every time you run Just drop this in your hardhat.config, change it however you need to, and then run
|
any chance to get this working with |
@feuGeneA Quite a bit of continued interest in this good ser! |
I couldn't get it to work with the 2.11.2 patch file provided so I modified it to use My
and then i have the following in the scripts section:
Edit: once you do this you don't need to use an extra cli arg or arg in |
I'm testing smart contract on arbitrum now, this feature is really needed to simulate test cases |
Try to use the 2.10.2 patch in the original post. |
@fvictorio updates? |
Hi everyone. We just published a beta version of Hardhat that should fix this issue. I would appreciate it if you can give it a try:
(If you are using npm 7 or later, you might get some warnings about unsatisfied peer dependencies, but you can ignore those.) If this seems to be working fine, we'll publish a stable version with this change as soon as possible. Please try it out and let us know if it works (or doesn't!) |
ty @fvictorio! the beta is working for me, I'm able to fork the goerli arbitrum network successfully using the hardhat config. Will keep testing with this package and let you know if I run into issues. |
Nice job! The beta is working for me as well. Installing the beta alone seems to hiccup on the
|
@andy191x yes, that's an unfortunate side effect of the way npm 7+ handles peer dependencies combined with how semver handles prerelease versions 😞 |
Worked perfectly for me! Forking now works with Arbitrum Goerli as usual. Thanks so much @fvictorio 👍 |
This fix is now included in the latest release. |
Certain EVM blockchain (e.g. Arbitrum Nitro) have non-standard EIP-2718 typed transaction that would prevent hardhat fork from working due to Error HH604: Error running JSON-RPC server: Unknown transaction type 106
While it is rarely a good idea to use hardhat fork with these blockchain due to chain specific behavior and precompiles as discussed in #1902, some devs found it helpful to test non-chain specific logic with existing states using hardhat fork. To workaround the
Unknown transaction type
error, I am proposing to add an optional--fork-ignore-unknown-tx-type
flag to skip those transactions.You can reproduce the error with
https://github.com/OffchainLabs/go-ethereum/blob/141b0fcdf0e4d8e9e5de3f0466533b86563f2d29/core/types/transaction.go#L48-L54
Here is a draft implementation: https://github.com/gzeoneth/hardhat/tree/2.10.2-gzeon
Also published on npm and can be installed with yarn alias
27/8/2022:
I have upload a patch file here if you don't want to install my package, this is also compatible with a few more hardhat version e.g. 2.9.9, 2.10.2
https://gist.github.com/gzeoneth/99ac30932bf07f91661d7bc621ba1f50
You can install it using patch-package, just follow the step there and put hardhat+2.10.2.patch into the
patches
folder and runyarn install
again. Please note that I did not update the source mapping in this patch file to improve compatibility but it might cause some issue debugging.10/9/2022:
Fixed a few bug with
2.10.2-gzeon-e972f1dda
, updated link above24/10/2022: #2995 (comment)
A beta version of Hardhat is published that should fix this issue.
(If you are using npm 7 or later, you might get some warnings about unsatisfied peer dependencies, but you can ignore those.)
The text was updated successfully, but these errors were encountered: