bnb-chain / opbnb

MIT License
403 stars 162 forks source link

feat: optimize l1 gas price calculation after snow hardfork #169

Closed redhdx closed 5 months ago

redhdx commented 5 months ago

Description

Optimize l1 gas price calculation.

Rationale

The current L1 gas price is a fixed value. This value can't truly reflect the L1 gas price and needs to be adjusted. The median gas price of the latest 21 blocks(21 validators in bsc) is calculated.

Example

n/a

Changes

Notable changes:

bnoieh commented 5 months ago

plz add snow fork to: https://github.com/bnoieh/opbnb/blob/6b6d0f05c78a6e6fc28ae94b65f3ce536f639d0f/op-chain-ops/genesis/config.go#L738

realknown commented 5 months ago

please change the title to make it more meaningful.

redhdx commented 5 months ago

plz add snow fork to: https://github.com/bnoieh/opbnb/blob/6b6d0f05c78a6e6fc28ae94b65f3ce536f639d0f/op-chain-ops/genesis/config.go#L738

Simplify the basefee when constructing the genesis block and ignore the Snow fork logic just in genesis.