Skip to content

feat: Experimental encrypted state feature flag with CI support #5537

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

Merged
merged 1 commit into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- no-sqlite
- no-encryption-and-sqlite
- sqlite-cryptostore
- experimental-encrypted-state-events
- rustls-tls
- markdown
- socks
Expand Down
9 changes: 9 additions & 0 deletions crates/matrix-sdk-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ automatic-room-key-forwarding = [
experimental-send-custom-to-device = [
"matrix-sdk-crypto?/experimental-send-custom-to-device",
]

# Enable experimental support for encrypting state events; see
# https://github.com/matrix-org/matrix-rust-sdk/issues/5397.
experimental-encrypted-state-events = [
"e2e-encryption",
"ruma/unstable-msc3414",
"matrix-sdk-crypto?/experimental-encrypted-state-events"
]

uniffi = ["dep:uniffi", "matrix-sdk-crypto?/uniffi", "matrix-sdk-common/uniffi"]

# Private feature, see
Expand Down
4 changes: 4 additions & 0 deletions crates/matrix-sdk-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ uniffi = ["dep:uniffi"]
# details.
test-send-sync = []

# Enable experimental support for encrypting state events; see
# https://github.com/matrix-org/matrix-rust-sdk/issues/5397.
experimental-encrypted-state-events = []

[dependencies]
eyeball-im.workspace = true
futures-core.workspace = true
Expand Down
4 changes: 3 additions & 1 deletion crates/matrix-sdk-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ experimental-send-custom-to-device = []

# Enable experimental support for encrypting state events; see
# https://github.com/matrix-org/matrix-rust-sdk/issues/5397.
experimental-encrypted-state-events = []
experimental-encrypted-state-events = [
"matrix-sdk-common/experimental-encrypted-state-events"
]

js = ["ruma/js", "vodozemac/js", "matrix-sdk-common/js"]
qrcode = ["dep:matrix-sdk-qrcode"]
Expand Down
2 changes: 2 additions & 0 deletions crates/matrix-sdk-crypto/src/store/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,8 @@ macro_rules! cryptostore_integration_tests {
let room_1 = room_id!("!test_1:localhost");
let settings_1 = RoomSettings {
algorithm: EventEncryptionAlgorithm::MegolmV1AesSha2,
#[cfg(feature = "experimental-encrypted-state-events")]
encrypt_state_events: false,
Comment on lines +1166 to +1167
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the change to the test I mentioned in the PR descrption - didn't catch it erroring prior to merging #5511 since there was no CI (sorry 😬)

only_allow_trusted_devices: true,
session_rotation_period: Some(Duration::from_secs(10)),
session_rotation_period_messages: Some(123),
Expand Down
4 changes: 4 additions & 0 deletions crates/matrix-sdk-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ crypto-store = ["dep:matrix-sdk-crypto"]
event-cache = ["dep:matrix-sdk-base"]
state-store = ["dep:matrix-sdk-base"]

experimental-encrypted-state-events = [
"matrix-sdk-crypto?/experimental-encrypted-state-events"
]

[dependencies]
as_variant.workspace = true
async-trait.workspace = true
Expand Down
9 changes: 9 additions & 0 deletions crates/matrix-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ indexeddb = ["matrix-sdk-indexeddb/state-store"]
qrcode = ["e2e-encryption", "matrix-sdk-base/qrcode"]
automatic-room-key-forwarding = ["e2e-encryption", "matrix-sdk-base/automatic-room-key-forwarding"]
experimental-send-custom-to-device = ["e2e-encryption", "matrix-sdk-base/experimental-send-custom-to-device"]

# Enable experimental support for encrypting state events; see
# https://github.com/matrix-org/matrix-rust-sdk/issues/5397.
experimental-encrypted-state-events = [
"e2e-encryption",
"matrix-sdk-base/experimental-encrypted-state-events",
"matrix-sdk-sqlite/experimental-encrypted-state-events"
]

markdown = ["ruma/markdown"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
Expand Down
6 changes: 6 additions & 0 deletions xtask/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ enum FeatureSet {
NoSqlite,
NoEncryptionAndSqlite,
SqliteCryptostore,
ExperimentalEncryptedStateEvents,
RustlsTls,
Markdown,
Socks,
Expand Down Expand Up @@ -262,6 +263,10 @@ fn run_feature_tests(cmd: Option<FeatureSet>) -> Result<()> {
FeatureSet::SqliteCryptostore,
"--no-default-features --features e2e-encryption,sqlite,native-tls,testing",
),
(
FeatureSet::ExperimentalEncryptedStateEvents,
"--no-default-features --features experimental-encrypted-state-events,e2e-encryption,sqlite,native-tls,testing",
),
(FeatureSet::RustlsTls, "--no-default-features --features rustls-tls,testing"),
(FeatureSet::Markdown, "--features markdown,testing"),
(FeatureSet::Socks, "--features socks,testing"),
Expand Down Expand Up @@ -313,6 +318,7 @@ fn run_crypto_tests() -> Result<()> {
"rustup run stable cargo test --doc -p matrix-sdk-crypto --features=experimental-algorithms,testing"
)
.run()?;
cmd!(sh, "rustup run stable cargo nextest run -p matrix-sdk-crypto --features=experimental-encrypted-state-events").run()?;

cmd!(sh, "rustup run stable cargo nextest run -p matrix-sdk-crypto-ffi").run()?;

Expand Down
Loading