use faster lookup for base fee
This commit is contained in:
parent
f9492691a6
commit
ffb2640736
@ -370,12 +370,8 @@ func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.T
|
|||||||
// queues.
|
// queues.
|
||||||
// Note that we don't do that for local messages, so that they can be accepted and republished
|
// Note that we don't do that for local messages, so that they can be accepted and republished
|
||||||
// automatically
|
// automatically
|
||||||
if !local {
|
if !local && len(curTs.Blocks()) > 0 {
|
||||||
baseFee, err := mp.api.ChainComputeBaseFee(context.TODO(), curTs)
|
baseFee := curTs.Blocks()[0].ParentBaseFee
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("error computing base fee: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
baseFeeLowerBound := types.BigDiv(baseFee, baseFeeLowerBoundFactor)
|
baseFeeLowerBound := types.BigDiv(baseFee, baseFeeLowerBoundFactor)
|
||||||
if m.Message.GasFeeCap.LessThan(baseFeeLowerBound) {
|
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",
|
return xerrors.Errorf("GasFeeCap doesn't meet base fee lower bound for inclusion in the next 20 blocks (GasFeeCap: %s, baseFeeLowerBound: %s): %w",
|
||||||
|
Loading…
Reference in New Issue
Block a user