-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
Conversation
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( |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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>> { |
There was a problem hiding this comment.
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>
.
What ❔
Add a
sealed_at
column to thel1_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
zkstack dev fmt
andzkstack dev lint
.