You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original behavior here is inconsistent with geth. To validate this - I ran geth devnet and ran two curl commands after making a trivial transfer in geth console
eth.sendTransaction({from: eth.coinbase, to: "0xb26Dc5174FFBeDD212247f258F53d16A1FECa444", value: web3.toWei(5, "ether")})
"0xe75c4a7d51af886595c16d531f11d71675d73deca3b81a41b235f20c63c0bcac"
When you call debug_traceTransaction without any additional params, note that the gas is in uint64 without hex encoding
However, when you use anvil (and I'll jump to mainnet impersonation test described in https://book.getfoundry.sh/tutorials/forking-mainnet-with-cast-anvil)
the instructions have gotten slightly outdated as the $LUCKY_USER has drained their $DAI, but we can still use the old block
This means any Go RPC Clients using the go-ethereum hexutil.Big or hexutil.Uint64 will fail because they expect the numbers to be in hex. This means that ansible cannot be used as a drop in replacement for clients using geth currently without also changing the type for gas to accept both int and hex string.
I'm aware this is a quirk of geth and perhaps related to the calltracer being a javascript function, but if the goal is to make anvil drop in replacement for geth for development, it'd be good to replicate the behavior geth has. I'd love to fix geth upstream too but I'm not sure if the breakage for clients relying on this behavior is worth it.
The text was updated successfully, but these errors were encountered:
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (03f5a95 2024-01-17T16:52:30.332226795Z)
What command(s) is the bug in?
anvil
Operating System
Linux
Describe the bug
The original behavior here is inconsistent with geth. To validate this - I ran geth devnet and ran two curl commands after making a trivial transfer in geth console
When you call
debug_traceTransaction
without any additional params, note that the gas is in uint64 without hex encodingreturns
However, when you call with calltracer, gas is in hex
However, when you use anvil (and I'll jump to mainnet impersonation test described in https://book.getfoundry.sh/tutorials/forking-mainnet-with-cast-anvil)
the instructions have gotten slightly outdated as the
$LUCKY_USER
has drained their $DAI, but we can still use the old blockin another window
returns
so far good..
Now if I trace this transaction, I get gas as a number - good.
However with callTracer it's still a number and not in hex
This means any Go RPC Clients using the go-ethereum hexutil.Big or hexutil.Uint64 will fail because they expect the numbers to be in hex. This means that ansible cannot be used as a drop in replacement for clients using geth currently without also changing the type for gas to accept both int and hex string.
I'm aware this is a quirk of geth and perhaps related to the calltracer being a javascript function, but if the goal is to make anvil drop in replacement for geth for development, it'd be good to replicate the behavior geth has. I'd love to fix geth upstream too but I'm not sure if the breakage for clients relying on this behavior is worth it.
The text was updated successfully, but these errors were encountered: