-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
Inconsistent tracing output for debug_traceBlockByHash. #29114
Comments
I managed to find at least another example transaction, calling it the first time returned an output similar to the first one, re-executing the same call led to a valid output, without using |
I found another sample with this transaction. We use javascript tracing with the following code: // Copyright 2021 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// callFrameTracer uses the new call frame tracing methods to report useful information
// about internal messages of a transaction.
{
callstack: [{}],
fault: function(log, db) {},
result: function(ctx, db) {
// Prepare outer message info
if (ctx.type === 'SELFDESTRUCT') {
var value = '0x' + db.getBalance(ctx.from).toString(16)
} else {
var value = '0x' + ctx.value.toString(16)
}
var result = {
type: ctx.type,
from: toHex(ctx.from),
to: toHex(ctx.to),
value: value,
gas: '0x' + bigInt(ctx.gas).toString(16),
gasUsed: '0x' + bigInt(ctx.gasUsed).toString(16),
input: toHex(ctx.input),
output: toHex(ctx.output),
}
if (this.callstack[0].calls !== undefined) {
result.calls = this.callstack[0].calls
}
if (this.callstack[0].error !== undefined) {
result.error = this.callstack[0].error
} else if (ctx.error !== undefined) {
result.error = ctx.error
}
if (result.error !== undefined && (result.error !== "execution reverted" || result.output ==="0x")) {
delete result.output
}
return result
},
enter: function(frame) {
var call = {
type: frame.getType(),
from: toHex(frame.getFrom()),
to: toHex(frame.getTo()),
input: toHex(frame.getInput()),
gas: '0x' + bigInt(frame.getGas()).toString('16'),
}
if (frame.getValue() !== undefined){
call.value='0x' + bigInt(frame.getValue()).toString(16)
}
this.callstack.push(call)
},
exit: function(frameResult) {
var len = this.callstack.length
if (len > 1) {
var call = this.callstack.pop()
call.gasUsed = '0x' + bigInt(frameResult.getGasUsed()).toString('16')
var error = frameResult.getError()
if (error === undefined) {
call.output = toHex(frameResult.getOutput())
} else {
call.error = error
if (call.type === 'CREATE' || call.type === 'CREATE2') {
delete call.to
}
}
len -= 1
if (this.callstack[len-1].calls === undefined) {
this.callstack[len-1].calls = []
}
this.callstack[len-1].calls.push(call)
}
}
} Tracing the block for the first time led to this output:
{
"txHash": "0xa9c4a396748be9c664a88028d48c3e27e19211cc11e1fd78f7cbf445f91b5aba",
"result": {
"type": "CALL",
"from": "0x471977571ad818379e2b6cc37792a5eac85fde22",
"to": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"value": "0x0",
"gas": "0x8b4ae",
"gasUsed": "0xd08e",
"input": "0xf99acf2200000000000000000000000000000000000000000000000000000000005110d60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000534632d6d7ad1fe5f832951c97fde73e4efd9a77000000000000000000000000000000000000000000000000000000000008fa180000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2b853066733d66c354d592db1d940965fc292ff4cc9f7077a84e3b2614e0e39e00000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d60000000000000000000000000000000000000000000000000000000000000267f90264a03a55f8ef782e2ffe438caaa3a2c9bd6a52f5e263892ac7118adda640c4109457a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347949b984d5a03980d8dc0a24506c968465424c81dbea0c34d878a86777d3a4b5fa00955dc55be9d1d4a9d85a4518136f34a20b326ab7ca042db2c489b4189539cf82802a028c6e73a9af087363d47defde3d2465f79d2c5a08839128876e61570db40bfbaef3ad2a2d8cdcf0a9b9f7b746946eb91c470dbf4b901000900900e7000409a20110322b114149084732080009010093291632e0528051ee0001a8082a00415e8220950802c74832e01840280e2130185ca182f20292100d088e00a010700004248dc8a8602408f8d071e4425c644011018020040027e308c618058024542179c84c61544486907132d45c60909818001088270a00c8c521390000c00090110f30591a1084090801851022003014020909150001e45da419f98c0e008ac80024060c02a0410022810a3484044418c5f64a004aa7c004204a086326b06ec00100d8028111c2268428930100478ca0005c281902246c4220930528044a2e160d500e24a00a2908104027221300a09021381024b4c31203e8580835110d68401c9c38083b2b0c08465d1b27c99d883010d0b846765746888676f312e32312e36856c696e7578a056e68ad948bbe3d7dbaa1208b9d8bddd754783b94dc392f0cde06f91ecd90d40880000000000000000844a617697a0253c556e4d82ca7c48963896ffce11f6c713b3a04f38cf75476896282a71a30a830c00008404b40000a07a141a1dfd57ea9094af68512cbf5fb3976442a68a16ccf47630e46f99baf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000c0010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440143a12d140daaeed7c76437237030b4b2819bf16bb1a132052ad0e67dcbc531b870000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00163d68fbb608de20b28831c5387f72e8e5cdd385c49cd1c1e746da87bcaf44e5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7004ad65a18e0e7baf5106dd5b5dba038079a66db7b7930dce6798f515f7a2048a5139a7b6d69e4cefaaf85c44a0f99cdbe2e3251c9f65f4e60b8314aedff46b13a101483496d1252e31ba233296c862f8b3b42ae8ae7668bc034486138303ffa64464ac301996bfc5ef446fd06c603f538e9da10723f8e83ab606a87533884320000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001002874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d02",
"output": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000146865616465722068617368206d69736d61746368000000000000000000000000",
"calls": [
{
"type": "DELEGATECALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0xd63ec907e93c793a1f2ffd7a3f04a46a3aec74fd",
"input": "0xf99acf2200000000000000000000000000000000000000000000000000000000005110d60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000534632d6d7ad1fe5f832951c97fde73e4efd9a77000000000000000000000000000000000000000000000000000000000008fa180000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2b853066733d66c354d592db1d940965fc292ff4cc9f7077a84e3b2614e0e39e00000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d60000000000000000000000000000000000000000000000000000000000000267f90264a03a55f8ef782e2ffe438caaa3a2c9bd6a52f5e263892ac7118adda640c4109457a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347949b984d5a03980d8dc0a24506c968465424c81dbea0c34d878a86777d3a4b5fa00955dc55be9d1d4a9d85a4518136f34a20b326ab7ca042db2c489b4189539cf82802a028c6e73a9af087363d47defde3d2465f79d2c5a08839128876e61570db40bfbaef3ad2a2d8cdcf0a9b9f7b746946eb91c470dbf4b901000900900e7000409a20110322b114149084732080009010093291632e0528051ee0001a8082a00415e8220950802c74832e01840280e2130185ca182f20292100d088e00a010700004248dc8a8602408f8d071e4425c644011018020040027e308c618058024542179c84c61544486907132d45c60909818001088270a00c8c521390000c00090110f30591a1084090801851022003014020909150001e45da419f98c0e008ac80024060c02a0410022810a3484044418c5f64a004aa7c004204a086326b06ec00100d8028111c2268428930100478ca0005c281902246c4220930528044a2e160d500e24a00a2908104027221300a09021381024b4c31203e8580835110d68401c9c38083b2b0c08465d1b27c99d883010d0b846765746888676f312e32312e36856c696e7578a056e68ad948bbe3d7dbaa1208b9d8bddd754783b94dc392f0cde06f91ecd90d40880000000000000000844a617697a0253c556e4d82ca7c48963896ffce11f6c713b3a04f38cf75476896282a71a30a830c00008404b40000a07a141a1dfd57ea9094af68512cbf5fb3976442a68a16ccf47630e46f99baf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000c0010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440143a12d140daaeed7c76437237030b4b2819bf16bb1a132052ad0e67dcbc531b870000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00163d68fbb608de20b28831c5387f72e8e5cdd385c49cd1c1e746da87bcaf44e5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7004ad65a18e0e7baf5106dd5b5dba038079a66db7b7930dce6798f515f7a2048a5139a7b6d69e4cefaaf85c44a0f99cdbe2e3251c9f65f4e60b8314aedff46b13a101483496d1252e31ba233296c862f8b3b42ae8ae7668bc034486138303ffa64464ac301996bfc5ef446fd06c603f538e9da10723f8e83ab606a87533884320000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001002874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d02",
"gas": "0x7d1f8",
"value": "0x0",
"gasUsed": "0xd6d",
"error": "execution reverted"
}
],
"error": "execution reverted"
}
} Re-running the exact same {
"txHash": "0xa9c4a396748be9c664a88028d48c3e27e19211cc11e1fd78f7cbf445f91b5aba",
"result": {
"type": "CALL",
"from": "0x471977571ad818379e2b6cc37792a5eac85fde22",
"to": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"value": "0x0",
"gas": "0x8b4ae",
"gasUsed": "0x71b3c",
"input": "0xf99acf2200000000000000000000000000000000000000000000000000000000005110d60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000534632d6d7ad1fe5f832951c97fde73e4efd9a77000000000000000000000000000000000000000000000000000000000008fa180000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2b853066733d66c354d592db1d940965fc292ff4cc9f7077a84e3b2614e0e39e00000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d60000000000000000000000000000000000000000000000000000000000000267f90264a03a55f8ef782e2ffe438caaa3a2c9bd6a52f5e263892ac7118adda640c4109457a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347949b984d5a03980d8dc0a24506c968465424c81dbea0c34d878a86777d3a4b5fa00955dc55be9d1d4a9d85a4518136f34a20b326ab7ca042db2c489b4189539cf82802a028c6e73a9af087363d47defde3d2465f79d2c5a08839128876e61570db40bfbaef3ad2a2d8cdcf0a9b9f7b746946eb91c470dbf4b901000900900e7000409a20110322b114149084732080009010093291632e0528051ee0001a8082a00415e8220950802c74832e01840280e2130185ca182f20292100d088e00a010700004248dc8a8602408f8d071e4425c644011018020040027e308c618058024542179c84c61544486907132d45c60909818001088270a00c8c521390000c00090110f30591a1084090801851022003014020909150001e45da419f98c0e008ac80024060c02a0410022810a3484044418c5f64a004aa7c004204a086326b06ec00100d8028111c2268428930100478ca0005c281902246c4220930528044a2e160d500e24a00a2908104027221300a09021381024b4c31203e8580835110d68401c9c38083b2b0c08465d1b27c99d883010d0b846765746888676f312e32312e36856c696e7578a056e68ad948bbe3d7dbaa1208b9d8bddd754783b94dc392f0cde06f91ecd90d40880000000000000000844a617697a0253c556e4d82ca7c48963896ffce11f6c713b3a04f38cf75476896282a71a30a830c00008404b40000a07a141a1dfd57ea9094af68512cbf5fb3976442a68a16ccf47630e46f99baf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000c0010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440143a12d140daaeed7c76437237030b4b2819bf16bb1a132052ad0e67dcbc531b870000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00163d68fbb608de20b28831c5387f72e8e5cdd385c49cd1c1e746da87bcaf44e5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7004ad65a18e0e7baf5106dd5b5dba038079a66db7b7930dce6798f515f7a2048a5139a7b6d69e4cefaaf85c44a0f99cdbe2e3251c9f65f4e60b8314aedff46b13a101483496d1252e31ba233296c862f8b3b42ae8ae7668bc034486138303ffa64464ac301996bfc5ef446fd06c603f538e9da10723f8e83ab606a87533884320000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001002874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d02",
"output": "0x",
"calls": [
{
"type": "DELEGATECALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0xd63ec907e93c793a1f2ffd7a3f04a46a3aec74fd",
"input": "0xf99acf2200000000000000000000000000000000000000000000000000000000005110d60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000534632d6d7ad1fe5f832951c97fde73e4efd9a77000000000000000000000000000000000000000000000000000000000008fa180000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2b853066733d66c354d592db1d940965fc292ff4cc9f7077a84e3b2614e0e39e00000000000000000000000000000000000000000000000000000000000000020fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d60000000000000000000000000000000000000000000000000000000000000267f90264a03a55f8ef782e2ffe438caaa3a2c9bd6a52f5e263892ac7118adda640c4109457a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347949b984d5a03980d8dc0a24506c968465424c81dbea0c34d878a86777d3a4b5fa00955dc55be9d1d4a9d85a4518136f34a20b326ab7ca042db2c489b4189539cf82802a028c6e73a9af087363d47defde3d2465f79d2c5a08839128876e61570db40bfbaef3ad2a2d8cdcf0a9b9f7b746946eb91c470dbf4b901000900900e7000409a20110322b114149084732080009010093291632e0528051ee0001a8082a00415e8220950802c74832e01840280e2130185ca182f20292100d088e00a010700004248dc8a8602408f8d071e4425c644011018020040027e308c618058024542179c84c61544486907132d45c60909818001088270a00c8c521390000c00090110f30591a1084090801851022003014020909150001e45da419f98c0e008ac80024060c02a0410022810a3484044418c5f64a004aa7c004204a086326b06ec00100d8028111c2268428930100478ca0005c281902246c4220930528044a2e160d500e24a00a2908104027221300a09021381024b4c31203e8580835110d68401c9c38083b2b0c08465d1b27c99d883010d0b846765746888676f312e32312e36856c696e7578a056e68ad948bbe3d7dbaa1208b9d8bddd754783b94dc392f0cde06f91ecd90d40880000000000000000844a617697a0253c556e4d82ca7c48963896ffce11f6c713b3a04f38cf75476896282a71a30a830c00008404b40000a07a141a1dfd57ea9094af68512cbf5fb3976442a68a16ccf47630e46f99baf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000c0010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440143a12d140daaeed7c76437237030b4b2819bf16bb1a132052ad0e67dcbc531b870000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00163d68fbb608de20b28831c5387f72e8e5cdd385c49cd1c1e746da87bcaf44e5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7004ad65a18e0e7baf5106dd5b5dba038079a66db7b7930dce6798f515f7a2048a5139a7b6d69e4cefaaf85c44a0f99cdbe2e3251c9f65f4e60b8314aedff46b13a101483496d1252e31ba233296c862f8b3b42ae8ae7668bc034486138303ffa64464ac301996bfc5ef446fd06c603f538e9da10723f8e83ab606a87533884320000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001002874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d02",
"gas": "0x7d1f8",
"value": "0x0",
"calls": [
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000005",
"input": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d36306000000000000000000000000000000000000000000000000000000000000023073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",
"gas": "0x7149b",
"gasUsed": "0xc8",
"output": "0x5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x000000000000000000000000000000000000000a",
"input": "0x0163d68fbb608de20b28831c5387f72e8e5cdd385c49cd1c1e746da87bcaf44e5e6856c04012bb93b8a0671498f387398d38cc4f07468cebd78b1ef5748164e7004ad65a18e0e7baf5106dd5b5dba038079a66db7b7930dce6798f515f7a2048a5139a7b6d69e4cefaaf85c44a0f99cdbe2e3251c9f65f4e60b8314aedff46b13a101483496d1252e31ba233296c862f8b3b42ae8ae7668bc034486138303ffa64464ac301996bfc5ef446fd06c603f538e9da10723f8e83ab606a8753388432",
"gas": "0x712cb",
"gasUsed": "0xc350",
"output": "0x000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000005",
"input": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200931d596de2fd10f01ddd073fd5a90a976f169c76f039bb91c4775720042d43a000000000000000000000000000000000000000000000000000000000000066d30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001",
"gas": "0x646d3",
"gasUsed": "0xc8",
"output": "0x09da3a7996780c479bb435c95476a58249b61371c94c98dd6a626f8ce97d878a"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000005",
"input": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200931d596de2fd10f01ddd073fd5a90a976f169c76f039bb91c4775720042d43a00000000000000000000000000000000000000000000000000000000000000c430644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001",
"gas": "0x64452",
"gasUsed": "0xc8",
"output": "0x1b3a719e7beec682a2e8c4d5730ce767a4f33d9d3da517c96ed35ca42ccb0ce7"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"input": "0xf398789b2874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d020e29488ca3e0191593fa06c9c10d6962152c78f2263d32f66f5f44d565cf58182298a447c651db04bd5d05ed269d7f1fec3d704042bff2cf4790e47470ad74d509da3a7996780c479bb435c95476a58249b61371c94c98dd6a626f8ce97d878a1b3a719e7beec682a2e8c4d5730ce767a4f33d9d3da517c96ed35ca42ccb0ce70fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d6",
"gas": "0x63324",
"calls": [
{
"type": "DELEGATECALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0xd63ec907e93c793a1f2ffd7a3f04a46a3aec74fd",
"input": "0xf398789b2874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff051642421031ab3334539dbdf25207a8d762be6866e1405cb251433c08ba654b1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e41c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d020e29488ca3e0191593fa06c9c10d6962152c78f2263d32f66f5f44d565cf58182298a447c651db04bd5d05ed269d7f1fec3d704042bff2cf4790e47470ad74d509da3a7996780c479bb435c95476a58249b61371c94c98dd6a626f8ce97d878a1b3a719e7beec682a2e8c4d5730ce767a4f33d9d3da517c96ed35ca42ccb0ce70fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df2bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d6",
"gas": "0x6182d",
"value": "0x0",
"calls": [
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x10a077041c9157dac87c494a03452e6c8990096c9a84d7639f49353b535c52652810c2f73835cf600f07c978f55fe18817c2885e3fc4ac949020107cf7ee814b0e29488ca3e0191593fa06c9c10d6962152c78f2263d32f66f5f44d565cf5818",
"gas": "0x5f992",
"gasUsed": "0x1770",
"output": "0x16b1574f07317e57033dd7ead8ef77168d59428a140851631905052f0f3450e803ef51ae6e64069cac8f6c95a5129054d57727589d8e9f71799a99772317ee72"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x16b1574f07317e57033dd7ead8ef77168d59428a140851631905052f0f3450e803ef51ae6e64069cac8f6c95a5129054d57727589d8e9f71799a99772317ee72305431f2cbe819fd16a18be847911a4ace4d7c886eec337d3b002549e3cf196f0d2684d93f911f00e2d7fa8b423d6f1c74de7f04687d8d65a3f84510398e3ddc",
"gas": "0x5e1c5",
"gasUsed": "0x96",
"output": "0x0d66cd5a135b041426187901793802607952b174d2d3a77d2e94567c506f3b730d68d956152d79dce875fd51856dfe42c663ac46fe10adbbcf4dd197f017299e"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x161b96e55439a2e3fd8b33be69d5c498c178a817ced7b5ad55dfeaa629f628df037022c488f518974889d49dbd029935e6a671da3d747dca6e2a3a870926303d2298a447c651db04bd5d05ed269d7f1fec3d704042bff2cf4790e47470ad74d5",
"gas": "0x5e03c",
"gasUsed": "0x1770",
"output": "0x16189e3298bef04436d8d261cbacf3ec99c6e694cd0beb411293ee925a347b7d19bc7ae1906f628a68247a3501dedb8b062abafca3f1f08f604151671c8a7592"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x16189e3298bef04436d8d261cbacf3ec99c6e694cd0beb411293ee925a347b7d19bc7ae1906f628a68247a3501dedb8b062abafca3f1f08f604151671c8a75920d66cd5a135b041426187901793802607952b174d2d3a77d2e94567c506f3b730d68d956152d79dce875fd51856dfe42c663ac46fe10adbbcf4dd197f017299e",
"gas": "0x5c872",
"gasUsed": "0x96",
"output": "0x0a99db4adae48255e1af7bbe5ae74e08ab199b8822f1602a40f3a488b746785423053ba5983b4aba302d919eed0c9fb8ab279d6890213379a6c3e90c91f1f1ff"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x17f498193bc520aada875e0584b99b605321c6b96b4d01b0027001bb961fd04e00c4c7eae80ad32bd3f2e07e0f6c496053c62426761195ae7faa7388458b0a3409da3a7996780c479bb435c95476a58249b61371c94c98dd6a626f8ce97d878a",
"gas": "0x5c6e9",
"gasUsed": "0x1770",
"output": "0x05fc32147c1c86cdb0031246a36c1a245618d3f50c938721ec21b535684ee2201c81f10ee53a64905cea28bdf9f1ac4769018d11151a2ed1df4db440e41fc499"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x05fc32147c1c86cdb0031246a36c1a245618d3f50c938721ec21b535684ee2201c81f10ee53a64905cea28bdf9f1ac4769018d11151a2ed1df4db440e41fc4990a99db4adae48255e1af7bbe5ae74e08ab199b8822f1602a40f3a488b746785423053ba5983b4aba302d919eed0c9fb8ab279d6890213379a6c3e90c91f1f1ff",
"gas": "0x5af1f",
"gasUsed": "0x96",
"output": "0x2020cad35c4ebb7550b1b6bf4a776bbb143ced9b58cea20b3bc64f8ac768da1710f695fcd09e33dde89789f197a81d231bc8baf46ab58a0a1abbe1c153a14a62"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x2975d86a27bf5c231b312673e80c335625d992e8200deac4f5f10c2159e7a24d094cd49be59c33deefc1d696ed21c34bae02c48d7c3c0d0027a55033b17e21ea1b3a719e7beec682a2e8c4d5730ce767a4f33d9d3da517c96ed35ca42ccb0ce7",
"gas": "0x5ad96",
"gasUsed": "0x1770",
"output": "0x178f66f61bb6073ba5de978682271e4209014d2a2d651255d2777a9a816af73d2d4159e75ecf7bbc63ee1da7f8d74100ffb84ab69d224cf990592a23a3b6361f"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x178f66f61bb6073ba5de978682271e4209014d2a2d651255d2777a9a816af73d2d4159e75ecf7bbc63ee1da7f8d74100ffb84ab69d224cf990592a23a3b6361f2020cad35c4ebb7550b1b6bf4a776bbb143ced9b58cea20b3bc64f8ac768da1710f695fcd09e33dde89789f197a81d231bc8baf46ab58a0a1abbe1c153a14a62",
"gas": "0x595cc",
"gasUsed": "0x96",
"output": "0x1d35771278f3c0d142e71c3d4deb91e2a667010e27f7f5b566dda68c3f6dd1c51befcfa2b84f29f1da0f3488bf5e9c3155cba4dd67eb8fb968303d7eef952f56"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x09d2a4c276ee16cd46bfa0cb5f1b44d122ad6d8e0ee14a3c102053ec543dbc3d1b19e0e7e1ddcd7570e23ae762d55f7d44bc604dc7db27b154c1708d57385c0b0fd01514315c7f99227e01c837d02ab346fcbdc74db09febc31b75bd063f86df",
"gas": "0x59443",
"gasUsed": "0x1770",
"output": "0x04357d8e95088e272658e0b1c6b5c407d112d6d1d8637d7f3a33f04806ff714e1d301cd98447f29ceb5e7c754bdedbdf050cd77ec7c4d71bbe3b6389bf41a7bf"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x04357d8e95088e272658e0b1c6b5c407d112d6d1d8637d7f3a33f04806ff714e1d301cd98447f29ceb5e7c754bdedbdf050cd77ec7c4d71bbe3b6389bf41a7bf1d35771278f3c0d142e71c3d4deb91e2a667010e27f7f5b566dda68c3f6dd1c51befcfa2b84f29f1da0f3488bf5e9c3155cba4dd67eb8fb968303d7eef952f56",
"gas": "0x57c78",
"gasUsed": "0x96",
"output": "0x26056bd16034b82d863fa5a972cd48e4d9280022abbf6802e7e94c4d5d8120690b1d0b564bae445e2772db21cae7d8c30399dec2166cfa6889de515538c8b5d5"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000007",
"input": "0x1591d3b45a480146f4629f9941c392ea161b9db2757f28ff11c7527727d374eb206ad75ee40f8d6e1e0ba3888ec707b29abb5d3295d012bc6b6bd306b4db65282bcfe63c6bdd8179a1c5ff0ea84fa95dfbb3492fb7e640ab4e37b4774b9ac3d6",
"gas": "0x57af0",
"gasUsed": "0x1770",
"output": "0x20628b8cce0271f5f28ea9cf075c142d4bd8b58692a89018f0cb5d32e5ab47bb181db4ee0d9e863ab3d91c04b649d2f445c17376eec80a6147e07f6d40347a02"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000006",
"input": "0x20628b8cce0271f5f28ea9cf075c142d4bd8b58692a89018f0cb5d32e5ab47bb181db4ee0d9e863ab3d91c04b649d2f445c17376eec80a6147e07f6d40347a0226056bd16034b82d863fa5a972cd48e4d9280022abbf6802e7e94c4d5d8120690b1d0b564bae445e2772db21cae7d8c30399dec2166cfa6889de515538c8b5d5",
"gas": "0x56325",
"gasUsed": "0x96",
"output": "0x0fb7e065f6cff04f00156432f8dcba7096b262da117d2ff0cb31243d6711e1612099d815cd89e16cd6fa8b80c39fb92aef88a8eaf56ebe8342e2a43e9cd4f4c7"
},
{
"type": "STATICCALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x0000000000000000000000000000000000000008",
"input": "0x2874769b4a45aa56aa0d9c8d5a77a39d9087bc9d4a12c4cb4e48fe6abcdb58ff2b4e0c30d0fff4f683fca7f88f2f50b4c01eac2901908a3089cf48dacfc297fc1572475ebc3e363d5d37b1847956691d6ee75e168b207d7a99a5a901ef700070093b9c79ec80e1121f2a523efe469d61780be59331c5ed205af1999994e09c78070f796d1bf44ab81bac38c7ecf67bc97c909112f94f0ab9e8ec60fa8b44e4931a3de5d71010f3590e6a371cf712a86b6a8545a07066421d2af5be54084906e410988d6c2d54f28c25a0718015e512c36da5ca9e0b5643d7af02c20f2293646323dfa0a56f85c5491fdced399eb5e13382204b2e6cfef68b4c13769bde43a98a27fc2d45e854d09eac69a6c11777153eb2699536b2580073f8e26d2350265278205ace91468165575227d56963b92cd031e404b6ff8cdff60e0acf15a0fab2670be5bac130e37ea0e1e6c55abd0817a17e7f9027d11a09f4ce4985a7f9bd714e231dd62f292b6811fcd5cdfd9a4c645ab425576bb20fe0ed18f60814d0011bfc0fb7e065f6cff04f00156432f8dcba7096b262da117d2ff0cb31243d6711e1612099d815cd89e16cd6fa8b80c39fb92aef88a8eaf56ebe8342e2a43e9cd4f4c7198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c21800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa1c0ecbd228002384222fa626d57cc1484663b02ffcccdad88ae24ff88d7847f10cbfee411f8b90165a3e52b2f40494a5538ec75ca5ca5c21a1bfdd6cb2893d021c60bc71f85d3120e336087daf45a8386ef48dbedd97fc87f7978b0b35d7e4761813d77586ff1f677d79fdcdb7fe9b4cea4c466e2c908d08d0f636406ae79bc10aa84398ad8517473c42113de0ad583f67b79e07372f761f32938f94e56517972c6c441389cb49117c12d11a33d276a6e7002278ac1a18994b5d8a19cbf99ae6",
"gas": "0x55ff8",
"gasUsed": "0x2c308",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
],
"gasUsed": "0x3659c",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
],
"gasUsed": "0x367f7",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
{
"type": "CALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x187712a3e229498e9e42888761ab9b92bceb46c7",
"input": "0x",
"gas": "0x8fc",
"value": "0x532ee0a06f359",
"gasUsed": "0x0",
"output": "0x"
},
{
"type": "CALL",
"from": "0x804c520d3c084c805e37a35e90057ac32831f96f",
"to": "0x534632d6d7ad1fe5f832951c97fde73e4efd9a77",
"input": "0x",
"gas": "0x8fc",
"value": "0x202b20de0b01b80",
"gasUsed": "0x0",
"output": "0x"
}
],
"gasUsed": "0x65828",
"output": "0x"
}
]
}
} |
We use the same code in mainnet and never run into this issue before. I noticed it frequently occurs with transactions involving this contract. |
At first I thought we are returning the result for another tx, but all the call info between wrong and correct result match. We have a code specific for JS tracers to prepare the state in parallel. My hunch is there is a race there. Still trying to figure it out. In the meanwhile, any reason why you are using this custom JS tracers as opposed to the built-in |
It's mostly because that code has been written a long time ago, back when we used Open Ethereum (ex-Parity). I'll look into migrating to that built-in tracer. |
I've switched to using that built-in tracer, we'll see whether it happens again. |
It seems to be working out so far, it seems your hunch is correct. |
@alecalve could you please run the following RPC to fetch the prestate for the bugged block, and paste the result here so that others can debug it offline in their own environment? for https://sepolia.etherscan.io/block/5287473 {
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"id": 67,
"params": [
"0x50AE31",
{
"timeout": "120s",
"tracer": "prestateTracer"
}
]
} for tx https://sepolia.etherscan.io/tx/0x82082d0f60f925fc5db30a23aff3d75bc19eb38b164ee7213fccacc574e12f23 {
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"id": 67,
"params": [
"0x50AECE",
{
"timeout": "120s",
"tracer": "prestateTracer"
}
]
} for tx https://sepolia.etherscan.io/tx/0xa9c4a396748be9c664a88028d48c3e27e19211cc11e1fd78f7cbf445f91b5aba {
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"id": 67,
"params": [
"0x5110DA",
{
"timeout": "120s",
"tracer": "prestateTracer"
}
]
} |
I've put the output of those requests in this gist. |
thanks for that |
The method var cache []common.Hash
return func(n uint64) common.Hash {
if ref.Number.Uint64() <= n {
// This situation can happen if we're doing tracing and using
// block overrides.
return common.Hash{}
}
// If there's no hash cache yet, make one
if len(cache) == 0 {
cache = append(cache, ref.ParentHash)
} That is, the block context, specifically the This could cause various types of problems, e.g. so that This does suprise me a bit, because I am pretty certain that we already fixed this exact bug once. (Though I'm not 100% certain that the unsafe-gethash-bug is the cause behind this exact ticket) |
BLOCKHASH seems to be invoked in these txes. We can test it with a simple fix: https://github.com/s1na/go-ethereum/tree/tracer/gethash-fix @alecalve can you try this branch and see if you still have that issue? |
#24286 And then I borked it again in https://github.com/ethereum/go-ethereum/pull/24283/files#diff-bd288cd51c1874c7e65ce0d35047c0a98366479c8924606c9efc577f6a98f75cR655 |
System information
The node is running on the Sepolia network.
Geth version:
1.13.11
CL client & version: Lighthouse
OS & Version: Linux
Expected behaviour
The output of calls to
debug_traceBlockByHash
for the same hash and finalized blocks should consistent.Actual behaviour
First call for 0x18a918ff5840857313cfd6c8f4906d8360a6e5df281fd5671137ae9ff6665c40, when looking at transaction 0x591876205f1a7240a56be7ecce03b7e70a7e6e6a1335f05019fc36dcba92d265 returns invalid data, saying the transaction was reverted when it wasn't:
Then I call
debug_traceTransaction
:Subsequent calls to
debug_traceBlockByHash
are now correct:Steps to reproduce the behaviour
I don't know whether it's reproducible.
The text was updated successfully, but these errors were encountered: