Skip to content

Avoid blob downloads for availability checks#3

Merged
sidhujag merged 5 commits into
mainfrom
use-check-vh-for-blob-exists
May 14, 2026
Merged

Avoid blob downloads for availability checks#3
sidhujag merged 5 commits into
mainfrom
use-check-vh-for-blob-exists

Conversation

@sidhujag

@sidhujag sidhujag commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Use getnevmblobdata with getdata=false for availability checks so node lookups do not download blob bytes.
  • Add blobs_exist for up to 32 version hashes using one JSON-RPC batch request and one PODA check_vh POST-array fallback for missing hashes.
  • Keep full blob downloads on /vh only and bump crate metadata and lockfile to 0.1.12.

Test plan

  • cargo fmt
  • cargo test
  • cargo check

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2381cf3dd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs
Comment on lines +291 to +295
if base.ends_with("/vh") {
return format!("{base}/{normalized_hash}");
}

vec![
format!("{base}/blob/{normalized_hash}"),
format!("{base}/vh/{normalized_hash}"),
]
format!("{base}/vh/{normalized_hash}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle /blob-suffixed PODA URLs correctly

This URL builder now only treats /vh as a terminal path segment, so a configured base like https://.../blob (which was explicitly supported before) is transformed into https://.../blob/vh/<hash>. get_blob_from_cloud uses this directly, causing cloud retrieval to fail for existing deployments that still provide a /blob base even when the blob is present at /blob/<hash>.

Useful? React with 👍 / 👎.

jagdeep sidhu and others added 2 commits May 13, 2026 20:56
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c2db62c17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs Outdated
Comment on lines +414 to +417
.map_or(true, Self::check_vh_value_exists)
}
_ => true,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat unknown check_vh values as non-existent

check_vh_value_exists currently defaults unrecognized payloads to true, so null or unexpected object shapes from /check_vh are interpreted as “blob exists”. In deployments where the endpoint returns null/nonstandard JSON for missing hashes, blob_exists and finality fallback can incorrectly report availability and stop retrying even though the blob is absent. The default branch here should be fail-closed (false or an error) instead of optimistic true.

Useful? React with 👍 / 👎.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 189acdf250

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs
format!("{base}/blob/{normalized_hash}"),
format!("{base}/vh/{normalized_hash}"),
]
format!("{base}/vh/{normalized_hash}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve /blob base when building cloud fetch URL

When poda_url is configured with a /blob suffix (which was supported before this change), this builder now produces .../blob/vh/{hash} instead of .../blob/{hash}. That makes get_blob_from_cloud hit a non-existent path and fail all cloud blob downloads for those existing configurations.

Useful? React with 👍 / 👎.

Comment thread src/lib.rs
fn poda_check_vh_batch_url(&self) -> String {
let mut base = self.poda_url.trim_end_matches('/');

for suffix in ["/vh", "/check_vh"] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize /blob URLs before calling check_vh

The batch fallback URL stripping only handles /vh and /check_vh, so a configured base like https://host/blob now becomes https://host/blob/check_vh. That breaks cloud existence/finality fallback for prior /blob deployments and can incorrectly report blobs as unavailable/not final even when they exist in PODA.

Useful? React with 👍 / 👎.

@sidhujag

Copy link
Copy Markdown
Member Author

@codex review we dont support a blob endpoint

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 189acdf250

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs
Comment on lines +767 to +768
|| msg.contains("\"code\":-32602")
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Distinguish unsupported RPC params from missing blobs

blobs_exist now always sends getnevmblobdata with [versionhash, false], but any "code":-32602 error is treated as “blob not found” and sent to cloud fallback. If a deployed node only supports the older one-argument signature, every lookup will return -32602, so on-node blobs can be reported unavailable unless PODA also has them. This is a behavior regression from the prior single-call path and can produce false negatives in availability/finality decisions.

Useful? React with 👍 / 👎.

Comment thread src/lib.rs
}
return Ok(values.iter().map(Self::check_vh_value_exists).collect());
}
return Ok(aggregate_result(value));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse object-valued check_vh results per hash

When check_vh returns an object under result/results (for example a hash→bool map), this branch collapses it through aggregate_result(value) instead of mapping by hash. Because check_vh_value_exists on a plain map object returns false, all requested hashes are marked unavailable. That yields incorrect cloud fallback results for valid map-style batch responses.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 189acdf250

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs
Comment on lines +767 to +768
|| msg.contains("\"code\":-32602")
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Distinguish unsupported RPC params from missing blobs

blobs_exist now always sends getnevmblobdata with [versionhash, false], but any "code":-32602 error is treated as “blob not found” and sent to cloud fallback. If a deployed node only supports the older one-argument signature, every lookup will return -32602, so on-node blobs can be reported unavailable unless PODA also has them. This is a behavior regression from the prior single-call path and can produce false negatives in availability/finality decisions.

Useful? React with 👍 / 👎.

Comment thread src/lib.rs
}
return Ok(values.iter().map(Self::check_vh_value_exists).collect());
}
return Ok(aggregate_result(value));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse object-valued check_vh results per hash

When check_vh returns an object under result/results (for example a hash→bool map), this branch collapses it through aggregate_result(value) instead of mapping by hash. Because check_vh_value_exists on a plain map object returns false, all requested hashes are marked unavailable. That yields incorrect cloud fallback results for valid map-style batch responses.

Useful? React with 👍 / 👎.

@sidhujag

Copy link
Copy Markdown
Member Author

@codex review
We should keep:

getnevmblobdata(versionhash, false)

No one-arg fallback, no compatibility shim.

For the two new PR issues:

  • Distinguish unsupported RPC params from missing blobs: ignore. There is no older node API we need to support.
  • Parse object-valued check_vh results per hash: only relevant if backend returns { "result": { "<vh>": true } }. That is not in the API spec we agreed on. If backend returns top-level bool or same-length bool array, current code works.

So I won’t add old-node fallback or /blob support.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 189acdf250

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs Outdated
Comment on lines +394 to +398
fn truthy_check_vh_response(response: &str) -> bool {
!matches!(
response.trim().to_ascii_lowercase().as_str(),
"0" | "false" | "missing" | "not_found" | "not found" | "notfound"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Parse check_vh string responses conservatively

The string parser currently treats every value except a short denylist as exists=true, so responses like "", "blob not found", or other backend error text will be interpreted as available. In this commit, blob_exists and both finality checks rely on check_vh, so this can incorrectly mark missing blobs as present/finalized when the cloud endpoint returns descriptive non-boolean strings instead of strict booleans.

Useful? React with 👍 / 👎.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review remember no /blob, no one-arg node compatibility, POST /check_vh with aggregate bool or same-length bool array.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sidhujag sidhujag merged commit af8f314 into main May 14, 2026
1 of 2 checks passed
@sidhujag sidhujag deleted the use-check-vh-for-blob-exists branch May 14, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant