-
Notifications
You must be signed in to change notification settings - Fork 136
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
CI migration: translation-proxy
MG to Integration Test
#1208
Comments
a comment about mocking roles here: even though the MG test is mocking an upstream, we could theoretically achieve this kind of test by connecting tProxy to a Pool, which would do the same things the mock is doing:
so (differently from #1207) there's no strong reason to use a mock here, aside for simplicity. so far I don't really have a strong opinion on whether we should do this integration test with a mock or a real upstream. the only pro-mock argument I can think of is: maybe launching a real TP+Pool could make the test execution slower than necessary? but yeah, not a strong opinion. |
This comment was marked as outdated.
This comment was marked as outdated.
this tProxy CI migration is currently blocked by the fact that shares are undeterministic, which makes it hard to determine the appropriate timing for the Integration Test runtime to halt the current naive approach is to we have two alternatives:
the second approach is described on #1282 and potentially solved via #1283 |
WARNING: this commit is just to illustrate how to unblock stratum-mining#1208 DO NOT CHERRY PICK, we still need to fix unnecessary JDC logic
The
translation-proxy
MG test displays undeterministic behavior on CI.The MG test does the following:
tProxy will establish a channel with the mocked upstream with some predefined difficulty target (via
OpenExtendedMiningChannel
)once tProxy receives a
NewExtendedMiningJob
, it forwards it to the CPU miner (as Sv1 messages)the lack of determinism comes from the fact that two different things could happen after
NewExtendedMiningJob
is sent:SubmitSharesExtended
to its upstreamUpdateChannel
it's impossible for us to know beforehand the
nominal_hash_rate
of the CPU miner (since it depends on the available system resources)as a consequence, we often see the following error on the current MG CI:
0x1b
, which meansSubmitSharesExtended
0x16
, which meansUpdateChannel
(ref: Message Types Spec)
that is because the MG test is fixed in a way that after sending
NewExtendedMiningJob
, it expects ONLYSubmitSharesExtended
, so whenever the difficulty adjustment finishes BEFORE a valid share is found, CI breaks#1059 was meant to add this kind of functionality to MG, which would allow it to assert that EITHER one specific message OR another arrived. Unfortunately, the trade-offs on the engineering effort for implementing this feature on MG didn't seem appealing.
hopefully the Integration Test framework will give us enough flexibility to avoid this kind of problem
The text was updated successfully, but these errors were encountered: