Skip to content
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

forge create sets eth_estimateGas's type field to null, which does not work with a Besu node #7739

Closed
2 tasks done
roderik opened this issue Apr 20, 2024 · 2 comments · Fixed by alloy-rs/alloy#621
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@roderik
Copy link

roderik commented Apr 20, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (ee47bb0 2024-04-16T00:17:39.642110112Z)

What command(s) is the bug in?

forge create

Operating System

Linux

Describe the bug

I'm trying to deploy a simple ERC20 token to a private Besu network setting the gas price to 0.

--gas-price 0

When i follow the json-rpc calls, i see it calling eth_chainId, eth_getTransactionCount and finally a bunch of eth_estimateGas calls that all fail with Invalid Params.

The estimateGas call looks like this:

curl -X POST --data '{"method":"eth_estimateGas","params":[{"from":"0x5230d744a2f776a1c75b6e48d4eb826423cb0bf6","to":null,"gas":null,"value":null,"input":"0x6101606040523480156200001257600080fd5b50604051620020bb380380620020bb833981016040819052620000359162000504565b6040805180820190915260018152603160f81b6020820152829081903382856003620000628382620005fe565b506004620000718282620005fe565b50506005805460ff19169055506001600160a01b038116620000ae57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000b981620001a0565b50620000c7826006620001fa565b61012052620000d8816007620001fa565b61014052815160208084019190912060e052815190820120610100524660a0526200016660e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506200019833620001836012600a620007dd565b6200019290620186a0620007f5565b62000233565b50506200087f565b600580546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020835110156200021a57620002128362000271565b90506200022d565b81620002278482620005fe565b5060ff90505b92915050565b6001600160a01b0382166200025f5760405163ec442f0560e01b815260006004820152602401620000a5565b6200026d60008383620002b4565b5050565b600080829050601f815111156200029f578260405163305a27a960e01b8152600401620000a591906200080f565b8051620002ac8262000844565b179392505050565b620002c1838383620002c6565b505050565b620002d0620002dd565b620002c183838362000304565b60055460ff1615620003025760405163d93c066560e01b815260040160405180910390fd5b565b6001600160a01b0383166200033357806002600082825462000327919062000869565b90915550620003a79050565b6001600160a01b03831660009081526020819052604090205481811015620003885760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000a5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216620003c557600280548290039055620003e4565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200042a91815260200190565b60405180910390a3505050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200046a57818101518382015260200162000450565b50506000910152565b600082601f8301126200048557600080fd5b81516001600160401b0380821115620004a257620004a262000437565b604051601f8301601f19908116603f01168101908282118183101715620004cd57620004cd62000437565b81604052838152866020858801011115620004e757600080fd5b620004fa8460208301602089016200044d565b9695505050505050565b600080604083850312156200051857600080fd5b82516001600160401b03808211156200053057600080fd5b6200053e8683870162000473565b935060208501519150808211156200055557600080fd5b50620005648582860162000473565b9150509250929050565b600181811c908216806200058357607f821691505b602082108103620005a457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002c1576000816000526020600020601f850160051c81016020861015620005d55750805b601f850160051c820191505b81811015620005f657828155600101620005e1565b505050505050565b81516001600160401b038111156200061a576200061a62000437565b62000632816200062b84546200056e565b84620005aa565b602080601f8311600181146200066a5760008415620006515750858301515b600019600386901b1c1916600185901b178555620005f6565b600085815260208120601f198616915b828110156200069b578886015182559484019460019091019084016200067a565b5085821015620006ba5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000721578160001904821115620007055762000705620006ca565b808516156200071357918102915b93841c9390800290620006e5565b509250929050565b6000826200073a575060016200022d565b8162000749575060006200022d565b81600181146200076257600281146200076d576200078d565b60019150506200022d565b60ff841115620007815762000781620006ca565b50506001821b6200022d565b5060208310610133831016604e8410600b8410161715620007b2575081810a6200022d565b620007be8383620006e0565b8060001904821115620007d557620007d5620006ca565b029392505050565b6000620007ee60ff84168362000729565b9392505050565b80820281158282048414176200022d576200022d620006ca565b6020815260008251806020840152620008308160408501602087016200044d565b601f01601f19169190910160400192915050565b80516020808301519190811015620005a45760001960209190910360031b1b16919050565b808201808211156200022d576200022d620006ca565b60805160a05160c05160e0516101005161012051610140516117e1620008da6000396000610cf701526000610cca01526000610a0b015260006109e30152600061093e015260006109680152600061099201526117e16000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c8063715018a6116100d85780638da5cb5b1161008c578063d505accf11610066578063d505accf14610324578063dd62ed3e14610337578063f2fde38b1461037d57600080fd5b80638da5cb5b146102c657806395d89b4114610309578063a9059cbb1461031157600080fd5b80637ecebe00116100bd5780637ecebe00146102905780638456cb59146102a357806384b0196e146102ab57600080fd5b8063715018a61461027557806379cc67901461027d57600080fd5b80633644e5151161013a57806342966c681161011457806342966c68146102215780635c975abb1461023457806370a082311461023f57600080fd5b80633644e515146101fc5780633f4ba83a1461020457806340c10f191461020e57600080fd5b806318160ddd1161016b57806318160ddd146101c857806323b872dd146101da578063313ce567146101ed57600080fd5b806306fdde0314610187578063095ea7b3146101a5575b600080fd5b61018f610390565b60405161019c91906114aa565b60405180910390f35b6101b86101b33660046114ed565b610422565b604051901515815260200161019c565b6002545b60405190815260200161019c565b6101b86101e8366004611517565b61043c565b6040516012815260200161019c565b6101cc610460565b61020c61046f565b005b61020c61021c3660046114ed565b610481565b61020c61022f366004611553565b610497565b60055460ff166101b8565b6101cc61024d36600461156c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61020c6104a4565b61020c61028b3660046114ed565b6104b6565b6101cc61029e36600461156c565b6104cb565b61020c6104f6565b6102b3610506565b60405161019c9796959493929190611587565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1660405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019c565b61018f610568565b6101b861031f3660046114ed565b610577565b61020c610332366004611649565b610585565b6101cc6103453660046116bc565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b61020c61038b36600461156c565b610737565b60606003805461039f906116ef565b80601f01602080910402602001604051908101604052809291908181526020018280546103cb906116ef565b80156104185780601f106103ed57610100808354040283529160200191610418565b820191906000526020600020905b8154815290600101906020018083116103fb57829003601f168201915b5050505050905090565b600033610430818585610798565b60019150505b92915050565b60003361044a8582856107aa565b610455858585610879565b506001949350505050565b600061046a610924565b905090565b610477610a5c565b61047f610ab5565b565b610489610a5c565b6104938282610b32565b5050565b6104a13382610b8e565b50565b6104ac610a5c565b61047f6000610bea565b6104c18233836107aa565b6104938282610b8e565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260086020526040812054610436565b6104fe610a5c565b61047f610c68565b60006060806000806000606061051a610cc3565b610522610cf0565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b60606004805461039f906116ef565b600033610430818585610879565b834211156105c7576040517f62791302000000000000000000000000000000000000000000000000000000008152600481018590526024015b60405180910390fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886106218c73ffffffffffffffffffffffffffffffffffffffff16600090815260086020526040902080546001810190915590565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061068982610d1d565b9050600061069982878787610d65565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610720576040517f4b800e4600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301528b1660248201526044016105be565b61072b8a8a8a610798565b50505050505050505050565b61073f610a5c565b73ffffffffffffffffffffffffffffffffffffffff811661078f576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b6104a181610bea565b6107a58383836001610d93565b505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146108735781811015610864576040517ffb8f41b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101829052604481018390526064016105be565b61087384848484036000610d93565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166108c9576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b73ffffffffffffffffffffffffffffffffffffffff8216610919576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b6107a5838383610edb565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561098a57507f000000000000000000000000000000000000000000000000000000000000000046145b156109b457507f000000000000000000000000000000000000000000000000000000000000000090565b61046a604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60055473ffffffffffffffffffffffffffffffffffffffff61010090910416331461047f576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016105be565b610abd610ee6565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff8216610b82576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b61049360008383610edb565b73ffffffffffffffffffffffffffffffffffffffff8216610bde576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b61049382600083610edb565b6005805473ffffffffffffffffffffffffffffffffffffffff8381166101008181027fffffffffffffffffffffff0000000000000000000000000000000000000000ff85161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610c70610f22565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b083390565b606061046a7f00000000000000000000000000000000000000000000000000000000000000006006610f5f565b606061046a7f00000000000000000000000000000000000000000000000000000000000000006007610f5f565b6000610436610d2a610924565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b600080600080610d778888888861100a565b925092509250610d878282611104565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416610de3576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b73ffffffffffffffffffffffffffffffffffffffff8316610e33576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016105be565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526001602090815260408083209387168352929052208290558015610873578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610ecd91815260200190565b60405180910390a350505050565b6107a5838383611208565b60055460ff1661047f576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055460ff161561047f576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060ff8314610f7957610f728361121b565b9050610436565b818054610f85906116ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610fb1906116ef565b8015610ffe5780601f10610fd357610100808354040283529160200191610ffe565b820191906000526020600020905b815481529060010190602001808311610fe157829003601f168201915b50505050509050610436565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561104557506000915060039050826110fa565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611099573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166110f0575060009250600191508290506110fa565b9250600091508190505b9450945094915050565b600082600381111561111857611118611742565b03611121575050565b600182600381111561113557611135611742565b0361116c576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282600381111561118057611180611742565b036111ba576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024016105be565b60038260038111156111ce576111ce611742565b03610493576040517fd78bce0c000000000000000000000000000000000000000000000000000000008152600481018290526024016105be565b611210610f22565b6107a583838361125a565b6060600061122883611405565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b73ffffffffffffffffffffffffffffffffffffffff83166112925780600260008282546112879190611771565b909155506113449050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015611318576040517fe450d38c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260248101829052604481018390526064016105be565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff821661136d57600280548290039055611399565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113f891815260200190565b60405180910390a3505050565b600060ff8216601f811115610436576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000815180845260005b8181101561146c57602081850181015186830182015201611450565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6020815260006114bd6020830184611446565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146114e857600080fd5b919050565b6000806040838503121561150057600080fd5b611509836114c4565b946020939093013593505050565b60008060006060848603121561152c57600080fd5b611535846114c4565b9250611543602085016114c4565b9150604084013590509250925092565b60006020828403121561156557600080fd5b5035919050565b60006020828403121561157e57600080fd5b6114bd826114c4565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e060208401526115c460e084018a611446565b83810360408501526115d6818a611446565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b818110156116375783518352928401929184019160010161161b565b50909c9b505050505050505050505050565b600080600080600080600060e0888a03121561166457600080fd5b61166d886114c4565b965061167b602089016114c4565b95506040880135945060608801359350608088013560ff8116811461169f57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156116cf57600080fd5b6116d8836114c4565b91506116e6602084016114c4565b90509250929050565b600181811c9082168061170357607f821691505b60208210810361173c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b80820180821115610436577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212209887ec89c30ef394ff8ee5d0dba9a8fd96bd169a374d434295323a66364152ee64736f6c6343000818003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c47656e65726963546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024754000000000000000000000000000000000000000000000000000000000000","nonce":"0x0","chainId":"0xa448","accessList":null,"type":null}],"id":2,"jsonrpc":"2.0"}' http://127.0.0.1:8545

When i execute this against an Erigon node or against Anvil it works.

I noticed type is set to null. When using either type 0, 1 or 2, it also works against the Besu node.

Setting --legacy does not change this value.

I have not found any configuration value for this, nor is my rust skill level enough to figure out where it comes from 🤷🏻

@roderik roderik added the T-bug Type: bug label Apr 20, 2024
@roderik roderik changed the title forge create sets eth_estimateGas's type firl to null, which does not work with a Besu node forge create sets eth_estimateGas's type field to null, which does not work with a Besu node Apr 20, 2024
@roderik
Copy link
Author

roderik commented Apr 20, 2024

The type field is one thing, but I found I can bypass it by providing a manual gas limit.

@roderik
Copy link
Author

roderik commented Apr 20, 2024

FYI, this is using eth_sendTransaction (so with --unlock)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant