Skip to content

feat: customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution#1173

Merged
raulk merged 108 commits intomainfrom
integration/gas-market
Oct 17, 2024
Merged

feat: customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution#1173
raulk merged 108 commits intomainfrom
integration/gas-market

Conversation

@raulk
Copy link
Copy Markdown
Contributor

@raulk raulk commented Oct 15, 2024

This PR integrates these draft and partial PRs into a fully reviewed solution.

New features

Gas markets in actor space

  • Customizable gas markets via a Wasm actor, adhering to the GasMarket standard interface which currently requires implementing two methods: CurrentReading and UpdateUtilization.
  • The gas market is a singleton actor sitting at ID 98. Users can deploy alternative implementations during genesis or an upgrade.
  • EIP-1559 as the default gas market, with default constants (minimum base fee, block gas, elasticity, multiplier) inherited from Filecoin.
  • EIP-1559 constants can be updated by calling the SetConstants method. By default this requires a system caller, thus limiting execution to migrations only. But users can override the caller requirement to something different to allow updates from authorized actors/accounts.

Premium distributions

Gas premiums previously collected under the Reward actor sitting at address f02 are now distributed to the block producer, crediting them to an f410/0x address derived from their secp256k1 public key.

Base fee oscillation

The base fee now oscillates based on gas utilization, as determined by the gas market implementation.

Block gas limit updates

Whenever the block gas limit is updated in the gas market actor, we inform the consensus layer during end_block so CometBFT begins to pack blocks adhering to the new block gas limit.

Message selection

We introduced an incipient message selection function, which users could override by patching the codebase. In the future, we intend to make this modular/pluggable.

Review

Many adjustments were done directly on the branch throughout review. I tried to atomize the changelog as separate commits, but this was done post-facto so the diffs aren't too clean. The first review commit is 040e18e.

TODO


Closes #925

cryptoAtwill and others added 30 commits May 31, 2024 00:14
Co-authored-by: Eric Tu <6364934+ec2@users.noreply.github.com>
Co-authored-by: Mikers <snissn@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
Co-authored-by: Shashank Trivedi <100513286+lordshashank@users.noreply.github.com>
Co-authored-by: Karel Moravec <moravec.wdd@gmail.com>
Co-authored-by: Karel Moravec <moravec.wdd@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
@raulk raulk requested a review from a team as a code owner October 15, 2024 17:03
@raulk raulk changed the title Customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution feat: Customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution Oct 15, 2024
@raulk raulk changed the title feat: Customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution feat: customizable gas markets (with EIP-1559 default), base fee oscillation, premium distribution Oct 15, 2024
@raulk raulk merged commit 702d49b into main Oct 17, 2024
@raulk raulk deleted the integration/gas-market branch October 17, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Gas completeness (EIP-1559, base fee oscillation, gas premiums, block gas limit)

2 participants