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

introduce logic to perform base fee tamping around the upgrade time #3623

Merged
merged 4 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
)

const UpgradeBreezeHeight = 0
const BreezeGasTampingDuration = 0

func init() {
power.ConsensusMinerMinPower = big.NewInt(2048)
miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{
Expand Down
3 changes: 3 additions & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ var (

PackingEfficiencyNum int64 = 4
PackingEfficiencyDenom int64 = 5

UpgradeBreezeHeight abi.ChainEpoch = 0
BreezeGasTampingDuration abi.ChainEpoch = 0
)
3 changes: 3 additions & 0 deletions build/params_testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
"github.com/filecoin-project/specs-actors/actors/builtin/power"
)

const UpgradeBreezeHeight = 41280
const BreezeGasTampingDuration = 120

func init() {
power.ConsensusMinerMinPower = big.NewInt(10 << 40)
miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{
Expand Down
4 changes: 4 additions & 0 deletions chain/store/basefee.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func computeNextBaseFee(baseFee types.BigInt, gasLimitUsed int64, noOfBlocks int
}

func (cs *ChainStore) ComputeBaseFee(ctx context.Context, ts *types.TipSet) (abi.TokenAmount, error) {
if ts.Height() > build.UpgradeBreezeHeight && ts.Height() < build.UpgradeBreezeHeight+build.BreezeGasTampingDuration {
return abi.NewTokenAmount(100), nil
}

zero := abi.NewTokenAmount(0)

// totalLimit is sum of GasLimits of unique messages in a tipset
Expand Down