Skip to content

Commit

Permalink
fix getProof API when zktrie is enabled (#132)
Browse files Browse the repository at this point in the history
fix getProof under zktrie
  • Loading branch information
noel2004 authored Jul 27, 2022
1 parent eb11a84 commit fefa8b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,13 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
return nil, err
}

zktrie := s.b.ChainConfig().Zktrie

storageTrie := state.StorageTrie(address)
storageHash := types.EmptyRootHash
var storageHash common.Hash
if !zktrie {
storageHash = types.EmptyRootHash
}
codeHash := state.GetCodeHash(address)
storageProof := make([]StorageResult, len(storageKeys))

Expand Down
6 changes: 6 additions & 0 deletions les/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package les

import (
"crypto/ecdsa"
"errors"
"time"

"github.com/scroll-tech/go-ethereum/common/mclock"
Expand Down Expand Up @@ -81,6 +82,11 @@ func NewLesServer(node *node.Node, e ethBackend, config *ethconfig.Config) (*Les
if err != nil {
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
// requests based on the user-specified value.
threads := config.LightServ * 4 / 100
Expand Down

0 comments on commit fefa8b9

Please sign in to comment.