Compare commits

..

28 commits

Author SHA1 Message Date
Jacob Taylor
7f5150acdc change rocksdb default error level to info from error
Some checks failed
Release Docker Image / define-variables (push) Failing after 4s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 3s
Rust Checks / Clippy (push) Failing after 17s
Rust Checks / Cargo Test (push) Failing after 12s
2025-06-14 19:08:19 -07:00
Jacob Taylor
964b0f253b scale rocksdb background jobs and subcompactions 2025-06-14 19:08:19 -07:00
Jacob Taylor
9d627dbaa1 change rocksdb stats level to 3 2025-06-14 19:08:19 -07:00
Jacob Taylor
2e10df716f add more parallelism_scaled and make them public 2025-06-14 19:08:19 -07:00
Jacob Taylor
b316bba0d9 update sender workers documentation 2025-06-14 19:08:19 -07:00
nexy7574
a96f7afe71 modify more log strings so they're more useful than not 2025-06-14 19:08:19 -07:00
nexy7574
d7dcffbd4a When in doubt, log all the things 2025-06-14 19:08:19 -07:00
Jacob Taylor
104ba42840 make sender workers default better and clamp value to core count 2025-06-14 19:08:19 -07:00
Jacob Taylor
b0e077a393 better roomid_spacehierarchy_cache_capacity 2025-06-14 19:08:19 -07:00
nexy7574
9eccb491ca log which room struggled to get mainline depth 2025-06-14 19:08:19 -07:00
nexy7574
5abb4c9545 more logs 2025-06-14 19:08:19 -07:00
nexy7574
3097390f20 Unsafe, untested, and potentially overeager PDU sanity checks 2025-06-14 19:08:19 -07:00
nexy7574
1c207afeaf Fix room ID check 2025-06-14 19:08:19 -07:00
nexy7574
f49bc6096a Kick up a fuss when m.room.create is unfindable 2025-06-14 19:08:19 -07:00
nexy7574
bc1f567d68 Note about ruma#2064 in TODO 2025-06-14 19:08:19 -07:00
nexy7574
04d3ef76a0 fix an auth rule not applying correctly 2025-06-14 19:08:19 -07:00
Jacob Taylor
64459f0032 better stateinfo_cache_capacity default 2025-06-14 19:08:19 -07:00
Jacob Taylor
91c850b5b2 enable converged 6g at the edge in continuwuity 2025-06-14 19:08:18 -07:00
nexy7574
06de58b0e8 Always calculate state diff IDs in syncv3
seemingly fixes #779
2025-06-14 19:08:18 -07:00
Jacob Taylor
a52d63869e upgrade some settings to enable 5g in continuwuity 2025-06-14 19:08:18 -07:00
Jacob Taylor
493a4d3b0b add futures::FutureExt to make cb15ac3c01 work 2025-06-14 19:08:18 -07:00
Jason Volk
2d0a120890 Mitigate large futures
Signed-off-by: Jason Volk <jason@zemos.net>
2025-06-14 19:08:18 -07:00
Jacob Taylor
903e3431df bump the number of allowed immutable memtables by 1, to allow for greater flood protection
this should probably not be applied if you have rocksdb_atomic_flush = false (the default)
2025-06-14 19:08:18 -07:00
Jacob Taylor
00cbf9536c probably incorrectly delete support for non-standardized matrix srv record 2025-06-14 19:08:18 -07:00
Jacob Taylor
c62e24663f Fix spaces rooms list load error. rev2 2025-06-14 19:08:18 -07:00
Jade Ellis
5a861d406a
fix: Filter out invalid replacements from bundled aggregations
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 1s
Rust Checks / Clippy (push) Failing after 11s
Rust Checks / Cargo Test (push) Failing after 9s
2025-06-14 19:40:27 +01:00
Jade Ellis
db50adc000
feat: Add bundled aggregations support
Add support for the m.replace and m.reference bundled
aggregations.
This should fix plenty of subtle client issues.
Threads are not included in the new code as they have
historically been written to the database. Replacing the
old system would result in issues when switching away from
continuwuity, so saved for later.
Some TODOs have been left re event visibility and ignored users.
These should be OK for now, though.
2025-06-14 19:40:26 +01:00
Jade Ellis
6c11e59c4a
refactor: Promote handling unsigned data out of timeline
Also fixes:
- Transaction IDs leaking in event route
- Age not being set for event relations or threads
- Both of the above for search results

Notes down concern with relations table
2025-06-14 19:40:26 +01:00
8 changed files with 53 additions and 52 deletions

20
Cargo.lock generated
View file

@ -771,7 +771,7 @@ dependencies = [
[[package]]
name = "conduwuit"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"clap",
"conduwuit_admin",
@ -800,7 +800,7 @@ dependencies = [
[[package]]
name = "conduwuit_admin"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"clap",
"conduwuit_api",
@ -821,7 +821,7 @@ dependencies = [
[[package]]
name = "conduwuit_api"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"async-trait",
"axum",
@ -853,14 +853,14 @@ dependencies = [
[[package]]
name = "conduwuit_build_metadata"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"built 0.8.0",
]
[[package]]
name = "conduwuit_core"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"argon2",
"arrayvec",
@ -919,7 +919,7 @@ dependencies = [
[[package]]
name = "conduwuit_database"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"async-channel",
"conduwuit_core",
@ -937,7 +937,7 @@ dependencies = [
[[package]]
name = "conduwuit_macros"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"itertools 0.14.0",
"proc-macro2",
@ -947,7 +947,7 @@ dependencies = [
[[package]]
name = "conduwuit_router"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"axum",
"axum-client-ip",
@ -981,7 +981,7 @@ dependencies = [
[[package]]
name = "conduwuit_service"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"async-trait",
"base64 0.22.1",
@ -1018,7 +1018,7 @@ dependencies = [
[[package]]
name = "conduwuit_web"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
dependencies = [
"askama",
"axum",

View file

@ -21,7 +21,7 @@ license = "Apache-2.0"
readme = "README.md"
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
rust-version = "1.86.0"
version = "0.5.0-rc.6"
version = "0.5.0-rc.5"
[workspace.metadata.crane]
name = "conduwuit"

View file

@ -990,7 +990,7 @@
# 3 to 5 = Statistics with possible performance impact.
# 6 = All statistics.
#
#rocksdb_stats_level = 3
#rocksdb_stats_level = 1
# This is a password that can be configured that will let you login to the
# server bot account (currently `@conduit`) for emergency troubleshooting
@ -1590,9 +1590,11 @@
#stream_amplification = 1024
# Number of sender task workers; determines sender parallelism. Default is
# number of CPU cores. Override by setting a different value.
# '0' which means the value is determined internally, likely matching the
# number of tokio worker-threads or number of cores, etc. Override by
# setting a non-zero value.
#
#sender_workers = 4
#sender_workers = 0
# Enables listener sockets; can be set to false to disable listening. This
# option is intended for developer/diagnostic purposes only.

View file

@ -4,10 +4,6 @@
{
"id": 1,
"message": "Welcome to Continuwuity! Important announcements about the project will appear here."
},
{
"id": 2,
"message": "🎉 Continuwuity v0.5.0-rc.6 is now available! This release includes improved knock-restricted room handling, automatic support contact configuration, and a new HTML landing page. Check [the release notes for full details](https://forgejo.ellis.link/continuwuation/continuwuity/releases/tag/v0.5.0-rc.6) and upgrade instructions."
}
]
}
}

View file

@ -3,7 +3,7 @@
"$id": "https://continwuity.org/schema/announcements.schema.json",
"type": "object",
"properties": {
"announcements": {
"updates": {
"type": "array",
"items": {
"type": "object",
@ -16,10 +16,6 @@
},
"date": {
"type": "string"
},
"mention_room": {
"type": "boolean",
"description": "Whether to mention the room (@room) when posting this announcement"
}
},
"required": [
@ -30,6 +26,6 @@
}
},
"required": [
"announcements"
"updates"
]
}

View file

@ -242,16 +242,12 @@ where
}
*/
// let (room_create_event, power_levels_event, sender_member_event) = join3(
// fetch_state(&StateEventType::RoomCreate, ""),
// fetch_state(&StateEventType::RoomPowerLevels, ""),
// fetch_state(&StateEventType::RoomMember, sender.as_str()),
// )
// .await;
let room_create_event = fetch_state(&StateEventType::RoomCreate, "").await;
let power_levels_event = fetch_state(&StateEventType::RoomPowerLevels, "").await;
let sender_member_event = fetch_state(&StateEventType::RoomMember, sender.as_str()).await;
let (room_create_event, power_levels_event, sender_member_event) = join3(
fetch_state(&StateEventType::RoomCreate, ""),
fetch_state(&StateEventType::RoomPowerLevels, ""),
fetch_state(&StateEventType::RoomMember, sender.as_str()),
)
.await;
let room_create_event = match room_create_event {
| None => {

View file

@ -1,4 +1,6 @@
use conduwuit::{Config, Result};
use std::{cmp, convert::TryFrom};
use conduwuit::{Config, Result, utils};
use rocksdb::{Cache, DBRecoveryMode, Env, LogLevel, Options, statistics::StatsLevel};
use conduwuit::config::{parallelism_scaled_i32, parallelism_scaled_u32};
use super::{cf_opts::cache_size_f64, logger::handle as handle_log};
@ -124,3 +126,15 @@ fn set_logging_defaults(opts: &mut Options, config: &Config) {
opts.set_callback_logger(rocksdb_log_level, &handle_log);
}
}
fn num_threads<T: TryFrom<usize>>(config: &Config) -> Result<T> {
const MIN_PARALLELISM: usize = 4;
let requested = if config.rocksdb_parallelism_threads != 0 {
config.rocksdb_parallelism_threads
} else {
utils::available_parallelism()
};
utils::math::try_into::<T, usize>(cmp::max(MIN_PARALLELISM, requested))
}

View file

@ -20,7 +20,7 @@ use std::{sync::Arc, time::Duration};
use async_trait::async_trait;
use conduwuit::{Result, Server, debug, info, warn};
use database::{Deserialized, Map};
use ruma::events::{Mentions, room::message::RoomMessageEventContent};
use ruma::events::room::message::RoomMessageEventContent;
use serde::Deserialize;
use tokio::{
sync::Notify,
@ -53,8 +53,6 @@ struct CheckForAnnouncementsResponseEntry {
id: u64,
date: Option<String>,
message: String,
#[serde(default, skip_serializing_if = "bool::not")]
mention_room: bool,
}
const CHECK_FOR_ANNOUNCEMENTS_URL: &str =
@ -141,20 +139,19 @@ impl Service {
} else {
info!("[announcements] {:#}", announcement.message);
}
let mut message = RoomMessageEventContent::text_markdown(format!(
"### New announcement{}\n\n{}",
announcement
.date
.as_ref()
.map_or_else(String::new, |date| format!(" - `{date}`")),
announcement.message
));
if announcement.mention_room {
message = message.add_mentions(Mentions::with_room_mention());
}
self.services.admin.send_message(message).await.ok();
self.services
.admin
.send_message(RoomMessageEventContent::text_markdown(format!(
"### New announcement{}\n\n{}",
announcement
.date
.as_ref()
.map_or_else(String::new, |date| format!(" - `{date}`")),
announcement.message
)))
.await
.ok();
}
#[inline]