Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add more metrics for the tee_prover #3276

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: add more metrics for the tee_prover #3276

wants to merge 2 commits into from

Conversation

haraldh
Copy link
Collaborator

@haraldh haraldh commented Nov 14, 2024

What ❔

Add a sealed_at column to the l1_batches table and extend the tee_prover metrics.

Why ❔

The duration metric of sealed -> TEE proven is of special interest for Interop. It should not regress and should be optimized in future development.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

Especially add a `sealed_at` column to the `l1_batches` table
to get the desired duration metric of sealed -> proven.

Signed-off-by: Harald Hoyer <[email protected]>
@@ -2394,6 +2396,29 @@ impl BlocksDal<'_, '_> {
.flatten())
}

pub async fn get_sealed_at(
Copy link
Contributor

Choose a reason for hiding this comment

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

Bikeshedding: Despite the argument making it clear what this method is about, I'd still name it more specifically, like get_batch_sealed_at(); other methods in this module usually specify entities they concern.

FROM
l1_batches
WHERE
is_sealed
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this condition redundant? If !is_sealed, sealed_at should be null. OTOH, it could still be null for old sealed batches; I think this is accounted for, right?


tracing::info!(
l1_batch_number = %l1_batch_number,
sealed_to_proven_in_secs = %duration_secs_f64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: f64 values can be supplied to tracing macros directly, w/o a Display / % qualifier.

tracing::info!(
proof_generation_time = %duration.as_secs_f64(),
l1_batch_number = %batch_number,
l1_root_hash = %verification_result.value_hash,
Copy link
Contributor

Choose a reason for hiding this comment

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

To record the full hash, use ? (= Debug) specifier. AFAIU, the Display impl for H256 doesn't display all hex digits, but rather only starting / ending ones.

pub async fn get_sealed_at(
&mut self,
l1_batch_number: L1BatchNumber,
) -> DalResult<Option<NaiveDateTime>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bikeshedding: Most existing DAL methods convert time to DateTime<Utc>.

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