Skip to content

Commit

Permalink
Merge pull request #3623 from filecoin-project/feat/base-fee-tamping
Browse files Browse the repository at this point in the history
introduce logic to perform base fee tamping around the upgrade time
  • Loading branch information
Jakub Sztandera authored Sep 7, 2020
2 parents bea31fd + baaec9d commit 8a018ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
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

0 comments on commit 8a018ce

Please sign in to comment.