Merge pull request #2908 from filecoin-project/fix/gasfee-est

Fix/gasfee est
This commit is contained in:
Łukasz Magiera 2020-08-08 00:50:38 +02:00 committed by GitHub
commit 702d95503b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -222,7 +222,7 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName) (*Messa
mp := &MessagePool{
ds: ds,
closer: make(chan struct{}),
repubTk: build.Clock.Ticker(time.Duration(build.BlockDelaySecs) * 10 * time.Second),
repubTk: build.Clock.Ticker(time.Duration(build.BlockDelaySecs) * time.Second),
localAddrs: make(map[address.Address]struct{}),
pending: make(map[address.Address]*msgSet),
minGasPrice: types.NewInt(0),
@ -973,6 +973,8 @@ func (mp *MessagePool) loadLocal() error {
log.Errorf("adding local message: %+v", err)
}
mp.localAddrs[sm.Message.From] = struct{}{}
}
return nil

View File

@ -975,7 +975,7 @@ var clientListDeals = &cli.Command{
} else {
onChain, err := api.StateMarketStorageDeal(ctx, v.DealID, head.Key())
if err != nil {
deals = append(deals, deal{ LocalDeal: v, })
deals = append(deals, deal{LocalDeal: v})
} else {
deals = append(deals, deal{
LocalDeal: v,

View File

@ -40,7 +40,7 @@ func (a *GasAPI) GasEstimateFeeCap(ctx context.Context, msg *types.Message, maxq
}
parentBaseFee := ts.Blocks()[0].ParentBaseFee
increaseFactor := math.Pow(1+float64(1/build.BaseFeeMaxChangeDenom), float64(maxqueueblks))
increaseFactor := math.Pow(1.+1./float64(build.BaseFeeMaxChangeDenom), float64(maxqueueblks))
feeInFuture := types.BigMul(parentBaseFee, types.NewInt(uint64(increaseFactor*(1<<8))))
feeInFuture = types.BigDiv(feeInFuture, types.NewInt(1<<8))