From ffb2640736b338f1359ee18afb58c51cd0bcec84 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sat, 5 Sep 2020 21:03:22 +0300 Subject: [PATCH] use faster lookup for base fee --- chain/messagepool/messagepool.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 173c72e8e..0d62e5423 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -370,12 +370,8 @@ func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.T // queues. // Note that we don't do that for local messages, so that they can be accepted and republished // automatically - if !local { - baseFee, err := mp.api.ChainComputeBaseFee(context.TODO(), curTs) - if err != nil { - return xerrors.Errorf("error computing base fee: %w", err) - } - + if !local && len(curTs.Blocks()) > 0 { + baseFee := curTs.Blocks()[0].ParentBaseFee baseFeeLowerBound := types.BigDiv(baseFee, baseFeeLowerBoundFactor) if m.Message.GasFeeCap.LessThan(baseFeeLowerBound) { return xerrors.Errorf("GasFeeCap doesn't meet base fee lower bound for inclusion in the next 20 blocks (GasFeeCap: %s, baseFeeLowerBound: %s): %w",