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

fix: Follow up metrics fixes vol.2 #656

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions core/lib/dal/sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2717,24 +2717,6 @@
},
"query": "UPDATE transactions\n SET in_mempool = TRUE\n FROM (\n SELECT hash FROM (\n SELECT hash\n FROM transactions\n WHERE miniblock_number IS NULL AND in_mempool = FALSE AND error IS NULL\n AND (is_priority = TRUE OR (max_fee_per_gas >= $2 and gas_per_pubdata_limit >= $3))\n AND tx_format != $4\n ORDER BY is_priority DESC, priority_op_id, received_at\n LIMIT $1\n ) as subquery1\n ORDER BY hash\n ) as subquery2\n WHERE transactions.hash = subquery2.hash\n RETURNING transactions.*"
},
"2cc57497090a97bcb453036f7b5e2139b590699aa1a2df4d6fd2b19e27e06251": {
"describe": {
"columns": [
{
"name": "l1_batch_number",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": []
}
},
"query": "SELECT l1_batch_number FROM proof_generation_details WHERE status <> 'generated' ORDER BY l1_batch_number ASC LIMIT 1"
},
"2e3f116ca05ae70b7c83ac550302194c91f57b69902ff8e42140fde732ae5e6a": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -4853,6 +4835,24 @@
},
"query": "SELECT (SELECT l1_batch_number FROM miniblocks WHERE number = $1) as \"block_batch?\", (SELECT MAX(number) + 1 FROM l1_batches) as \"max_batch?\""
},
"5f29e71af038c974e2d83b908c5a2559ab8afbb169bc0ae9f881a6628dc087fd": {
"describe": {
"columns": [
{
"name": "l1_batch_number",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": []
}
},
"query": "SELECT l1_batch_number FROM proof_generation_details WHERE status NOT IN ('generated', 'skipped') ORDER BY l1_batch_number ASC LIMIT 1"
},
"5f40849646bb7436e29cda8fb87fece2a4dcb580644f45ecb82388dece04f222": {
"describe": {
"columns": [
Expand Down
4 changes: 2 additions & 2 deletions core/lib/dal/src/proof_generation_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl ProofGenerationDal<'_, '_> {
.ok_or(sqlx::Error::RowNotFound)
}

pub async fn get_oldest_unprocessed_batch(&mut self) -> Option<L1BatchNumber> {
pub async fn get_oldest_unpicked_batch(&mut self) -> Option<L1BatchNumber> {
let result: Option<L1BatchNumber> = sqlx::query!(
"SELECT l1_batch_number \
FROM proof_generation_details \
Expand All @@ -129,7 +129,7 @@ impl ProofGenerationDal<'_, '_> {
let result: Option<L1BatchNumber> = sqlx::query!(
"SELECT l1_batch_number \
FROM proof_generation_details \
WHERE status <> 'generated' \
WHERE status NOT IN ('generated', 'skipped') \
ORDER BY l1_batch_number ASC \
LIMIT 1",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,10 @@ impl PeriodicJob for FriProverStatsReporter {

if let Some(l1_batch_number) = db_conn
.proof_generation_dal()
.get_oldest_unprocessed_batch()
.get_oldest_unpicked_batch()
.await
{
metrics::gauge!(
"fri_prover.oldest_unprocessed_batch",
l1_batch_number.0 as f64
)
metrics::gauge!("fri_prover.oldest_unpicked_batch", l1_batch_number.0 as f64)
}

if let Some(l1_batch_number) = db_conn
Expand Down