-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: inferTypes error #4859
base: main
Are you sure you want to change the base?
fix: inferTypes error #4859
Conversation
Hi! I'd love to see this PR merged, as it would fix an issue where ethers v6 incorrectly infers the transaction type to be 1 instead of 0. In my case, my transaction contains a @ricmoo is there any reason to not merge it? The current logic looks flawed to me because of } else if (hasGasPrice) {
types.push(1);
if (!hasAccessList) { types.push(0); }
} else if (hasAccessList) {
...
types.sort(); Thanks in advance. |
The inferring is based on what types of transaction if “could” be. In the event of ambiguity, it favours the most recent type that is still compatible. I think this still makes sense, but am open to discussing it. But keep in mind this type of change could also break existing code which relies on the type being selected as type 1. The `inferTypes' in this case is still “useful” (I don’t actually care much for inferred types and these reasons are exactly why), since it helps isolate what types it is valid for, for some applications that care about that. But the most recent fork is what should be targeted. Is the issue that you are on a network that doesn’t support modern transaction types? It might make sense in a future update to include a comparator on the Network object to indicate the preferred transaction type (and allow rejecting invalid values). This will become much more difficult as new transaction types aren’t necessary canonically ordered. :( |
Thank you for taking the time to reply. |
If (sorry for my unsolicited input - just lurking the “Viem” keyword on GitHub search 😂) |
Any unsolicited feedback is always welcome! :) The issue though, is that properties implicit value. So, if the So, the transaction This becomes an issue as we add more types, since just because a number is canonically larger, no longer means it should necessarily be the default type. And some exotic networks now have their own (much higher) transaction envelope types. So, going forward On the one hand if we suggest people include This is why I'm thinking we need some sort of |
Specific errors and solutions from hre #4858