From ca2e576d81cc9bbfba00e2c8cdf3be2694707099 Mon Sep 17 00:00:00 2001 From: maskpp Date: Mon, 26 Sep 2022 10:32:47 +0800 Subject: [PATCH] avoid the unexpected situation (#163) --- eth/tracers/api_blockresult.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eth/tracers/api_blockresult.go b/eth/tracers/api_blockresult.go index 72d0ab63a3..cb3bd6de6a 100644 --- a/eth/tracers/api_blockresult.go +++ b/eth/tracers/api_blockresult.go @@ -356,8 +356,11 @@ func (api *API) fillBlockResult(env *traceEnv, block *types.Block) (*types.Block } } - if err := zkproof.FillBlockResultForMPTWitness(zkproof.MPTWitnessType(api.backend.CacheConfig().MPTWitness), blockResult); err != nil { - log.Error("fill mpt witness fail", "error", err) + // only zktrie model has the ability to get `mptwitness`. + if api.backend.ChainConfig().Zktrie { + if err := zkproof.FillBlockResultForMPTWitness(zkproof.MPTWitnessType(api.backend.CacheConfig().MPTWitness), blockResult); err != nil { + log.Error("fill mpt witness fail", "error", err) + } } return blockResult, nil