Skip to content

Handle SetCustomMiningJobError in translator and JD mining upstream (#142) - #282

Open
ANAMASGARD wants to merge 1 commit into
dmnd-pool:masterfrom
ANAMASGARD:fix-set-custom-mining-job-error
Open

Handle SetCustomMiningJobError in translator and JD mining upstream (#142)#282
ANAMASGARD wants to merge 1 commit into
dmnd-pool:masterfrom
ANAMASGARD:fix-set-custom-mining-job-error

Conversation

@ANAMASGARD

Copy link
Copy Markdown

Summary

  • Translator upstream: Replace unimplemented!() in handle_set_custom_mining_job_error with structured error logging and Ok(SendTo::None(None)), preventing process panic when the pool rejects token-update SetCustomMiningJob requests.
  • JD mining upstream: On SetCustomMiningJobError, log the rejection reason, clear the pending request_id -> template_id mapping via take_template_id, and set IS_CUSTOM_JOB_SET so the job declarator is not blocked for up to 120s.
  • Maintenance: Comment out SetCustomMiningJobError in the translator parse_incoming todo!() arm (consistent with SubmitSharesError); fix success-handler log typo (SetupConnectionSuccessSetCustomMiningJobSuccess).

Closes #142

Changes

File What changed
src/translator/upstream/upstream.rs Error handler + parse_incoming cleanup + unit test
src/jd_client/mining_upstream/upstream.rs Error handler with mapping cleanup + log typo fix + unit test

Test plan

  • cargo build
  • cargo test set_custom_mining_job_error
  • cargo test (81 passed, 2 ignored)

What the tests prove

Test Assertion
translator::upstream::upstream::tests::set_custom_mining_job_error_does_not_panic Handler returns Ok(SendTo::None(None)) without panicking
jd_client::mining_upstream::upstream::tests::set_custom_mining_job_error_clears_request_mapping request_id mapping removed; IS_CUSTOM_JOB_SET == true

Log pool rejection reasons, avoid translator panic on custom job errors,
and clean up JD request_id mappings while unblocking the custom-job wait flag.
Fixes dmnd-pool#142

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
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.

Handle SetCustomMiningJobError

1 participant