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

Similar to the issue mentioned in #6569: insufficient funds for gas * price + value: address ... #7801

Closed
MobillsInMobild opened this issue Jun 26, 2023 · 2 comments

Comments

@MobillsInMobild
Copy link

System information

Erigon version:

OS & Version:

  • Ubuntu 22.04.2 LTS

Commit hash:

Concensus Layer:

  • just Erigon used as an Execution Layer for Consensus Layer clients with default configuration

Chain/Network:

  • ETH main

Expected behaviour

  • I would like to use eth_callMany to simulate a trade. Obviously 0x380d096daec90a2d255574df70a89f65efc773a627adc924fba5f5869570e642 on ethereum is a successfully executed transaction and its position in the block is 10. So when I build the correct raw transaction and use eth_callMany at any position in block, I should be able to call this transaction successfully.

Actual behaviour

  • In fact, when I use eth_callMany at any position greater than 10, it occurs this:
insufficient funds for gas * price + value: address ...
  • Any position less than or equal to 10 can be executed normally, which means that the original transaction at position 10 was not executed normally.
  • To be able to execute eth_callMany, I had to set gasBailout in core.ApplyMessage to True in erigon/cmd/rpcdaemon/commands/eth_callMany.go
  • Noticing that the transaction at position 9 has the same tx.from as the transaction at position 10, it leads me to believe that this issue is related to block BaseFee in callMany #6569 . @ArielTM

Steps to reproduce the behaviour

from web3 import Web3, HTTPProvider
from config import *

import requests


w3 = Web3(HTTPProvider(Erigon_path))
s = requests.session()


def get_amount_from_raw_tx(raw_tx, height, index):
    for k in raw_tx:
        if isinstance(raw_tx[k], int):
            raw_tx[k] = hex(raw_tx[k])
    raw_tx = dict(
        [
            (k, raw_tx[k])
            for k in raw_tx
            if k in ["to", "gas", "maxFeePerGas", "maxPriorityFeePerGas", "data"]
        ]
    )

    params = [
        [{"transactions": [raw_tx]}],
        {"blockNumber": hex(height), "transactionIndex": index},
    ]
    print(
        s.post(
            erigon_path,
            json={
                "jsonrpc": "2.0",
                "method": "eth_callMany",
                "params": params,
                "id": 67,
            },
        ).json()
    )


if __name__ == "__main__":
    raw_tx = {
        "value": 0,
        "chainId": 1,
        "gas": 2000000,
        "maxFeePerGas": 1029546770420,
        "maxPriorityFeePerGas": 1192368570,
        "to": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",
        "data": "0xf7729d43000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000012a05f2000000000000000000000000000000000000000000000000000000000000000000",
    }
    height = 16957059
    index = 11
    get_amount_from_raw_tx(raw_tx, height, index)
@github-actions
Copy link

github-actions bot commented Aug 6, 2023

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 6, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant