introduce logic to perform base fee tamping around the upgrade time

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
whyrusleeping 2020-09-07 11:19:45 -07:00 committed by Jakub Sztandera
parent bea31fdcb0
commit 5654322f54
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 7 additions and 0 deletions

View File

@ -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{}{

View File

@ -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