From 20a7093f4c674a8a5851284a5d821c5a5bfcd9fa Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:26:30 +0800 Subject: [PATCH] fix `ZkTrie`'s `GetStorage` (#800) --- trie/zk_trie.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/trie/zk_trie.go b/trie/zk_trie.go index b246b11be9..4c56dcdef5 100644 --- a/trie/zk_trie.go +++ b/trie/zk_trie.go @@ -27,7 +27,6 @@ import ( "github.com/ethereum/go-ethereum/crypto/poseidon" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie/trienode" ) @@ -83,12 +82,7 @@ func (t *ZkTrie) GetAccount(address common.Address) (*types.StateAccount, error) func (t *ZkTrie) GetStorage(_ common.Address, key []byte) ([]byte, error) { sanityCheckByte32Key(key) - enc, err := t.TryGet(key) - if err != nil || len(enc) == 0 { - return nil, err - } - _, content, _, err := rlp.Split(enc) - return content, err + return t.TryGet(key) } func (t *ZkTrie) UpdateAccount(address common.Address, acc *types.StateAccount) error {