mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
fix getProof API when zktrie is enabled (#132)
fix getProof under zktrie
This commit is contained in:
parent
eb11a84c56
commit
fefa8b99c7
2 changed files with 12 additions and 1 deletions
|
|
@ -657,8 +657,13 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zktrie := s.b.ChainConfig().Zktrie
|
||||||
|
|
||||||
storageTrie := state.StorageTrie(address)
|
storageTrie := state.StorageTrie(address)
|
||||||
storageHash := types.EmptyRootHash
|
var storageHash common.Hash
|
||||||
|
if !zktrie {
|
||||||
|
storageHash = types.EmptyRootHash
|
||||||
|
}
|
||||||
codeHash := state.GetCodeHash(address)
|
codeHash := state.GetCodeHash(address)
|
||||||
storageProof := make([]StorageResult, len(storageKeys))
|
storageProof := make([]StorageResult, len(storageKeys))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package les
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/scroll-tech/go-ethereum/common/mclock"
|
"github.com/scroll-tech/go-ethereum/common/mclock"
|
||||||
|
|
@ -81,6 +82,11 @@ func NewLesServer(node *node.Node, e ethBackend, config *ethconfig.Config) (*Les
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// Now disable for zktrie
|
||||||
|
if e.BlockChain().Config().Zktrie {
|
||||||
|
return nil, errors.New("light server not work with zktrie storage")
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate the number of threads used to service the light client
|
// Calculate the number of threads used to service the light client
|
||||||
// requests based on the user-specified value.
|
// requests based on the user-specified value.
|
||||||
threads := config.LightServ * 4 / 100
|
threads := config.LightServ * 4 / 100
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue