paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.com/
1.89k stars 696 forks source link

Efficient upsert of exposures in multi-paged election #6499

Open gpestana opened 1 day ago

gpestana commented 1 day ago

Currently, the implementation in https://github.com/paritytech/polkadot-sdk/pull/6034 of upserting exposures when the election supports are fetched in a multi-page way, the whole exposure page is read from storage.

Figure out a way to append up to n exposures to a paged exposure type without having to read the whole struct from memory. This will most likely require to implement a new sp_io primitive.