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: reload from config for up-to-date satoshis_per_byte #4061

Merged

Conversation

tippenein
Copy link
Contributor

@tippenein tippenein commented Nov 14, 2023

feat #4047

introduces get_satoshis_per_byte fn for fetching most up to date value from config

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2023

CLA assistant check
All committers have signed the CLA.

@tippenein tippenein force-pushed the satoshis-per-byte-current-4047 branch from b1f82ff to 17e9864 Compare November 15, 2023 00:05
@tippenein
Copy link
Contributor Author

I'm not sure if it's desirable to do file reads every time a function needs spb but maybe it's nbd?

@wileyj
Copy link
Contributor

wileyj commented Nov 15, 2023

@tippenein can you change the target branch to develop? you may need to rebase

@@ -162,6 +162,13 @@ pub fn make_bitcoin_indexer(config: &Config) -> BitcoinIndexer {
burnchain_indexer
}

pub fn get_satoshis_per_byte(config: Config) -> u64 {
Copy link
Member

Choose a reason for hiding this comment

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

Do you think this could be an instance method of Config, and take &self?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's one usage on the LeaderBlockCommitFees impl that prevented me from doing this

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

Thank you for sending this PR @tippenein! It looks pretty good to me; just had a few of small comments that are easily addressed. EDIT: Also, I agree with @wileyj that this will need to be rebased on develop, since that's where all new non-consensus-breaking features land (i.e. we follow the gitflow branch model).

Do you think you could add some test coverage? A unit test that verifies that get_satoshis_per_byte() works as intended would suffice. Thanks!

@jcnelson
Copy link
Member

@tippenein I'm not sure if it's desirable to do file reads every time a function needs spb but maybe it's nbd?

Given how small the config file is, and how often it'll be loaded, it's probably going to be resident in at least the kernel's block cache in perpetuity. It's not a big deal at all :)

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (e6d2342) 0.04% compared to head (a6a75f2) 0.04%.
Report is 2 commits behind head on develop.

Files Patch % Lines
...-node/src/burnchains/bitcoin_regtest_controller.rs 0.00% 36 Missing ⚠️
testnet/stacks-node/src/config.rs 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #4061    +/-   ##
=========================================
  Coverage     0.04%    0.04%            
=========================================
  Files          401      401            
  Lines       287322   286810   -512     
=========================================
  Hits           136      136            
+ Misses      287186   286674   -512     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tippenein tippenein changed the base branch from master to develop November 15, 2023 04:25
@tippenein tippenein force-pushed the satoshis-per-byte-current-4047 branch from d61095d to 476c74c Compare November 15, 2023 04:32
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this PR!

Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

This LGTM, but can you add a CHANGELOG.md entry?

@tippenein tippenein force-pushed the satoshis-per-byte-current-4047 branch from 85e101c to a6a75f2 Compare November 17, 2023 17:08
@jcnelson jcnelson merged commit 0929a8b into stacks-network:develop Nov 17, 2023
2 checks passed
@jcnelson
Copy link
Member

Congratulations on your first accepted PR @tippenein! 🥳

@cylewitruk
Copy link
Member

Congrats, @tippenein :D Welcome :)

@tippenein tippenein deleted the satoshis-per-byte-current-4047 branch November 17, 2023 22:12
jcnelson added a commit that referenced this pull request Dec 31, 2023
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.

None yet

6 participants