-
Notifications
You must be signed in to change notification settings - Fork 118
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: consider tenure block fullness for transaction fee estimations #2203
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Vercel deployment URL: https://stacks-blockchain-qurhv694h-hirosystems.vercel.app 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you testing this @rafaelcr ?
Thanks for the review @diwakergupta !
Once logic is verified by Brice/core team I will add unit tests simulating different tenure fullness scenarios. Once merged, we'll follow the same procedure we did for the initial fee estimation proxy (deploy to testnet and validate before moving deployment to mainnet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I noted a couple of thoughts.
It may also be nice to take the current tenure into account, so that it would react quickly when the traffic dies down after a surge. This could be something really simple/naive like, if the current tenure has at least 5 blocks and all cost dimensions are < 50% of the limit, then use the min fee.
@obycode @diwakergupta can you take another look? Easiest is to follow the unit test scenarios starting here: https://github.com/hirosystems/stacks-blockchain-api/pull/2203/files#diff-22bb01d2b4337f97428b33c9aed8d5d87611b43381a61b04611f26606f50c94fR203 Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the details of the SQL queries for someone else to review, but everything else looks great!
What do you think about always including the minimum fee in this response, along with the estimated fee, so that wallets could easily include that in their UI? I think this would be nice from a user perspective, if I have a low priority transaction that I'd like to get included whenever, I just want to pay the min fee. |
@obycode that's a good idea. Would this be the first value of the 3 estimations returned by core? (it always returns an array of 3 estimations) |
Looks like it is just "low", "medium", and "high", but low is not necessarily the minimum fee, but I think it could be fine if we just take over the "low" for this minimum value. I guess we should check with the wallets. |
@obycode sounds good. I think we can make that tweak in a next PR once we've touched base with them. |
## [8.6.0-beta.1](v8.5.0...v8.6.0-beta.1) (2025-01-28) ### Features * consider tenure block fullness for transaction fee estimations ([#2203](#2203)) ([396e2ea](396e2ea)) * store total transaction size in blocks table ([#2204](#2204)) ([ac7c41b](ac7c41b)) ### Bug Fixes * make tx_total_size column nullable ([#2207](#2207)) ([77bd2f8](77bd2f8))
🎉 This PR is included in version 8.6.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [8.6.0](v8.5.0...v8.6.0) (2025-02-06) ### Features * consider tenure block fullness for transaction fee estimations ([#2203](#2203)) ([396e2ea](396e2ea)) * store total transaction size in blocks table ([#2204](#2204)) ([ac7c41b](ac7c41b)) ### Bug Fixes * make tx_total_size column nullable ([#2207](#2207)) ([77bd2f8](77bd2f8)) * use an independent sql connection for mempool stats ([#2217](#2217)) ([f8137e4](f8137e4))
🎉 This PR is included in version 8.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Modifies the Stacks core fee estimator proxy to follow this algorithm:
All previous numbers are configurable via ENV: