Increase Limit For Rebuilding Field Trie (#15252)

* Increase Limit

* Fix Test
This commit is contained in:
Nishant Das
2025-05-08 12:42:30 +08:00
committed by GitHub
parent a69c033e35
commit 7f89bb3c6f
3 changed files with 6 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ const (
// This specifies the limit till which we process all dirty indices for a certain field.
// If we have more dirty indices than the threshold, then we rebuild the whole trie. This
// comes due to the fact that O(alogn) > O(n) beyond a certain value of a.
indicesLimit = 8000
indicesLimit = 20000
)
// SetGenesisTime for the beacon state.

View File

@@ -400,11 +400,11 @@ func TestDuplicateDirtyIndices(t *testing.T) {
newState.dirtyIndices[types.Balances] = append(newState.dirtyIndices[types.Balances], []uint64{0, 1, 2, 3, 4}...)
// We would remove the duplicates and stay under the threshold
newState.addDirtyIndices(types.Balances, []uint64{9997, 9998})
newState.addDirtyIndices(types.Balances, []uint64{20997, 20998})
assert.Equal(t, false, newState.rebuildTrie[types.Balances])
// We would trigger above the threshold.
newState.addDirtyIndices(types.Balances, []uint64{10000, 10001, 10002, 10003})
newState.addDirtyIndices(types.Balances, []uint64{21000, 21001, 21002, 21003})
assert.Equal(t, true, newState.rebuildTrie[types.Balances])
}