crypto-econ-lab
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: Gas, Research proposals, Almanac --- # Gas lanes. ## TL;DR While we believe that *gas gentrification* is unlikely to occur at the early stages of FVM launch, we see a lot of value in understanding, proposing and testing possibles mitigation strategies. Motivated by this, we investigate the idea of so-called *gas lanes* as a potential solution to the *gas gentrification issue*. We also discuss possibles extensions to the proposed model, and we also identify some potential drawbacks from the proposed solution. ## 1. Introduction The Filecoin Virtual Machine (FVM) is quickly rising in popularity and it is posed to attract a larger and much welcome user base to the Filecoin network. However, one as-of-now hypothetical, but serious scenario that this larger user base might bring is what we call *gas gentrification.* In short, this refers to the phenomena where demand for FVM-related messages is so high that either (i) it drives the base fee upwards to a point where it might become difficult for some miners to submit network-critical messages (such as onboarding, sector recovery of proofs of storage) or (ii) that FVM users are simply willing to pay significantly higher tips to get their messages included, and thus pricing out some storage providers. Either case (which again, are purely hypotethical as of the time of writing) is a scenario that could potentially harm the network. In this writeup we investigate the idea of so-called *gas lanes* as a potential solution to the *gas gentrification issue*. *Gas lanes* (also known as *multi-dimensional gas*) refer to the idea of dividing the block space into multiple parallel *lanes*, each with its own target block size, gas limit, and EIP1559-like pricing mechanism. In this setting, each lane would be intended for a specific type of message, such as, e.g., network-related maintenace messages, data onboarding, or FVM-related messages, and each type of message will be priced according to the resources consumed in each lane. We present two examples to illustrate the point. We emphasize that the values taken in those examples are purely chosen for illustration purposes, and are not to be understood as a specific recommendation. --- **Example I.** Let's say that we introduce two gas lanes: - FVM lane: 30% of the maximum block size, with a target of 15% of the maximum block size. This includes FVM related messages such as `invokeContract`. - Status-Quo lane: 70% of the maximum block, with a target of 35% of the maximum block size. This lane wouls include all other non-FVM messages such as `SubmitWindowdPost`, as well as the recovery messages. Essentilly, it would correspond to the Filecoin network pre-FVM. --- **Example II.** Let's now consider a case with three gas lanes: - SP maintenace lane: 20% of the maximum block size, with a target of 10% of the maximum block size. This would include messages such as `SubmitWindowdPost`, as well as the recovery messages. - Data onboarding lane: 50% of the block, with a target of 25% of the maximum block size. This lane would include messages such as `PreCommitSector`, `ProveCommitSector`, `PreCommitBatch` and `ProveCommitAggregate`. - 'Others' lane: 30% of the max. block size, with a target of 15%. This lane would include all other types of messages, including all FVM-related messages. --- **Remark.** *It might not always be straightforward to identify the difference among these messages (e.g., an FVM contract that takes care of SP maintenance messages); and as such one needs to be careful with the classification.* In this setting, the network would identify the lane each message belongs to, and miners will process messages in each lane according to their given preference (e.g., in descinding order of tips). If a lane runs out of gas before all the messages are processed, the remaining messages would be processed in the next block for that lane. Once messages are packed, the base fee for each lane would be adjusted dynamically based on the demand for that particular lane. For example, if the 'Others' lane is experiencing high demand, the base fee for that lane would increase, making it more expensive for senders to submit messages to that lane. This would help balance the demand for each lane and ensure that the network operates efficiently. **Intuitively, it will also solve the issue of having FVM users "pricing out" miners from their maintenance messages, as these messages are in two separate and independent lanes** Overall, a version of the Filecoin 1559 mechanism that utilizes gas lanes intended for specific types of messages would aim to improve the efficiency and throughput of the network by allowing for more granular fee adjustments and better responsiveness to changes in demand for specific types of messages. However, there is no free lunch and this would also require careful design and testing to ensure its safety and reliability. We also remark that is also not immediately clear for us at the CEL how technically challenging the implementaiton of such a mechanism would be. The rest of the writeup is organized as follows. We introduce the proposed model in Section 2. In particular, we argue how a simple Transaction Fee Mechnism (TFM) with gas lanes can be constructed as an extension of the EIP1559 TFM. In Section 3 we discuss several extensions and generalizations to the proposed model. We present a critique of the proposed mechanism in Section 4, and mentioned some related works in Section 5. ## 2. Model. We begin by stating a perhaps obvious, but important (and not so innocent) assumption. **Assumption 1.** *There are $L\in\mathbb{N}$ different classes of messages, and each message belongs to exactly one class $c_\ell$, $\ell=1,2,\dots,L$, i.e., no message can belong to two or more classes.* **Remark.** The previous assumption requires carefully classifying messages as the line thaty separates different classes of messages can become blurry. An example of an edge case is where we have two classes of meesages: FVM and non-FVM (e.g., network maintenance), and an FVM user invokes a contract that takes care of maintenance-related tasks, such as `submitWindowedPost`. This classification is worth discussing in more deailt with the wider community. We present a simplified model for gas lanes, and discuss several possible extensions in the next Section. Let $t\in\mathbb{N}$ denote the *epoch number*, $L\in\mathbb{N}$ denote the number of gas lanes, and let $B_\text{max}\in\mathbb{R}_{> 0}$ and $B_\text{target}\in\mathbb{R}_{> 0}$ denote the *maximum* and *target* block sizes, respectively. In our simplified model, we split the block $B$ into $L$ **non-overlapping gas lanes**. Each lane $\ell=1,2,\dots,L$ is defined so that it has a *maximum width,* $w_\ell$, and a *target width*, $B_{\text{target},\ell}$ where \begin{aligned} \sum_{\ell=1}^L w_\ell&=B_\text{max}\\ \sum_{\ell=1}^L B_{\text{target},\ell}&=B_\text{target}\\ \ell_i&\leq w_i, \quad \forall \ell=1,2,\dots,L. \end{aligned} In addition, to each lane $\ell=1,2,\dots,L$, there corresponds a *gas utilization at epoch $t$ denoted by $G_{\ell,t}\in[0,w_\ell]$* (which clearly implies that $\sum_{i=1}^N G_{\ell,t}\leq B_\text{max}, \ \forall t$) and a *base fee* $p_{\ell,t}$. This version of the EIP1559 mechanism with gas lanes then proceeds as follows. We propose to equip each lane with its own EIP1559-like transaction fee mechanism. Thus, the base fee at lane $\ell$ is updated on an epoch-to-epoch basis according to: \begin{align} p_{\ell,t+1}=\underbrace{\max\left\{p_{\ell,t}\left(1+\frac{1}{8}\frac{G_{\ell,t}-B_{\text{target},\ell}}{B_{\text{target},\ell}}\right) , p_{\ell}^\text{min}\right\}}_\text{$:=H_p(p_{\ell,t},G_{\ell,t},p_\ell^\text{min},B_{\text{target},\ell})$}, \tag{1} \end{align} with $p_{\ell}^\text{min}\in\mathbb{R}_{>0}$ the minimum base fee to be paid per lane. At the time of writing, (i.e., with $L=1$) this minimum is set to $p_{\ell}^\text{min}=100$attoFIL$=10^{-16}$FIL. Given this, the proposed multi-lane EIP1559 mechanism would proceed as follows: 1. For each class of message $c_\ell=1,2,\dots,L$: - Miners select the messages of class $c_\ell$ that they would like to include, according to their strategy $\mathsf{S}$, taking into account the the maximum block size for this class of messages is $w_\ell$ and the target utilization is $B_{\text{target},\ell}$. The total gas limit from each class of message is given by $G_{\ell,t}\leq w_\ell$. 2. The base fee for each lane gets updated according to the price-update function in Equation (1). Under the scenario outlined above, we would need to define $3\times L$ parameters, namely $\{w_\ell,B_{\text{target},\ell},p^\text{min}_\ell\}_{\ell=1}^L$. **These parameters would need to be defined from the begining of the implementation, and might need to get adjusted over time.** Intuitively, a properly chosen lane width $w_\ell$ and lane target $B_{\text{target},\ell}$, can help us overcome the potential issue of Storage Providers being priced out; indeed, since gas lanes are non-overlapping and the base fees of each lane is independent of the others, a lane whose target is bigger than the average gas usage for that specific type of lane will almost never result in a gas gentrification issue, however, one needs to be careful to not give too narrow lanes (and hence, overcharge) other users. In addition, **preliminary** experimental results, where we used a demand-driven, agent-based system to simulate the version of gas lanes presented in **Example I** above (in a scenario where there's a comparable amount of gas demaded by either actor) *suggest* that gas lanes do indeed provide a safety net of sorts to the miners. Naturally, we will expand on these models and experiments once input from other stakeholders has been obtained. ![](https://hackmd.io/_uploads/ryIeY4xx2.png) ## 3. Possible extensions. ### 3.1 Variable lane width. Instead of defining a fixed lane width $w_\ell$, we can alternatively use a mechanism that adjusts the lane widths based on the utilization rate of each lane. For simplicity, let's suppose throughout that $B_{\text{target},\ell,t}=w_{\ell,t}/2$. We present two examples of how to implement this. **Example III.** Consider a scenario with only two lanes; one for the network maintenance, (say $\ell=1$) and one for all FVM-related messsages ($\ell=2$). Intuitively, we can expect the number of mainentance messages to grow with the network Quality Adjusted Power (QAP). Thus, one alternative in this case would be to make \begin{aligned} w_{1,t+1}&=\max\left\{w_{1,t}\left(1+\alpha \frac{\textsf{QAP}_t-\textsf{QAP}_{t-1}}{\textsf{QAP}_{t-1}}\right), B_\text{max}\right\},\\ w_{2,t+1}&=B_\text{max}-w_{1,t+1}. \end{aligned} for some suitable value of $\alpha$. Notice that the time indices in the previous equation can also be taken as moving averages over some given number of epochs $T$. This approach has the advantage of being quite straightforward, once $\alpha$ has been defined. Notice that if the network becomes so large that $w_{2,t+1}\ll w_{1,t+1}$, there's a clear scalability issue (as this would mean that the network maintenance is taking almost all available resources) and as such we would need to resort to layer 2 solutions. **Example IV.** We now consider a slightly more abstract example. Let $\pi_{\ell} \in(0,1)$ be a *priority factor* for lane $\ell$, where a higher value indicates higher priority for messages in lane $\ell$. Given this, one could update $w_{\ell,t}$ on an epoch-to-epoch basis using the following procedure. 1. Once mesages have been included in a block, we compute an *adjustment factor* for each lane, $A_{\ell,t}$ defined as \begin{align} A_{\ell,t}:= \pi_\ell \left(\frac{G_{\ell,t}-B_{\text{target},\ell}}{B_{\text{target},\ell}}\right). \end{align} 2. Update widths according to \begin{aligned} w_{\ell,t+1}:=\frac{w_{\ell,t}(1+A_{\ell,t})}{\sum_{\ell'=1}^L w_{\ell',t}(1+A_{\ell',t})}\cdot B_\text{max}. \end{aligned} When congestion levels rise in a particular lane (i.e., the ratio $\frac{G_{l,t}}{B_{\text{target},\ell}}$ is greater than 1), the adjustment factor $A_{l,t}$ becomes positive, leading to an increase in the width of that lane. This increased width allows more transactions to be included in that lane, effectively lowering the gas fee for that lane. As a result, storage providers in that lane would have a lower chance of being priced-out due to high gas fees. On the other hand, if a lane's congestion level drops (i.e., the ratio $\frac{G_{l,t}}{B_{\text{target},\ell}}$ is less than 1), the adjustment factor $A_{l,t}$ becomes negative, leading to a decrease in the width of that lane. This decreased width results in a smaller number of transactions being included in that lane, effectively increasing the gas fee for that lane. However, since the sum of lane widths is kept constant at $B_\text{max}$, the capacity that is removed from this lane will be reallocated to other lanes with higher congestion levels. This reallocation helps maintain a balance between the lanes, ensuring that storage providers have a fair chance of being included in the network without being priced-out by other users. ### 3.2 Variable target block-size. Alternatively, one could fix the lane widths at every epoch (effectively setting $w_{\ell,t}=w_\ell$) and change the target lane size $B_{\text{target},\ell}$ so that at eavery epoch the network is optimizing a predefined objective. This mechanism is discussed in detail [here](https://hackmd.io/@cryptoecon/B10RGzlHo?type=view). ### 3.3 Choice of update rule. In addition, one could also implement each lane with its own different EIP1559-like update rule. Some alternatives are, e.g., **Exponential.** Defined as \begin{align} p_{\ell,t+1}=\max\left\{p_{\ell,t}\exp\left(a\frac{G_{\ell,t}-B_{\text{target},\ell}}{B_{\text{target},\ell}}\right),p^{{\text{min}}}_\ell\right\} \end{align} **Geometric average.** as \begin{align} p_{\ell,t+1}=\max\left\{p_{\ell,t}\left(1+\frac{1}{8}\frac{\widehat{G}_{\ell,t}-B_{\text{target},\ell}}{B_{\text{target},\ell}}\right),p^{{\text{min}}}_\ell\right\} \end{align} with $\widehat{G}_{\ell,t}$ the geometric average of the gas consumption. In either case, it can be shown that using these update rules, while computationally more expensive, can help securing the network against some weakly-coordinted potential attacks as discussed in [this potential FIP](https://hackmd.io/@guy-goren/r1RVuou0j). ## 4. Critique and topics to discuss. Naturally, we are aware that the model presented is not perfect, and there are a few issues to discuss with the community. **Added complexity.** One potential drawback of the gas lanes model is the added complexity it introduces, as miners and users need to manage lane-specific parameters, such as lane widths, base fees, and target consumptions. This complexity could make it more difficult for users to estimate transaction costs and for miners to efficiently select transactions. Additionally, the gas lanes model might require more frequent monitoring and updates to keep lane parameters in line with the network's current state. This could lead to increased overhead for network operators and a higher chance of suboptimal adjustments if the monitoring and updating processes are not executed effectively. **Lane definition.** The number of lanes $L$ in the proposed model needs to be carefully defined. Indeed, one could consider having e.g., 2 lanes, one for FVM messages and one for non-FVM, or 3 lanes, one for onboarding, one for PoSt, and one for everything else (including FVM), or many other choices. Furthermore, the choice of $L$ can have a significant impact on the efficiency and flexibility of the network. A larger number of lanes allows for finer granularity in segregating transactions based on factors such as gas prices or priority levels. This in turn could lead to a more efficient allocation of resources and better handling of congestion. However, increasing the number of lanes can also result in added complexity for both miners and users, making it more challenging to determine the optimal lane for a transaction or to adjust lane parameters effectively. Therefore, when choosing the number of lanes, it is essential to strike a balance between granularity and simplicity to maintain efficient network operation. **Non-identifiability.** This is the scenario where it is not immediately obvious whether a message belongs to a given class or not. In the 2 lane case, for example (FVM Vs. Maintenace), a contract that takes care of submitting maintenance would be difficult to classify in either group. This distinction would need to be analyzed in detail. **Multi-dimensional knapsack problem solved by the miners.** Introducing gas lanes results in a "multi-constraint" knapsack problem for the miners when deciding which blocks to pack (in the setting where they want to maximize miner tips). This problem is NP-hard, which means finding an optimal solution can be computationally intensive. However, miners can employ heuristic or approximation algorithms to obtain near-optimal solutions within reasonable time frames. These algorithms can consider factors such as transaction fees, gas prices, and priorities to create a balanced and profitable block, however, it is unclear to us if this would represent a significant techincal challenge. ## 5. Related work. 1. Resource pricing. Anorth has recently proposed a *similar* (but not quite the same) idea [here](https://github.com/filecoin-project/FIPs/discussions/587). The idea of segregating and pricing messages according to the type fo resources they consume has been studied in the recent work [Dynamic Pricing for Non-fungible Resources: Designing Multidimensional Blockchain Fee Markets](https://arxiv.org/abs/2208.07919) by Theo Diamandis et. Al.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully