From 5654322f54e7495d080807fc65f64133f09a4cc4 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 7 Sep 2020 11:19:45 -0700 Subject: [PATCH] introduce logic to perform base fee tamping around the upgrade time Signed-off-by: Jakub Sztandera --- build/params_testnet.go | 3 +++ chain/store/basefee.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/build/params_testnet.go b/build/params_testnet.go index 0d5602d70..92d9eba48 100644 --- a/build/params_testnet.go +++ b/build/params_testnet.go @@ -12,6 +12,9 @@ import ( "github.com/filecoin-project/specs-actors/actors/builtin/power" ) +const UpgradeBreezeHeight = 42000 +const BreezeGasTampingDuration = 120 + func init() { power.ConsensusMinerMinPower = big.NewInt(10 << 40) miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{ diff --git a/chain/store/basefee.go b/chain/store/basefee.go index 9d6322639..69970dd96 100644 --- a/chain/store/basefee.go +++ b/chain/store/basefee.go @@ -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