Skip to content

Conversation

@redpanda-f
Copy link
Collaborator

  • synapse-sdk needed sessions key registry addr, which was not exported earlier
  • post and seal layers can be disabled for PDP layer only operations

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the SessionKeyRegistry contract address to the exported DevnetInfo so external consumers (e.g. synapse-sdk) can discover it, and simplifies Curio startup by disabling seal/post layers for PDP-only workflows.

Changes:

  • Export session_key_registry_addr in DevnetInfo/ContractsInfo and update the JS schema accordingly.
  • Extend FOC deploy output parsing to capture the SessionKeyRegistry address from a pre-summary log line.
  • Update Curio layer configuration to run only pdp-only,gui.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/external_api/export.rs Adds session_key_registry_addr extraction from SetupContext into exported devnet-info JSON.
src/external_api/devnet_info.rs Extends ContractsInfo schema with session_key_registry_addr.
src/commands/start/foc_deployer/mod.rs Parses SessionKeyRegistry deployed at ... output and records it in the deployment addresses map.
src/commands/start/curio/constants.rs Removes seal and post from the Curio --layers argument.
examples/devnet-schema.js Updates Zod schema to require session_key_registry_addr in contracts.

Comment on lines +401 to +406
fn extract_address_from_deployed_line(line: &str) -> Option<String> {
let marker = "deployed at ";
let idx = line.find(marker)?;
let addr = line[idx + marker.len()..].trim();
if addr.starts_with("0x") && addr.len() >= 42 {
Some(addr.to_string())
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract_address_from_deployed_line returns the entire substring after deployed at , so if the deploy script ever prints anything after the address (e.g. trailing commas, extra text, ANSI codes), the stored value will not be a valid 0x address and downstream consumers will break. Consider extracting only the first token, then validating it is exactly 42 chars (0x + 40) and hex before returning.

Suggested change
fn extract_address_from_deployed_line(line: &str) -> Option<String> {
let marker = "deployed at ";
let idx = line.find(marker)?;
let addr = line[idx + marker.len()..].trim();
if addr.starts_with("0x") && addr.len() >= 42 {
Some(addr.to_string())
fn is_valid_hex_address(token: &str) -> bool {
if token.len() != 42 {
return false;
}
if !token.starts_with("0x") {
return false;
}
token[2..].chars().all(|c| c.is_ascii_hexdigit())
}
fn extract_address_from_deployed_line(line: &str) -> Option<String> {
let marker = "deployed at ";
let idx = line.find(marker)?;
let rest = line[idx + marker.len()..].trim();
let first_token = rest.split_whitespace().next()?;
if is_valid_hex_address(first_token) {
Some(first_token.to_string())

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a bad point, but also maybe irrelevant since we control the code; not a bad thing to be as robust as we can though

Comment on lines +271 to +272
}
continue;
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SessionKeyRegistry deployed at special-case always continues even when extract_address_from_deployed_line returns None. If the deploy output format varies slightly (e.g. deployed at: with a colon, extra prefixes), this will skip the line entirely and the address won't be captured. Consider only continue after successfully extracting an address, or falling back to the generic parsing path when extraction fails.

Suggested change
}
continue;
continue;
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

@redpanda-f redpanda-f force-pushed the feat/redpanda/add-sessions-key-registry branch from 7df9b6c to efeaa46 Compare February 11, 2026 07:21
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Feb 11, 2026
@BigLep
Copy link
Contributor

BigLep commented Feb 11, 2026

This is being done in support of #7, and particularly FilOzone/synapse-sdk#600

@BigLep BigLep mentioned this pull request Feb 11, 2026
2 tasks
pub const CURIO_LONG_TERM_STORAGE_PATH: &str = "/home/foc-user/curio/long-term-storage";

pub const CURIO_LAYERS: &str = "seal,post,pdp-only,gui";
pub const CURIO_LAYERS: &str = "pdp-only,gui";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, good catch
also I thought it was pdp, I didn't know pdp-only was a thing, hopefully this simplifies the running instances a little

Copy link
Contributor

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving but those two copilot items would be worth fixing, more resilience when dealing with parsed log output

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✔️ Approved by reviewer

Development

Successfully merging this pull request may close these issues.

3 participants