@ -31,7 +31,6 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/light"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
@ -273,7 +272,7 @@ func createAccountRequestResponse(t *testPeer, root common.Hash, origin common.H
// Unless we send the entire trie, we need to supply proofs
// Actually, we need to supply proofs either way! This seems to be an implementation
// quirk in go-ethereum
proof := light . NewNode Set( )
proof := trienode . NewProof Set( )
if err := t . accountTrie . Prove ( origin [ : ] , proof ) ; err != nil {
t . logger . Error ( "Could not prove inexistence of origin" , "origin" , origin , "error" , err )
}
@ -283,7 +282,7 @@ func createAccountRequestResponse(t *testPeer, root common.Hash, origin common.H
t . logger . Error ( "Could not prove last item" , "error" , err )
}
}
for _ , blob := range proof . Node List( ) {
for _ , blob := range proof . List ( ) {
proofs = append ( proofs , blob )
}
return keys , vals , proofs
@ -353,7 +352,7 @@ func createStorageRequestResponse(t *testPeer, root common.Hash, accounts []comm
if originHash != ( common . Hash { } ) || ( abort && len ( keys ) > 0 ) {
// If we're aborting, we need to prove the first and last item
// This terminates the response (and thus the loop)
proof := light . NewNode Set( )
proof := trienode . NewProof Set( )
stTrie := t . storageTries [ account ]
// Here's a potential gotcha: when constructing the proof, we cannot
@ -368,7 +367,7 @@ func createStorageRequestResponse(t *testPeer, root common.Hash, accounts []comm
t . logger . Error ( "Could not prove last item" , "error" , err )
}
}
for _ , blob := range proof . Node List( ) {
for _ , blob := range proof . List ( ) {
proofs = append ( proofs , blob )
}
break
@ -411,7 +410,7 @@ func createStorageRequestResponseAlwaysProve(t *testPeer, root common.Hash, acco
if exit {
// If we're aborting, we need to prove the first and last item
// This terminates the response (and thus the loop)
proof := light . NewNode Set( )
proof := trienode . NewProof Set( )
stTrie := t . storageTries [ account ]
// Here's a potential gotcha: when constructing the proof, we cannot
@ -427,7 +426,7 @@ func createStorageRequestResponseAlwaysProve(t *testPeer, root common.Hash, acco
t . logger . Error ( "Could not prove last item" , "error" , err )
}
}
for _ , blob := range proof . Node List( ) {
for _ , blob := range proof . List ( ) {
proofs = append ( proofs , blob )
}
break
@ -599,9 +598,10 @@ func testSyncBloatedProof(t *testing.T, scheme string) {
vals = append ( vals , entry . v )
}
// The proofs
proof := light . NewNode Set( )
proof := trienode . NewProof Set( )
if err := t . accountTrie . Prove ( origin [ : ] , proof ) ; err != nil {
t . logger . Error ( "Could not prove origin" , "origin" , origin , "error" , err )
t . logger . Error ( "Could not prove origin" , "origin" , origin , "error" , err )
}
// The bloat: add proof of every single element
for _ , entry := range t . accountValues {
@ -614,7 +614,7 @@ func testSyncBloatedProof(t *testing.T, scheme string) {
keys = append ( keys [ : 1 ] , keys [ 2 : ] ... )
vals = append ( vals [ : 1 ] , vals [ 2 : ] ... )
}
for _ , blob := range proof . Node List( ) {
for _ , blob := range proof . List ( ) {
proofs = append ( proofs , blob )
}
if err := t . remote . OnAccounts ( t , requestId , keys , vals , proofs ) ; err != nil {