Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize domain blocks and default domain block and state pruning #3372

Merged
merged 9 commits into from
Feb 10, 2025

Conversation

vedhavyas
Copy link
Member

@vedhavyas vedhavyas commented Feb 7, 2025

This PR brings following changes

  • Finalize domain block that is confirmed in the Finalized consensus block
  • Cleanup AUX storages for finalized domain blocks
  • Set challenge_period * 2 blocks for block and state pruning beyond the finalized domain blocks

Closes: #2353
Closes: #3005

Code contributor checklist:

@vedhavyas vedhavyas requested a review from teor2345 February 7, 2025 04:33
@vedhavyas vedhavyas added the audit-P3 Low audit priority label Feb 7, 2025
Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Look good in general, left some questions.

Also, this PR set proper block/state pruning arg for the domain chain, we also need to ensure the corresponding consensus block/state are not pruned because they are required by FP generation.

@vedhavyas vedhavyas requested a review from NingLin-P February 9, 2025 08:07
Copy link
Member

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Just some questions about how the code works, overall it makes sense to me.

Edit: none of these are blocking, feel free to resolve or ask me to open a PR instead.

@@ -51,6 +51,7 @@ sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a814
sc-proof-of-time = { version = "0.1.0", path = "../sc-proof-of-time" }
sc-subspace-chain-specs = { version = "0.1.0", path = "../sc-subspace-chain-specs" }
sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false }
sc-state-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

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

Nit: There are no explicit features or optional dependencies in this crate, and it uses std collections unconditionally:
https://github.com/autonomys/polkadot-sdk/blob/94a1a8143a89bbe9f938c1939ff68abc1519a305/substrate/client/state-db/Cargo.toml

It doesn’t matter much either way, but it’s slightly confusing to suggest there are features we’re not using:

Suggested change
sc-state-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false }
sc-state-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305" }

@vedhavyas vedhavyas requested a review from teor2345 February 10, 2025 08:48
teor2345
teor2345 previously approved these changes Feb 10, 2025
Copy link
Member

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Good enough to merge, I don't mind if you want to tweak that comment (or not).

NingLin-P
NingLin-P previously approved these changes Feb 10, 2025
Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Thanks! just one nit, non-blocker for this PR.

@vedhavyas vedhavyas added this pull request to the merge queue Feb 10, 2025
@vedhavyas vedhavyas removed this pull request from the merge queue due to a manual request Feb 10, 2025
@vedhavyas
Copy link
Member Author

Forgot to add TODO :(

@vedhavyas vedhavyas dismissed stale reviews from NingLin-P and teor2345 via 5890173 February 10, 2025 13:32
@vedhavyas vedhavyas enabled auto-merge February 10, 2025 13:32
@vedhavyas vedhavyas disabled auto-merge February 10, 2025 16:09
@vedhavyas vedhavyas enabled auto-merge February 10, 2025 16:09
@vedhavyas vedhavyas added this pull request to the merge queue Feb 10, 2025
Merged via the queue into main with commit 8dcc0fd Feb 10, 2025
8 checks passed
@vedhavyas vedhavyas deleted the domain_block_state_pruning branch February 10, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-P3 Low audit priority
Projects
None yet
3 participants