-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
SDK update 3.1.8 broke estimateL1GasCost
for type 0 txs
#9293
Comments
estimateL1GasCost
for type 1 txsestimateL1GasCost
for type 0 txs
I see. We are on an old version of ethers so we can't really fix this issue with ethers directly. As a quick fix my suggestion is we use I won't be able to get to this pr this week but happy to review a pr if you want to make this change in meantime |
Thanks for the reply @roninjin10 This is actually how I would expect ethers to behave. I don't think txs should have both type Is it possible for you to handle it prior to serialization with ethers? I'm not exactly sure where, but I would think ethers has a utility function somewhere that handles this. |
Yes @shanefontaine. What you can do is filter out the undefined values. Viem will work without doing this because they check the value instead of the key. ('key' in value) vs (value.key !== undefined). Only downside to filtering out the keys is it's more code than using viem but upside is you aren't mixing viem and ethersv5. |
@roninjin10 sorry I might not be clear. I believe there is nothing I can do because the Optimism SDK is what adds the values no matter what I pass in (including |
@shanefontaine Right sorry I'm the one that is not clear. I'm talking about fixing the sdk not your repo. I worded it confusing because I said |
The sdk is very fragile, it seems like every change that happens with it breaks something. There isn't good test coverage for it right now, the real main test for it is it runs both an eth and erc20 withdrawal against the docker compose devnet |
The sdk is deprecated |
Describe the bug
The fix in #8902 explicitly defines values to be serialized by ethers.
For type
0
txs, ethers will accept the input and check the property keys. Since type2
properties now exist on the tx object (even if undefined), they fail the check.To Reproduce
Call
estimateL1GasCost()
with type0
params on ethers 5.7.2.Expected behavior
Return estimated l1 gas cost.
The text was updated successfully, but these errors were encountered: