Skip to content

Conversation

@michalkucharczyk
Copy link
Contributor

@michalkucharczyk michalkucharczyk commented Sep 23, 2025

This PR adds an option to prevent TrieDBMut from committing implicitly on drop.

This PR extends the TrieDBMut implementation to provide better control over when changes are committed to the database.

Changes:

  • commit_on_drop flag added to TrieDBMut,
  • Added without_commit_on_drop method to TrieDBMutBuilder which configures the builder to create a non-commiting TrieDBMut instance for cases where commit on drop is undesired.

Part of: paritytech/polkadot-sdk#6020

[package]
name = "trie-db"
version = "0.30.0"
version = "0.31.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I generally prefer having a dedicated "chore" release PR with no/minimal changes, we'll also need to add this PR to the trie-db changelog 🤔

Copy link
Contributor Author

@michalkucharczyk michalkucharczyk Sep 23, 2025

Choose a reason for hiding this comment

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

well, just copied the "modus operandi" from some other commit in this repo :), which makes a change and bumps version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that works too, proly need a few more bumps? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lexnv

Yes, I can do it. Not really needed as they are mainly tests/benchmarks, but I will bump and publish these crates.
See: c682c3a

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

LGTM! I think we can add the release to a dedicated PR and tiny question around the root ++ commit op 🙏

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

Looks good! 🙏

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Some nitpicks. Otherwise should be fine as it doesn't change the default behavior.

@michalkucharczyk michalkucharczyk merged commit 8fcd391 into master Dec 8, 2025
4 checks passed
@michalkucharczyk
Copy link
Contributor Author

Uploaded crates:

Uploaded trie-db-test v0.31.1 to registry `crates-io`
Uploaded trie-bench v0.42.1 to registry `crates-io`
Uploaded reference-trie v0.29.2 to registry `crates-io`
Uploaded trie-db v0.31.0 to registry `crates-io`

New tags:

 * [new tag]         reference-trie-v0.29.2 -> reference-trie-v0.29.2
 * [new tag]         trie-bench-v0.42.1 -> trie-bench-v0.42.1
 * [new tag]         trie-db-test-v0.31.1 -> trie-db-test-v0.31.1
 * [new tag]         trie-eip1186-v0.5.1 -> trie-eip1186-v0.5.1
 * [new tag]         trie-eip1186-test-v0.7.1 -> trie-eip1186-test-v0.7.1
 * [new tag]         trie-db-v0.31.0 -> trie-db-v0.31.0

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.

6 participants