substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Remove discarded blocks and states from database by default

Open hzy1919 opened this issue 3 years ago • 8 comments

Fixes #11912

1.Add state_pruning's sub-param archive-canonical in sc-cli. 2.Change blocks_pruning to be like state_pruning : use the string archive for BlocksPruning::KeepAll and archive-canonical(and default) for BlocksPruning::KeepFinalized and then a number of BlocksPruning::Some(x).

polkadot companion: https://github.com/paritytech/polkadot/pull/5992 cumulus companion: https://github.com/paritytech/cumulus/pull/1613

hzy1919 avatar Aug 05 '22 09:08 hzy1919

There's no need to change the defult pruning mode. It should remain at 256 block history.

arkpar avatar Aug 09 '22 17:08 arkpar

Regarding https://github.com/paritytech/substrate/issues/11912, adding a CLI for ArchiveCanonical only fixes it half way. The major piece of work required here is to remove block bodies, and not just state. This part is a bit more involved.

arkpar avatar Aug 09 '22 17:08 arkpar

Regarding #11912, adding a CLI for ArchiveCanonical only fixes it half way. The major piece of work required here is to remove block bodies, and not just state. This part is a bit more involved.

Well , I'll rethink where to start...

hzy1919 avatar Aug 10 '22 00:08 hzy1919

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 09 '22 01:09 stale[bot]

Looks good with some minor comments. One addition that's also required here, is that prune_block function also deletes justification data.

		utils::remove_from_db(
			transaction,
			&*self.storage.db,
			columns::KEY_LOOKUP,
			columns::JUSTIFICATIONS,
			id,
		)?;

arkpar avatar Sep 09 '22 10:09 arkpar

Looks good with some minor comments. One addition that's also required here, is that prune_block function also deletes justification data.

Done.

hzy1919 avatar Sep 10 '22 08:09 hzy1919

Looks good. Could also use a companion PR to the polkadot repo. See here: https://github.com/paritytech/substrate/blob/master/docs/CONTRIBUTING.adoc#updating-polkadot-as-well

arkpar avatar Sep 13 '22 07:09 arkpar

Looks good. Could also use a companion PR to the polkadot repo. See here: https://github.com/paritytech/substrate/blob/master/docs/CONTRIBUTING.adoc#updating-polkadot-as-well

yeah, I added before. :D

hzy1919 avatar Sep 14 '22 02:09 hzy1919

Ty @hzy1919

bkchr avatar Sep 26 '22 07:09 bkchr

bot merge

bkchr avatar Sep 26 '22 07:09 bkchr

Error: "Check reviews" status is not passing for https://github.com/paritytech/cumulus/pull/1613

bot merge

bkchr avatar Sep 26 '22 07:09 bkchr

Ty @hzy1919

You're welcome. @bkchr

hzy1919 avatar Sep 27 '22 10:09 hzy1919

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-39/2277/1

Polkadot-Forum avatar Mar 09 '23 19:03 Polkadot-Forum