Skip to content
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

Add Sonic's base-fee computation algorithm #296

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

HerbertJordan
Copy link
Collaborator

@HerbertJordan HerbertJordan commented Nov 11, 2024

This PR introduces Sonic's base-fee adjustment algorithm. The algorithm is a generalization of the fee market price algorithm described in EIP-1559 supporting a variable block-time period.

The maximum increase and decrease is limited to approximately ±12.5% per 15 seconds, analog to Ethereum's implementation.

@HerbertJordan HerbertJordan force-pushed the herbert/per_block_gas_pricing_algorithm branch 2 times, most recently from e3825cc to bb4adec Compare November 11, 2024 17:38
@HerbertJordan HerbertJordan marked this pull request as ready for review November 11, 2024 17:40
@HerbertJordan HerbertJordan force-pushed the herbert/per_block_gas_pricing_algorithm branch from d7d20e1 to 5d89d11 Compare November 11, 2024 18:06
gossip/gasprice/base_fee.go Outdated Show resolved Hide resolved
simonlechner
simonlechner previously approved these changes Nov 12, 2024
Copy link
Collaborator

@simonlechner simonlechner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the comments are definitely helpful.

gossip/gasprice/base_fee.go Outdated Show resolved Hide resolved
jenikd
jenikd previously approved these changes Nov 12, 2024
Copy link
Collaborator

@jenikd jenikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good

LuisPH3
LuisPH3 previously approved these changes Nov 12, 2024
Copy link

@LuisPH3 LuisPH3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, just small nitpick about new introduced type.

inter/time.go Outdated Show resolved Hide resolved
gossip/gasprice/base_fee.go Outdated Show resolved Hide resolved
LuisPH3
LuisPH3 previously approved these changes Nov 12, 2024
@HerbertJordan HerbertJordan force-pushed the herbert/per_block_gas_pricing_algorithm branch from dcde650 to 67e6008 Compare November 13, 2024 08:16
@HerbertJordan HerbertJordan merged commit fb9975e into develop Nov 13, 2024
2 checks passed
@HerbertJordan HerbertJordan deleted the herbert/per_block_gas_pricing_algorithm branch November 13, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants