-
Couldn't load subscription status.
- Fork 713
Added tenure size checker/limiter #6486
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Added some comments for improvements.
One thing I think it missing is an update to the code where the miner decides whether or not it should attempt to tenure extend, see stacks-node/src/nakamoto_node/miner.rs:1676
// Do not extend if we have spent < 50% of the budget, since it is
// not necessary.
let usage = self
.tenure_budget
.proportion_largest_dimension(&self.tenure_cost);
if usage < self.config.miner.tenure_extend_cost_threshold {
return Ok(NakamotoTenureInfo {
coinbase_tx: None,
tenure_change_tx: None,
});
}I think it should also attempt to extend if the size is >50% of the budget.
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'm not seeing the code where the miner checks max_tenure_size to stop mining blocks?
I did it for allowing smaller transactions to be included (given that the check is done at transaction inclusion). The only case I see for completely disabling block mining is if the current tenure size is so near to the limit that it is impossibile for any transaction to be included |
Love it, working on it |
|
Looks like CI is still failing |
|
@jcnelson @brice-stacks i have removed the miner logic for automatic tenure extend based on tenure size. Before merging i think it is worthy to be sure that DEFAULT_MAX_TENURE_BYTES (currently 10 MB) is a solid value. (currently it has been choosen fully arbitrary) |
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.
Just need answers to a couple of comments.
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.
LGTM!
Head branch was pushed to by a user without write access
0f36e8a
Description
This patch introduces monitoring and limiting for the size of a whole tenure. Note that tenure extend resets the counter.
For allowing more targeted tests, it introduces a config option for the miner (not exposed to the file based configuration) for enabling logging of skipped transactions (that are not logged or sent to the event system).
Applicable issues
Additional info (benefits, drawbacks, caveats)
Checklist
docs/rpc/openapi.yamlandrpc-endpoints.mdfor v2 endpoints,event-dispatcher.mdfor new events)clarity-benchmarkingrepobitcoin-tests.yml