Skip to content

Conversation

@pashinov
Copy link
Member

@pashinov pashinov commented Oct 14, 2025

Pull Request Checklist

NODE CONFIGURATION MODEL CHANGES

Yes

Added .core_storage.store_shard_state_step: u32 with default value 2.

BLOCKCHAIN CONFIGURATION MODEL CHANGES

None


COMPATIBILITY

Fully compatible

SPECIAL DEPLOYMENT ACTIONS

Not Required


PERFORMANCE IMPACT

States GC stopped lagging -> cells cache stopped growing -> network degradation fixed. TPS increased by 10-15%. Storage timings a little decreased.


TESTS

Yes

Manual Tests

Manual Tests

Deploy 10M accounts then run 20k transfers

image
image

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

🧪 Network Tests

To run network tests for this PR, use:

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

Available test options:

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

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 36.30573% with 100 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.27%. Comparing base (edb15c6) to head (159efed).

Files with missing lines Patch % Lines
collator/src/state_node.rs 5.81% 80 Missing and 1 partial ⚠️
core/src/storage/shard_state/mod.rs 74.07% 6 Missing and 8 partials ⚠️
collator/src/collator/do_collate/mod.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #937      +/-   ##
==========================================
- Coverage   46.28%   46.27%   -0.02%     
==========================================
  Files         335      335              
  Lines       60474    60623     +149     
  Branches    60474    60623     +149     
==========================================
+ Hits        27990    28051      +61     
- Misses      31042    31104      +62     
- Partials     1442     1468      +26     

☔ 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.

@pashinov pashinov self-assigned this Oct 14, 2025
@pashinov pashinov linked an issue Oct 14, 2025 that may be closed by this pull request
@pashinov pashinov force-pushed the feat/reduce-state-writes branch from e49c772 to 6eb936e Compare October 14, 2025 12:47
@pashinov pashinov requested review from 0xdeafbeef, Rexagon and SmaGMan and removed request for Rexagon and SmaGMan October 14, 2025 12:47
@pashinov pashinov force-pushed the feat/reduce-state-writes branch 2 times, most recently from 3687b3f to 79a1a97 Compare October 16, 2025 10:34
@pashinov pashinov force-pushed the feat/reduce-state-writes branch from 79a1a97 to 159efed Compare October 16, 2025 14:39
// if it is finished, then we can just reload prev state
if last_task.store_new_state_task.is_finished() {
if last_task.store_new_state_task.is_finished()
&& last_task.block_id.seqno.is_multiple_of(store_state_step)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it will be better to use more clear helper, e.g. self.state_node_adapter.check_should_store_state(..block_id.seqno)?

while let Some((block_id, merkle_update)) = chain.pop() {
let prev_block_id = *state.block_id();
state = rayon_run({
move || state.par_make_next_state(&block_id, &merkle_update, Some(5))
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have 2+ places with a magic constant 5. Maybe it is worth to add a new param to the node config?


tracing::debug!(target: tracing_targets::STATE_NODE_ADAPTER, "Load state: {}", block_id.as_short_id());

let state = self
Copy link
Contributor

Choose a reason for hiding this comment

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

Now we have duplicating code here and in ShardStateStorage. Maybe it will be better to wrap the shard blocks cache into a some kind of ShardBlocksProvider that we can pass to ShardStateStorage::load_state(). So it will try to get shard block from provider or then load it from the db. Out of StateNodeAdapter we will pass an empty provider.

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.

Store not all shard states to db

3 participants