Post
Topic
Board Development & Technical Discussion
Re: Elastic block cap with rollover penalties
by
klondike_bar
on 04/06/2015, 12:54:14 UTC
Code:
max block size = 10 * (median size of last 144 blocks) * (% of transactions with a fee higher than median transaction fee for last 144 blocks * 2)

Code:
max block size = 20 * (median size of last 1200 blocks) * (% of transactions with a fee higher than median transaction fee for last 600 blocks)

I think the above simplifies your equation slightly, and uses better timeframes (~200hrs and ~50hrs) to compute the averages.

my biggest concern is what would happen in a spam attack, which could easily last several days, to as much as a week, if a quick-changing algorithm can be played to drastically increase blocksize during that time.

lets look at your original equation: assume that blocks are 0.5MB for the last 144 blocks (thus the block limit will probably be set to something like 5-10MB), but then spam attacks start. you see every block filled with 5MB of spam, 95% of transactions below the median for fees. after 144 blocks of this (1 day), you get something like this:
Code:
max block size = 10 * (5MB) * (0.05 * 2) = 50*0.1 = 5MB
which seems to resist growing any larger.

however, the median transaction fee drastically drops as a result, and in a continued attack soon you could see that ~10% of transactions pay more than the median fee.

Code:
max block size = 10 * (5MB) * (0.1 * 2) = 10MB
   If this attack persisted for 3-4 days you could see the blocksize increase to >20MB very fast, and >60MB within a week (would likely require very well-funded spammers though)

longer timeframes are absolutely necessary, bare minimum should be 600 blocks for calculations.