Skip to content

Add timing logs for Aligned proof verification + optional split flow (submit + is_proof_verified) with timing #9

Description

@Kirol54

We currently submit proofs to the Aligned verification layer using:

aligned_sdk::verification_layer::submit_and_wait_verification(
    eth_rpc_url,
    network.to_owned(),
    &verification_data,
    max_fee,
    wallet,
    nonce,
)
.await
.map_err(|e| e.to_string())

This task covers:

  1. Add time logging to report how long the request takes.
  2. Add an alternative implementation that uses two separate SDK calls: submit and is_proof_verified, including timing for the overall flow (and ideally per-step timing too).

Requirements

1) Timing logs for current flow

  • Measure elapsed time for submit_and_wait_verification.
  • Log duration (ms/seconds) with enough context (network, maybe proof id/hash if available).
  • Keep logs consistent with repo logging style (tracing/log).

2) Optional split-flow implementation

  • Implement a separate flow using:

    • aligned_sdk::verification_layer::submit(...)
    • aligned_sdk::verification_layer::is_proof_verified(...)
  • Poll is_proof_verified until success (or timeout), with a configurable poll interval.

  • Add timing:

    • Total elapsed time end-to-end
    • (Nice-to-have) time for submit call + verification wait time separately
  • Expose this as an option (non-breaking):

    • Config flag / CLI flag / env var (whatever the repo uses) to choose:

      • submit_and_wait_verification (default)
      • submit + is_proof_verified (new mode)

Acceptance Criteria

  • Existing default behavior unchanged.
  • Logs include elapsed time for the current submit_and_wait_verification flow.
  • New optional mode exists using submit + polling is_proof_verified, with elapsed timing logged.
  • Errors remain mapped to String as before (or equivalent), and no breaking changes to public API surface.

Notes

  • Prefer std::time::Instant for timing.
  • Add a reasonable timeout (configurable) to avoid infinite polling.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions