Commit Graph

92 Commits

Author SHA1 Message Date
Kim Altintop 61b54ef723 Upgrade jemalloc_pprof and tempfile crates (#2982) 2025-07-24 15:57:57 +00:00
Kim Altintop 09717e97ad Make websocket configurable via config.toml (#2944) 2025-07-16 19:31:07 +00:00
Noa 742303ca49 Bump rust-toolchain to rust 1.88 (#2749)
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2025-07-15 17:39:41 +00:00
Noa 967e82a5f8 Pin db threads to cores (#2801)
Signed-off-by: Noa <coolreader18@gmail.com>
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2025-06-06 18:37:35 +00:00
Kim Altintop c729c2100d Reintroduce replication factor parameter (#2718) 2025-05-19 06:55:09 +00:00
Mazdak Farrokhzad 373e47db39 PagePool::{default -> new_for_test} + temporary hack for IN_MEMORY_CONFIG / test_index_scans (#2707) 2025-05-12 13:15:07 +00:00
Noa c5f1d8d0dd Use spacetimedb-standalone to get schema for spacetime generate (#2644) 2025-05-07 21:56:53 +00:00
Mazdak Farrokhzad eb589728c6 Allocate pages using a mult-tenant lock-free pool (#2587) 2025-04-28 17:35:19 +00:00
Noa 483a9488e2 Update rand (#2568) 2025-04-11 17:39:41 +00:00
Mario Montoya f9f38543c8 Add readmes to all implementation crates specifying that they do no offer stable interfaces (#2320) 2025-03-06 19:50:17 +00:00
Mario Montoya 04fd294627 Add missing LICENSE (#2319) 2025-02-28 14:32:59 +00:00
Noa 6a8375260f Refactor HTTP api to better adhere to REST guidelines (real) (#2243) 2025-02-11 02:59:45 +00:00
Phoebe Goldman aedc601145 Rename Address to ConnectionId (#2220)
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: James Gilles <jameshgilles@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-02-10 00:40:16 +00:00
Tyler Cloutier e54a28584a Standardized module names and added module-test-cs based on module-test (#2232) 2025-02-09 05:58:19 +00:00
Noa e6775eb93a Finish spacetimedb-update functionality (#2126) 2025-02-06 20:32:46 +00:00
Noa 293aebaef9 Bump to Rust 1.84 (#2001) 2025-01-28 23:11:29 +00:00
Zeke Foppa a54ea3a391 CLI - Replace clippy with a manual check (#1928)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-17 00:03:11 +00:00
Noa c24042609e Split binaries (#2011) 2025-01-15 18:45:14 +00:00
Ingvar Stepanyan 40faad6e2e Implement ctx.Identity for C# (#2091) 2025-01-07 20:45:27 +00:00
Shubham Mishra 9c64d1fbd1 Durability Provider (#1864)
Signed-off-by: Shubham Mishra <shubham@clockworklabs.io>
Co-authored-by: Kim Altintop <kim@eagain.io>
2024-11-19 09:06:52 +00:00
Ingvar Stepanyan a7a1d36535 Run and test benchmarks against C# as well (#1965)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2024-11-15 17:27:11 +00:00
Noa f136670420 Directory structure impl (#1879)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2024-11-12 04:24:43 +00:00
Mario Montoya 17423a4cf0 Add missing LICENSE (#1960) 2024-11-07 22:33:15 +00:00
Ingvar Stepanyan 6d712b4b0d Simplify benchmarking wrappers (#1951) 2024-11-06 17:21:56 +00:00
Mario Montoya cb9e0176e6 Fix benches for ia_loop, circles (#1922) 2024-11-05 14:50:31 +00:00
Mazdak Farrokhzad ac0053caab Websocket API: Light transaction updates & NoSuccessNotify (#1812)
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2024-11-04 15:59:11 +00:00
Zeke Foppa 61360387be CLI - Login flow (#1878)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-29 20:28:45 +00:00
Tyler Cloutier fa960b3be9 Small naming fixes. Fixes database identity creation. (#1892) 2024-10-24 23:02:21 +00:00
Tyler Cloutier 83fc5c33d4 The banishment of Address (#1880)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2024-10-23 01:56:20 +00:00
Shubham Mishra 0a86b46152 Fix Build: Use default() to init custom hash based datastructures (#1871)
Signed-off-by: Shubham Mishra <shubham@clockworklabs.io>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2024-10-17 14:41:38 +00:00
Noa c4e637e98b Energy metering for persistent memory usage (#766) 2024-10-15 17:58:34 +00:00
Jeffrey Dallatezza 83310eb6a7 Remove email and recovery related identity endpoints (#1833) 2024-10-15 00:13:18 +00:00
Tyler Cloutier d6bb05b072 Renamed database instance to replica (#1806) 2024-10-05 18:53:20 +00:00
Mazdak Farrokhzad 1ac741aa6b Generic and optimized WebSocket API (#1761)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 21:57:00 +00:00
Zeke Foppa 0375bcb80a CLI stabilization (#1741)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 20:57:38 +00:00
Zeke Foppa 09ad4decd0 CLI - publish and generate take a --build-options param (#1742)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 01:10:44 +00:00
Noa 53758420ec Rust module API rework (#1660) 2024-09-27 20:09:36 +00:00
Kim Altintop 711a6717c6 client-api: Remove publisher address (#1564) 2024-08-05 06:02:07 +00:00
Noa 10b151b999 Protobufectomy: server (#1077)
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
2024-07-12 18:02:18 +00:00
Mario Montoya 814dd5b738 Add small 'realistic' workload benchmark integration test (#714) 2024-06-13 18:28:35 +00:00
Ingvar Stepanyan 4b7eff66da Generate tagged enums in C# client code (#1421) 2024-06-13 16:32:46 +00:00
Kim Altintop 1044ebc652 core: Store address, owner and program bytes in st_module (#1305) 2024-06-10 10:25:16 +00:00
Zeke Foppa b06b2e59f1 Fix bug with Lockfile sticking around (#1341)
* [bfops/fix-config-lock]: do thing

* [bfops/fix-config-lock]: review

* [bfops/fix-config-lock]: review

* [bfops/fix-config-lock]: fix

* [bfops/fix-config-lock]: TODOs

* [bfops/fix-config-lock]: review

* [bfops/fix-config-lock]: review

* [bfops/fix-config-lock]: review

* [bfops/fix-config-lock]: review

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-06-05 22:40:24 +00:00
Noa 6b1a3d3896 Module hotswapping (#1147) 2024-05-22 17:49:35 +00:00
Kim Altintop 2de147522d core: Collapse DBIC into HostController (#1186)
Make it so `HostController` manages both the module host (wasm
machinery) and the database (`RelationalDB` / `DatabaseInstanceContext`)
of spacetime databases deployed to a server.

The `DatabaseInstanceContextController` (DBIC) is removed in the
process.

This allows to make database accesses panic-safe, in that uncaught
panics will cause all resouces to be released and the database to be
restarted on subsequent access. This is a prerequisite for #985.

It also allows to move towards storage of the module binary directly in
the database / commitlog. This patch, however, makes some contortions in
order to **not** introduce a breaking change just yet.
2024-05-21 17:30:02 +00:00
Phoebe Goldman f6573c444e Create a lockfile when opening config files (#1196)
* Create a lockfile when opening config files

In the past, we've had issues where multiple concurrent CLI processes
would race to read and write the CLI config file,
leading to data loss.

We considered using `flock`/`LockFileEx` and blocking until the file became available,
but unfortunately it's not possible to atomically create and lock a nonexistent file,
which we need to do in the case where the configuration doesn't yet exist.

Instead, we opt for a classic lockfile-based scheme:
Before opening a config file `foo.conf`, attempt to exclusively create `foo.lock`,
and panic if the exclusive creation fails.
Once it becomes clear that we will not write the config any more,
i.e. in `Config::drop`,
delete the lockfile, allowing another process to operate.

This means that attempting to run multiple concurrent Spacetime CLI processes
with the same config file is now a hard error.

* Fix CI failures

This commit fixes two CI failures:

- `spacetime start`, and a few other CLI subcommands, do not access their `Config` at all,
  but the CLI constructs it unconditionally in `main`,
  which made it an error to run any CLI command while `spacetime start` was running.
  This is fixed by having subcommands which don't need a `Config`
  drop it before doing anything.
- Contrary to my assumption,
  the test configuration created by `Config::new_with_localhost` does get `drop`ped,
  because the test harness `clone`s is and passes an owned version to the CLI.
  This was causing it to attempt to delete the empty path, which failed.
  This is fixed by having the home configuration be `Option`al,
  and setting it to `None` in tests.

* Clap before config because they suppress destructors

Perform Clap argument parsing as the very first thing in a CLI process,
before locking the config,
because Clap calls `exit` directly on error rather than panicing
(presumably to have more control over error output),
which prevents destructors from running,
leaving stale lockfiles.

* Encapsulate lockfile logic in a type

Also deduplicate logic for finding config file paths.

* Define `create_parent_dir` helper with comments

* Replace `drop` calls with more explicit `Config::release_lock`.
2024-05-13 18:22:54 +00:00
Noa 3b754f10b1 Bump to Rust 1.78 (#1205)
* Bump to rust 1.78

* Fix lints
2024-05-08 14:20:12 +00:00
Zeke Foppa fbaa5ae9df Tests use explicit --server local (#1150)
* [bfops/tests-use-explicit-server]: fix?

* [bfops/tests-use-explicit-server]: empty

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-04-25 02:41:49 +00:00
Kim Altintop 47048559b4 core: Integrate new commitlog + durability (#926)
This patch attempts to integrate the new commitlog with the minimum
changes.

Most of the diff comes from deletions of the legacy log and the need to
adjust tests due to the requirement for a tokio runtime when a durable
database is used in tests.

The "meat" of the patch are the `RelationalDB` constructors,
`RelationalDB::commit_tx`, and the replay logic in
`locking_tx_datastore`.

While `DataKey` is gone, there is still some redundant data being passed
around, which will be addressed in the follow-up patch.
2024-04-11 22:46:31 +00:00
Mazdak Farrokhzad 344861f290 use nohasher_hash and ahash instead of siphash13 (#1040)
* use nohasher_hash and ahash instead of siphash13

* re-export types in spacetimedb_data_structures::map
2024-04-05 17:30:51 +00:00