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

Failed to load root for contract #4501

Open
envestcc opened this issue Nov 22, 2024 · 1 comment
Open

Failed to load root for contract #4501

envestcc opened this issue Nov 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@envestcc
Copy link
Member

What version of iotex-core image (or code branch) are you using?

v2.0.8

What operating system and processor architecture are you using?

What did you do? If possible, provide a recipe for reproducing the error.

some eth_call

What did you expect to see?

What did you see instead?

{"level":"error","ts":"2024-11-22T08:22:35.020Z","caller":"evm/evmstatedbadapter.go:694","msg":"Failed to load root for contract.","ioAddr":"io1sllhya07z4lseycxaar68zan9sa39lnn50w0cv","error":"failed to get key e6b9527498beb3cfb8e86d0f91d0ff334168cf289ca00f11f65e1c3b5f682ecf: failed to find key e6b9527498beb3cfb8e86d0f91d0ff334168cf289ca00f11f65e1c3b5f682ecf: not exist in DB","errorVerbose":"not exist in DB
github.com/iotexproject/iotex-core/v2/db.init
	/go/apps/iotex-core/db/builder.go:7
runtime.doInit1
	/usr/local/go/src/runtime/proc.go:6740
runtime.doInit
	/usr/local/go/src/runtime/proc.go:6707
runtime.main
	/usr/local/go/src/runtime/proc.go:249
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1650
failed to find key e6b9527498beb3cfb8e86d0f91d0ff334168cf289ca00f11f65e1c3b5f682ecf
github.com/iotexproject/iotex-core/v2/action/protocol.(*kvStoreForTrie).Get
	/go/apps/iotex-core/action/protocol/kvstorefortrie.go:64
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).loadNode
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:305
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).setRootHash
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:247
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).SetRootHash
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:150
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.(*contract).LoadRoot
	/go/apps/iotex-core/action/protocol/execution/evm/contract.go:153
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.(*StateDBAdapter).RevertToSnapshot
	/go/apps/iotex-core/action/protocol/execution/evm/evmstatedbadapter.go:693
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:249
github.com/ethereum/go-ethereum/core/vm.opCall
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/instructions.go:669
github.com/ethereum/go-ethereum/core/vm.(*EVMInterpreter).Run
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/interpreter.go:234
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:241
github.com/ethereum/go-ethereum/core/vm.opCall
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/instructions.go:669
github.com/ethereum/go-ethereum/core/vm.(*EVMInterpreter).Run
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/interpreter.go:234
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:241
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.executeInEVM
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:505
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.ExecuteContract
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:245
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.SimulateExecution
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:671
github.com/iotexproject/iotex-core/v2/state/factory.(*stateDB).SimulateExecution
	/go/apps/iotex-core/state/factory/statedb.go:291
github.com/iotexproject/iotex-core/v2/api.(*coreService).simulateExecution
	/go/apps/iotex-core/api/coreservice.go:1958
github.com/iotexproject/iotex-core/v2/api.(*coreService).ReadContract
	/go/apps/iotex-core/api/coreservice.go:591
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).call
	/go/apps/iotex-core/api/web3server.go:413
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).handleWeb3Req
	/go/apps/iotex-core/api/web3server.go:174
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).HandlePOSTReq
	/go/apps/iotex-core/api/web3server.go:123
github.com/iotexproject/iotex-core/v2/api.(*hTTPHandler).ServeHTTP
	/go/apps/iotex-core/api/http.go:71
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*Handler).ServeHTTP
	/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/[email protected]/handler.go:212
net/http.(*ServeMux).ServeHTTP
	/usr/local/go/src/net/http/server.go:2514
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2938
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:2009
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1650
failed to get key e6b9527498beb3cfb8e86d0f91d0ff334168cf289ca00f11f65e1c3b5f682ecf
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).loadNode
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:307
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).setRootHash
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:247
github.com/iotexproject/iotex-core/v2/db/trie/mptrie.(*merklePatriciaTrie).SetRootHash
	/go/apps/iotex-core/db/trie/mptrie/merklepatriciatrie.go:150
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.(*contract).LoadRoot
	/go/apps/iotex-core/action/protocol/execution/evm/contract.go:153
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.(*StateDBAdapter).RevertToSnapshot
	/go/apps/iotex-core/action/protocol/execution/evm/evmstatedbadapter.go:693
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:249
github.com/ethereum/go-ethereum/core/vm.opCall
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/instructions.go:669
github.com/ethereum/go-ethereum/core/vm.(*EVMInterpreter).Run
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/interpreter.go:234
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:241
github.com/ethereum/go-ethereum/core/vm.opCall
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/instructions.go:669
github.com/ethereum/go-ethereum/core/vm.(*EVMInterpreter).Run
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/interpreter.go:234
github.com/ethereum/go-ethereum/core/vm.(*EVM).Call
	/go/pkg/mod/github.com/iotexproject/[email protected]/core/vm/evm.go:241
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.executeInEVM
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:505
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.ExecuteContract
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:245
github.com/iotexproject/iotex-core/v2/action/protocol/execution/evm.SimulateExecution
	/go/apps/iotex-core/action/protocol/execution/evm/evm.go:671
github.com/iotexproject/iotex-core/v2/state/factory.(*stateDB).SimulateExecution
	/go/apps/iotex-core/state/factory/statedb.go:291
github.com/iotexproject/iotex-core/v2/api.(*coreService).simulateExecution
	/go/apps/iotex-core/api/coreservice.go:1958
github.com/iotexproject/iotex-core/v2/api.(*coreService).ReadContract
	/go/apps/iotex-core/api/coreservice.go:591
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).call
	/go/apps/iotex-core/api/web3server.go:413
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).handleWeb3Req
	/go/apps/iotex-core/api/web3server.go:174
github.com/iotexproject/iotex-core/v2/api.(*web3Handler).HandlePOSTReq
	/go/apps/iotex-core/api/web3server.go:123
github.com/iotexproject/iotex-core/v2/api.(*hTTPHandler).ServeHTTP
	/go/apps/iotex-core/api/http.go:71
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*Handler).ServeHTTP
	/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/[email protected]/handler.go:212
net/http.(*ServeMux).ServeHTTP
	/usr/local/go/src/net/http/server.go:2514
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2938
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:2009
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1650","addrHash":"3e8bd57eb43bbda79d0423c138a1db3dca754076"}
@envestcc envestcc added the bug Something isn't working label Nov 22, 2024
@envestcc
Copy link
Member Author

It's caused by updated statedb when putblock, which is using in eth_call. Fixing this issue will require waiting for support for the historical factory feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant