Skip to content

Commit

Permalink
use faster lookup for base fee
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Sep 6, 2020
1 parent f949269 commit ffb2640
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions chain/messagepool/messagepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ffb2640

Please sign in to comment.