Skip to content

feat: add separate pki transaction#2121

Open
fewerner wants to merge 8 commits intomainfrom
felix/pki-transaction
Open

feat: add separate pki transaction#2121
fewerner wants to merge 8 commits intomainfrom
felix/pki-transaction

Conversation

@fewerner
Copy link
Copy Markdown
Contributor

What's new in this PR

This PR adds a separate pki transaction to the database to allow crypto and e2ei to use independent transactions.


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@fewerner fewerner requested a review from a team May 11, 2026 06:57
@fewerner fewerner force-pushed the felix/pki-transaction branch from 7ef3db0 to 1b4db9a Compare May 11, 2026 07:10
Comment thread keystore/src/connection/mod.rs Outdated
Comment thread keystore/src/connection/mod.rs
Comment thread keystore/src/connection/mod.rs Outdated
Comment thread keystore/src/connection/mod.rs Outdated
Comment thread keystore/src/connection/mod.rs Outdated
Comment thread keystore/src/connection/mod.rs Outdated
Comment thread keystore/src/connection/mod.rs Outdated
@fewerner fewerner force-pushed the felix/pki-transaction branch from 6019082 to 3327eae Compare May 11, 2026 07:41
Comment thread keystore/src/connection/mod.rs
Comment thread keystore/src/mls.rs Outdated
@fewerner fewerner force-pushed the felix/pki-transaction branch from 3327eae to d5dbd4b Compare May 11, 2026 09:10
Comment thread keystore/src/connection/mod.rs
@fewerner fewerner force-pushed the felix/pki-transaction branch 2 times, most recently from 8645905 to b352826 Compare May 11, 2026 10:59
Comment thread keystore/src/connection/mod.rs Outdated
pub(crate) conn: Arc<Mutex<Option<KeystoreDatabaseConnection>>>,
pub(crate) transaction: Arc<Mutex<Option<KeystoreTransaction>>>,
transaction_semaphore: Arc<Semaphore>,
// We assume that these transactions never hold the same entitx types.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo: entitx -> entity

Copy link
Copy Markdown
Member

@SimonThormeyer SimonThormeyer left a comment

Choose a reason for hiding this comment

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

This looks good, pending green CI and the typo fix

fewerner added 8 commits May 11, 2026 14:24
The idea here is to assign one SLOT to a crypto transaction and one to
the PkiEnvironment transaction.
This trait now implements functions needed from the crypto transaction.
It takes the first of the two transaction slots.
This trait implements the mutable functions for the PkiEnvironment.
It takes the second transaction slot.
Every function with a const generic SLOT parameter should be internal.
We adjust the getters to return the first match of an existing
transaction cache. We can only do this because a record type will only
ever exist in exactly one of the caches.

For returning multiple records, we have to pull out some previously
`KeystoreTransaction` internal logic of `find_all` and `search`. We
merge with both of the transactions because a cache can be empty but the
`KeystoreTransaction` deleted list could hold a relevant id. Right now
there is no simple way to know which transaction cache is relevant.
The enrollment type does not exist anymore and the functions have no
usage.
Whereever we use Database functions that are now implemented by
`CryptoTransaction` we add this trait to the scope to call this function
for the CryptoTransaction slot.
@fewerner fewerner force-pushed the felix/pki-transaction branch from b352826 to 33d438d Compare May 11, 2026 12:27
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