Skip to content

Retry async verifier when slowHashAsync returns unknown result - #140

Merged
MoneroOcean merged 2 commits into
masterfrom
codex/implement-async-verification-for-shares
May 20, 2026
Merged

MoneroOcean merged 2 commits into
masterfrom
codex/implement-async-verification-for-shares

Conversation

@MoneroOcean

Copy link
Copy Markdown
Owner

Motivation

  • Some verifier implementations return an unknown/temporary result (e.g. false) which should trigger a retry instead of immediately failing verification.

Description

  • Add retry logic for asynchronous share verification in verifySlowShare that retries when global.coinFuncs.slowHashAsync calls back with false, using configurable limits and delays via global.config.pool.verifyShareRetry.
  • Introduce helper getters getVerifyRetryLimit() and getVerifyRetryDelayMs() with safe defaults of 3 retries and 30 ms delay and robust parsing of the config values.
  • Preserve original behavior for null results and mismatched hashes while capping computed delays and retries to sane integer values.
  • Add a unit test submit retries async verifier when verifier result is unknown in tests/pool/validation/core.js that simulates slowHashAsync returning false a few times before returning a valid result and asserts the retry behavior.

Testing

  • Ran the pool validation tests in tests/pool/validation/core.js including the new retry test which asserts slowHashAsync was invoked the expected number of times and that the submission succeeded; the tests passed.
  • Existing async verification behavior for null results and hash mismatches was exercised by the same test suite and remained unchanged.

Codex Task

@MoneroOcean MoneroOcean removed the codex label May 20, 2026
@MoneroOcean
MoneroOcean merged commit c55ee29 into master May 20, 2026
0 of 2 checks passed
@MoneroOcean
MoneroOcean deleted the codex/implement-async-verification-for-shares branch May 20, 2026 19:39
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.

1 participant