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

Element-R: Support staged rollout of migration to Rust Crypto #26869

Closed
BillCarsonFr opened this issue Jan 15, 2024 · 1 comment · Fixed by matrix-org/matrix-react-sdk#12184
Closed
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Enhancement Z-Element-R-Blocker A blocker for enabling Element R by default Z-Labs

Comments

@BillCarsonFr
Copy link
Member

BillCarsonFr commented Jan 15, 2024

Some sort of mechanism (config.json setting, probably) to migrate a given percentage of users to rust crypto.

This could be set to 100% to migrate all users to Rust.

@BillCarsonFr BillCarsonFr added A-Element-R Issues affecting the port of Element's crypto layer to Rust Z-Element-R-Blocker A blocker for enabling Element R by default labels Jan 15, 2024
@richvdh richvdh changed the title Element-R: Mecanism to stage rollout of migration + Force migration if 100% Element-R: Support staged rollout of migration to Rust Crypto Jan 15, 2024
@richvdh
Copy link
Member

richvdh commented Jan 26, 2024

Basic ideas on this:

  • Add a new setting to matrix-react-sdk/src/settings/Settings.tsx called migrateToRustCryptoRatio or something, which takes a value from 0-100. (See also https://github.com/matrix-org/matrix-react-sdk/blob/develop/docs/settings.md which documents how the settings system works.)
  • In initClientCrypto, if feature_rust_crypto is not already enabled:
    • Hash the device ID to produce an integer (say, 32 bits). The precise details of the hash algorithm are unimportant, but the result needs to be reasonably evenly distributed over the output range.
    • If the hash is greater than (2**32 / 100) * migrateToRustCryptoRatio, we will migrate this session. Set useRustCrypto = true, persist it to the settings store, and carry on with the init code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Enhancement Z-Element-R-Blocker A blocker for enabling Element R by default Z-Labs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants