Remove statics from tproxy and jdc#432
Open
Shourya742 wants to merge 4 commits intostratum-mining:mainfrom
Open
Remove statics from tproxy and jdc#432Shourya742 wants to merge 4 commits intostratum-mining:mainfrom
Shourya742 wants to merge 4 commits intostratum-mining:mainfrom
Conversation
…d make adjustments accordingly
… sure that we don't send mining message upstream
8dfe1b6 to
27c48c0
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR removes the use of static variables that were previously used to specify the operating mode (in JDC:
FullTemplate/CoinbaseOnly/SoloMining, and in Tproxy:Aggregated/NonAggregated). While static approach works fine in production where a single binary simulates the process, it does not work well in integration tests (IT), where these components are used as libraries. In such cases, the test harness is built once, and static global variables are placed in the binary’s data section, remaining valid for the entire runtime. However, for testing, we need the ability to change this value dynamically in accordance to start method invocation. Although it is technically possible to mutate these values (as done in JDC), doing so can introduce non-deterministic behavior. When multiple such tasks run in parallel, they may modify the shared state concurrently without proper coordination, leading to unpredictable results.This PR updates both Tproxy and JDC to eliminate statics and instead initialize the mode locally within the
startmethod.closes: #430