Skip to content

fix: use isolates in bip340 event verifier#345

Merged
frnandu merged 8 commits intomasterfrom
fix/bip340-isolate
Jan 16, 2026
Merged

fix: use isolates in bip340 event verifier#345
frnandu merged 8 commits intomasterfrom
fix/bip340-isolate

Conversation

@frnandu
Copy link
Collaborator

@frnandu frnandu commented Dec 22, 2025

No description provided.

@frnandu frnandu requested review from 1-leo and nogringo December 22, 2025 01:13
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.64%. Comparing base (61b39b1) to head (1533678).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
.../repositories/verifiers/bip340_event_verifier.dart 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #345   +/-   ##
=======================================
  Coverage   71.64%   71.64%           
=======================================
  Files         142      142           
  Lines        5283     5287    +4     
=======================================
+ Hits         3785     3788    +3     
- Misses       1498     1499    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@1-leo
Copy link
Contributor

1-leo commented Dec 22, 2025

can we merge #327 (and #332)
before?
Then we can reuse the isolate, reducing the overhead:

Used like this:

    final data = await IsolateManager.instance
        .runInComputeIsolate<PARAMTYPE, RETURNTYPE>(
      <function>,
      <params>
    );

    final data = await IsolateManager.instance
        .runInComputeIsolate<_MiningParams, Nip01Event>(
      _mineEventInIsolate,
      _MiningParams(
        event: event,
        targetDifficulty: targetDifficulty,
        maxIterations: maxIterations ?? 1000000,
      ),
    );
    

Copy link
Contributor

@1-leo 1-leo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frnandu
Copy link
Collaborator Author

frnandu commented Dec 22, 2025

can we merge #327 (and #332) before? Then we can reuse the isolate, reducing the overhead:

Used like this:

    final data = await IsolateManager.instance
        .runInComputeIsolate<PARAMTYPE, RETURNTYPE>(
      <function>,
      <params>
    );

    final data = await IsolateManager.instance
        .runInComputeIsolate<_MiningParams, Nip01Event>(
      _mineEventInIsolate,
      _MiningParams(
        event: event,
        targetDifficulty: targetDifficulty,
        maxIterations: maxIterations ?? 1000000,
      ),
    );
    

depends if performance-wise verifying a lot of events proves to be noticeable better with Isolate.run than using only 1 isolate for all events sequentially ....(assuming no pool mechanism exists or be added in near-term to IsolateManager)

@frnandu frnandu added this to the 0.7 milestone Dec 22, 2025
@frnandu frnandu self-assigned this Jan 14, 2026
@frnandu
Copy link
Collaborator Author

frnandu commented Jan 15, 2026

applied the fix from #346 and changed to use IsolateManager.instance.runInComputeIsolate so should be ready to merge

@frnandu frnandu requested a review from 1-leo January 15, 2026 20:11
@frnandu frnandu changed the title fix: use isolate.run in bip340 event verifier fix: use isolates in bip340 event verifier Jan 15, 2026
@frnandu frnandu merged commit 2174eb4 into master Jan 16, 2026
3 checks passed
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.

3 participants