Skip to content

should consider minimum priority fee when calculating maxPriorityFeePerGas #3855

@egonspace

Description

@egonspace

In calculating maxPriorityFeePerGas as following code:

const medianPriorityFee = medianOf(priorityFees);
  const adjustedPriorityFee = medianPriorityFee
    .mul(settings.priorityFeePercentageMultiplier)
    .divn(100);

If minimum priority fee in block history is same to the median value, then the tx having 97% of the median as
maxPriorityFeePerGas may not be accepted by txpool.

For example, let's assume the following situation.
priorityFees = [10, 10, 10, 10, 10, 11, 12, 13, 14]
median is 10 (5th element)
and adjustedPriorityFee = 9.7 (10 * 97%)
So txpool may reject the tx because of the priorityFee less than min value.

Actually, some chain uses fixed priorityFee to have the all same effectivePriorityFeePerGas in block fee history so
metamask fails to send a transaction without manual setting of gas.

Are you willing to improve this?
How about to use median * 97% but at least set it to be greater than min?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions