Skip to content

Commit 4c7d02c

Browse files
authored
Merge branch 'master' into bfops/fix-cli-rebuild
2 parents 3e032b5 + 3f6678c commit 4c7d02c

33 files changed

Lines changed: 2430 additions & 105 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,6 @@ jobs:
338338
339339
wasm-bindgen --version
340340
341-
- name: Check engine simulation build
342-
run: cargo check -p spacetimedb-engine --no-default-features --features simulation
343-
344341
# Source emsdk environment to make emcc (Emscripten compiler) available in PATH.
345342
- name: Run tests
346343
run: |

.github/workflows/llm-benchmark-periodic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
114114
LLM_VENDOR: openrouter
115115
LLM_BENCHMARK_API_KEY: ${{ secrets.LLM_BENCHMARK_API_KEY }}
116-
LLM_BENCHMARK_UPLOAD_URL: ${{ inputs.LLM_BENCHMARK_UPLOAD_URL }}
116+
LLM_BENCHMARK_UPLOAD_URL: ${{ vars.LLM_BENCHMARK_UPLOAD_URL }}
117117
DOTNET_MULTILEVEL_LOOKUP: "0"
118118
DOTNET_CLI_HOME: ${{ runner.temp }}/dotnet-home
119119
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ jobs:
124124
- name: Run release (dry-run)
125125
if: ${{ inputs.dry_run }}
126126
# NOTE: This will print a warning that `cargo-release release crates` dry runs are not supported
127-
run: cargo-release release crates --dry-run
127+
run: cargo-release release crates ${{ github.event.inputs.release_tag }} --dry-run
128128

129129
- name: Run release
130130
if: ${{ !inputs.dry_run }}
131-
run: cargo-release release crates
131+
run: cargo-release release crates ${{ github.event.inputs.release_tag }}
132132

133133
release-csharp:
134134
needs: build-cargo-release

Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ members = [
7777
"crates/bindings-typescript/test-app/server",
7878
"crates/bindings-typescript/test-react-router-app/server",
7979
"crates/bindings-typescript/test-solid-router/server",
80-
"crates/query-builder",
80+
"crates/query-builder", "crates/dst",
8181
]
8282
default-members = ["crates/cli", "crates/standalone", "crates/update"]
8383
# cargo feature graph resolver. v3 is default in edition2024 but workspace

crates/core/src/host/host_controller.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ pub struct ModuleHostWithBootstrap {
100100
/// The handle owns any wait state needed to prove that the database has a
101101
/// durable `st_module` row.
102102
pub struct BootstrapCompletion {
103-
program_hash: Hash,
103+
bootstrap_generation: u64,
104104
status: ProgramBootstrap,
105105
}
106106

107107
/// Has the module been bootstrapped from the controldb?
108108
///
109109
/// Once we have inserted into `st_module`, bootstrapping is no longer necessary,
110-
/// and the initial program bytes can be dropped fromt the controldb.
110+
/// and the initial program bytes can be dropped from the controldb.
111111
enum ProgramBootstrap {
112112
/// The module's program bytes have already been written to `st_module`
113113
Durable,
@@ -119,32 +119,32 @@ enum ProgramBootstrap {
119119
}
120120

121121
impl BootstrapCompletion {
122-
fn durable(program_hash: Hash) -> Self {
122+
fn durable(bootstrap_generation: u64) -> Self {
123123
Self {
124-
program_hash,
124+
bootstrap_generation,
125125
status: ProgramBootstrap::Durable,
126126
}
127127
}
128128

129-
fn pending(program_hash: Hash, tx_offset: TransactionOffset, durable_offset: Option<DurableOffset>) -> Self {
129+
fn pending(bootstrap_generation: u64, tx_offset: TransactionOffset, durable_offset: Option<DurableOffset>) -> Self {
130130
Self {
131-
program_hash,
131+
bootstrap_generation,
132132
status: ProgramBootstrap::Pending {
133133
tx_offset,
134134
durable_offset,
135135
},
136136
}
137137
}
138138

139-
pub fn program_hash(&self) -> Hash {
140-
self.program_hash
139+
pub fn bootstrap_generation(&self) -> u64 {
140+
self.bootstrap_generation
141141
}
142142

143143
/// Wait until it is safe to complete program bootstrap in controldb.
144144
/// That is, wait until the initial `st_module` insert becomes durable.
145-
pub async fn wait(self) -> anyhow::Result<Hash> {
145+
pub async fn wait(self) -> anyhow::Result<()> {
146146
match self.status {
147-
ProgramBootstrap::Durable => Ok(self.program_hash),
147+
ProgramBootstrap::Durable => Ok(()),
148148
ProgramBootstrap::Pending {
149149
tx_offset,
150150
durable_offset,
@@ -160,7 +160,7 @@ impl BootstrapCompletion {
160160
.context("failed waiting for initialized program to become durable")?;
161161
}
162162

163-
Ok(self.program_hash)
163+
Ok(())
164164
}
165165
}
166166
}
@@ -1132,7 +1132,8 @@ impl Host {
11321132
(program, true)
11331133
}
11341134
};
1135-
let mut bootstrap_completion = Some(BootstrapCompletion::durable(program.hash));
1135+
let bootstrap_generation = database.bootstrap_generation;
1136+
let mut bootstrap_completion = Some(BootstrapCompletion::durable(bootstrap_generation));
11361137

11371138
let relational_db = Arc::new(db);
11381139
let (program, launched) = match HostType::from(program.kind) {
@@ -1222,13 +1223,12 @@ impl Host {
12221223
};
12231224

12241225
if program_needs_init {
1225-
let program_hash = program.hash;
12261226
let InitDatabaseResult { reducer, tx_offset } = launched.module_host.init_database(program).await?;
12271227
if let Some(call_result) = reducer {
12281228
Result::from(call_result)?;
12291229
}
12301230
bootstrap_completion = Some(BootstrapCompletion::pending(
1231-
program_hash,
1231+
bootstrap_generation,
12321232
tx_offset,
12331233
launched.module_host.durable_tx_offset(),
12341234
));
@@ -1540,6 +1540,7 @@ pub(crate) async fn extract_schema_with_pools(
15401540
owner_identity,
15411541
host_type,
15421542
initial_program: program.hash,
1543+
bootstrap_generation: 0,
15431544
};
15441545

15451546
let core = AllocatedJobCore::default();

crates/core/src/host/instance_env.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,7 @@ mod test {
13771377
owner_identity: Identity::ZERO,
13781378
host_type: HostType::Wasm,
13791379
initial_program: Hash::ZERO,
1380+
bootstrap_generation: 0,
13801381
},
13811382
replica_id: 0,
13821383
logger,

crates/core/src/messages/control_db.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pub struct Database {
3737
///
3838
/// Updating the database's module will **not** change this value.
3939
pub initial_program: Hash,
40+
/// Generation of the current bootstrap requirement for `initial_program`.
41+
pub bootstrap_generation: u64,
4042
}
4143

4244
#[derive(Clone, PartialEq, Serialize, Deserialize)]

crates/datastore/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ rust-version.workspace = true
1010
spacetimedb-data-structures.workspace = true
1111
spacetimedb-lib = { workspace = true, features = ["serde", "metrics_impls"] }
1212
spacetimedb-commitlog.workspace = true
13-
spacetimedb-durability = { path = "../durability", default-features = false }
13+
spacetimedb-durability.workspace = true
1414
spacetimedb-metrics.workspace = true
1515
spacetimedb-primitives.workspace = true
1616
spacetimedb-paths.workspace = true
1717
spacetimedb-sats = { workspace = true, features = ["serde"] }
1818
spacetimedb-schema.workspace = true
1919
spacetimedb-table.workspace = true
20-
spacetimedb-snapshot = { path = "../snapshot", default-features = false }
20+
spacetimedb-snapshot.workspace = true
2121
spacetimedb-execution.workspace = true
2222

2323
anyhow = { workspace = true, features = ["backtrace"] }
@@ -39,9 +39,7 @@ thin-vec.workspace = true
3939
[features]
4040
# Print a warning when doing an unindexed `iter_by_col_range` on a large table.
4141
unindexed_iter_by_col_range_warn = []
42-
default = ["unindexed_iter_by_col_range_warn", "tokio"]
43-
tokio = ["spacetimedb-durability/tokio", "spacetimedb-snapshot/tokio"]
44-
simulation = ["spacetimedb-durability/simulation", "spacetimedb-snapshot/simulation"]
42+
default = ["unindexed_iter_by_col_range_warn"]
4543
# Enable test helpers and utils
4644
test = ["spacetimedb-commitlog/test", "spacetimedb-schema/test"]
4745

crates/dst/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "spacetimedb-dst"
3+
version.workspace = true
4+
edition.workspace = true
5+
rust-version.workspace = true
6+
7+
[dependencies]
8+
anyhow.workspace = true
9+
clap.workspace = true
10+
spacetimedb-datastore.workspace = true
11+
spacetimedb-commitlog.workspace = true
12+
spacetimedb-durability.workspace = true
13+
spacetimedb-engine.workspace = true
14+
spacetimedb-lib.workspace = true
15+
spacetimedb-primitives.workspace = true
16+
spacetimedb-runtime = { workspace = true, features = ["simulation"] }
17+
spacetimedb-sats.workspace = true
18+
spacetimedb-schema.workspace = true
19+
spacetimedb-table.workspace = true
20+
tracing.workspace = true
21+
tracing-subscriber.workspace = true
22+
23+
[lints]
24+
workspace = true

0 commit comments

Comments
 (0)