(Mis) Configuring pallet-elections-phragmen

We have identified there are possibly mis-configured elections-phragmen pallet.

The gist of the issue is that this pallet performs the full election process (phragmen algorithm by default) onchain, and on_initialize . This, if overweight, will cause your chain to stall.

To fix this, there are number of things you need to know:

as a side note, low deposits also played a role in this attack: Thoughts on governance security and configs for parachains

The main problem we have seen is that some have set these numbers to really high values like 10,000 voters. These number are possible copy-pasted from substrate’s kitchensink-runtime . Don’t do that! The configurations of this runtime are not meant for production use.

3 Likes