Skip to content

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

Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:transaction-type-checking
Oct 8, 2023
Merged

Checks to ensure transactions execute in the context of their originating stores#4297
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:transaction-type-checking

Conversation

@pwojcikdev
Copy link
Copy Markdown
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.


MDB_txn * nano::store::lmdb::env::tx (store::transaction const & transaction_a) const
{
debug_assert (transaction_a.store_id () == store_id);
Copy link
Copy Markdown
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
Copy Markdown
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
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