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

eirgon3 trace_callMany not work with multiple trasaction #11798

Closed
sstonehu opened this issue Aug 29, 2024 · 1 comment · Fixed by #11879
Closed

eirgon3 trace_callMany not work with multiple trasaction #11798

sstonehu opened this issue Aug 29, 2024 · 1 comment · Fixed by #11879
Assignees
Labels
erigon3 imp1 High importance
Milestone

Comments

@sstonehu
Copy link

sstonehu commented Aug 29, 2024

System information

Erigon version: ./erigon3 -- main branch [2fceaea]

OS & Version: Linux

Commit hash: 2fceaea

Erigon Command (with flags/config):

datadir : '/mnt/evm_node/data/mainnet'
externalcl : true
prune.mode : 'archive'
prune.distance : 2048
prune.distance.blocks : 2048
chain : 'mainnet'
port : 30303
http.port : 8545
http.addr : 0.0.0.0
authrpc.port : 8551
torrent.port : 42069
http.vhosts : 'any'
http.corsdomain : '*'
private.api.addr : 127.0.0.1:9090
rpc.batch.limit : 200
http : true
ws : true
ws.compression : true
ws.port : 8546
http.api : ["eth","debug","net","trace","web3","erigon","admin"]
torrent.download.rate : '512mb'

Consensus Layer: prysm

Consensus Layer Command (with flags/config):

Chain/Network: mainnet

Expected behaviour

trace_callMany execute transaction on the state of pre-transaction

Actual behaviour

trace_callMany execute transaction seperately

Steps to reproduce the behaviour

execute the following code:

const simulate_address = "0x***57c3";
const weth_holder = "0x***7806";

const transfer_weth_txn = {
    from: weth_holder,
    to: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
    data: '0xa9059cbb' + simulate_address.slice(2).padStart(64, '0') + BigInt(1e20).toString(16).padStart(64, '0'),
}

const balanceOf_weth_txn = {
    from: simulate_address,
    to: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
    data: '0x70a08231' + simulate_address.slice(2).padStart(64, '0'),
}

async function test() {
    const txns = [
        [balanceOf_weth_txn, ['trace']],
        [transfer_weth_txn, ['trace']],
        [balanceOf_weth_txn, ['trace']]
    ];

    const blockNumber = 20635100;
    const blockNumberHex = '0x' + blockNumber.toString(16);

    const requestBody = [{
        "jsonrpc": "2.0",
        "method": "trace_callMany",
        "params": [
            txns,
            blockNumberHex
        ],
        "id": 0
    }];

    console.log('simulate_http_url:', hre.network.config.simulate_http_url);
    const res = await fetch(hre.network.config.simulate_http_url, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'header': 'content-type: application/json'
        },
        body: JSON.stringify(requestBody),
    });

    const resJson = await res.json();

    for (const r of resJson[0].result) {
        console.log('r:', r);
    }
}

test().then(() => {
console.log('test finished');
}).catch(err => {
console.log('test failed:', err);
});

it trace_callMany with 3 transactions: [balanceOf, transfer, balanceOf ]

the third transaction's output should reflect the transfer result as '0x0000000000000000000000000000000000000000000000056bc75e2d63100000'

while erigon3 return
'0x0000000000000000000000000000000000000000000000000000000000000000'

works well with erigon2.

Backtrace

@AskAlexSharov AskAlexSharov added erigon3 imp1 High importance labels Aug 30, 2024
@sstonehu
Copy link
Author

debug_traceCallMany works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erigon3 imp1 High importance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants