-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented the limit per fee currency #2203
Conversation
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2203 +/- ##
=======================================
Coverage 55.09% 55.09%
=======================================
Files 682 683 +1
Lines 114449 114533 +84
=======================================
+ Hits 63055 63106 +51
- Misses 47501 47536 +35
+ Partials 3893 3891 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach looks right to me, left one additional comment inline.
f7f9c57
to
b2430f7
Compare
Coverage from tests in coverage: 46.9% of statements across all listed packagescoverage: 57.2% of statements in consensus/istanbul coverage: 23.7% of statements in consensus/istanbul/announce coverage: 54.3% of statements in consensus/istanbul/backend coverage: 0.0% of statements in consensus/istanbul/backend/backendtest coverage: 24.3% of statements in consensus/istanbul/backend/internal/replica coverage: 65.1% of statements in consensus/istanbul/core coverage: 45.0% of statements in consensus/istanbul/db coverage: 0.0% of statements in consensus/istanbul/proxy coverage: 64.2% of statements in consensus/istanbul/uptime coverage: 51.8% of statements in consensus/istanbul/validator coverage: 79.2% of statements in consensus/istanbul/validator/random |
b2430f7
to
ceac8c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few comments, one is something to change and the others are more opinionated about the defaults.
On the other hand, I've also checked what could happen in the case of having a validator accepting a proposal that whitelists a new currency, and in the same block sending a tx with that field, but we are not allowing that because we are checking against the whitelist that we have in the block context, which won't change until the next one, so we won't have that scenario.
93f2691
to
12c8f46
Compare
39cf5da
to
8fd6e46
Compare
8fd6e46
to
6434d6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, optional nit
Description
In the light of the recent growth of interest in extending of the gas currencies allowlist, we need to implement a protective mechanism that would allow validators more precisely control the percentage of available block space used paid with an alternative fee currency (other than CELO).
Goals
Proposed Solution
Add a flag
celo.feecurrency.limits
with a comma-separated currency addresshash=limit
mappings for currencies listed in theFeeCurrencyWhitelist
contract, where limit represents the maximal fraction of the block gas limit as a float point number available for the given fee currency.For example,
--celo.feecurrency.limits=0x765DE816845861e75A25fCA122bb6898B8B1282a=0.1,0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73=0.05;0xEd6961928066D3238134933ee9cDD510Ff157a6e=0
.Add an overridable default value
celo.feecurrency.default
(initially set to 0.5 ) for currencies not listed in the map, meaning that if not specified otherwise, a TX with a given fee currency can take up to 50% of the block space.CELO token doesn’t have a limit.
Default Configuration
Based on historical data we will use this default configuration:
It imposes the following limits:
cUSD
up to 90%cEUR
up to 50%cREAL
up to 50%any other token except CELO - 50%
Other changes
No.
Tested
Added tests.
Backwards compatibility
Yes, both flags have default options. Behavior-wise, the effect should be similar to what we observe now.
It would be easier to review by following the commits.