Skip to content

Commit 9710b30

Browse files
committed
Update to worker 0.6.6
- Remove console_error_panic_hook call, as it's no longer needed after cloudflare/workers-rs#805 - Update to worker 0.6.6 and update compatibility dates - Add endpoint to print out sequencer Durable Object ID, useful for memory profiling in internal Cloudflare dashboards
1 parent 858cb8f commit 9710b30

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

Cargo.lock

Lines changed: 6 additions & 6 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
@@ -71,7 +71,7 @@ thiserror = "2.0"
7171
tlog_tiles = { path = "crates/tlog_tiles", version = "0.2.0" }
7272
tokio = { version = "1", features = ["sync"] }
7373
url = "2.2"
74-
worker = "0.6.5"
74+
worker = "0.6.6"
7575
x509-cert = "0.2.5"
7676
x509-verify = { version = "0.4.4", features = [
7777
"md2",

crates/ct_worker/src/frontend_worker.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
129129
stub.fetch_with_str(&format!("http://fake_url.com{METRICS_ENDPOINT}"))
130130
.await
131131
})
132+
.get("/logs/:log/sequencer_id", |_req, ctx| {
133+
// Print out the Durable Object ID of the sequencer to allow
134+
// looking it up in internal Cloudflare dashboards. This
135+
// value does not need to be kept secret.
136+
let name = ctx.data;
137+
let namespace = ctx.env.durable_object("SEQUENCER")?;
138+
let object_id = namespace.id_from_name(name)?;
139+
Response::ok(object_id.to_string())
140+
})
132141
.get_async("/logs/:log/*key", |_req, ctx| async move {
133142
let name = ctx.data;
134143
let key = ctx.param("key").unwrap();

crates/ct_worker/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "static-ct",
33
"main": "build/worker/shim.mjs",
4-
"compatibility_date": "2025-04-01",
4+
"compatibility_date": "2025-09-25",
55
"workers_dev": false,
66
"build": {
77
"command": "echo 'Default environment not configured. Please specify an environment with the \"-e\" flag.' && exit 1"

crates/generic_log_worker/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ pub fn init_logging(level: Option<&str>) {
5656
let level = level
5757
.and_then(|level| Level::from_str(level).ok())
5858
.unwrap_or(Level::Info);
59-
console_error_panic_hook::set_once();
6059
INIT_LOGGING.call_once(|| {
6160
console_log::init_with_level(level).expect("error initializing logger");
6261
});
@@ -244,9 +243,10 @@ impl CacheRead for DedupCache {
244243
}
245244

246245
impl DedupCache {
247-
// Batches are written at most once per second, and we only need them deduplicate
248-
// entries long enough for KV's eventual consistency guarantees (~60s).
249-
// Cap at 128 so we can use a single get_multiple call to get all batches at once.
246+
// Batches are written at most once per second, and we only need them to
247+
// deduplicate entries long enough for KV's eventual consistency guarantees
248+
// (~60s). Cap at 128 so we can use a single get_multiple call to get all
249+
// batches at once.
250250
// https://developers.cloudflare.com/durable-objects/api/storage-api/#get
251251
const MAX_BATCHES: usize = 128;
252252
const FIFO_HEAD_KEY: &str = "fifo:head";

crates/mtc_worker/src/frontend_worker.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,15 @@ async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
251251
stub.fetch_with_str(&format!("http://fake_url.com{METRICS_ENDPOINT}"))
252252
.await
253253
})
254+
.get("/logs/:log/sequencer_id", |_req, ctx| {
255+
// Print out the Durable Object ID of the sequencer to allow
256+
// looking it up in internal Cloudflare dashboards. This
257+
// value does not need to be kept secret.
258+
let name = ctx.data;
259+
let namespace = ctx.env.durable_object("SEQUENCER")?;
260+
let object_id = namespace.id_from_name(name)?;
261+
Response::ok(object_id.to_string())
262+
})
254263
.get_async("/logs/:log/*key", |_req, ctx| async move {
255264
let name = ctx.data;
256265
let key = ctx.param("key").unwrap();

crates/mtc_worker/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mtc",
33
"main": "build/worker/shim.mjs",
4-
"compatibility_date": "2025-04-01",
4+
"compatibility_date": "2025-09-25",
55
"workers_dev": false,
66
"build": {
77
"command": "echo 'Default environment not configured. Please specify an environment with the \"-e\" flag.' && exit 1"

0 commit comments

Comments
 (0)