Skip to content

explicit cancel collation flow#1083

Merged
SmaGMan merged 14 commits into
masterfrom
refactor/cancel-collation
May 22, 2026
Merged

explicit cancel collation flow#1083
SmaGMan merged 14 commits into
masterfrom
refactor/cancel-collation

Conversation

@SmaGMan
Copy link
Copy Markdown
Member

@SmaGMan SmaGMan commented May 12, 2026

Use explicit flow to cancel active collations on the block mismatch or when received a block from bc far ahead of last collated. Now we drain active collation tasks in a separate cancel task and do not relay on collator result cancellation using flags. Removed races when shard collator trying to collate next block even if cancellation requested before sync.

Collation manager code was splitted on several modules.

Pull Request Checklist

NODE CONFIGURATION MODEL CHANGES

None

BLOCKCHAIN CONFIGURATION MODEL CHANGES

None

COMPATIBILITY

Fully compatible

SPECIAL DEPLOYMENT ACTIONS

Not Required


PERFORMANCE IMPACT

No impact expected


TESTS

Unit Tests

No special coverage

Network Tests

No special coverage

Manual Tests

Manual tests used on devnet5

  • transfers 30k
  • externals 100k
  • deploy 30kk
  • transfers 30k
  • transfers 50k
  • dex 2000

Notes/Additional Comments:

Better to review all commits except the last one separately because the last commit only moves working code from a single file to a several modules.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

🧪 Network Tests

To run network tests for this PR, use:

gh workflow run network-tests.yml -f pr_number=1083

Available test options:

  • Run all tests: gh workflow run network-tests.yml -f pr_number=1083
  • Run specific test: gh workflow run network-tests.yml -f pr_number=1083 -f test_selection=ping-pong

Test types: destroyable, ping-pong, one-to-many-internal-messages, fq-deploy, nft-index, persistent-sync

Results will be posted as workflow runs in the Actions tab.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 52.04741% with 445 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.52%. Comparing base (a87ef36) to head (9c7f32e).

Files with missing lines Patch % Lines
collator/src/manager/sync.rs 62.42% 101 Missing and 20 partials ⚠️
collator/src/manager/commit.rs 0.00% 82 Missing ⚠️
collator/src/manager/state_update_handler.rs 59.17% 60 Missing and 9 partials ⚠️
collator/src/manager/collation_cancel.rs 49.59% 59 Missing and 3 partials ⚠️
collator/src/manager/msgs_queue.rs 62.83% 48 Missing and 7 partials ⚠️
collator/src/collator/mod.rs 0.00% 16 Missing ⚠️
collator/src/manager/active_collators.rs 40.74% 16 Missing ⚠️
collator/src/collator/types.rs 0.00% 12 Missing ⚠️
collator/src/manager/cancel_validation_runner.rs 76.19% 2 Missing and 3 partials ⚠️
collator/src/collator/do_collate/mod.rs 0.00% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1083      +/-   ##
==========================================
- Coverage   58.97%   57.52%   -1.45%     
==========================================
  Files         459      464       +5     
  Lines       76888    77109     +221     
  Branches    76888    77109     +221     
==========================================
- Hits        45342    44357     -985     
- Misses      29434    30733    +1299     
+ Partials     2112     2019      -93     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SmaGMan SmaGMan force-pushed the refactor/cancel-collation branch 3 times, most recently from 7d84320 to 17de686 Compare May 14, 2026 12:08
@SmaGMan SmaGMan marked this pull request as ready for review May 14, 2026 12:08
@SmaGMan SmaGMan requested review from 0xdeafbeef and Rexagon May 14, 2026 12:08
@SmaGMan SmaGMan force-pushed the refactor/cancel-collation branch from 17de686 to 1aa75f5 Compare May 14, 2026 12:18
@SmaGMan SmaGMan marked this pull request as draft May 15, 2026 11:27
@SmaGMan SmaGMan force-pushed the refactor/cancel-collation branch from 1aa75f5 to 356af0e Compare May 16, 2026 12:10
@SmaGMan SmaGMan marked this pull request as ready for review May 17, 2026 13:57
@SmaGMan SmaGMan force-pushed the refactor/cancel-collation branch from 40873e7 to d266b3b Compare May 21, 2026 16:49
…ync to prevent incorrect behaviour in `detect_next_collation_step` on stale statuses
@SmaGMan SmaGMan force-pushed the refactor/cancel-collation branch from d266b3b to 9c7f32e Compare May 21, 2026 22:12
Copy link
Copy Markdown
Member

@0xdeafbeef 0xdeafbeef left a comment

Choose a reason for hiding this comment

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

lgtm

@SmaGMan SmaGMan added this pull request to the merge queue May 22, 2026
Merged via the queue into master with commit b0a5a87 May 22, 2026
21 of 23 checks passed
@SmaGMan SmaGMan deleted the refactor/cancel-collation branch May 22, 2026 13:35
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