Skip to content

Commit 7f89bb3

Browse files
authored
Increase Limit For Rebuilding Field Trie (#15252)
* Increase Limit * Fix Test
1 parent a69c033 commit 7f89bb3

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

beacon-chain/state/state-native/setters_misc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const (
3939
// This specifies the limit till which we process all dirty indices for a certain field.
4040
// If we have more dirty indices than the threshold, then we rebuild the whole trie. This
4141
// comes due to the fact that O(alogn) > O(n) beyond a certain value of a.
42-
indicesLimit = 8000
42+
indicesLimit = 20000
4343
)
4444

4545
// SetGenesisTime for the beacon state.

beacon-chain/state/state-native/state_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ func TestDuplicateDirtyIndices(t *testing.T) {
400400
newState.dirtyIndices[types.Balances] = append(newState.dirtyIndices[types.Balances], []uint64{0, 1, 2, 3, 4}...)
401401

402402
// We would remove the duplicates and stay under the threshold
403-
newState.addDirtyIndices(types.Balances, []uint64{9997, 9998})
403+
newState.addDirtyIndices(types.Balances, []uint64{20997, 20998})
404404
assert.Equal(t, false, newState.rebuildTrie[types.Balances])
405405

406406
// We would trigger above the threshold.
407-
newState.addDirtyIndices(types.Balances, []uint64{10000, 10001, 10002, 10003})
407+
newState.addDirtyIndices(types.Balances, []uint64{21000, 21001, 21002, 21003})
408408
assert.Equal(t, true, newState.rebuildTrie[types.Balances])
409409
}
410410

changelog/nisdas_increase_limit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Changed
2+
3+
- Increase indices limit in field trie rebuilding.

0 commit comments

Comments
 (0)