Matej Pavlovic
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
<a id="sectionSpec"></a> ## Specification <!--The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Filecoin implementations. --> The following equation describes the main part of the change, that is, replacing $s[i]$ by $s_{\textit{avg}}[i]$. For $q\in (0,1)$, $$s_{\textit{avg}}[i] \triangleq \frac{1-q}{q}\sum_{k=1}^{\infty } q^k\cdot s[i-k+1]$$ which simplifies to the recursive form $$s_{\textit{avg}}[i] = (1-q)\cdot s[i] + q\cdot s_{\textit{avg} }[i-1].$$ The change to the learning rate $\phi$ (from constant to adaptive), is defined by the following rule with parameters $\alpha$ and $\gamma$, and is bounded to be within $[\phi_{\min},\phi_{\max}]$. $$\text{if } (1-\gamma){s^* } \le s_{\textit{avg}}[i]\le (1+\gamma){s^* } \text{ \hspace{0.5cm} then \hspace{0.5cm} } \phi[i+1] \gets \max \left( \phi[i]-\alpha, \phi_\min \right) $$ $$\text{ else \hspace{0.5cm} } \phi[i+1] \gets \min \left( \phi[i]+\alpha, \phi_\max \right) .$$ This scheme provides us with multiple knobs that can be adjusted: - $q$ - which determines the concentration of the average. Roughly, smaller $q$ values result in $s_\textit{avg}$ resembling the very last block sizes, while larger $q$ values smoothen the average over a longer history. - $\alpha$ - the additive term used to increase and decrease the learning rate. Larger $\alpha$ values result in faster adjustments to changes in demand but might lead to instability. - $\gamma\in(0,1)$ - the threshold for deciding if the average is "close" or "far" from the desired block size. A "far from desired" average results in an increase of the learning rate while a "close" results in reducing the learning rate. - $\phi_\min\in(0,\phi_\max)$ - the minimum learning rate. Roughly, the smaller $\phi_\min$ is, the more stable the system is in case of an approximately stable demand. However, small $\phi_\min$ values make it longer to adapt to changes in demand. - $\phi_\max\in(\phi_\min,1)$ - the maximal learning rate. Roughly, the larger $\phi_\max$ is, the faster the system can adapt to sudden changes in demand. However, large $\phi_\max$ values can lead to cases of instability of the base fee even when the demand barely changes. ### Parameter setting Setting the right parameters is a work of art more than science, and it depends on the particular characteristics of the system. Therefore, tuning these parameters will require extensive data and experiments after Filecoin launches FVM and demand patterns emerge. Nonetheless, leaving the update rule unchanged is also a choice with unforeseeable consequences. Below is a possible option for the initial parameter setting (which is based only the [honeymoon data](https://arxiv.org/pdf/2110.04753.pdf) from Ethereum --- blocks 12935000 to 13079999). - $q = 0.5$ - $\alpha = 0.025$ - $\gamma = 0.25$ - $\phi_\min = 0.0125$ - $\phi_\max = 0.75$ ### Additional info EIP-1559 allows for a variable block size, but a valid block size must be in the range $s[i]\in[0,2s^*]$. Unlike in Ethereum, in Filecoin the value $s[i]$ is determined not by a single block's size but [by the average size of a block in the previous tipset](https://spec.filecoin.io/#section-systems.filecoin_vm.gas_fee). This affects the issue from both sides. On the positive side, the averaging reduces the profitability of bribing a single miner. On the negative side, given the possibility to choose different tipsets to build ontop, a rational miner might be incentivized to choose the "emptier" tipset in order to reduce the base fee for its current block, thus affecting the present and not just the future. ## Design Rationale <!--The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.--> An intuitive option for the Transaction Fee Mechanism (TFM) that adjusts supply and demand economically is *First price auction*, which is well known and studied. Nevertheless, in Filecoin the choice was to use EIP-1559 for the TFM. In this proposal, our design goal is to improve the TFM (of EIP-1559) by mitigating known problems that it raises. It is important to note that these problems do not yet inflict the Filecoin network. If Filecoin gains traction, however, they are expected to rise. We may want to prepare for this beforehand. The suggestion is composed of two parts: (i) using an average over epochs of block sizes rather than only the latest, and (ii) using an adaptive learning rate. The first part is the basis of the proposal. The second is an additional improvement (that depends on the first part being implemented). We therefore discuss them separately. ### $s_\textit{avg}[i]$ instead of $s[i]$ The change is based on [this work](https://drive.google.com/file/d/1o_47aiN1BWegOmG8utYh4a47TM0OOa12/view?usp=share_link) that described a rational strategy in which bribes are profitable. Choosing to average based on a geometric series weights results in two desired properties: (i) the computation and space complexity are both in O(1), and (ii) the average gradually phases out the impact of a single outlier block without causing significant fluctuations in the base fee. ### Having an adaptive learning rate instead of $\phi=1/8$ This suggestion is based on a [research work](https://arxiv.org/pdf/2110.04753.pdf) dealing with the learning rate in Ethereum, which was arbitrarily set to $\phi=1/8$. Intuitively, a hige value of $\phi$ leads to more instability, while a low value of $\phi$ leads to slow adaptations to changes in demand. Having $\phi$ adaptive rather than constant seems like a good way to go. In particular, Additive Increase and Multiplicative Decrease (AIMD) was considered in this [paper](https://arxiv.org/pdf/2110.04753.pdf). AIMD has the benefit of reducing larger $\phi$ values faster than smaller $\phi$ values, but requires the tuning of an extra parameter -- $\beta\in(0,1)$ -- which determines the Multiplicative Decrease rate. For their suggested parameters of $\alpha=0.025$ and $\beta=0.95$, however, the difference between AIMD and AIAD does not appear to be significant. Therefore, we suggest to first consider the simpler Additive Increase Additive Decrease method. ## Backwards Compatibility This change requires a hard fork since the base fee is enforced (for blocks to be considerd valid). ## Test Cases To early to say ## Security Considerations <!--All FIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. FIP submissions missing the "Security Considerations" section will be rejected. A FIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.--> The more complicated a mechanism is, the more it is vulnerable to unforeseen security threats. The case of EIP1559 is just one example of it. We hope to mitigate those risks, however, discussions might show us differently. ## Incentive Considerations <!--All FIPs must contain a section that discusses the incentive implications/considerations relative to the proposed change. Include information that might be important for incentive discussion. A discussion on how the proposed change will incentivize reliable and useful storage is required. FIP submissions missing the "Incentive Considerations" section will be rejected. An FIP cannot proceed to status "Final" without a Incentive Considerations discussion deemed sufficient by the reviewers.--> The proposal is designed to improve the incentive compatibility of the TFM. A [game theoretic analysys](https://drive.google.com/file/d/1o_47aiN1BWegOmG8utYh4a47TM0OOa12/view?usp=share_link) shows that a TFM based on EIP-1559 encourages bribes. Roughly, because the base fee in the next block depends on the size of the the current block, a miner that creates an empty block reduces the base fee of the next block by a factor of $\phi$. The opportunity cost for mining an empty block instead of a normal block is only the tips it contains. Thus, the cost of bribing a miner is only compensating it for the lost tips. In case the base fee is significantly larger than the tips, the bribing user gains a significant reduction in the base fees of the next block, making the bribe profitable. One of the main goals of EIP-1559 was to simplify the bidding for users. It was articulated [theoretically by Roughgarden](https://timroughgarden.org/papers/eip1559.pdf) as users bidding their honest valuations being an optimal strategy. In contrast, when using first price auctions for the TFM (as done by Bitcoin and previously in Ethereum), it is typically sub-optimal for a user to bid its honest valuation. In other words, a TFM that encourages users to not fully reveal their preferences is considered less good. However, our opinion is that a TFM that encourages bribes is worse than a TFM that encourages not revealing one's full preferences. We believe that a first price auction is the best way to go regarding TFMs, however, Filecoin chooses to use EIP-1559 and burn transaction fees (perhaps for reasons other than game-theoretic ones). We therefore suggest to mitigate the current incentives for bribes using the above proposal. ## Product Considerations <!--All FIPs must contain a section that discusses the product implications/considerations relative to the proposed change. Include information that might be important for product discussion. A discussion on how the proposed change will enable better storage-related goods and services to be developed on Filecoin. FIP submissions missing the "Product Considerations" section will be rejected. An FIP cannot proceed to status "Final" without a Product Considerations discussion deemed sufficient by the reviewers.--> Beside mitigating the incentives for bribes, we see two other potential benefits from a product perspective. - The new averaging mechanism would reduce spikes and extreme oscillations of the base fee. - The AIAD would adapt faster to significant changes in persistent demand (not a momentary peak). The above should lead to a better user experience. For example, with this proposal, it would be less likely for an SP to be surprised by an outrageous base fee exactly when it wants to post its proofs. ## Implementation <!--The implementations must be completed before any core FIP is given status "Final", but it need not be completed before the FIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.--> None currently. ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). _Originally posted by @guy-goren in https://github.com/filecoin-project/FIPs/discussions/686_

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