Skip to content

median_fee in fee command is inaccurate (Version: 1.8.1) #4027

Open
@mDuo13

Description

@mDuo13

Issue Description

The fee command returns a drops.median_fee field that is supposed to represent the median transaction cost paid in the last validated ledger. However, due to the way the underlying value is used in the fee escalation code, this field has a minimum value of 5000, "to ensure that fee escalation is meaningful even when there aren't many transactions." (To quote @ximinez)

However, the minimum having a value of 5000 is overkill for most users, who only want to know how much they should pay to give their transaction a good chance of being confirmed. (For example, in a lot of recent ledgers, the median fee was probably more in the tens or hundreds of drops, not thousands.) As best I can tell, this is a case where the API is exposing an implementation detail of the fee escalation formula. After all, the median fee in the validated ledger is an actual empirical observation of what fees are being confirmed by consensus.

The command should probably return the actual median fee from the last validated ledger, which would be actually useful for API users. (The escalation calculations can still use the value of 5000 internally.)

In the special case where the previous ledger is empty (something that happens regularly on test networks like Devnet), I think it should return the minimum fee.

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