w3f / polkadot-payouts

Apache License 2.0
17 stars 7 forks source link

Optimize looping logic #51

Open Nexus2k opened 2 years ago

Nexus2k commented 2 years ago

Right now the polkadot-payouts tool doesn't scale very well. It iterates thru the blockchain for every single Stash address.

We should instead change the logic to iterate thru the blockchain and store all pending payouts in a Map[stash][num_pending_payouts] or so and then compare it to the configured addresses and claim for all of them. This should make execution time much faster.

@ironoa FYI

Nexus2k commented 2 years ago

In https://github.com/w3f/polkadot-payouts/pull/50 we've parallelised the looping logic, however that will not be the optimal solution because: