Skip to content

gasstation: scale fee history reward percentiles to 0-100 - #5032

Open
guo wants to merge 1 commit into
masterfrom
guo/fee-history-percentiles
Open

guo wants to merge 1 commit into
masterfrom
guo/fee-history-percentiles

Conversation

@guo

@guo guo commented Oct 2, 2026

Copy link
Copy Markdown
Member

Reward percentiles are given in [0, 100], but the index was computed as
len*p, so every percentile of 1 or more returned the block's highest tip.
Divide by 100, and return zero rewards for a block with no priority fees
instead of indexing an empty slice.

Test: gasstation/gasstattion_test.go covers the change and fails without it. go test -gcflags=all=-N -l -short passes for the touched packages.

Reward percentiles are given in [0, 100], but the index was computed as
len*p, so every percentile of 1 or more returned the block's highest tip.
Divide by 100, and return zero rewards for a block with no priority fees
instead of indexing an empty slice.
@guo
guo requested a review from a team as a code owner October 2, 2026 17:41
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

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.

1 participant