-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove static instantiation of network_constants #3420
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…stantiating statically.
… belong, rather than on network_constants.
…et rather than instantiating it statically.
…itializing statically.
… constructing it.
…dard always_log message. We don't log error messages to cerr so this was out of place. Removing an unnecessary check for vacuuming within unit tests. This would be functionally equivalent yet potentially a performance issue. Timing the unit tests showed < 1% difference in time.
…coroutines are no longer used.
…ms initialization on to nano::work_thresholds class where they belong.
…_thresholds whre it belongs and to remove static instantiation of network_constants.
…ferences to nano::network_constants from within the ledger processor.
…'s redundant and removing static instantiation of network_constants.
…ssociated static instantiation of network_constants. No appreciable difference in unit test speed.
…on't directly have access to the network constants. node_rpc_config::set_request_callback is used for testing though nothing functionally requires it to be called from a unit test context. write_database_queue::contains checks that it's only called in a unit test context though this is also not functionally required. Calling the count function on several of the db tables has a performance impact though nothing about it is functionally incorrect and the caller needs to determine if the performance hit is acceptable.
…s the responsibility of determining difficulty fully on to work_thresholds rather than splitting this responsibliity with nano::block.
…oesn't need a static reference.
…olding a reference.
…ias with other instances of ledger_constants.
…nd including a referencing it within ledger_constants and network_constants instead of creating copies.
zhyatt
added
the
quality improvements
This item indicates the need for or supplies changes that improve maintainability
label
Aug 10, 2021
dsiganos
approved these changes
Aug 11, 2021
thsfs
approved these changes
Aug 11, 2021
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
quality improvements
This item indicates the need for or supplies changes that improve maintainability
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change removes static references to network_constants that were littered around the code. Additionally, free-functions related to work difficulty and value calculations were moved on to the work_thrsholds class.
This PR is best reviewed on a per-commit basis, each commit is self-contained with clean test runs.