Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
name: run callgrind benchmarks
# DON'T run on benchmarks-runner, using docker on a self-hosted runner has
# been broken for 4 years: https://github.com/actions/runner/issues/434 .
# Fortunately, we can run on standard Github Actions infra because we don't care
# Fortunately, we can run on standard GitHub Actions infra because we don't care
# about other stuff running on the machine!
# runs-on: benchmarks-runner
runs-on: ubuntu-latest
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
# summary PR" step). otherwise, we can use a fully shallow checkout
fetch-depth: ${{ env.PR_NUMBER && 1 || 2 }}

- name: Unbork Github Actions state
- name: Unbork GitHub Actions state
shell: bash
run: |
echo "Letting anybody touch our git repo, in order to avoid breaking other jobs"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
 
<a href="https://twitter.com/spacetime_db"><img height="25" src="./images/social/twitter.svg" alt="Twitter"></a>
&nbsp;
<a href="https://github.com/clockworklabs/spacetimedb"><img height="25" src="./images/social/github.svg" alt="Github"></a>
<a href="https://github.com/clockworklabs/spacetimedb"><img height="25" src="./images/social/github.svg" alt="GitHub"></a>
&nbsp;
<a href="https://twitch.tv/SpacetimeDB"><img height="25" src="./images/social/twitch.svg" alt="Twitch"></a>
&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion crates/bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Which will build the docker image and run the callgrind benchmarks inside of it.

You can also comment "benchmarks please" or "callgrind please" on a pull request in the SpacetimeDB repository to run the criterion/callgrind benchmarks on that PR. The results will be posted in a comment on the PR.

This is coordinated using the benchmarks Github Actions: see [`../../.github/workflows/benchmarks.yml`](../../.github/workflows/benchmarks.yml), and
This is coordinated using the benchmarks GitHub Actions: see [`../../.github/workflows/benchmarks.yml`](../../.github/workflows/benchmarks.yml), and
[`../../.github/workflows/callgrind_benchmarks.yml`](../../.github/workflows/callgrind_benchmarks.yml).
These also rely on the benchmarks-viewer application (https://github.com/clockworklabs/benchmarks-viewer).

Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-csharp/BSATN.Codegen/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public override string ToString()
.AppendLine(" {");
}

// Loop through the full parent type hiearchy, starting with the outermost.
// Loop through the full parent type hierarchy, starting with the outermost.
foreach (
var (i, typeScope) in Scope.typeScopes.Select((ts, i) => (i, ts)).Reverse()
)
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-csharp/Runtime/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ EXPORT(int16_t, __call_reducer__,

#define WASI_NAME(name) __imported_wasi_snapshot_preview1_##name

// Shim for WASI calls that always unconditionaly succeeds.
// Shim for WASI calls that always unconditionally succeeds.
// This is suitable for most (but not all) WASI functions used by .NET.
#define WASI_SHIM(name, params) \
int32_t WASI_NAME(name) params { return 0; }
Expand Down
4 changes: 2 additions & 2 deletions crates/bindings-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ pub mod raw {
/// ```
pub fn bytes_source_read(source: BytesSource, buffer_ptr: *mut u8, buffer_len_ptr: *mut usize) -> i16;

/// Logs at `level` a `message` message occuring in `filename:line_number`
/// Logs at `level` a `message` message occurring in `filename:line_number`
/// with `target` being the module path at the `log!` invocation site.
///
/// These various pointers are interpreted lossily as UTF-8 strings with a corresponding `_len`.
Expand Down Expand Up @@ -1039,7 +1039,7 @@ pub enum LogLevel {
Panic = raw::LOG_LEVEL_PANIC,
}

/// Log at `level` a `text` message occuring in `filename:line_number`
/// Log at `level` a `text` message occurring in `filename:line_number`
/// with [`target`] being the module path at the `log!` invocation site.
///
/// [`target`]: https://docs.rs/log/latest/log/struct.Record.html#method.target
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ The following changes are allowed, but may break clients:
- ⚠️ **Changing or removing reducers**. Clients that attempt to call the old version of a changed reducer will receive runtime errors.
- ⚠️ **Changing tables from public to private**. Clients that are subscribed to a newly-private table will receive runtime errors.
- ⚠️ **Removing `#[primary_key]` annotations**. Non-updated clients will still use the old `#[primary_key]` as a unique key in their local cache, which can result in non-deterministic behavior when updates are received.
- ⚠️ **Removing indexes**. This is only breaking in some situtations.
- ⚠️ **Removing indexes**. This is only breaking in some situations.
The specific problem is subscription queries <!-- TODO: clientside link --> involving semijoins, such as:
```sql
SELECT Employee.*
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub use spacetimedb_bindings_macro::client_visibility_filter;
/// Tables are private by default. This means that clients cannot read their contents
/// or see that they exist.
///
/// If you'd like to make your table publically accessible by clients,
/// If you'd like to make your table publicly accessible by clients,
/// put `public` in the macro arguments (e.g.
/// `#[spacetimedb::table(public)]`). You can also specify `private` if
/// you'd like to be specific.
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings/src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl ReducerContext {
/// [`rand::Rng`] in order to access many useful random algorithms.
///
/// `StdbRng` uses the same PRNG as `rand`'s [`StdRng`]. Note, however, that
/// because it is seeded from a publically-known timestamp, it is not
/// because it is seeded from a publicly-known timestamp, it is not
/// cryptographically secure.
///
/// You may be looking for a level of reproducibility that's finer-grained
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings/tests/deps.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Snapshot testing for the dependency tree of the `bindings` crate - we want
//! to make sure we don't unknowningly add a bunch of dependencies here,
//! to make sure we don't unknowingly add a bunch of dependencies here,
//! slowing down compilation for every spacetime module.

// We need to remove the `cpufeatures` and `libc` dependencies from the output, it added on `arm` architecture:
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static GLOBAL: MiMalloc = MiMalloc;
async fn main() -> anyhow::Result<ExitCode> {
// Compute matches before loading the config, because `Config` has an observable `drop` method
// (which deletes a lockfile),
// and Clap calls `exit` on parse failure rather than panicing, so destructors never run.
// and Clap calls `exit` on parse failure rather than panicking, so destructors never run.
let matches = get_command().get_matches();
let (cmd, subcommand_args) = matches.subcommand().unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/subcommands/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::E
// We typically don't want logs from the very beginning if we're also following.
num_lines = Some(10);
}
let query_parms = LogsParams { num_lines, follow };
let query_params = LogsParams { num_lines, follow };

let host_url = config.get_host_url(server)?;

let builder = reqwest::Client::new().get(format!("{}/v1/database/{}/logs", host_url, database_identity));
let builder = add_auth_header_opt(builder, &auth_header);
let mut res = builder.query(&query_parms).send().await?;
let mut res = builder.query(&query_params).send().await?;
let status = res.status();

if status.is_client_error() || status.is_server_error() {
Expand Down
2 changes: 1 addition & 1 deletion crates/client-api-messages/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ pub struct OneOffTable<F: WebsocketFormat> {
/// The set of rows which matched the query, encoded as BSATN or JSON according to the table's schema
/// and the client's requested protocol.
///
/// TODO(centril, 1.0): Evalutate whether we want to conditionally compress these.
/// TODO(centril, 1.0): Evaluate whether we want to conditionally compress these.
pub rows: F::List,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/client-api/src/routes/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub async fn call<S: ControlStateDelegate + NodeDelegate>(
StatusCode::NOT_FOUND
}
ReducerCallError::LifecycleReducer(lifecycle) => {
log::debug!("Attempt to call {lifecycle:?} lifeycle reducer {}", reducer);
log::debug!("Attempt to call {lifecycle:?} lifecycle reducer {}", reducer);
StatusCode::BAD_REQUEST
}
};
Expand Down
2 changes: 1 addition & 1 deletion crates/client-api/src/routes/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct SubscribeQueryParams {
#[serde(default)]
pub compression: Compression,
/// Whether we want "light" responses, tailored to network bandwidth constrained clients.
/// This knob works by setting other, more specifc, knobs to the value.
/// This knob works by setting other, more specific, knobs to the value.
#[serde(default)]
pub light: bool,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/codegen/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ impl<Ctx: __sdk::DbContext<
///
/// If `event_type` is `Some`, `event_type_doc_link` should be as well.
/// It should be a rustdoc-formatted link (including square brackets and all) to the `event_type`.
/// This may differ (in the `strcmp` sense) from `event_type` because it should not inlcude generic parameters.
/// This may differ (in the `strcmp` sense) from `event_type` because it should not include generic parameters.
fn define_event_context(
out: &mut Indenter,
struct_and_trait_name: &str,
Expand Down
4 changes: 2 additions & 2 deletions crates/codegen/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub(super) fn iter_reducers(module: &ModuleDef) -> impl Iterator<Item = &Reducer

/// Iterate over all the [`TableDef`]s defined by the module, in alphabetical order by name.
///
/// Sorting is necessary to have deterministic reproducable codegen.
/// Sorting is necessary to have deterministic reproducible codegen.
pub(super) fn iter_tables(module: &ModuleDef) -> impl Iterator<Item = &TableDef> {
module.tables().sorted_by_key(|table| &table.name)
}
Expand Down Expand Up @@ -124,7 +124,7 @@ pub(super) fn iter_indexes(table: &TableDef) -> impl Iterator<Item = &IndexDef>

/// Iterate over all the [`TypeDef`]s defined by the module, in alphabetical order by name.
///
/// Sorting is necessary to have deterministic reproducable codegen.
/// Sorting is necessary to have deterministic reproducible codegen.
pub fn iter_types(module: &ModuleDef) -> impl Iterator<Item = &TypeDef> {
module.types().sorted_by_key(|table| &table.name)
}
4 changes: 2 additions & 2 deletions crates/commitlog/src/index/indexfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ENTRY_SIZE: usize = KEY_SIZE + mem::size_of::<u64>();
///
/// `IndexFileMut` provides efficient read and write access to an index file, which stores
/// key-value pairs
/// Succesive key written should be sorted in ascending order, 0 is invalid-key value
/// Successive key written should be sorted in ascending order, 0 is invalid-key value
#[derive(Debug)]
pub struct IndexFileMut<Key> {
// A mutable memory-mapped buffer that represents the file contents.
Expand Down Expand Up @@ -185,7 +185,7 @@ impl<Key: Into<u64> + From<u64>> IndexFileMut<Key> {
/// Asynchronously flushes any pending changes to the index file
///
/// Due to Async nature, `Ok(())` does not guarantee that the changes are flushed.
/// an `Err` value indicates it definately did not succeed
/// an `Err` value indicates it definitely did not succeed
pub fn async_flush(&self) -> io::Result<()> {
self.inner.flush_async()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ impl<F: FnMut(u64)> spacetimedb_commitlog::payload::txdata::Visitor for ReplayVi
type Error = ReplayError;
// NOTE: Technically, this could be `()` if and when we can extract the
// row data without going through `ProductValue` (PV).
// To accomodate auxiliary traversals (e.g. for analytics), we may want to
// To accommodate auxiliary traversals (e.g. for analytics), we may want to
// provide a separate visitor yielding PVs.
type Row = ProductValue;

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl DeltaStore for MutTxId {
None
}

/// Subscriptions are currently evaluated using read-only transcations.
/// Subscriptions are currently evaluated using read-only transactions.
/// Hence this will never be called on a mutable transaction.
fn index_scan_range_for_delta(
&self,
Expand All @@ -116,7 +116,7 @@ impl DeltaStore for MutTxId {
std::iter::empty()
}

/// Subscriptions are currently evaluated using read-only transcations.
/// Subscriptions are currently evaluated using read-only transactions.
/// Hence this will never be called on a mutable transaction.
fn index_scan_point_for_delta(
&self,
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/db/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ impl RelationalDB {
/// Records the database's identity, owner and module parameters in the
/// system tables. The transactional context is supplied by the caller.
///
/// It is an error to call this method on an alread-initialized database.
/// It is an error to call this method on an already-initialized database.
///
/// See [`Self::open`] for further information.
pub fn set_initialized(&self, tx: &mut MutTx, host_type: HostType, program: Program) -> Result<(), DBError> {
Expand Down Expand Up @@ -990,8 +990,8 @@ impl RelationalDB {
{
let mut tx = self.begin_tx(workload);
let res = f(&mut tx);
let (tx_metics, reducer) = self.release_tx(tx);
self.report_tx_metricses(&reducer, None, None, &tx_metics);
let (tx_metrics, reducer) = self.release_tx(tx);
self.report_tx_metricses(&reducer, None, None, &tx_metrics);
res
}

Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/host/module_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ impl ModuleHost {
..
}) => fallback().await,

// If it succeeded, as mentioend above, `st_client` is already updated.
// If it succeeded, as mentioned above, `st_client` is already updated.
Ok(ReducerCallResult {
outcome: ReducerOutcome::Committed,
..
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/host/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ impl SchedulerActor {
let Ok(schedule_row) = get_schedule_row_mut(tx, &db, id) else {
// if the row is not found, it means the schedule is cancelled by the user
log::debug!(
"table row corresponding to yeild scheduler id not found: tableid {}, schedulerId {}",
"table row corresponding to yield scheduler id not found: tableid {}, schedulerId {}",
id.table_id,
id.schedule_id
);
return Ok(None);
};

let ScheduledReducer { reducer, bsatn_args } = proccess_schedule(tx, &db, id.table_id, &schedule_row)?;
let ScheduledReducer { reducer, bsatn_args } = process_schedule(tx, &db, id.table_id, &schedule_row)?;

let (reducer_id, reducer_seed) = module_info
.module_def
Expand Down Expand Up @@ -480,7 +480,7 @@ fn commit_and_broadcast_deletion_event(tx: MutTxId, module_host: ModuleHost) {
}

/// Generate `ScheduledReducer` for given `ScheduledReducerId`
fn proccess_schedule(
fn process_schedule(
tx: &MutTxId,
db: &RelationalDB,
table_id: TableId,
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/host/wasm_common/module_host_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl<T: WasmInstance> WasmModuleInstance<T> {
// case.
//
/// The method also performs various measurements and records energy usage,
/// as well as broadcasting a [`ModuleEvent`] containg information about
/// as well as broadcasting a [`ModuleEvent`] containing information about
/// the outcome of the call.
#[tracing::instrument(level = "trace", skip_all)]
fn call_reducer_with_tx(&mut self, tx: Option<MutTxId>, params: CallReducerParams) -> ReducerCallResult {
Expand Down Expand Up @@ -472,7 +472,7 @@ impl<T: WasmInstance> WasmModuleInstance<T> {
);
EventStatus::Failed(errmsg.into())
}
// We haven't actually comitted yet - `commit_and_broadcast_event` will commit
// We haven't actually committed yet - `commit_and_broadcast_event` will commit
// for us and replace this with the actual database update.
//
// Detecting a new client, and inserting it in `st_clients`
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/host/wasmtime/wasm_instance_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ impl WasmInstanceEnv {
})
}

/// Logs at `level` a `message` message occuring in `filename:line_number`
/// Logs at `level` a `message` message occurring in `filename:line_number`
/// with [`target`](target) being the module path at the `log!` invocation site.
///
/// These various pointers are interpreted lossily as UTF-8 strings with a corresponding `_len`.
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/messages/control_worker_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct EnergyBalanceUpdate {
pub identity: Identity,
pub energy_balance: i128,
}
// A message to syncronize energy balances from control node to worker node.
// A message to synchronize energy balances from control node to worker node.
#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub struct EnergyBalanceState {
pub balances: Vec<EnergyBalance>,
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/sql/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ mod tests {

let tx = begin_tx(&db);
// Note, order does not matter.
// The sargable predicate occurs first adn we can generate an index scan.
// The sargable predicate occurs first and we can generate an index scan.
let sql = "select * from test where b = 2 and a = 1";
let CrudExpr::Query(QueryExpr { source: _, query }) = compile_sql(&db, &tx, sql)?.remove(0) else {
panic!("Expected QueryExpr");
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/sql/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub fn run(
subs: Option<&ModuleSubscriptions>,
head: &mut Vec<(Box<str>, AlgebraicType)>,
) -> Result<SqlResult, DBError> {
// We parse the sql statement in a mutable transation.
// We parse the sql statement in a mutable transaction.
// If it turns out to be a query, we downgrade the tx.
let (tx, stmt) = db.with_auto_rollback(db.begin_mut_tx(IsolationLevel::Serializable, Workload::Sql), |tx| {
compile_sql_stmt(sql_text, &SchemaViewer::new(tx, &auth), &auth)
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/subscription/execution_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl PartialEq for ExecutionUnit {
impl From<SupportedQuery> for ExecutionUnit {
// Used in tests and benches.
// TODO(bikeshedding): Remove this impl,
// in favor of more explcit calls to `ExecutionUnit::new` with `QueryHash::NONE`.
// in favor of more explicit calls to `ExecutionUnit::new` with `QueryHash::NONE`.
fn from(plan: SupportedQuery) -> Self {
Self::new(plan, QueryHash::NONE).unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/subscription/module_subscription_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ mod tests {
Ok(())
}

/// Test that clients receieve error messages on tx updates
/// Test that clients receive error messages on tx updates
#[tokio::test]
async fn tx_update_error() -> anyhow::Result<()> {
let client_id = client_id_from_u8(1);
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/subscription/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ mod tests {
}

#[test]
/// TODO: This test is a slight modifaction of [test_eval_incr_for_index_join].
/// TODO: This test is a slight modification of [test_eval_incr_for_index_join].
/// Essentially the WHERE condition is on different tables.
/// Should refactor to reduce duplicate logic between the two tests.
fn test_eval_incr_for_left_semijoin() -> ResultTest<()> {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/subscription/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl IncrementalJoin {
/// B(t) refers to the state of table B as of transaction t.
/// In particular, B(t) includes all of the changes from t.
/// B(s) refers to the state of table B as of transaction s,
/// where s is the transaction immediately preceeding t.
/// where s is the transaction immediately preceding t.
///
/// Now we may ask,
/// given a set of updates to tables A and/or B,
Expand All @@ -316,7 +316,7 @@ impl IncrementalJoin {
/// Because they have no bearing on newly inserted rows of A.
///
/// Now consider rows that were deleted from A.
/// Similary we want to know if they join with any deleted rows of B,
/// Similarly we want to know if they join with any deleted rows of B,
/// or if they join with any previously existing rows of B.
/// That is:
///
Expand Down
Loading
Loading