This proposal is for making the active elections container more dynamic with regards to how and when it drops blocks. I believe the need for a more dynamic way of managing this container har arisen with the reduction in size and the removal of pow prioritization.
There are two parameters that comes into play here:
TSA: Time since block added to the active election container
VC: The current vote count of the election of the block
First, a quick review of how it is now: A block is added to the active election cointainer after being processed by the election scheduler. When a block is added here it request votes from other reps, and stays in this container for 5 minutes. If it has not reached enough votes go be confirmed after 5 minutes it is dropped and restarted after 30 min, or some other specific criteria which I won't go through now.
My proposal is to make this container more dynamic to avoid it being filled up with blocks during spam that will never be able to be confirmed because other representative nodes are not voting on the same blocks. For clarity the current size of the container is 5k
I suggest that a node will get triggered to start dropping blocks from the active elections container when it is 90% filled up. This to make sure it is rarely completely filled up, so it will allow new blocks to be added from the active elections container.
The criteria for dropping a block would be based on TSA and VC. If the container reaches 90% filled up, it will look up blocks that have been in the container for longer than 10-30 seconds, and drop ones with the lowest vote count. Perhaps there should be a threshold here, that if it is less than 10% from reaching quorum we do not drop it. A block would still be dropped if it has stayed longer than 5 minutes regardless of VC.
Perhaps also together with this we should reduce the wait time for it to being picked up again from 30 min to 5 min or even 2 minutes. The election scheduler should anyway be responsible for picking the block to be added again based on LRU and balance.
I have not considered how this might, if it does, affect bootstrapping, so any input on that would be nice.
Any feedback is welcome