@@ -376,8 +376,7 @@ type SyncPeer interface {
376376// - The peer delivers a stale response after a previous timeout
377377// - The peer delivers a refusal to serve the requested state
378378type Syncer struct {
379- db ethdb.KeyValueStore // Database to store the trie nodes into (and dedup)
380- bloom * trie.SyncBloom // Bloom filter to deduplicate nodes for state fixup
379+ db ethdb.KeyValueStore // Database to store the trie nodes into (and dedup)
381380
382381 root common.Hash // Current state trie root being synced
383382 tasks []* accountTask // Current account task set being synced
@@ -446,10 +445,9 @@ type Syncer struct {
446445
447446// NewSyncer creates a new snapshot syncer to download the Ethereum state over the
448447// snap protocol.
449- func NewSyncer (db ethdb.KeyValueStore , bloom * trie. SyncBloom ) * Syncer {
448+ func NewSyncer (db ethdb.KeyValueStore ) * Syncer {
450449 return & Syncer {
451- db : db ,
452- bloom : bloom ,
450+ db : db ,
453451
454452 peers : make (map [string ]SyncPeer ),
455453 peerJoin : new (event.Feed ),
@@ -546,7 +544,7 @@ func (s *Syncer) Sync(root common.Hash, cancel chan struct{}) error {
546544 s .lock .Lock ()
547545 s .root = root
548546 s .healer = & healTask {
549- scheduler : state .NewStateSync (root , s .db , s . bloom ),
547+ scheduler : state .NewStateSync (root , s .db , nil ),
550548 trieTasks : make (map [common.Hash ]trie.SyncPath ),
551549 codeTasks : make (map [common.Hash ]struct {}),
552550 }
@@ -1660,7 +1658,6 @@ func (s *Syncer) processBytecodeResponse(res *bytecodeResponse) {
16601658 bytes += common .StorageSize (len (code ))
16611659
16621660 rawdb .WriteCode (batch , hash , code )
1663- s .bloom .Add (hash [:])
16641661 }
16651662 if err := batch .Write (); err != nil {
16661663 log .Crit ("Failed to persist bytecodes" , "err" , err )
@@ -1796,7 +1793,6 @@ func (s *Syncer) processStorageResponse(res *storageResponse) {
17961793 }
17971794 // Node is not a boundary, persist to disk
17981795 batch .Put (it .Key (), it .Value ())
1799- s .bloom .Add (it .Key ())
18001796
18011797 bytes += common .StorageSize (common .HashLength + len (it .Value ()))
18021798 nodes ++
@@ -1953,7 +1949,6 @@ func (s *Syncer) forwardAccountTask(task *accountTask) {
19531949 }
19541950 // Node is neither a boundary, not an incomplete account, persist to disk
19551951 batch .Put (it .Key (), it .Value ())
1956- s .bloom .Add (it .Key ())
19571952
19581953 bytes += common .StorageSize (common .HashLength + len (it .Value ()))
19591954 nodes ++
0 commit comments