Skip to content

Commit 3dfa923

Browse files
committed
Prepare v0.9.0 release for bumped MSRV and dependency updates
Create a new minor release because the MSRV has been raised from 1.85.0 to 1.90.0. A downstream dependency silently raised its MSRV, which would cause build failures for users relying on our previously announced MSRV. Bumps all crate versions from 0.8.0 to 0.9.0, fixes new clippy lints (collapsible_if, manual_is_multiple_of) introduced in Rust 1.90, and adds release notes. Fixes #91
1 parent b0c7151 commit 3dfa923

10 files changed

Lines changed: 142 additions & 42 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "restate-sdk"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2024"
55
description = "Restate SDK for Rust"
66
license = "MIT"
77
repository = "https://github.com/restatedev/sdk-rust"
8-
rust-version = "1.85.0"
8+
rust-version = "1.90.0"
99

1010
[[example]]
1111
name = "tracing"
@@ -35,8 +35,8 @@ hyper-util = { version = "0.1", features = ["tokio", "server", "server-graceful"
3535
pin-project-lite = "0.2"
3636
rand = { version = "0.10", optional = true }
3737
regress = "0.10"
38-
restate-sdk-macros = { version = "0.8", path = "macros" }
39-
restate-sdk-shared-core = { version = "=0.7.1", features = ["request_identity", "sha2_random_seed", "http"] }
38+
restate-sdk-macros = { version = "0.9", path = "macros" }
39+
restate-sdk-shared-core = { version = "=0.9.0", features = ["request_identity", "sha2_random_seed", "http"] }
4040
schemars = { version = "1.2", optional = true }
4141
serde = "1.0"
4242
serde_json = "1.0"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ The Rust SDK is currently in active development, and might break across releases
190190

191191
The compatibility with Restate is described in the following table:
192192

193-
| Restate Server\sdk-rust | < 0.4 | 0.4 - 0.5 | 0.6 | 0.7 | 0.8 |
194-
|-------------------------|------------------|-----------|------------------|------------------|------------------|
195-
| < 1.3 ||||||
196-
| 1.3 ||| ✅ <sup>(1)</sup> | ✅ <sup>(2)</sup> | ✅ <sup>(2)</sup> |
197-
| 1.4 |||| ✅ <sup>(2)</sup> | ✅ <sup>(2)</sup> |
198-
| 1.5 | ⚠ <sup>(3)</sup> |||||
199-
| 1.6 | ❌ <sup>(4)</sup> |||||
193+
| Restate Server\sdk-rust | < 0.4 | 0.4 - 0.5 | 0.6 | 0.7 - 0.9 |
194+
|-------------------------|------------------|-----------|------------------|------------------|
195+
| < 1.3 |||||
196+
| 1.3 ||| ✅ <sup>(1)</sup> | ✅ <sup>(2)</sup> |
197+
| 1.4 |||| ✅ <sup>(2)</sup> |
198+
| 1.5 | ⚠ <sup>(3)</sup> ||||
199+
| 1.6 | ❌ <sup>(4)</sup> ||||
200200

201201
<sup>(1)</sup> **Note** `bind_with_options` works only from Restate 1.4 onward.
202202

examples/failures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl FailureExample for FailureExampleImpl {
1717
async fn do_run(&self, context: Context<'_>) -> Result<(), TerminalError> {
1818
context
1919
.run::<_, _, ()>(|| async move {
20-
if rand::rng().next_u32() % 4 == 0 {
20+
if rand::rng().next_u32().is_multiple_of(4) {
2121
Err(TerminalError::new("Failed!!!"))?
2222
}
2323

macros/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "restate-sdk-macros"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2024"
55
description = "Restate SDK for Rust macros"
66
license = "MIT"
77
repository = "https://github.com/restatedev/sdk-rust"
8-
rust-version = "1.85.0"
8+
rust-version = "1.90.0"
99

1010
[lib]
1111
proc-macro = true

release-notes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This directory contains release notes for the Restate Rust SDK, organized to tra
88
release-notes/
99
├── README.md # This file
1010
├── v0.8.0.md # Consolidated release notes for v0.8.0
11-
├── v0.9.0.md # (future releases follow the same pattern)
11+
├── v0.9.0.md # Consolidated release notes for v0.9.0
1212
└── unreleased/ # Release notes for changes not yet released
1313
└── *.md # Individual release note files
1414
```

release-notes/v0.9.0.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Restate Rust SDK v0.9.0 Release Notes
2+
3+
## Highlights
4+
5+
- **MSRV raised to 1.90.0** — a downstream dependency silently raised its MSRV, which would cause build failures for users relying on our previously announced MSRV
6+
- **`#[lazy_state]` handler attribute** — opt into lazy state loading on a per-handler basis
7+
8+
## Table of Contents
9+
10+
- [Breaking Changes](#breaking-changes)
11+
- [New Features](#new-features)
12+
13+
## Breaking Changes
14+
15+
### Dependency bumps with user-facing API changes
16+
17+
Several dependencies have been bumped. Most are transparent, but the following affect user code:
18+
19+
#### `rand` 0.9 → 0.10
20+
21+
The `rand()` method on context types returns `&mut rand::prelude::StdRng`. In rand 0.10, the trait that provides convenience methods like `.random()` and `.random_range()` was renamed from `Rng` to `RngExt`. If you import this trait, update your code:
22+
23+
```diff
24+
- use rand::Rng;
25+
+ use rand::RngExt;
26+
```
27+
28+
Additionally, the low-level trait `RngCore` (providing `next_u32()`, `next_u64()`, `fill_bytes()`) was renamed to `Rng`:
29+
30+
```diff
31+
- use rand::RngCore;
32+
+ use rand::Rng;
33+
```
34+
35+
`StdRng` no longer implements `Clone`. If you were cloning the RNG returned by `ctx.rand()`, this is no longer possible.
36+
37+
#### Other dependency bumps (no user-facing changes)
38+
39+
The following dependencies were also bumped but require no changes to user code:
40+
41+
| Dependency | Old | New |
42+
|---|---|---|
43+
| `restate-sdk-shared-core` | `0.6.0` | `0.9.0` |
44+
| `aws_lambda_events` | `0.16.1` | `1.0` |
45+
| `lambda_runtime` | `0.14.2` | `1.0` |
46+
| `typify` | `0.1.0` | `0.6` |
47+
| `jsonptr` | `0.5.1` | `0.7` |
48+
| `regress` | `0.10.3` | `0.10` |
49+
| `bytes` | `1.10` | `1.11` |
50+
| `http` | `1.3` | `1.4` |
51+
| `hyper` | `1.6` | `1.8` |
52+
| `tokio` | `1.44` | `1.49` |
53+
| `uuid` | `1.16.0` | `1.20` |
54+
| `schemars` | `1.0.0` | `1.2` |
55+
| `reqwest` (dev) | `0.12` | `0.13` |
56+
| `testcontainers` | `0.23.3` | `0.27` |
57+
58+
### MSRV raised to 1.90.0
59+
60+
The minimum supported Rust version (MSRV) has been raised from **1.85.0** to **1.90.0**.
61+
62+
This bump was necessary because a downstream dependency raised its own MSRV without announcing it. Without this change, users relying on our previously announced MSRV of 1.85.0 would encounter build failures. Any user building with a toolchain between 1.85.0 and 1.87.x is affected. Rather than pinning to an older version of the dependency, we chose to follow the ecosystem forward.
63+
64+
**Impact on Users:**
65+
- Projects using a Rust toolchain older than 1.90.0 will fail to compile against this version of the SDK
66+
- Your own crate's `edition` field does not need to change, but your installed Rust toolchain must be >= 1.90.0
67+
68+
**Migration Guidance:**
69+
70+
Update your Rust toolchain:
71+
72+
```bash
73+
rustup update stable
74+
```
75+
76+
Verify your version:
77+
78+
```bash
79+
rustc --version # Must be >= 1.90.0
80+
```
81+
82+
## New Features
83+
84+
### `#[lazy_state]` handler attribute
85+
86+
You can now annotate individual handlers with `#[lazy_state]` to enable lazy state loading for that handler. When enabled, state is fetched on demand rather than eagerly loaded when the handler is invoked.
87+
88+
**Example:**
89+
90+
```rust
91+
#[restate_sdk::object]
92+
pub trait MyObject {
93+
#[lazy_state]
94+
async fn my_handler(name: String) -> Result<String, HandlerError>;
95+
}
96+
```
97+
98+
**Related Issues:**
99+
- PR [#90](https://github.com/restatedev/sdk-rust/pull/90)

src/endpoint/context.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl ContextInternal {
402402
.and_then(|input| {
403403
inner_lock
404404
.vm
405-
.sys_call(target, input, PayloadOptions::stable())
405+
.sys_call(target, input, None, PayloadOptions::stable())
406406
.map_err(Into::into)
407407
});
408408

@@ -500,6 +500,7 @@ impl ContextInternal {
500500
.expect("Duration since unix epoch cannot fail")
501501
+ delay
502502
}),
503+
None,
503504
PayloadOptions::stable(),
504505
) {
505506
Ok(h) => h,
@@ -755,10 +756,10 @@ impl ContextInternal {
755756
let mut inner_lock = must_lock!(self.inner);
756757

757758
let out = inner_lock.vm.take_output();
758-
if let TakeOutputResult::Buffer(b) = out {
759-
if !inner_lock.write.send(b) {
760-
// Nothing we can do anymore here
761-
}
759+
if let TakeOutputResult::Buffer(b) = out
760+
&& !inner_lock.write.send(b)
761+
{
762+
// Nothing we can do anymore here
762763
}
763764
}
764765

src/filter.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,35 @@ impl<S: Subscriber + for<'lookup> LookupSpan<'lookup>> Filter<S> for ReplayAware
5454
if let Some(scope) = cx.event_scope(event) {
5555
let iterator = scope.from_root();
5656
for span in iterator {
57-
if span.name() == "restate_sdk_endpoint_handle" {
58-
if let Some(replay) = span.extensions().get::<ReplayField>() {
59-
return !replay.0;
60-
}
57+
if span.name() == "restate_sdk_endpoint_handle"
58+
&& let Some(replay) = span.extensions().get::<ReplayField>()
59+
{
60+
return !replay.0;
6161
}
6262
}
6363
}
6464
true
6565
}
6666

6767
fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>) {
68-
if let Some(span) = ctx.span(id) {
69-
if span.name() == "restate_sdk_endpoint_handle" {
70-
let mut visitor = ReplayFieldVisitor(false);
71-
attrs.record(&mut visitor);
72-
let mut extensions = span.extensions_mut();
73-
extensions.replace::<ReplayField>(ReplayField(visitor.0));
74-
}
68+
if let Some(span) = ctx.span(id)
69+
&& span.name() == "restate_sdk_endpoint_handle"
70+
{
71+
let mut visitor = ReplayFieldVisitor(false);
72+
attrs.record(&mut visitor);
73+
let mut extensions = span.extensions_mut();
74+
extensions.replace::<ReplayField>(ReplayField(visitor.0));
7575
}
7676
}
7777

7878
fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>) {
79-
if let Some(span) = ctx.span(id) {
80-
if span.name() == "restate_sdk_endpoint_handle" {
81-
let mut visitor = ReplayFieldVisitor(false);
82-
values.record(&mut visitor);
83-
let mut extensions = span.extensions_mut();
84-
extensions.replace::<ReplayField>(ReplayField(visitor.0));
85-
}
79+
if let Some(span) = ctx.span(id)
80+
&& span.name() == "restate_sdk_endpoint_handle"
81+
{
82+
let mut visitor = ReplayFieldVisitor(false);
83+
values.record(&mut visitor);
84+
let mut extensions = span.extensions_mut();
85+
extensions.replace::<ReplayField>(ReplayField(visitor.0));
8686
}
8787
}
8888
}

test-services/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "test-services"
33
version = "0.1.0"
44
edition = "2024"
55
publish = false
6-
rust-version = "1.85.0"
6+
rust-version = "1.90.0"
77

88
[dependencies]
99
anyhow = "1.0"

testcontainers/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[package]
22
name = "restate-sdk-testcontainers"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2024"
55
description = "Restate SDK Testcontainers utilities"
66
license = "MIT"
77
repository = "https://github.com/restatedev/sdk-rust"
8-
rust-version = "1.85.0"
8+
rust-version = "1.90.0"
99

1010

1111
[dependencies]
1212
anyhow = "1.0"
1313
futures = "0.3"
1414
reqwest = { version= "0.13", features = ["json"] }
15-
restate-sdk = { version = "0.8.0", path = "../" }
15+
restate-sdk = { version = "0.9.0", path = "../" }
1616
serde = "1.0"
1717
testcontainers = { version = "0.27", features = ["http_wait"] }
1818
tokio = "1.49"

0 commit comments

Comments
 (0)