Remove statics from tproxy and jdc#432
Merged
Shourya742 merged 5 commits intostratum-mining:mainfrom Apr 24, 2026
Merged
Conversation
8dfe1b6 to
27c48c0
Compare
27c48c0 to
5007a00
Compare
Member
Author
|
I think Gimballock's AI explained the issue here: #373 (comment) |
plebhash
reviewed
Apr 23, 2026
plebhash
reviewed
Apr 23, 2026
Member
|
a similar integration test to avoid JDC regressions: ea9e7f3 |
5007a00 to
0b4daf8
Compare
Member
Author
Picked, thanks |
plebhash
reviewed
Apr 24, 2026
plebhash
approved these changes
Apr 24, 2026
0b4daf8 to
ae61b15
Compare
GitGab19
reviewed
Apr 24, 2026
GitGab19
reviewed
Apr 24, 2026
GitGab19
reviewed
Apr 24, 2026
GitGab19
approved these changes
Apr 24, 2026
…d make adjustments accordingly
… sure that we don't send mining message upstream
ae61b15 to
7b4a82a
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