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

feat: Improved Fee Rate Computation #2972

Merged
merged 112 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
0d03b2a
separated out the update function
Dec 6, 2021
9f49d2b
factored out `fee_rate_from_receipt`
Dec 6, 2021
a828e17
renamed variables
Dec 7, 2021
dca3254
reorganize fee rates
Dec 7, 2021
7faf443
compiles
Dec 7, 2021
7c43fe8
weighte estimates in place but need to add the "minimum rate"
Dec 7, 2021
c86e7d7
factored into methods and added "maybe minimum fee rate"
Dec 7, 2021
8d7082f
added rough code for the estimate updates
Dec 7, 2021
05992aa
added in fee medians
Dec 7, 2021
d45f441
reinstate old fee_scalar
Dec 7, 2021
ba8a6aa
branch tests
Dec 7, 2021
ddebc1e
no such column: estimate_key
Dec 7, 2021
095f488
diffed against aaron's version
Dec 7, 2021
a2d38e1
two working tests
Dec 8, 2021
dd475ba
test isn't working
Dec 8, 2021
321fa8e
interpolation is working
Dec 8, 2021
f9e6721
fixed test_single_contract_call
Dec 8, 2021
03f87b0
five calls is failing
Dec 8, 2021
a3f4677
test_one_block_mostly_filled added
Dec 8, 2021
4958b7e
test_ten_blocks_mostly_filled working
Dec 8, 2021
8f53b9b
added comments
Dec 8, 2021
785c2ed
revert src/cost_estimates/metrics.rs
Dec 8, 2021
b4df12c
removed warn's
Dec 8, 2021
a73d7b1
fixed some test logic comments
Dec 8, 2021
0c2dd1d
added basic structure to fuzzer
Dec 8, 2021
b29221f
test compiles
Dec 9, 2021
89d1255
fee estimator compils but needs random seed
Dec 9, 2021
a0d894f
fuzzer takes an optional seed input
Dec 9, 2021
e649463
creator function is working
Dec 9, 2021
65eab2b
test is almost ready to work
Dec 9, 2021
0d8b141
fuzzing tests are working
Dec 9, 2021
669fe57
added a notify test
Dec 9, 2021
7bf3210
removed some unused imports
Dec 9, 2021
61c2429
fixed uniform noise comment
Dec 9, 2021
f676a15
refactored the test to avoid duplicate code
Dec 9, 2021
2566f34
ran format
Dec 9, 2021
ec53f50
fix formattin
Dec 9, 2021
7e92f39
added constructor comment
Dec 9, 2021
c56abd6
Merge branch 'develop' into feat/fee-rates
kantai Dec 9, 2021
c285870
added some tests for fee_rate_estimate_from_sorted_weighted_fees
Dec 13, 2021
6aa6b70
new fee rate estimate cases
Dec 13, 2021
0004684
use checked add for weight normalization
Dec 13, 2021
a18b657
refactor ScalarFeeRateEstimator::open
Dec 13, 2021
6050462
use floats to avoid overflow
Dec 13, 2021
f70ed27
add assert
Dec 13, 2021
a539cdc
ichanged block limits to see what fails
Dec 13, 2021
84ca564
changed test values that were failing after chaning `full_block_weight`
Dec 14, 2021
a802a18
Merge branch 'develop' into feat/fee-fuzzing
Dec 14, 2021
8be6386
Merge branch 'feat/fee-rates' into feat/hook-up-estimator
Dec 14, 2021
a42fbab
removed orig files
Dec 14, 2021
243b49e
hook up estimator to stacks node
Dec 14, 2021
1c13db3
fix build using statics
Dec 14, 2021
0cbe379
make the FeeRateFuzzer generic instead of using boxes
Dec 14, 2021
d77d95b
Merge branch 'feat/fee-fuzzing' into feat/hook-up-estimator
Dec 14, 2021
17a6230
fix stacks-node
Dec 14, 2021
801ddbb
test if failing with bad input, want to send link
Dec 15, 2021
8e83fdf
test is passing but vacuous
Dec 15, 2021
2833421
remove sleep calls
Dec 15, 2021
403e7b5
Estimation could not be performed
Dec 15, 2021
cf61fde
getting the estimates out now
Dec 16, 2021
ee494ec
test is making asserts
Dec 17, 2021
33cff43
undoing the debug logging
Dec 17, 2021
03fd00f
changed logic to support fractional fuzz instead of absolute
Dec 17, 2021
2158bc8
fixed tests and added comment
Dec 17, 2021
2afa048
Merge branch 'feat/fee-fuzzing' into feat/hook-up-estimator
Dec 17, 2021
74c5f8c
added comment for fuzzed_median_fee_rate_estimation_test
Dec 17, 2021
6197200
added contract
Dec 17, 2021
54aa0cf
ran fmt
Dec 17, 2021
55160da
remove bad comment
Jan 3, 2022
dbd1613
remove extra comment
Jan 3, 2022
a53f48a
fuzz each eleement by the same factor
Jan 3, 2022
5826417
added tests to yml file
Jan 3, 2022
3c93a6c
remove new estimator from the toml file; wait till we add it to all o…
Jan 3, 2022
e9afd2d
remove make_block_receipt
Jan 3, 2022
0ad5063
replaced 0.5 with 0.1 as the fraction, changed variable name
Jan 3, 2022
5428f96
Merge branch 'develop' into feat/hook-up-estimator
Jan 3, 2022
94f2c90
mark make_block_receipt as for test
Jan 4, 2022
b77f5a8
add constant MINIMUM_TX_FEE_RATE
Jan 4, 2022
b76585d
panic if weight is 0f64
Jan 4, 2022
b045302
added changelog
Jan 4, 2022
eca6e01
added fuzzer options to config structs
Jan 5, 2022
2ceffad
added the config options so they are used now
Jan 5, 2022
9f03d8c
updated integration test to use parameters
Jan 5, 2022
913f03e
added to the README
Jan 5, 2022
3cad19e
fixed the names in bitcoin-tests
Jan 5, 2022
c8e9bc4
Update README.md
gregorycoppola Jan 5, 2022
ba534b3
Update README.md
gregorycoppola Jan 5, 2022
c22ba1e
remove "now defaulting to this" in CHANGELOG
Jan 5, 2022
b26fb4c
Merge branch 'feat/hook-up-estimator' of github.com:blockstack/stacks…
Jan 5, 2022
0332ece
use expect not unwrap
Jan 5, 2022
281ed4c
changed config options to be Option's
Jan 5, 2022
cda4f08
fix test comments
Jan 5, 2022
b2913de
update default handling
Jan 5, 2022
26165de
move comment for symmetry
Jan 7, 2022
c1d2fde
readability
Jan 7, 2022
2e151f1
added two extra calls to `next_block_and_wait` to make sure block pro…
Jan 7, 2022
9b8bbd1
Merge branch 'develop' into feat/hook-up-estimator
Jan 7, 2022
0316d4b
fmt
Jan 7, 2022
9d81342
address jude's comments
Jan 10, 2022
cac9ce1
small readability things
Jan 10, 2022
3a24704
replace vec with array
Jan 10, 2022
644c640
remove the fee_estimation
Jan 10, 2022
e6d4756
Merge branch 'develop' into feat/hook-up-estimator
Jan 10, 2022
6305f48
pavi's comments
Jan 11, 2022
0ee4c4f
fmt
Jan 11, 2022
25aaa1d
add spender addr
Jan 11, 2022
0e64d28
code clean ups
Jan 12, 2022
14ca280
return none if infinite
Jan 12, 2022
ff52409
added warn
Jan 12, 2022
65f5d9f
fixed min/max bug
Jan 12, 2022
e599068
restart the tests
Jan 12, 2022
e6cff5e
start tests again
Jan 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
- tests::neon_integrations::filter_low_fee_tx_integration_test
- tests::neon_integrations::filter_long_runtime_tx_integration_test
- tests::neon_integrations::mining_transactions_is_fair
- tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window5
- tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window10
- tests::neon_integrations::use_latest_tip_integration_test
- tests::epoch_205::test_dynamic_db_method_costs
- tests::epoch_205::transition_empty_blocks
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the versioning scheme outlined in the [README.md](README.md).

## [Unreleased]
## [Upcoming]

### Added

- A new fee estimator intended to produce fewer over-estimates, by having less
sensitivity to outliers. Its characteristic features are: 1) use a window to
forget past estimates instead of exponential averaging, 2) use weighted
percentiles, so that bigger transactions influence the estimates more, 3)
assess empty space in blocks as having paid the "minimum fee", so that empty
space is accounted for, 4) use random "fuzz" so that in busy times we will
not have ties.

### Changed

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ Fee and cost estimators can be configure via the config section `[fee_estimation
```
[fee_estimation]
cost_estimator = naive_pessimistic
fee_estimator = scalar_fee_rate
fee_estimator = fuzzed_weighted_median_fee_rate
fee_rate_fuzzer_fraction = 0.1
fee_rate_window_size = 5
cost_metric = proportion_dot_product
log_error = true
enabled = true
Expand All @@ -378,6 +380,11 @@ are **not** consensus-critical components, but rather can be used by miners to
rank transactions in the mempool or client to determine appropriate fee rates
for transactions before broadcasting them.

The `fuzzed_weighted_median_fee_rate` uses a
median estimate from a window of the fees paid in the last `fee_rate_window_size` blocks.
Estimates are then randomly "fuzzed" using uniform random fuzz of size up to
`fee_rate_fuzzer_fraction` of the base estimate.

## Non-Consensus Breaking Release Process

For non-consensus breaking releases, this project uses the following release process:
Expand Down
Loading