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

Checks to ensure transactions execute in the context of their originating stores #4297

Merged

Conversation

pwojcikdev
Copy link
Contributor

@pwojcikdev pwojcikdev commented Sep 26, 2023

A small wallet store cleanup and changes that ensure (lmdb) transactions always execute in the context of their original environment.

@@ -105,5 +106,6 @@ nano::store::write_transaction nano::store::lmdb::env::tx_begin_write (store::lm

MDB_txn * nano::store::lmdb::env::tx (store::transaction const & transaction_a) const
{
debug_assert (transaction_a.store_id () == store_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like the critical check. Would it be enough to use an lmdb::env * as the store_id or does the dispenser give other benefits?

Copy link
Contributor Author

@pwojcikdev pwojcikdev Sep 29, 2023

Choose a reason for hiding this comment

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

The dispenser is used quite broadly on the tracking/logging branch. Naive tracking via pointers to '*this' might work in some cases (like here), but it completely breaks when objects are dynamically allocated.

@pwojcikdev pwojcikdev merged commit cff51c4 into nanocurrency:develop Oct 8, 2023
16 of 17 checks passed
pwojcikdev added a commit that referenced this pull request Oct 9, 2023
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.

2 participants