paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Make trie-cache resettable from backend #14516

Closed skunert closed 1 year ago

skunert commented 1 year ago

I have some benchmarks in cumulus where I want to reset the trie cache in between runs.

skunert commented 1 year ago

In general, can you not just recreate the backend? As we do in the Substrate based benchmarks. Then you don't need this function.

You mean like here? https://github.com/paritytech/substrate/blob/da604f1777df6a79ad787f2d960309ffeb9dd68c/client/db/benches/state_access.rs#L212

The substrate benchmarks reset the backend once for each benchmark. For my purposes I want to reset per iteration, so I would need to create a whole new client (not only backend) for each iteration. Being able to reset the trie cache seemed like the more elegant option here. But if you prefer I can look into that.

skunert commented 1 year ago

bot merge

paritytech-processbot[bot] commented 1 year ago

Waiting for commit status.

paritytech-processbot[bot] commented 1 year ago

Merge cancelled due to error. Error: Statuses failed for efaeb51ddb97a26556773e075de1c15da77d4836