Skip to content

feat: increase default min-retain-blocks to 100_000#6949

Draft
rach-id wants to merge 1 commit intocelestiaorg:mainfrom
rach-id:rach-id/default-min-retain-blocks-100k
Draft

feat: increase default min-retain-blocks to 100_000#6949
rach-id wants to merge 1 commit intocelestiaorg:mainfrom
rach-id:rach-id/default-min-retain-blocks-100k

Conversation

@rach-id
Copy link
Copy Markdown
Member

@rach-id rach-id commented Apr 1, 2026

Summary

  • Add DefaultMinRetainBlocks = 100_000 const to appconsts and use it as the default in DefaultAppConfig()

Closes #6947

Test plan

  • TestDefaultAppConfig updated and passes
  • Verify bridge node can sync from a consensus node retaining 100k blocks

🤖 Generated with Claude Code


Open with Devin

Increase the default from 3000 to 100_000 to ensure bridge nodes can
sync from consensus nodes using the default configuration.

Closes celestiaorg#6947

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rach-id rach-id requested a review from a team as a code owner April 1, 2026 13:51
@rach-id rach-id requested review from mcrakhman and removed request for a team April 1, 2026 13:51
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@rach-id rach-id requested review from rootulp April 1, 2026 13:51
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@rach-id
Copy link
Copy Markdown
Member Author

rach-id commented Apr 1, 2026

In order to confirm this works, @walldiss do you remember in which setup the bridge node wasn't able to sync? would like to test it and see before I merge this PR

Copy link
Copy Markdown
Member

@ninabarbakadze ninabarbakadze left a comment

Choose a reason for hiding this comment

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

lgtm as long as we manually verify

@rach-id rach-id marked this pull request as draft April 1, 2026 15:25
@rach-id
Copy link
Copy Markdown
Member Author

rach-id commented Apr 1, 2026

turning to draft to avoid merging accidentally

Comment on lines 28 to 31
// MinRetainBlocks is the minimum number of blocks to retain for state sync.
// This ensures all blocks in the snapshot window (SnapshotInterval × SnapshotKeepRecent)
// are retained so other nodes can sync from snapshots.
MinRetainBlocks uint64 = 3000
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[question] If this constant is now unused, can we delete?

Comment on lines +33 to +36
// DefaultMinRetainBlocks is the default number of blocks to retain in the
// block store. This value is large enough for bridge nodes to sync while
// still bounding block store growth for operators who don't change the default.
DefaultMinRetainBlocks uint64 = 100_000
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

100,000 blocks * 6 seconds per block = 600,000 seconds / 60 seconds per minute / 60 minutes per hour = 166.6666666667 hours = 6.9166666667 days

  • Do we want this to be a bit higher than 7 days as a buffer in case blocks avg less than 6 seconds?
  • Do we want to add a unit test or follow-up issue to modify this for v9 because we will reduce the block time to 3 seconds so this will have to double to remain ~7 days

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Very good idea 👍 once we test this, I'll address this feedback

@rach-id
Copy link
Copy Markdown
Member Author

rach-id commented Apr 6, 2026

I tested this in a local node with the min-retain-blocks set to 3000 and the bridge node is able to sync:

  1. I started a bridge node when the node was < 3000 blocks
  2. Then, I started another one when the node was > 3000 blocks
  3. Then another one when the node was > 6000 blocks

and it worked everytime without errors.

cc @walldiss

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.

feat: default min-retain-blocks to appconsts.MinRetainBlocks instead of 0

3 participants