Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track the average transaction mass throughout the mempool's lifespan #599

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

michaelsutton
Copy link
Contributor

Tracks the average transaction mass throughout the mempool's lifespan using a decaying formulae.

The intention is to avoid sensitivity to cases where the mempool has only a few transactions with unusually high mass, which affects the fee estimation mechanism (block slots in the estimator are defined by the average mass).

By using a decaying formula over all history we get:

  1. The average reflects samples obtained over a long duration
  2. It still gives more weight to more recent samples (eventually "forgetting" old enough samples)
  3. The formula for this calculation is very simple and requires no special bookkeeping

Copy link
Collaborator

@coderofstuff coderofstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely like this approach over the current one. Still need to spend time actually running it, but the change looks sound to me.

mining/src/mempool/model/frontier.rs Show resolved Hide resolved
mining/src/mempool/model/frontier.rs Outdated Show resolved Hide resolved
@michaelsutton michaelsutton merged commit 233552b into kaspanet:master Nov 28, 2024
6 checks passed
@michaelsutton michaelsutton deleted the mempool-track-avg-mass branch November 28, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants