Closed koute closed 3 years ago
Maybe relates to https://github.com/paritytech/polkadot/issues/3053#issuecomment-848991368 as well. Something isn't right.
Two things to fix here:
Externalities::next_storage_key
should not be recursive.None
items in the overlay, it will iterate them all until it finds an existing key. Instead the overlay should probably maintain two separate BtreeMap
s for existing and non-existing key.
I was doing some memory profiling over the weekend, and over the course of 60h of profiling I've got this stack trace that was 5763 frames long:
The
<sp_state_machine::ext::Ext<H,N,B> as sp_externalities::Externalities>::next_storage_key
appears 5693 times in total in this stack trace; looks like unbound recursion.This happened during a fresh sync of a new node on Kusama, with interpreted WASM execution, with freshly compiled
polkadot
fromf0ce0ca1f8b03d5ad3b80ce66793f18bde21cd14
.Probably the same issue as https://github.com/paritytech/substrate/issues/4527 if I'd had to guess.