Skip to content

Add DA finality state and force publish APIs#4

Merged
sidhujag merged 2 commits into
mainfrom
fix/da-finality-healing-api
May 17, 2026
Merged

Add DA finality state and force publish APIs#4
sidhujag merged 2 commits into
mainfrom
fix/da-finality-healing-api

Conversation

@sidhujag

Copy link
Copy Markdown
Member

Summary

  • Adds BlobFinalityState APIs so callers can distinguish finalized, confirmed-but-waiting, unconfirmed, and missing DA blobs.
  • Adds force_create_blob for healing stale publications with overwrite_existing=true while preserving the idempotent create_blob behavior.
  • Covers the new force-publish and finality-state semantics with focused mock RPC tests.

Test plan

  • Not run locally per local-cargo restriction.
  • IDE diagnostics reported clean for src/lib.rs and tests/lib_test.rs.
  • git diff --check

Made with Cursor

Expose richer blob finality states and a force-publish path so callers can heal stale DA publications without treating confirmed-but-not-final blobs as missing.

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

@mickeyjoes mickeyjoes 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.

Reviewed as the dependency-side mitigation for the zksync-os-server DA self-healing path. The client semantics look right to me:

  • create_blob remains idempotent and force_create_blob sets overwrite_existing=true, so callers can perform an actual republish when they still have the blob data.
  • The new BlobFinalityState API distinguishes finalized, confirmed-but-waiting, unconfirmed, and missing. Confirmed does not satisfy should_republish_after_timeout(), which is the behavior the server follow-up needs to avoid republishing blobs that are mined but not chainlocked / threshold-final yet.
  • The existing PoDA fallback behavior is preserved: RPC-missing + check_vh=true still means finalized/pruned from the client perspective.

Local validation:

  • cargo +1.92 test --locked passed: 34 tests.
  • cargo +1.92 fmt --all -- --check currently fails on src/lib.rs around check_blob_finality; cargo fmt should fix it.
  • cargo +1.92 clippy --workspace --all-targets -- -D warnings also fails on pre-existing needless_return warnings in RealRpcClient::create_or_load_wallet (src/lib.rs:306 and src/lib.rs:323). That is not introduced by this PR, but the self-hosted probe clippy gate may still catch it.

No logic/security objection from me on this client PR. The next zksync-os-server PR should consume blob_finality_state_with_mode plus force_create_blob, and only republish after its own timeout when should_republish_after_timeout() is true.

Keep the new finality helpers formatted and remove needless returns so stricter clippy probes stay clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag sidhujag merged commit aec99f4 into main May 17, 2026
1 of 2 checks passed
@sidhujag sidhujag deleted the fix/da-finality-healing-api branch May 17, 2026 00:17
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.

2 participants