Skip to content

Adaptive master block collation frequency#885

Merged
Rexagon merged 9 commits intomasterfrom
851-adaptive-master-block-collation-frequency
Sep 10, 2025
Merged

Adaptive master block collation frequency#885
Rexagon merged 9 commits intomasterfrom
851-adaptive-master-block-collation-frequency

Conversation

@SmaGMan
Copy link
Copy Markdown
Member

@SmaGMan SmaGMan commented Sep 2, 2025

Pull Request Checklist

NODE CONFIGURATION MODEL CHANGES

None

BLOCKCHAIN CONFIGURATION MODEL CHANGES

Yes

  • added .params.28.mc_block_max_interval_ms
  • added supported capability CapOmitMasterBlockHistory = 34

COMPATIBILITY

Affected features:

  1. Message Processing Algorithm - incompatible, externals reading changed

  2. Collation management - incompatible. New version may choose other anchors for collation

  • master collated when min interval reached and
    • no pending messages after shard block
    • or collated shard block with externals
  • master collated after max interval reached when no externals in shard blocks or no shard blocks at all

SPECIAL DEPLOYMENT ACTIONS

Required:
Update master block intervals in blockchain config after deployment

.params.28.mc_block_min_interval_ms = 1000
.params.28.mc_block_max_interval_ms = 3000

Attention:

  • Updated nodes will produce invalid blocks until 2/3+1 updated
  • By default min interval will be used as max until the blockchain config updated

PERFORMANCE IMPACT

Expected impact

With min interval = 1000 and max interval = 3000 the avg latency will be reduced to ~1.3 sec

[2025-09-03T16:03:24Z INFO  nekroddos::latency]
Successful transactions: 500
Failed transactions: 0
Average latency: 1.301128751s
P50 latency: 1.20439826s
P95 latency: 2.24626334s
P99 latency: 2.395625692s

metrics


TESTS

Unit Tests

Covered by:

  • test_detect_next_collation_step
  • test_import_init_anchors

Network Tests

No special coverage

Manual Tests

Manual tests used:

  • transfers 20k
  • swaps 1500
  • deploy 10kk
  • ping-pong 100
  • latency 500 tx

metrics

ping-pong 100 metrics

@SmaGMan SmaGMan linked an issue Sep 2, 2025 that may be closed by this pull request
@SmaGMan SmaGMan force-pushed the 851-adaptive-master-block-collation-frequency branch from 0bc0d3f to 36a4a4f Compare September 2, 2025 14:11
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 2, 2025

🧪 Network Tests

To run network tests for this PR, use:

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

Available test options:

  • Run all tests: gh workflow run network-tests.yml -f pr_number=885
  • Run specific test: gh workflow run network-tests.yml -f pr_number=885 -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 Sep 2, 2025

Codecov Report

❌ Patch coverage is 84.85714% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.81%. Comparing base (c1b5cc5) to head (5c65887).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
collator/src/collator/do_collate/finalize.rs 0.00% 17 Missing ⚠️
collator/src/collator/do_collate/mod.rs 0.00% 14 Missing ⚠️
collator/src/manager/mod.rs 94.73% 11 Missing ⚠️
collator/src/collator/types.rs 92.18% 3 Missing and 2 partials ⚠️
collator/src/collator/mod.rs 85.18% 4 Missing ⚠️
cli/src/cmd/tools/gen_zerostate.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #885      +/-   ##
==========================================
+ Coverage   46.66%   46.81%   +0.14%     
==========================================
  Files         326      326              
  Lines       58145    58312     +167     
  Branches    58145    58312     +167     
==========================================
+ Hits        27136    27301     +165     
- Misses      29587    29590       +3     
+ Partials     1422     1421       -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.

@SmaGMan SmaGMan force-pushed the 851-adaptive-master-block-collation-frequency branch from 36a4a4f to 1ff8acd Compare September 2, 2025 14:16
@SmaGMan SmaGMan marked this pull request as ready for review September 2, 2025 16:14
@SmaGMan SmaGMan requested review from Rexagon and drmick September 2, 2025 16:15
@SmaGMan SmaGMan requested a review from 0xdeafbeef September 2, 2025 16:15
@SmaGMan SmaGMan marked this pull request as draft September 2, 2025 16:27
@SmaGMan SmaGMan force-pushed the 851-adaptive-master-block-collation-frequency branch 2 times, most recently from 4ca4c0c to 3fa51d5 Compare September 3, 2025 16:16
@SmaGMan SmaGMan marked this pull request as ready for review September 3, 2025 16:16
@SmaGMan SmaGMan marked this pull request as draft September 4, 2025 14:44
@SmaGMan SmaGMan force-pushed the 851-adaptive-master-block-collation-frequency branch from 3fa51d5 to 1599f9a Compare September 4, 2025 21:03
@SmaGMan SmaGMan marked this pull request as ready for review September 5, 2025 08:29
@Rexagon Rexagon added this pull request to the merge queue Sep 10, 2025
Merged via the queue into master with commit 4ce5a7b Sep 10, 2025
20 checks passed
@Rexagon Rexagon deleted the 851-adaptive-master-block-collation-frequency branch September 10, 2025 10:18
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.

Adaptive master block collation frequency

3 participants