-
Notifications
You must be signed in to change notification settings - Fork 28
Add RSKIP 433 #433
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
Open
rmoreliovlabs
wants to merge
6
commits into
master
Choose a base branch
from
stable-min-gas-price
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add RSKIP 433 #433
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b058ee6
Initial commit
rmoreliovlabs 07f3d84
Updating RSKIP number
rmoreliovlabs 2bd9446
Fixing typo
rmoreliovlabs c71f5df
Rename RSKIP title and add backwards compatibility section
rmoreliovlabs 85dda57
Fixing typo
rmoreliovlabs 2b52a8d
Fixing wording
rmoreliovlabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| --- | ||
| rskip: 433 | ||
| title: Stable Minimum Gas Price | ||
| description: | ||
| status: Draft | ||
| purpose: Usa | ||
| author: RM | ||
| layer: Core | ||
rmoreliovlabs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| complexity: 2 | ||
| created: 2024-06 | ||
| --- | ||
| # Stable Minimum Gas Price | ||
|
|
||
|
|
||
| |RSKIP | 433 | | ||
| | :------------ |:-------------| | ||
| |**Title** |Stable Minimum Gas Price| | ||
| |**Created** |JUNE-2024 | | ||
| |**Author** |RM | | ||
| |**Purpose** |Usa | | ||
| |**Layer** |Core | | ||
| |**Complexity** |2 | | ||
| |**Status** |Draft | | ||
|
|
||
| # **Abstract** | ||
|
|
||
| This RSKIP proposes a feature that allows RSK miners to configure the minimum gas price (MinGasPrice) in fiat currency instead of the current cryptocurrency (WEI) linked to Bitcoin. | ||
rmoreliovlabs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Motivation | ||
|
|
||
| In the current RSK network, miners have the ability to set the minimum gas price through the `miner.minGasPrice` configuration, which is denominated in WEI. This parameter is essentially linked to the Bitcoin price, causing the gas price to vary in correlation with Bitcoin's value. This behavior creates uncertainty in transaction costs, often leading to increased costs when Bitcoin prices go up. This unpredictability can negatively impact user experience, as transaction fees become less stable. | ||
|
|
||
| This can be solved adding a new feature that allows miners to specify and configure the minimum gas price in fiat currency. By decoupling gas prices from Bitcoin's market fluctuations, this property aims to stabilize transaction costs in terms of fiat value, thereby improving predictability. This approach not only protects users from the volatility of cryptocurrency markets but also provides a better user experience. | ||
|
|
||
| ## Specification | ||
|
|
||
| We could introduce a new configuration property, `stableMinGasPrice` to specify the minimum gas price in fiat currency. Key elements of this configuration include: | ||
| 1. **Enabled Flag:** Adding the `enabled` flag to disable the stable gas price feature. If this value is false, then the system should behave as it currently does, using the `miner.minGasPrice` configuration. | ||
| 2. **source.method:** Defines the method to retrieve the Bitcoin price. It can be one of these 2 methods: | ||
| * `HTTP_GET`: Simple HTTP Get request to fetch the price. | ||
| * `ETH_CALL`: Call to a Smart Contract that returns the price. | ||
| 3. **Minimum Stable Gas Price:** `minStableGasPrice` to specify the minimum gas price in the chosen fiat currency. | ||
| 4. **Refresh Rate:** `refreshRate` to determine how often the Bitcoin price should be refreshed. | ||
|
|
||
| It should look something like this: | ||
| ``` | ||
| miner { | ||
| # The default gas price | ||
| minGasPrice = 4265280000000 | ||
|
|
||
| stableGasPrice { | ||
| enabled = false | ||
| minStableGasPrice = 4265280000000 # 0.00000426528 USD per gas unit | ||
| refreshRate = 360 | ||
| method = HTTP_GET || ETH_CALL | ||
|
|
||
| # Examples: | ||
| # method = "HTTP-GET" | ||
| # params { | ||
| # url = "https://domain.info/ticker" | ||
| # jsonPath = "/USD/buy" | ||
| # timeout = 2 seconds | ||
| # } | ||
| # | ||
| # method = "ETH_CALL" | ||
| # params { | ||
| # from: "0xcd2a3d9f938e13cd947ec05abc7fe734df8dd825", | ||
| # to: "0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826", | ||
| # data: "0x8300df49" | ||
| # } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| When the `stableGasPrice` feature is **enabled**, we should adjust the behavior to retrieve BTC price data according to the he cached _minStableGasPrice_ or the specified method to keep transaction costs stable in fiat currency (like USD or EUR). It first checks if there is a recent, **cached** Bitcoin price within the defined _refresh rate_ and uses this value if available. If no valid cached price exists, it fetches the latest Bitcoin price using the specified method (HTTP_GET or ETH_CALL). | ||
|
|
||
| If the price retrieval fails but a cached price is still valid, the system uses the cached price. If **both** the price fetch and cached price are unavailable, it defaults to the original `minGasPrice` setting. | ||
|
|
||
| ## Rationale | ||
|
|
||
| The mechanism would only trigger if a RSK miner configures the minimumGasPrice in fiat currency by enabling `stableGasPrice` in the configuration settings. | ||
|
|
||
| ## Backwards Compatibility | ||
|
|
||
| This feature would be backwards compatible, as it is just a node behavior change and it ensures that existing configurations and functionalities remain intact for users who choose not to adopt or enable the `stableGasPrice` setting. | ||
rmoreliovlabs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # **Copyright** | ||
|
|
||
| Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,6 +228,7 @@ You can find an easily browseable version of this information [here](https://ips | |
| | 415 |[Fix pegnatories address derivation from public keys](IPs/RSKIP415.md)| 30-JAN-24 | MI | Usa | Core | 1 | Adopted | | ||
| | 417 |[Avoid transactions to be reverted when Bridge method calls from smart contracts return an empty response](IPs/RSKIP417.md)| 28-FEB-24 | MI | Usa | Core | 1 | Adopted | | ||
| | 419 |[Powpeg Spendability Validation Protocol](IPs/RSKIP419.md)| 31-AUG-23 | JD, JZ | Sec | Core | 2 | Draft | | ||
| | 433 |[StableMinGasPrice](IPs/RSKIP433.md)| 06-JUNE-24 | RM | Usa | Core | 2 | Draft | | ||
|
|
||
| (*) Under evaluation to be implemented in the next reference client release | ||
|
|
||
|
|
@@ -265,6 +266,7 @@ You can find an easily browseable version of this information [here](https://ips | |
| | SM | Shreemoy Mishra | [email protected] | | ||
| | SMS | Sebastian Matias Sicardi | | | ||
| | VK | Volodymyr Kravets | [email protected] | | ||
| | RM | Reynold Morel | [email protected] | | ||
|
|
||
| ## Build locally | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.