ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
255 stars 654 forks source link

--rpc.txfeecap=0 isn't being honored, returning tx fee exceeds the configured cap #209

Open yaanakbr opened 5 months ago

yaanakbr commented 5 months ago

System information

Geth version: Geth/v1.101304.2-stable-c6b416da/linux-amd64/go1.20.10 OS & Version: OSX

Describe the bug We are getting an error on our nodes that says: "message":"tx fee (1.63 ether) exceeds the configured cap (1.00 ether)

To Reproduce Steps to reproduce the behavior:

Here is an example of a transaction that is 1.63 ETH that is getting denied and we cant figure out why the txfeecap isn't being overridden:

➜  ~ curl -X POST "ADD_ANY_URL"      \
     -H "Content-Type: application/json" \
     -d '{"jsonrpc":"2.0","id":61092,"method":"eth_sendRawTransaction","params":["0xf8e7821d1f86018ecb5d3235830e909e941c8a8e0991a18852951cbc18fb19d1f44dcc403d80b87e06cdc42b0000000000000000000016292d14d1778f9df3eee5473a9640f13682e3846f61febc3655000000000a03a0500e2adf9d530568f5c0a2de713a54991e01858fd27a38324018492118000000000003f393c0b1824f3ff585c31ffa3706d1cce9d525a00f1c7d4a2911754ca114000000000000000000001700fbe137a03e77cca2d7965447d699ad64baacc40569d236282f47e5033b2741fd85e66f0aa00c2fb89765726a8e99f209cf9e7efc026355c1864ce1acee0909878b102c0e05"]}'

{"jsonrpc":"2.0","id":61092,"error":{"code":-32000,"message":"tx fee (1.63 ether) exceeds the configured cap (1.00 ether)"}}

I have decoded the transaction, and here is what it is returning:

{"nonce":7455,"gasPrice":{"_hex":"0x018ecb5d3235"},"gasLimit":{"_hex":"0x0e909e"},"to":"0x1c8a8e0991a18852951cbc18fb19d1f44dcc403d","value":{"_hex":"0x0"},"data":"0x06cdc42b0000000000000000000016292d14d1778f9df3eee5473a9640f13682e3846f61febc3655000000000a03a0500e2adf9d530568f5c0a2de713a54991e01858fd27a38324018492118000000000003f393c0b1824f3ff585c31ffa3706d1cce9d525a00f1c7d4a2911754ca114000000000000000000001700fbe1","v":55,"r":"0x3e77cca2d7965447d699ad64baacc40569d236282f47e5033b2741fd85e66f0a","s":"0x0c2fb89765726a8e99f209cf9e7efc026355c1864ce1acee0909878b102c0e05"}
❯ hexdec 0x0e909e
954526
❯ hexdec 0x018ecb5d3235
1712808866357
Multiply those numbers together and you get:
1.634920595968282e18

I also have tested public URLs and they all return the same:

curl -X POST "https://optimism.publicnode.com"      \
     -H "Content-Type: application/json" \
     -d '{"jsonrpc":"2.0","id":61092,"method":"eth_sendRawTransaction","params":["0xf8e7821d1f86018ecb5d3235830e909e941c8a8e0991a18852951cbc18fb19d1f44dcc403d80b87e06cdc42b0000000000000000000016292d14d1778f9df3eee5473a9640f13682e3846f61febc3655000000000a03a0500e2adf9d530568f5c0a2de713a54991e01858fd27a38324018492118000000000003f393c0b1824f3ff585c31ffa3706d1cce9d525a00f1c7d4a2911754ca114000000000000000000001700fbe137a03e77cca2d7965447d699ad64baacc40569d236282f47e5033b2741fd85e66f0aa00c2fb89765726a8e99f209cf9e7efc026355c1864ce1acee0909878b102c0e05"]}'

   {"jsonrpc":"2.0","id":61092,"error":{"code":-32000,"message":"tx fee (1.63 ether) exceeds the configured cap (1.00 ether)"}}

System Specs:

And here is the following config file (some unnecessary things have been redacted):

[Service]
User            = optimism
ExecStart   = /usr/local/bin/geth \
                    --ws \
                    --ws.port=8546 \
                    --ws.addr=0.0.0.0 \
                    --ws.origins="*" \
                    --http \
                    --http.port=8545 \
                    --http.addr=0.0.0.0 \
                    --http.vhosts="*" \
                    --http.corsdomain="*" \
                    --authrpc.addr=0.0.0.0 \
                    --authrpc.port=8551 \
                    --datadir=/home/optimism \
                    --verbosity=3 \
                    --rollup.disabletxpoolgossip=true \
                    --rollup.sequencerhttp=https://mainnet-sequencer.optimism.io \
                    --rollup.historicalrpc=http://opti-l2geth-mainnet.<URL>:8525 \
                    --rollup.historicalrpctimeout=300s \
                    --nodiscover \
                    --networkid=10 \
                    --op-network=op-mainnet \
                    --syncmode=full \
                    --snapshot=false \
                    --maxpeers=0 \
                    --txlookuplimit=0 \
                    --rpc.txfeecap=0 \
                    --gcmode=full \
                    --rollup.halt=major
Restart         = on-failure 

Additional context We cant seem to find anywhere in the source code that seems this would be honored. Is it possible the sequencer is rejecting it?

sbvegan commented 5 months ago

Relaying information that I have on this subject:

The fee-cap = 0 case is being handled correctly in the local op-geth node I believe, since we made no changes from what upstream geth does here, and the short-circuit behavior of the fee-cap looks correct in checkTxFee. It likely is an issue with the OP Mainnet sequencer RPC then, which has its own independent fee-cap. I believe this is configured with the geth default, which would be 1 ETH, matching the behavior seen here. Can I ask in what particular circumstance the tx sender is trying to submit a tx with a fee of more than 1 ETH? Most L2 txs don't cost nearly as much. When using the full 30 million gas, it takes a gas price of 33.3 gwei to consume the full 1 ETH. However, priority-fees and base-fees are generally much lower than this on L2.