From 65bebf30ec41b4f349e00219a44305651ac05582 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 15 Nov 2023 14:40:15 +0100 Subject: [PATCH] trie: only check ~5% of all trie nodes --- trie/sync_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trie/sync_test.go b/trie/sync_test.go index d9b4f93c1b..0e7a7a84f5 100644 --- a/trie/sync_test.go +++ b/trie/sync_test.go @@ -19,6 +19,7 @@ package trie import ( "bytes" "fmt" + "math/rand" "testing" "github.com/ethereum/go-ethereum/common" @@ -585,9 +586,12 @@ func testIncompleteSync(t *testing.T, scheme string) { }) } } - // Sanity check that removing any node from the database is detected for i, path := range addedKeys { + if rand.Int31n(100) > 5 { + // Only check 5 percent of added keys as a sanity check + continue + } owner, inner := ResolvePath([]byte(path)) nodeHash := addedHashes[i] value := rawdb.ReadTrieNode(diskdb, owner, inner, nodeHash, scheme)