Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Minimal Dockerfile that just wraps pre-built binaries, so we can test the server inside docker
FROM rust:1.90.0
FROM rust:1.93.0
RUN mkdir -p /stdb/data
COPY ./target/debug/spacetimedb-standalone ./target/debug/spacetimedb-cli /usr/local/bin/
COPY ./crates/standalone/config.toml /stdb/data/config.toml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20 # on a successful run, runs in 8 minutes
container:
image: rust:1.90.0
image: rust:1.93.0
options: --privileged
# filter for a comment containing 'benchmarks please'
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, 'benchmarks please')) }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ debug = true
version = "1.11.3"
edition = "2021"
# update rust-toolchain.toml too!
rust-version = "1.90.0"
rust-version = "1.93.0"

[workspace.dependencies]
spacetimedb = { path = "crates/bindings", version = "=1.11.3" }
Expand Down
2 changes: 1 addition & 1 deletion crates/bench/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the README for commands to run.

# sync with: ../../rust-toolchain.toml
FROM rust:1.90.0
FROM rust:1.93.0

RUN apt-get update && \
apt-get install -y valgrind bash && \
Expand Down
3 changes: 3 additions & 0 deletions crates/bindings/src/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub fn invoke_procedure<'a, A: Args<'a>, Ret: IntoProcedureResult>(
}

/// A trait for types representing the *execution logic* of a reducer.
#[expect(clippy::duplicated_attributes, reason = "false positive")]
#[diagnostic::on_unimplemented(
message = "invalid reducer signature",
label = "this reducer signature is not valid",
Expand Down Expand Up @@ -95,6 +96,7 @@ pub fn invoke_view<'a, A: Args<'a>, T: ViewReturn>(
std::mem::take(&mut *buf)
}
/// A trait for types representing the execution logic of a caller-specific view.
#[expect(clippy::duplicated_attributes, reason = "false positive")]
#[diagnostic::on_unimplemented(
message = "invalid view signature",
label = "this view signature is not valid",
Expand Down Expand Up @@ -123,6 +125,7 @@ pub fn invoke_anonymous_view<'a, A: Args<'a>, T: ViewReturn>(
std::mem::take(&mut *buf)
}
/// A trait for types representing the execution logic of an anonymous view.
#[expect(clippy::duplicated_attributes, reason = "false positive")]
#[diagnostic::on_unimplemented(
message = "invalid anonymous view signature",
label = "this view signature is not valid",
Expand Down
3 changes: 1 addition & 2 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::num::ParseIntError;
use std::path::PathBuf;
use std::sync::{MutexGuard, PoisonError};

use enum_as_inner::EnumAsInner;
use hex::FromHexError;
use spacetimedb_commitlog::repo::TxOffset;
use spacetimedb_durability::DurabilityExited;
Expand Down Expand Up @@ -96,7 +95,7 @@ impl From<LockError> for DatabaseError {
}
}

#[derive(Error, Debug, EnumAsInner)]
#[derive(Error, Debug)]
pub enum DBError {
#[error("LibError: {0}")]
Lib(#[from] LibError),
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/host/wasm_common/module_host_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ impl InstanceCommon {
) -> (ViewCallResult, bool) {
let view_calls = tx
.view_for_update()
.cloned()
.map(|info| {
let view_def = module_def
.get_view_by_id(info.fn_ptr, info.sender.is_none())
Expand Down
8 changes: 2 additions & 6 deletions crates/core/src/subscription/websocket_building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ pub struct BsatnRowListBuilder {
}

/// A [`RowSizeHint`] under construction.
#[derive(Default)]
pub enum RowSizeHintBuilder {
/// We haven't seen any rows yet.
#[default]
Empty,
/// Each row in `rows_data` is of the same fixed size as specified here
/// but we don't know whether the size fits in `RowSize`
Expand All @@ -107,12 +109,6 @@ impl BsatnRowListBuilder {
}
}

impl Default for RowSizeHintBuilder {
fn default() -> Self {
Self::Empty
}
}

impl RowListBuilder for BsatnRowListBuilder {
type FinishedList = BsatnRowList;

Expand Down
5 changes: 2 additions & 3 deletions crates/datastore/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::system_tables::SystemTable;
use enum_as_inner::EnumAsInner;
use spacetimedb_lib::db::raw_def::{v9::RawSql, RawIndexDefV8};
use spacetimedb_primitives::{ColId, ColList, IndexId, SequenceId, TableId, ViewId};
use spacetimedb_sats::buffer::DecodeError;
Expand All @@ -13,7 +12,7 @@ use spacetimedb_table::{
};
use thiserror::Error;

#[derive(Error, Debug, EnumAsInner)]
#[derive(Error, Debug)]
pub enum DatastoreError {
#[error("LibError: {0}")]
Lib(#[from] LibError),
Expand Down Expand Up @@ -61,7 +60,7 @@ pub enum ViewError {
SerializeArgs,
}

#[derive(Error, Debug, EnumAsInner)]
#[derive(Error, Debug)]
pub enum TableError {
#[error("Table with name `{0}` start with 'st_' and that is reserved for internal system tables.")]
System(Box<str>),
Expand Down
9 changes: 2 additions & 7 deletions crates/datastore/src/execution_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,19 @@ impl Workload {
/// A transaction can be executing a reducer.
/// It can be used to satisfy a one-off sql query or subscription.
/// It can also be an internal operation that is not associated with a reducer or sql request.
#[derive(Clone, Copy, Display, Hash, PartialEq, Eq, strum::AsRefStr, enum_map::Enum)]
#[derive(Clone, Copy, Display, Hash, PartialEq, Eq, Default, strum::AsRefStr, enum_map::Enum)]
pub enum WorkloadType {
Reducer,
Sql,
Subscribe,
Unsubscribe,
Update,
#[default]
Internal,
View,
Procedure,
}

impl Default for WorkloadType {
fn default() -> Self {
Self::Internal
}
}

impl ExecutionContext {
/// Returns an [ExecutionContext] with the provided parameters and empty metrics.
fn new(database_identity: Identity, reducer: Option<ReducerContext>, workload: WorkloadType) -> Self {
Expand Down
21 changes: 10 additions & 11 deletions crates/datastore/src/locking_tx_datastore/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2597,9 +2597,10 @@ mod tests {
}

fn expect_index_err(res: Result<impl fmt::Debug>) -> IndexError {
res.expect_err("`res` should be an error")
.into_index()
.expect("the error should be an `IndexError`")
match res.expect_err("`res` should be an error") {
DatastoreError::Index(err) => err,
_ => panic!("the error should be an `IndexError`"),
}
}

fn test_under_tx_and_commit(
Expand Down Expand Up @@ -2627,14 +2628,12 @@ mod tests {
let _ = row.pop().expect("there should be an element to remove");
let row = row.into();
// Now attempt the update.
let err = update(&datastore, tx, table_id, index_id, &row)
.expect_err("the update should fail")
.into_table()
.expect("the error should be a `TableError`")
.into_bflatn()
.expect("the error should be a bflatn error");

assert_matches!(err, spacetimedb_table::bflatn_to::Error::Decode(..));
let err = update(&datastore, tx, table_id, index_id, &row).expect_err("the update should fail");

assert_matches!(
err,
DatastoreError::Table(TableError::Bflatn(spacetimedb_table::bflatn_to::Error::Decode(..)))
);
Ok(())
})
}
Expand Down
2 changes: 1 addition & 1 deletion crates/standalone/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG CARGO_PROFILE=release


FROM rust:1.90.0 AS chef
FROM rust:1.93.0 AS chef
RUN rust_target=$(rustc -vV | awk '/^host:/{ print $2 }') && \
curl https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$rust_target.tgz -fL | tar xz -C $CARGO_HOME/bin
RUN cargo binstall -y cargo-chef@0.1.70
Expand Down
5 changes: 2 additions & 3 deletions crates/standalone/src/control_db/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,14 @@ fn test_decode() -> ResultTest<()> {
assert_eq!(dbs.len(), 1);
assert_eq!(dbs[0].owner_identity, id);

let mut new_replica = Replica {
let new_replica = Replica {
id: 0,
database_id: 1,
node_id: 0,
leader: true,
};

let id = cdb.insert_replica(new_replica.clone())?;
new_replica.id = id;
let id = cdb.insert_replica(new_replica)?;

let dbs = cdb.get_replicas()?;

Expand Down
5 changes: 2 additions & 3 deletions crates/standalone/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl spacetimedb_client_api::ControlStateWriteAccess for StandaloneEnv {
None => {
let program = Program::from_bytes(&spec.program_bytes[..]);

let mut database = Database {
let database = Database {
id: 0,
database_identity: spec.database_identity,
owner_identity: *publisher,
Expand All @@ -287,8 +287,7 @@ impl spacetimedb_client_api::ControlStateWriteAccess for StandaloneEnv {

debug_assert_eq!(_hash_for_assert, program_hash);

let database_id = self.control_db.insert_database(database.clone())?;
database.id = database_id;
let database_id = self.control_db.insert_database(database)?;

self.schedule_replicas(database_id, num_replicas).await?;

Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[toolchain]
# change crates/{standalone,bench}/Dockerfile, and the docker image tag in
# change crates/{standalone,bench}/Dockerfile, .github/Dockerfile, and the docker image tag in
# .github/workflows/benchmarks.yml:jobs/callgrind_benchmark/container/image
# maybe also the rust-version in Cargo.toml
channel = "1.90.0"
channel = "1.93.0"
profile = "default"
targets = ["wasm32-unknown-unknown"]
components = ["rust-src"]
4 changes: 2 additions & 2 deletions tools/xtask-llm-benchmark/src/bin/llm_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ async fn run_many_routes_for_mode(
let host = config.host.clone();
let details_path = config.details_path.clone();

futures::stream::iter(routes.iter().cloned().map(|route| {
futures::stream::iter(routes.iter().map(|route| {
let host = host.clone();
let details_path = details_path.clone();

Expand All @@ -899,7 +899,7 @@ async fn run_many_routes_for_mode(
bench_root,
mode,
hash,
route: &route,
route,
context,
llm,
lang,
Expand Down
Loading