EGL
Search…
Calculating desiredEgl
The initial value for desiredEGL at launch will equal the current gas limit at launch, e.g. 15M gas.
Each vote specifies the voter’s desired gasTarget, as well as an eglAmount and lockupDuration, and the weekly tally calculates the weighted average of all the votes’ gasTarget to determine the desiredEGL.
The votes are weighted based on eglAmount (the more EGLs you use, the stronger your vote) and lockupDuration (1 to 8 weeks; the longer you lockup your EGLs, the stronger your vote). Specifically, weight = eglAmount * lockupDuration , and the weighted average is calculated as
$\frac{\sum_i (targetGasLimit_i * weight_i)}{ \sum_i weight_i}$
desiredEGLis calculated by storing and updating 2 variables:
1. 1.
sum of all voters’ eglAmount * lockupDuration
2. 2.
sum of all voters’ eglAmount * lockupDuration * gasTarget
When tallyVotes() is called, the weighted average is calculated, and desiredEGL is adjusted towards it, but by no more than 1M gas.
To avoid manipulation of the weighted average by using very high / low values for gasTarget, the value of gasTargetmust be close to the actual gas limit of the block in which the vote()/revote()Tx is mined.
If the desiredEGL is within 10,000 of the tallyVotesGasLimit,functionally the community is voting to keep the gas limit the same. For simplicity, thedesiredEGL will be set totallyVotesGasLimit.
Specifically, the delta between the two must be no greater than 4M gas. To protect honest users from having their Tx fail due to jitters in the gas limit, the UI provided at egl.vote allows a delta of up to 3M gas between gasTargetand the current gas limit. Sophisticated users can of course bypass this limitation, and carry the risk of having their Tx fail.
If your vote for a given epoch was within 4M of the gas at the time of the vote, but you've locked in your vote for several weeks and now it is outside of the 4M range, it will still be included in the desiredEGL calculation. For example, if you voted for 7M gas when the current gas was 10M and now the current gas is 13M, your 7M vote will still be included as (7M * your multiplier) in the calculation. However, remember that the desiredEGL cannot change by more than 1M each week.
desiredEGL is calculated when tallyvotes() is called for the first time after the epoch has ended. Thus, someone needs to call tallyvotes() after an epoch has ended to ensure desiredEGL is calculated.