diff --git a/core/lib/dal/.sqlx/query-00c0389f4cde049078885cdf05bdb7dbe0bb23c4fc87a78be2d01b77da2ecbd3.json b/core/lib/dal/.sqlx/query-00c0389f4cde049078885cdf05bdb7dbe0bb23c4fc87a78be2d01b77da2ecbd3.json deleted file mode 100644 index d83713192cb4..000000000000 --- a/core/lib/dal/.sqlx/query-00c0389f4cde049078885cdf05bdb7dbe0bb23c4fc87a78be2d01b77da2ecbd3.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n available_batches AS (\n SELECT\n MAX(number) AS \"last_batch\"\n FROM\n l1_batches\n ),\n processed_batches AS (\n SELECT\n COALESCE(MAX(l1_batch_number), $1) + $2 AS \"last_ready_batch\"\n FROM\n vm_runner_protective_reads\n WHERE\n time_taken IS NOT NULL\n )\n SELECT\n LEAST(last_batch, last_ready_batch) AS \"last_ready_batch!\"\n FROM\n available_batches\n FULL JOIN processed_batches ON TRUE\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "last_ready_batch!", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, - "nullable": [ - true - ] - }, - "hash": "00c0389f4cde049078885cdf05bdb7dbe0bb23c4fc87a78be2d01b77da2ecbd3" -} diff --git a/core/lib/dal/.sqlx/query-0124bad591f7ed156000c515cb0772b3002289a05ab23b7dafde2af10c7d88da.json b/core/lib/dal/.sqlx/query-0124bad591f7ed156000c515cb0772b3002289a05ab23b7dafde2af10c7d88da.json new file mode 100644 index 000000000000..5cd56fee6b78 --- /dev/null +++ b/core/lib/dal/.sqlx/query-0124bad591f7ed156000c515cb0772b3002289a05ab23b7dafde2af10c7d88da.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n base_token_ratios (\n numerator, denominator, ratio_timestamp, created_at, updated_at\n )\n VALUES\n ($1, $2, $3, NOW(), NOW())\n RETURNING\n id\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Numeric", + "Numeric", + "Timestamp" + ] + }, + "nullable": [ + false + ] + }, + "hash": "0124bad591f7ed156000c515cb0772b3002289a05ab23b7dafde2af10c7d88da" +} diff --git a/core/lib/dal/.sqlx/query-026ab7dd7407f10074a2966b5eac2563a3e061bcc6505d8c295b1b2517f85f1b.json b/core/lib/dal/.sqlx/query-026ab7dd7407f10074a2966b5eac2563a3e061bcc6505d8c295b1b2517f85f1b.json deleted file mode 100644 index d98798241f7e..000000000000 --- a/core/lib/dal/.sqlx/query-026ab7dd7407f10074a2966b5eac2563a3e061bcc6505d8c295b1b2517f85f1b.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN eth_txs_history AS prove_tx ON (l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id)\n WHERE\n prove_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false - ] - }, - "hash": "026ab7dd7407f10074a2966b5eac2563a3e061bcc6505d8c295b1b2517f85f1b" -} diff --git a/core/lib/dal/.sqlx/query-0429f2fa683bdff6fc1ff5069de69d57dbfda4be1f70232afffca82a895d43e0.json b/core/lib/dal/.sqlx/query-0429f2fa683bdff6fc1ff5069de69d57dbfda4be1f70232afffca82a895d43e0.json new file mode 100644 index 000000000000..5693bdf987e5 --- /dev/null +++ b/core/lib/dal/.sqlx/query-0429f2fa683bdff6fc1ff5069de69d57dbfda4be1f70232afffca82a895d43e0.json @@ -0,0 +1,36 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n sl AS (\n SELECT\n (\n SELECT\n ARRAY[hashed_key, value] AS kv\n FROM\n storage_logs\n WHERE\n storage_logs.miniblock_number = $1\n AND storage_logs.hashed_key >= u.start_key\n AND storage_logs.hashed_key <= u.end_key\n ORDER BY\n storage_logs.hashed_key\n LIMIT\n 1\n )\n FROM\n UNNEST($2::bytea [], $3::bytea []) AS u (start_key, end_key)\n )\n \n SELECT\n sl.kv[1] AS \"hashed_key?\",\n sl.kv[2] AS \"value?\",\n initial_writes.index\n FROM\n sl\n LEFT OUTER JOIN initial_writes ON initial_writes.hashed_key = sl.kv[1]\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "hashed_key?", + "type_info": "Bytea" + }, + { + "ordinal": 1, + "name": "value?", + "type_info": "Bytea" + }, + { + "ordinal": 2, + "name": "index", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8", + "ByteaArray", + "ByteaArray" + ] + }, + "nullable": [ + null, + null, + true + ] + }, + "hash": "0429f2fa683bdff6fc1ff5069de69d57dbfda4be1f70232afffca82a895d43e0" +} diff --git a/core/lib/dal/.sqlx/query-046590a310cc7bbfa421d0d8e20c3bdae18b88c4c223e374df9a997c271b091b.json b/core/lib/dal/.sqlx/query-046590a310cc7bbfa421d0d8e20c3bdae18b88c4c223e374df9a997c271b091b.json deleted file mode 100644 index 950d72a3e238..000000000000 --- a/core/lib/dal/.sqlx/query-046590a310cc7bbfa421d0d8e20c3bdae18b88c4c223e374df9a997c271b091b.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n soft AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n TYPE = 'Soft'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n ),\n hard AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n TYPE = 'Hard'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n )\n SELECT\n soft.pruned_l1_batch AS last_soft_pruned_l1_batch,\n soft.pruned_miniblock AS last_soft_pruned_miniblock,\n hard.pruned_l1_batch AS last_hard_pruned_l1_batch,\n hard.pruned_miniblock AS last_hard_pruned_miniblock\n FROM\n soft\n FULL JOIN hard ON TRUE\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "last_soft_pruned_l1_batch", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "last_soft_pruned_miniblock", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "last_hard_pruned_l1_batch", - "type_info": "Int8" - }, - { - "ordinal": 3, - "name": "last_hard_pruned_miniblock", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - true, - true, - true, - true - ] - }, - "hash": "046590a310cc7bbfa421d0d8e20c3bdae18b88c4c223e374df9a997c271b091b" -} diff --git a/core/lib/dal/.sqlx/query-048f255042f0a75c04bc19369c4b0dd75acbe4248159d2fb62d9e9878c158016.json b/core/lib/dal/.sqlx/query-048f255042f0a75c04bc19369c4b0dd75acbe4248159d2fb62d9e9878c158016.json new file mode 100644 index 000000000000..8c41c0ab9763 --- /dev/null +++ b/core/lib/dal/.sqlx/query-048f255042f0a75c04bc19369c4b0dd75acbe4248159d2fb62d9e9878c158016.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n protocol_versions (\n id,\n timestamp,\n bootloader_code_hash,\n default_account_code_hash,\n upgrade_tx_hash,\n created_at\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW())\n ON CONFLICT DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int8", + "Bytea", + "Bytea", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "048f255042f0a75c04bc19369c4b0dd75acbe4248159d2fb62d9e9878c158016" +} diff --git a/core/lib/dal/.sqlx/query-05891e039a54b70ac406a63b73b6f5521c888c5bc9050333dd18a88c098b2d12.json b/core/lib/dal/.sqlx/query-05891e039a54b70ac406a63b73b6f5521c888c5bc9050333dd18a88c098b2d12.json new file mode 100644 index 000000000000..735d04d2053a --- /dev/null +++ b/core/lib/dal/.sqlx/query-05891e039a54b70ac406a63b73b6f5521c888c5bc9050333dd18a88c098b2d12.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n new_logs AS MATERIALIZED (\n SELECT DISTINCT\n ON (hashed_key)\n hashed_key,\n miniblock_number,\n operation_number\n FROM\n storage_logs\n WHERE\n miniblock_number BETWEEN $1 AND $2\n ORDER BY\n hashed_key,\n miniblock_number DESC,\n operation_number DESC\n )\n \n DELETE FROM storage_logs USING new_logs\n WHERE\n storage_logs.hashed_key = new_logs.hashed_key\n AND storage_logs.miniblock_number <= $2\n AND (storage_logs.miniblock_number, storage_logs.operation_number)\n < (new_logs.miniblock_number, new_logs.operation_number)\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "05891e039a54b70ac406a63b73b6f5521c888c5bc9050333dd18a88c098b2d12" +} diff --git a/core/lib/dal/.sqlx/query-05c2a77d9f65d435e2df63a300850e42abbaf365a1b041d0e7a809796ef0fe63.json b/core/lib/dal/.sqlx/query-05c2a77d9f65d435e2df63a300850e42abbaf365a1b041d0e7a809796ef0fe63.json deleted file mode 100644 index f3c85b9b43dc..000000000000 --- a/core/lib/dal/.sqlx/query-05c2a77d9f65d435e2df63a300850e42abbaf365a1b041d0e7a809796ef0fe63.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE proof_generation_details\n SET\n status = 'picked_by_prover',\n updated_at = NOW(),\n prover_taken_at = NOW()\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n proof_generation_details\n LEFT JOIN l1_batches ON l1_batch_number = l1_batches.number\n WHERE\n (\n vm_run_data_blob_url IS NOT NULL\n AND proof_gen_data_blob_url IS NOT NULL\n AND l1_batches.hash IS NOT NULL\n AND l1_batches.aux_data_hash IS NOT NULL\n AND l1_batches.meta_parameters_hash IS NOT NULL\n AND status = 'unpicked'\n )\n OR (\n status = 'picked_by_prover'\n AND prover_taken_at < NOW() - $1::INTERVAL\n )\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n )\n RETURNING\n proof_generation_details.l1_batch_number\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "l1_batch_number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Interval" - ] - }, - "nullable": [ - false - ] - }, - "hash": "05c2a77d9f65d435e2df63a300850e42abbaf365a1b041d0e7a809796ef0fe63" -} diff --git a/core/lib/dal/.sqlx/query-2b1aa207a058f66265acf2c21b8ed5d8007789c0fc1eab948f6d7339dfb69147.json b/core/lib/dal/.sqlx/query-08740b96c883fce75b6238bb6bdc95254f94dddb4ed84a675c2655421758b049.json similarity index 80% rename from core/lib/dal/.sqlx/query-2b1aa207a058f66265acf2c21b8ed5d8007789c0fc1eab948f6d7339dfb69147.json rename to core/lib/dal/.sqlx/query-08740b96c883fce75b6238bb6bdc95254f94dddb4ed84a675c2655421758b049.json index 96b48892516d..51392a6ed8f8 100644 --- a/core/lib/dal/.sqlx/query-2b1aa207a058f66265acf2c21b8ed5d8007789c0fc1eab948f6d7339dfb69147.json +++ b/core/lib/dal/.sqlx/query-08740b96c883fce75b6238bb6bdc95254f94dddb4ed84a675c2655421758b049.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM transactions\n WHERE\n miniblock_number IS NULL\n AND received_at < NOW() - $1::INTERVAL\n AND is_priority = FALSE\n AND error IS NULL\n RETURNING\n hash\n ", + "query": "\n DELETE FROM transactions\n WHERE\n miniblock_number IS NULL\n AND received_at < NOW() - $1::INTERVAL\n AND is_priority = FALSE\n AND error IS NULL\n RETURNING\n hash\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "2b1aa207a058f66265acf2c21b8ed5d8007789c0fc1eab948f6d7339dfb69147" + "hash": "08740b96c883fce75b6238bb6bdc95254f94dddb4ed84a675c2655421758b049" } diff --git a/core/lib/dal/.sqlx/query-0a0dd4a98128c2ef60d385f5c0674ddd4f2422089604768b19e0b6d948c0cf1b.json b/core/lib/dal/.sqlx/query-0a0dd4a98128c2ef60d385f5c0674ddd4f2422089604768b19e0b6d948c0cf1b.json new file mode 100644 index 000000000000..0d4d8c0dc745 --- /dev/null +++ b/core/lib/dal/.sqlx/query-0a0dd4a98128c2ef60d385f5c0674ddd4f2422089604768b19e0b6d948c0cf1b.json @@ -0,0 +1,100 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n events_select AS (\n SELECT\n address,\n topic1,\n topic2,\n topic3,\n topic4,\n value,\n miniblock_number,\n tx_hash,\n tx_index_in_block,\n event_index_in_block,\n event_index_in_tx\n FROM\n events\n WHERE\n miniblock_number > $1\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n )\n \n SELECT\n miniblocks.hash AS \"block_hash?\",\n address AS \"address!\",\n topic1 AS \"topic1!\",\n topic2 AS \"topic2!\",\n topic3 AS \"topic3!\",\n topic4 AS \"topic4!\",\n value AS \"value!\",\n miniblock_number AS \"miniblock_number!\",\n miniblocks.l1_batch_number AS \"l1_batch_number?\",\n tx_hash AS \"tx_hash!\",\n tx_index_in_block AS \"tx_index_in_block!\",\n event_index_in_block AS \"event_index_in_block!\",\n event_index_in_tx AS \"event_index_in_tx!\",\n miniblocks.timestamp AS \"block_timestamp\"\n FROM\n events_select\n INNER JOIN miniblocks ON events_select.miniblock_number = miniblocks.number\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "block_hash?", + "type_info": "Bytea" + }, + { + "ordinal": 1, + "name": "address!", + "type_info": "Bytea" + }, + { + "ordinal": 2, + "name": "topic1!", + "type_info": "Bytea" + }, + { + "ordinal": 3, + "name": "topic2!", + "type_info": "Bytea" + }, + { + "ordinal": 4, + "name": "topic3!", + "type_info": "Bytea" + }, + { + "ordinal": 5, + "name": "topic4!", + "type_info": "Bytea" + }, + { + "ordinal": 6, + "name": "value!", + "type_info": "Bytea" + }, + { + "ordinal": 7, + "name": "miniblock_number!", + "type_info": "Int8" + }, + { + "ordinal": 8, + "name": "l1_batch_number?", + "type_info": "Int8" + }, + { + "ordinal": 9, + "name": "tx_hash!", + "type_info": "Bytea" + }, + { + "ordinal": 10, + "name": "tx_index_in_block!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "event_index_in_block!", + "type_info": "Int4" + }, + { + "ordinal": 12, + "name": "event_index_in_tx!", + "type_info": "Int4" + }, + { + "ordinal": 13, + "name": "block_timestamp", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false + ] + }, + "hash": "0a0dd4a98128c2ef60d385f5c0674ddd4f2422089604768b19e0b6d948c0cf1b" +} diff --git a/core/lib/dal/.sqlx/query-0b5d5efeac95d429cf6a5be22153897edf8c868094ad029e2e8fcf286d44fd55.json b/core/lib/dal/.sqlx/query-0b5d5efeac95d429cf6a5be22153897edf8c868094ad029e2e8fcf286d44fd55.json deleted file mode 100644 index 822a6967f6db..000000000000 --- a/core/lib/dal/.sqlx/query-0b5d5efeac95d429cf6a5be22153897edf8c868094ad029e2e8fcf286d44fd55.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n data_availability (l1_batch_number, blob_id, sent_at, created_at, updated_at)\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ON CONFLICT DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Timestamp" - ] - }, - "nullable": [] - }, - "hash": "0b5d5efeac95d429cf6a5be22153897edf8c868094ad029e2e8fcf286d44fd55" -} diff --git a/core/lib/dal/.sqlx/query-dcfc3c0df11b923116af194a26c122dbdbf650edfec6d9c18f96c3bd0064d18d.json b/core/lib/dal/.sqlx/query-0bae50601f2dc3ea7ba9ab6b9f508275cef018c7060c49b9f7a387a14f6a5be8.json similarity index 80% rename from core/lib/dal/.sqlx/query-dcfc3c0df11b923116af194a26c122dbdbf650edfec6d9c18f96c3bd0064d18d.json rename to core/lib/dal/.sqlx/query-0bae50601f2dc3ea7ba9ab6b9f508275cef018c7060c49b9f7a387a14f6a5be8.json index 36e56da404ee..ca0578f338fd 100644 --- a/core/lib/dal/.sqlx/query-dcfc3c0df11b923116af194a26c122dbdbf650edfec6d9c18f96c3bd0064d18d.json +++ b/core/lib/dal/.sqlx/query-0bae50601f2dc3ea7ba9ab6b9f508275cef018c7060c49b9f7a387a14f6a5be8.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n miniblocks.hash AS block_hash,\n miniblocks.number,\n miniblocks.l1_batch_number,\n miniblocks.timestamp,\n miniblocks.base_fee_per_gas,\n miniblocks.gas_limit AS \"block_gas_limit?\",\n miniblocks.logs_bloom,\n prev_miniblock.hash AS \"parent_hash?\",\n l1_batches.timestamp AS \"l1_batch_timestamp?\",\n transactions.gas_limit AS \"transaction_gas_limit?\",\n transactions.refunded_gas AS \"refunded_gas?\",\n transactions.hash AS \"tx_hash?\"\n FROM\n miniblocks\n LEFT JOIN miniblocks prev_miniblock ON prev_miniblock.number = miniblocks.number - 1\n LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number\n LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number\n WHERE\n miniblocks.number = $1\n ORDER BY\n transactions.index_in_block ASC\n ", + "query": "\n SELECT\n miniblocks.hash AS block_hash,\n miniblocks.number,\n miniblocks.l1_batch_number,\n miniblocks.timestamp,\n miniblocks.base_fee_per_gas,\n miniblocks.gas_limit AS \"block_gas_limit?\",\n miniblocks.logs_bloom,\n prev_miniblock.hash AS \"parent_hash?\",\n l1_batches.timestamp AS \"l1_batch_timestamp?\",\n transactions.gas_limit AS \"transaction_gas_limit?\",\n transactions.refunded_gas AS \"refunded_gas?\",\n transactions.hash AS \"tx_hash?\"\n FROM\n miniblocks\n LEFT JOIN\n miniblocks prev_miniblock\n ON prev_miniblock.number = miniblocks.number - 1\n LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number\n LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number\n WHERE\n miniblocks.number = $1\n ORDER BY\n transactions.index_in_block ASC\n ", "describe": { "columns": [ { @@ -84,5 +84,5 @@ false ] }, - "hash": "dcfc3c0df11b923116af194a26c122dbdbf650edfec6d9c18f96c3bd0064d18d" + "hash": "0bae50601f2dc3ea7ba9ab6b9f508275cef018c7060c49b9f7a387a14f6a5be8" } diff --git a/core/lib/dal/.sqlx/query-1074d0a2e4a4afb9a92f3822e133db7a71aca15698bafba051a8d9a91a4dbc76.json b/core/lib/dal/.sqlx/query-1074d0a2e4a4afb9a92f3822e133db7a71aca15698bafba051a8d9a91a4dbc76.json deleted file mode 100644 index 13e4cdb9431d..000000000000 --- a/core/lib/dal/.sqlx/query-1074d0a2e4a4afb9a92f3822e133db7a71aca15698bafba051a8d9a91a4dbc76.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n mb AS (\n SELECT\n l1_gas_price,\n l2_fair_gas_price,\n fair_pubdata_price\n FROM\n miniblocks\n WHERE\n l1_batch_number = $1\n LIMIT\n 1\n )\n SELECT\n l1_batches.number,\n l1_batches.timestamp,\n l1_batches.l1_tx_count,\n l1_batches.l2_tx_count,\n l1_batches.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n mb.l1_gas_price,\n mb.l2_fair_gas_price,\n mb.fair_pubdata_price,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash\n FROM\n l1_batches\n INNER JOIN mb ON TRUE\n LEFT JOIN eth_txs_history AS commit_tx ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n l1_batches.number = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "timestamp", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "l1_tx_count", - "type_info": "Int4" - }, - { - "ordinal": 3, - "name": "l2_tx_count", - "type_info": "Int4" - }, - { - "ordinal": 4, - "name": "root_hash?", - "type_info": "Bytea" - }, - { - "ordinal": 5, - "name": "commit_tx_hash?", - "type_info": "Text" - }, - { - "ordinal": 6, - "name": "committed_at?", - "type_info": "Timestamp" - }, - { - "ordinal": 7, - "name": "prove_tx_hash?", - "type_info": "Text" - }, - { - "ordinal": 8, - "name": "proven_at?", - "type_info": "Timestamp" - }, - { - "ordinal": 9, - "name": "execute_tx_hash?", - "type_info": "Text" - }, - { - "ordinal": 10, - "name": "executed_at?", - "type_info": "Timestamp" - }, - { - "ordinal": 11, - "name": "l1_gas_price", - "type_info": "Int8" - }, - { - "ordinal": 12, - "name": "l2_fair_gas_price", - "type_info": "Int8" - }, - { - "ordinal": 13, - "name": "fair_pubdata_price", - "type_info": "Int8" - }, - { - "ordinal": 14, - "name": "bootloader_code_hash", - "type_info": "Bytea" - }, - { - "ordinal": 15, - "name": "default_aa_code_hash", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - true, - false, - true, - false, - true, - false, - true, - false, - false, - true, - true, - true - ] - }, - "hash": "1074d0a2e4a4afb9a92f3822e133db7a71aca15698bafba051a8d9a91a4dbc76" -} diff --git a/core/lib/dal/.sqlx/query-150d0219cabbabcc9d0e97e3fd94032f3d900b74e62dfdec0c9f61bf2bacb595.json b/core/lib/dal/.sqlx/query-150d0219cabbabcc9d0e97e3fd94032f3d900b74e62dfdec0c9f61bf2bacb595.json new file mode 100644 index 000000000000..e3a8399ca285 --- /dev/null +++ b/core/lib/dal/.sqlx/query-150d0219cabbabcc9d0e97e3fd94032f3d900b74e62dfdec0c9f61bf2bacb595.json @@ -0,0 +1,21 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n snapshot_recovery (\n l1_batch_number,\n l1_batch_timestamp,\n l1_batch_root_hash,\n miniblock_number,\n miniblock_timestamp,\n miniblock_hash,\n protocol_version,\n storage_logs_chunks_processed,\n updated_at,\n created_at\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, NOW(), NOW())\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int8", + "Bytea", + "Int8", + "Int8", + "Bytea", + "Int4", + "BoolArray" + ] + }, + "nullable": [] + }, + "hash": "150d0219cabbabcc9d0e97e3fd94032f3d900b74e62dfdec0c9f61bf2bacb595" +} diff --git a/core/lib/dal/.sqlx/query-1767de83aa4ef34f080da6d30d6154185671d13f3b234ce1f16aaeeab54b2a16.json b/core/lib/dal/.sqlx/query-1767de83aa4ef34f080da6d30d6154185671d13f3b234ce1f16aaeeab54b2a16.json new file mode 100644 index 000000000000..84fc44f7b5f9 --- /dev/null +++ b/core/lib/dal/.sqlx/query-1767de83aa4ef34f080da6d30d6154185671d13f3b234ce1f16aaeeab54b2a16.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n commitments (\n l1_batch_number,\n events_queue_commitment,\n bootloader_initial_content_commitment\n )\n VALUES\n ($1, $2, $3)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Bytea", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "1767de83aa4ef34f080da6d30d6154185671d13f3b234ce1f16aaeeab54b2a16" +} diff --git a/core/lib/dal/.sqlx/query-1823e1ac602ce4ba1db06543af9cb2685cda1ae7ecca83062ede7320c3b4a427.json b/core/lib/dal/.sqlx/query-1823e1ac602ce4ba1db06543af9cb2685cda1ae7ecca83062ede7320c3b4a427.json new file mode 100644 index 000000000000..1e20a9151b98 --- /dev/null +++ b/core/lib/dal/.sqlx/query-1823e1ac602ce4ba1db06543af9cb2685cda1ae7ecca83062ede7320c3b4a427.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n contracts_verification_info (address, verification_info)\n VALUES\n ($1, $2)\n ON CONFLICT (address) DO\n UPDATE\n SET\n verification_info = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Bytea", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "1823e1ac602ce4ba1db06543af9cb2685cda1ae7ecca83062ede7320c3b4a427" +} diff --git a/core/lib/dal/.sqlx/query-18d507f6c9fe051da9899e2e4346e94d0b4f902c84e31fca606773cf4c9d17fc.json b/core/lib/dal/.sqlx/query-18d507f6c9fe051da9899e2e4346e94d0b4f902c84e31fca606773cf4c9d17fc.json new file mode 100644 index 000000000000..dc913c570053 --- /dev/null +++ b/core/lib/dal/.sqlx/query-18d507f6c9fe051da9899e2e4346e94d0b4f902c84e31fca606773cf4c9d17fc.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n initial_writes (hashed_key, index, l1_batch_number, created_at, updated_at)\n SELECT\n u.hashed_key,\n u.index,\n $3,\n NOW(),\n NOW()\n FROM\n UNNEST($1::bytea [], $2::bigint []) AS u (hashed_key, index)\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "Int8Array", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "18d507f6c9fe051da9899e2e4346e94d0b4f902c84e31fca606773cf4c9d17fc" +} diff --git a/core/lib/dal/.sqlx/query-1a6f4db7fb5ad9b54367c7f9d87ecbc877c8e04d47bf16b9c2e59ba652d2955f.json b/core/lib/dal/.sqlx/query-1a6f4db7fb5ad9b54367c7f9d87ecbc877c8e04d47bf16b9c2e59ba652d2955f.json new file mode 100644 index 000000000000..a9ec3c779060 --- /dev/null +++ b/core/lib/dal/.sqlx/query-1a6f4db7fb5ad9b54367c7f9d87ecbc877c8e04d47bf16b9c2e59ba652d2955f.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n vm_runner_protective_reads (\n l1_batch_number, created_at, updated_at, processing_started_at\n )\n VALUES\n ($1, NOW(), NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW(),\n processing_started_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [] + }, + "hash": "1a6f4db7fb5ad9b54367c7f9d87ecbc877c8e04d47bf16b9c2e59ba652d2955f" +} diff --git a/core/lib/dal/.sqlx/query-1bbfac481c402bcb3bb888b84146d922fa1fc9c202072fbc04cae1bbf97195aa.json b/core/lib/dal/.sqlx/query-1bbfac481c402bcb3bb888b84146d922fa1fc9c202072fbc04cae1bbf97195aa.json deleted file mode 100644 index f24a28ffdc28..000000000000 --- a/core/lib/dal/.sqlx/query-1bbfac481c402bcb3bb888b84146d922fa1fc9c202072fbc04cae1bbf97195aa.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n vm_runner_bwip (l1_batch_number, created_at, updated_at, processing_started_at)\n VALUES\n ($1, NOW(), NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW(),\n processing_started_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - }, - "hash": "1bbfac481c402bcb3bb888b84146d922fa1fc9c202072fbc04cae1bbf97195aa" -} diff --git a/core/lib/dal/.sqlx/query-1c9468bead5b80f209c4e94ab652f75a4055a9c1e7c3b767455df804f09f7d4c.json b/core/lib/dal/.sqlx/query-1c9468bead5b80f209c4e94ab652f75a4055a9c1e7c3b767455df804f09f7d4c.json new file mode 100644 index 000000000000..39eaca5a9434 --- /dev/null +++ b/core/lib/dal/.sqlx/query-1c9468bead5b80f209c4e94ab652f75a4055a9c1e7c3b767455df804f09f7d4c.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN\n eth_txs_history AS prove_tx\n ON (l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id)\n WHERE\n prove_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "1c9468bead5b80f209c4e94ab652f75a4055a9c1e7c3b767455df804f09f7d4c" +} diff --git a/core/lib/dal/.sqlx/query-1ed6c99dcaa47f1525499362e316a12866726e1f3ca9cf9d89f61c4e97373361.json b/core/lib/dal/.sqlx/query-1ed6c99dcaa47f1525499362e316a12866726e1f3ca9cf9d89f61c4e97373361.json new file mode 100644 index 000000000000..86256d4d0a0c --- /dev/null +++ b/core/lib/dal/.sqlx/query-1ed6c99dcaa47f1525499362e316a12866726e1f3ca9cf9d89f61c4e97373361.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n data_availability (l1_batch_number, blob_id, sent_at, created_at, updated_at)\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ON CONFLICT DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Timestamp" + ] + }, + "nullable": [] + }, + "hash": "1ed6c99dcaa47f1525499362e316a12866726e1f3ca9cf9d89f61c4e97373361" +} diff --git a/core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json b/core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json deleted file mode 100644 index 3817369ecc16..000000000000 --- a/core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n consensus_replica_state (fake_key, global_config, genesis, state)\n VALUES\n (TRUE, $1, $2, $3)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Jsonb", - "Jsonb", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85" -} diff --git a/core/lib/dal/.sqlx/query-2169cc7dfb074566ceb0bd5754d6e7a755c4bc6c25c7e6caff5fd6142813d349.json b/core/lib/dal/.sqlx/query-2169cc7dfb074566ceb0bd5754d6e7a755c4bc6c25c7e6caff5fd6142813d349.json deleted file mode 100644 index e48fddcf6175..000000000000 --- a/core/lib/dal/.sqlx/query-2169cc7dfb074566ceb0bd5754d6e7a755c4bc6c25c7e6caff5fd6142813d349.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n tee_proof_generation_details (l1_batch_number, tee_type, status, created_at, updated_at)\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ON CONFLICT (l1_batch_number, tee_type) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2169cc7dfb074566ceb0bd5754d6e7a755c4bc6c25c7e6caff5fd6142813d349" -} diff --git a/core/lib/dal/.sqlx/query-3490fe0b778a03c73111bf8cbf426b0b3185a231bbf0b8b132a1a95bc157e827.json b/core/lib/dal/.sqlx/query-21acded689c24b653d149ff169f53b54a1965e100e0949006212f97e6d11a18b.json similarity index 75% rename from core/lib/dal/.sqlx/query-3490fe0b778a03c73111bf8cbf426b0b3185a231bbf0b8b132a1a95bc157e827.json rename to core/lib/dal/.sqlx/query-21acded689c24b653d149ff169f53b54a1965e100e0949006212f97e6d11a18b.json index 3275e94936a1..b613aa8d71b3 100644 --- a/core/lib/dal/.sqlx/query-3490fe0b778a03c73111bf8cbf426b0b3185a231bbf0b8b132a1a95bc157e827.json +++ b/core/lib/dal/.sqlx/query-21acded689c24b653d149ff169f53b54a1965e100e0949006212f97e6d11a18b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n hashed_key,\n l1_batch_number,\n INDEX\n FROM\n initial_writes\n WHERE\n hashed_key = ANY ($1::bytea[])\n ", + "query": "\n SELECT\n hashed_key,\n l1_batch_number,\n index\n FROM\n initial_writes\n WHERE\n hashed_key = ANY($1::bytea [])\n ", "describe": { "columns": [ { @@ -30,5 +30,5 @@ false ] }, - "hash": "3490fe0b778a03c73111bf8cbf426b0b3185a231bbf0b8b132a1a95bc157e827" + "hash": "21acded689c24b653d149ff169f53b54a1965e100e0949006212f97e6d11a18b" } diff --git a/core/lib/dal/.sqlx/query-eab36591af61369e36e3dab79025ac6758a0a4e367f93a9bd48ec82c51e09755.json b/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json similarity index 81% rename from core/lib/dal/.sqlx/query-eab36591af61369e36e3dab79025ac6758a0a4e367f93a9bd48ec82c51e09755.json rename to core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json index b9783f771a7a..48fa673b2c91 100644 --- a/core/lib/dal/.sqlx/query-eab36591af61369e36e3dab79025ac6758a0a4e367f93a9bd48ec82c51e09755.json +++ b/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n *\n FROM\n eth_txs\n WHERE\n from_addr IS NOT DISTINCT FROM $2 -- can't just use equality as NULL != NULL\n AND is_gateway = $3\n AND id > (\n SELECT\n COALESCE(MAX(eth_tx_id), 0)\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NOT NULL\n AND eth_txs.from_addr IS NOT DISTINCT FROM $2\n AND is_gateway = $3\n )\n ORDER BY\n id\n LIMIT\n $1\n ", + "query": "\n SELECT\n *\n FROM\n eth_txs\n WHERE\n from_addr IS NOT DISTINCT FROM $2 -- can't just use equality as NULL != NULL\n AND is_gateway = $3\n AND id > (\n SELECT\n COALESCE(MAX(eth_tx_id), 0)\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NOT NULL\n AND eth_txs.from_addr IS NOT DISTINCT FROM $2\n AND is_gateway = $3\n )\n ORDER BY\n id\n LIMIT\n $1\n ", "describe": { "columns": [ { @@ -110,5 +110,5 @@ true ] }, - "hash": "eab36591af61369e36e3dab79025ac6758a0a4e367f93a9bd48ec82c51e09755" + "hash": "2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b" } diff --git a/core/lib/dal/.sqlx/query-c61682ed92c1a43855a991598d593639a63047f46dc8e605ff37b78f43f5cef5.json b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json similarity index 77% rename from core/lib/dal/.sqlx/query-c61682ed92c1a43855a991598d593639a63047f46dc8e605ff37b78f43f5cef5.json rename to core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json index b797ccb46045..b8d6482ea744 100644 --- a/core/lib/dal/.sqlx/query-c61682ed92c1a43855a991598d593639a63047f46dc8e605ff37b78f43f5cef5.json +++ b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE processed_events\n SET\n next_block_to_process = $3\n WHERE\n TYPE = $1\n AND chain_id = $2\n ", + "query": "\n UPDATE processed_events\n SET\n next_block_to_process = $3\n WHERE\n type = $1\n AND chain_id = $2\n ", "describe": { "columns": [], "parameters": { @@ -22,5 +22,5 @@ }, "nullable": [] }, - "hash": "c61682ed92c1a43855a991598d593639a63047f46dc8e605ff37b78f43f5cef5" + "hash": "228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a" } diff --git a/core/lib/dal/.sqlx/query-040eaa878c3473f5edc73b77e572b5ea100f59295cd693d14ee0d5ee089c7981.json b/core/lib/dal/.sqlx/query-229db646c85461858689b81d80f5ddbee82a65c00c5740e9017382c57c279b18.json similarity index 63% rename from core/lib/dal/.sqlx/query-040eaa878c3473f5edc73b77e572b5ea100f59295cd693d14ee0d5ee089c7981.json rename to core/lib/dal/.sqlx/query-229db646c85461858689b81d80f5ddbee82a65c00c5740e9017382c57c279b18.json index c0e0c777cc52..3a21023c4da8 100644 --- a/core/lib/dal/.sqlx/query-040eaa878c3473f5edc73b77e572b5ea100f59295cd693d14ee0d5ee089c7981.json +++ b/core/lib/dal/.sqlx/query-229db646c85461858689b81d80f5ddbee82a65c00c5740e9017382c57c279b18.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n l1_batch_number\n FROM\n snapshots\n WHERE\n NOT (''::TEXT = ANY (storage_logs_filepaths))\n ORDER BY\n l1_batch_number DESC\n ", + "query": "\n SELECT\n l1_batch_number\n FROM\n snapshots\n WHERE\n NOT (''::TEXT = ANY(storage_logs_filepaths))\n ORDER BY\n l1_batch_number DESC\n ", "describe": { "columns": [ { @@ -16,5 +16,5 @@ false ] }, - "hash": "040eaa878c3473f5edc73b77e572b5ea100f59295cd693d14ee0d5ee089c7981" + "hash": "229db646c85461858689b81d80f5ddbee82a65c00c5740e9017382c57c279b18" } diff --git a/core/lib/dal/.sqlx/query-24722ee4ced7f03e60b1b5ecaaa5234d536b064951a67d826ac49b7a3a095a1a.json b/core/lib/dal/.sqlx/query-24865315c100f495a6e2cefb3b0e84d2fcc5d436e52cc82ed2aba664bde3ee6b.json similarity index 71% rename from core/lib/dal/.sqlx/query-24722ee4ced7f03e60b1b5ecaaa5234d536b064951a67d826ac49b7a3a095a1a.json rename to core/lib/dal/.sqlx/query-24865315c100f495a6e2cefb3b0e84d2fcc5d436e52cc82ed2aba664bde3ee6b.json index 194f4faedb1b..d343cd5a7107 100644 --- a/core/lib/dal/.sqlx/query-24722ee4ced7f03e60b1b5ecaaa5234d536b064951a67d826ac49b7a3a095a1a.json +++ b/core/lib/dal/.sqlx/query-24865315c100f495a6e2cefb3b0e84d2fcc5d436e52cc82ed2aba664bde3ee6b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n hashed_key,\n INDEX\n FROM\n initial_writes\n WHERE\n l1_batch_number = $1\n ORDER BY\n INDEX\n ", + "query": "\n SELECT\n hashed_key,\n index\n FROM\n initial_writes\n WHERE\n l1_batch_number = $1\n ORDER BY\n index\n ", "describe": { "columns": [ { @@ -24,5 +24,5 @@ false ] }, - "hash": "24722ee4ced7f03e60b1b5ecaaa5234d536b064951a67d826ac49b7a3a095a1a" + "hash": "24865315c100f495a6e2cefb3b0e84d2fcc5d436e52cc82ed2aba664bde3ee6b" } diff --git a/core/lib/dal/.sqlx/query-86dbcf93abdd4206d2d62b140cf5dd11537925d02f5a7f2bae23c8dc48204e3f.json b/core/lib/dal/.sqlx/query-2589f98459979f776ce5fd6e3ff94ec52b3eb68c346492a8fed98f20f2a0381d.json similarity index 62% rename from core/lib/dal/.sqlx/query-86dbcf93abdd4206d2d62b140cf5dd11537925d02f5a7f2bae23c8dc48204e3f.json rename to core/lib/dal/.sqlx/query-2589f98459979f776ce5fd6e3ff94ec52b3eb68c346492a8fed98f20f2a0381d.json index 42cf55bd939e..9d8cc36189fc 100644 --- a/core/lib/dal/.sqlx/query-86dbcf93abdd4206d2d62b140cf5dd11537925d02f5a7f2bae23c8dc48204e3f.json +++ b/core/lib/dal/.sqlx/query-2589f98459979f776ce5fd6e3ff94ec52b3eb68c346492a8fed98f20f2a0381d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n proofs.l1_batch_number\n FROM\n tee_proof_generation_details AS proofs\n JOIN tee_verifier_input_producer_jobs AS inputs ON proofs.l1_batch_number = inputs.l1_batch_number\n WHERE\n inputs.status = $1\n AND proofs.status = $2\n ORDER BY\n proofs.l1_batch_number ASC\n LIMIT\n 1\n ", + "query": "\n SELECT\n proofs.l1_batch_number\n FROM\n tee_proof_generation_details AS proofs\n JOIN\n tee_verifier_input_producer_jobs AS inputs\n ON proofs.l1_batch_number = inputs.l1_batch_number\n WHERE\n inputs.status = $1\n AND proofs.status = $2\n ORDER BY\n proofs.l1_batch_number ASC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -32,5 +32,5 @@ false ] }, - "hash": "86dbcf93abdd4206d2d62b140cf5dd11537925d02f5a7f2bae23c8dc48204e3f" + "hash": "2589f98459979f776ce5fd6e3ff94ec52b3eb68c346492a8fed98f20f2a0381d" } diff --git a/core/lib/dal/.sqlx/query-25fb31277591dd7d5d783bd8777f1a855e76b37b6ed36ae612b551f9a6a55633.json b/core/lib/dal/.sqlx/query-25fb31277591dd7d5d783bd8777f1a855e76b37b6ed36ae612b551f9a6a55633.json deleted file mode 100644 index ee88bcdf39bd..000000000000 --- a/core/lib/dal/.sqlx/query-25fb31277591dd7d5d783bd8777f1a855e76b37b6ed36ae612b551f9a6a55633.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n protocol_versions (\n id,\n timestamp,\n bootloader_code_hash,\n default_account_code_hash,\n upgrade_tx_hash,\n created_at\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW())\n ON CONFLICT DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int8", - "Bytea", - "Bytea", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "25fb31277591dd7d5d783bd8777f1a855e76b37b6ed36ae612b551f9a6a55633" -} diff --git a/core/lib/dal/.sqlx/query-1e3c88b41bc02cb6a116fa930ae85b8b60165ed757ae1044e83fdc877d95cbd8.json b/core/lib/dal/.sqlx/query-2719fa6e4f282535526ef6c3c7c73dcb740d1d2750fe17fb5330e50323b96b49.json similarity index 90% rename from core/lib/dal/.sqlx/query-1e3c88b41bc02cb6a116fa930ae85b8b60165ed757ae1044e83fdc877d95cbd8.json rename to core/lib/dal/.sqlx/query-2719fa6e4f282535526ef6c3c7c73dcb740d1d2750fe17fb5330e50323b96b49.json index 206d2f91e3b1..0fcc6b457003 100644 --- a/core/lib/dal/.sqlx/query-1e3c88b41bc02cb6a116fa930ae85b8b60165ed757ae1044e83fdc877d95cbd8.json +++ b/core/lib/dal/.sqlx/query-2719fa6e4f282535526ef6c3c7c73dcb740d1d2750fe17fb5330e50323b96b49.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n miniblock_number,\n log_index_in_miniblock,\n log_index_in_tx,\n tx_hash,\n NULL::BIGINT AS \"l1_batch_number?\",\n shard_id,\n is_service,\n tx_index_in_miniblock,\n tx_index_in_l1_batch,\n sender,\n key,\n value\n FROM\n l2_to_l1_logs\n WHERE\n tx_hash = ANY ($1)\n ORDER BY\n tx_index_in_l1_batch ASC,\n log_index_in_tx ASC\n ", + "query": "\n SELECT\n miniblock_number,\n log_index_in_miniblock,\n log_index_in_tx,\n tx_hash,\n NULL::BIGINT AS \"l1_batch_number?\",\n shard_id,\n is_service,\n tx_index_in_miniblock,\n tx_index_in_l1_batch,\n sender,\n key,\n value\n FROM\n l2_to_l1_logs\n WHERE\n tx_hash = ANY($1)\n ORDER BY\n tx_index_in_l1_batch ASC,\n log_index_in_tx ASC\n ", "describe": { "columns": [ { @@ -84,5 +84,5 @@ false ] }, - "hash": "1e3c88b41bc02cb6a116fa930ae85b8b60165ed757ae1044e83fdc877d95cbd8" + "hash": "2719fa6e4f282535526ef6c3c7c73dcb740d1d2750fe17fb5330e50323b96b49" } diff --git a/core/lib/dal/.sqlx/query-69c885498b186f3b7cbb215112ec86783d7da0ec1d008680872f3619cf217923.json b/core/lib/dal/.sqlx/query-28c5a9f99af4d2857346e0df73c9b9086ba42bac53629793a42d67b353c30210.json similarity index 60% rename from core/lib/dal/.sqlx/query-69c885498b186f3b7cbb215112ec86783d7da0ec1d008680872f3619cf217923.json rename to core/lib/dal/.sqlx/query-28c5a9f99af4d2857346e0df73c9b9086ba42bac53629793a42d67b353c30210.json index 82575c807fb3..93520d4ded3e 100644 --- a/core/lib/dal/.sqlx/query-69c885498b186f3b7cbb215112ec86783d7da0ec1d008680872f3619cf217923.json +++ b/core/lib/dal/.sqlx/query-28c5a9f99af4d2857346e0df73c9b9086ba42bac53629793a42d67b353c30210.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM transactions\n WHERE\n hash = ANY ($1)\n ", + "query": "\n DELETE FROM transactions\n WHERE\n hash = ANY($1)\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "69c885498b186f3b7cbb215112ec86783d7da0ec1d008680872f3619cf217923" + "hash": "28c5a9f99af4d2857346e0df73c9b9086ba42bac53629793a42d67b353c30210" } diff --git a/core/lib/dal/.sqlx/query-294005d0b9445cc8b9c8e4ce7453f71664dcb5ebbc35005a18c5251c3d902f62.json b/core/lib/dal/.sqlx/query-294005d0b9445cc8b9c8e4ce7453f71664dcb5ebbc35005a18c5251c3d902f62.json deleted file mode 100644 index e2aeb15b19af..000000000000 --- a/core/lib/dal/.sqlx/query-294005d0b9445cc8b9c8e4ce7453f71664dcb5ebbc35005a18c5251c3d902f62.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n MAX(INDEX) AS \"max?\"\n FROM\n initial_writes\n WHERE\n l1_batch_number = (\n SELECT\n MAX(l1_batch_number) AS \"max?\"\n FROM\n initial_writes\n WHERE\n l1_batch_number <= $1\n )\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "max?", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - null - ] - }, - "hash": "294005d0b9445cc8b9c8e4ce7453f71664dcb5ebbc35005a18c5251c3d902f62" -} diff --git a/core/lib/dal/.sqlx/query-2a2083fd04ebd006eb0aa4e0e5f62f3339768a85aaff9a509901e9f42b09097b.json b/core/lib/dal/.sqlx/query-2a2083fd04ebd006eb0aa4e0e5f62f3339768a85aaff9a509901e9f42b09097b.json new file mode 100644 index 000000000000..a713616d582c --- /dev/null +++ b/core/lib/dal/.sqlx/query-2a2083fd04ebd006eb0aa4e0e5f62f3339768a85aaff9a509901e9f42b09097b.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n number,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN\n data_availability\n ON data_availability.l1_batch_number = l1_batches.number\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND data_availability.blob_id IS NULL\n AND pubdata_input IS NOT NULL\n ORDER BY\n number\n LIMIT\n $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "number", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "pubdata_input", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + true + ] + }, + "hash": "2a2083fd04ebd006eb0aa4e0e5f62f3339768a85aaff9a509901e9f42b09097b" +} diff --git a/core/lib/dal/.sqlx/query-2a4bfb1ed34f0d508352a5f3f761eda9057c7fb71b8f0d96f69fda78662ecec5.json b/core/lib/dal/.sqlx/query-2a4bfb1ed34f0d508352a5f3f761eda9057c7fb71b8f0d96f69fda78662ecec5.json new file mode 100644 index 000000000000..7444f11734a8 --- /dev/null +++ b/core/lib/dal/.sqlx/query-2a4bfb1ed34f0d508352a5f3f761eda9057c7fb71b8f0d96f69fda78662ecec5.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN\n eth_txs_history AS commit_tx\n ON (l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id)\n WHERE\n commit_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "2a4bfb1ed34f0d508352a5f3f761eda9057c7fb71b8f0d96f69fda78662ecec5" +} diff --git a/core/lib/dal/.sqlx/query-2d1e0f2e043c193052c9cc20f9efeb5f094160627bc09db4bda2dda9a8c11c44.json b/core/lib/dal/.sqlx/query-2d1e0f2e043c193052c9cc20f9efeb5f094160627bc09db4bda2dda9a8c11c44.json deleted file mode 100644 index 1d9c276b0786..000000000000 --- a/core/lib/dal/.sqlx/query-2d1e0f2e043c193052c9cc20f9efeb5f094160627bc09db4bda2dda9a8c11c44.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n contracts_verification_info (address, verification_info)\n VALUES\n ($1, $2)\n ON CONFLICT (address) DO\n UPDATE\n SET\n verification_info = $2\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Bytea", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "2d1e0f2e043c193052c9cc20f9efeb5f094160627bc09db4bda2dda9a8c11c44" -} diff --git a/core/lib/dal/.sqlx/query-2d467a96fd065137d1038998ae5f8dcb1642688940bc52831498479b250de2b1.json b/core/lib/dal/.sqlx/query-2d467a96fd065137d1038998ae5f8dcb1642688940bc52831498479b250de2b1.json new file mode 100644 index 000000000000..81ae6c590f95 --- /dev/null +++ b/core/lib/dal/.sqlx/query-2d467a96fd065137d1038998ae5f8dcb1642688940bc52831498479b250de2b1.json @@ -0,0 +1,112 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n mb AS (\n SELECT\n l1_gas_price,\n l2_fair_gas_price,\n fair_pubdata_price\n FROM\n miniblocks\n WHERE\n l1_batch_number = $1\n LIMIT\n 1\n )\n \n SELECT\n l1_batches.number,\n l1_batches.timestamp,\n l1_batches.l1_tx_count,\n l1_batches.l2_tx_count,\n l1_batches.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n mb.l1_gas_price,\n mb.l2_fair_gas_price,\n mb.fair_pubdata_price,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash\n FROM\n l1_batches\n INNER JOIN mb ON TRUE\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n l1_batches.number = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "number", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "timestamp", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "l1_tx_count", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "l2_tx_count", + "type_info": "Int4" + }, + { + "ordinal": 4, + "name": "root_hash?", + "type_info": "Bytea" + }, + { + "ordinal": 5, + "name": "commit_tx_hash?", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "committed_at?", + "type_info": "Timestamp" + }, + { + "ordinal": 7, + "name": "prove_tx_hash?", + "type_info": "Text" + }, + { + "ordinal": 8, + "name": "proven_at?", + "type_info": "Timestamp" + }, + { + "ordinal": 9, + "name": "execute_tx_hash?", + "type_info": "Text" + }, + { + "ordinal": 10, + "name": "executed_at?", + "type_info": "Timestamp" + }, + { + "ordinal": 11, + "name": "l1_gas_price", + "type_info": "Int8" + }, + { + "ordinal": 12, + "name": "l2_fair_gas_price", + "type_info": "Int8" + }, + { + "ordinal": 13, + "name": "fair_pubdata_price", + "type_info": "Int8" + }, + { + "ordinal": 14, + "name": "bootloader_code_hash", + "type_info": "Bytea" + }, + { + "ordinal": 15, + "name": "default_aa_code_hash", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + false, + true, + false, + true, + false, + true, + false, + false, + true, + true, + true + ] + }, + "hash": "2d467a96fd065137d1038998ae5f8dcb1642688940bc52831498479b250de2b1" +} diff --git a/core/lib/dal/.sqlx/query-2d8da95804a7a300ff2b756e6785c0665ee3ea4086ddb91428fa1b6a00760737.json b/core/lib/dal/.sqlx/query-2d8da95804a7a300ff2b756e6785c0665ee3ea4086ddb91428fa1b6a00760737.json deleted file mode 100644 index 8b8cef7dd77e..000000000000 --- a/core/lib/dal/.sqlx/query-2d8da95804a7a300ff2b756e6785c0665ee3ea4086ddb91428fa1b6a00760737.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT DISTINCT\n ON (hashed_key) hashed_key,\n miniblock_number,\n value\n FROM\n storage_logs\n WHERE\n hashed_key = ANY ($1)\n AND miniblock_number <= $2\n AND miniblock_number <= COALESCE(\n (\n SELECT\n MAX(number)\n FROM\n miniblocks\n ),\n (\n SELECT\n miniblock_number\n FROM\n snapshot_recovery\n )\n )\n ORDER BY\n hashed_key,\n miniblock_number DESC,\n operation_number DESC\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "hashed_key", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "miniblock_number", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "value", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "ByteaArray", - "Int8" - ] - }, - "nullable": [ - false, - false, - false - ] - }, - "hash": "2d8da95804a7a300ff2b756e6785c0665ee3ea4086ddb91428fa1b6a00760737" -} diff --git a/core/lib/dal/.sqlx/query-b7cd7c40282c2ca2287eef93ee79c69a9e494bf1f873291b4ae7bf68b7e3c549.json b/core/lib/dal/.sqlx/query-2dc550a35fb0f0ddb1aded83d54a2e93066a5cffbb3857dfd3c6fe00c307eada.json similarity index 84% rename from core/lib/dal/.sqlx/query-b7cd7c40282c2ca2287eef93ee79c69a9e494bf1f873291b4ae7bf68b7e3c549.json rename to core/lib/dal/.sqlx/query-2dc550a35fb0f0ddb1aded83d54a2e93066a5cffbb3857dfd3c6fe00c307eada.json index ed4744206a48..8bf22e1b6fb7 100644 --- a/core/lib/dal/.sqlx/query-b7cd7c40282c2ca2287eef93ee79c69a9e494bf1f873291b4ae7bf68b7e3c549.json +++ b/core/lib/dal/.sqlx/query-2dc550a35fb0f0ddb1aded83d54a2e93066a5cffbb3857dfd3c6fe00c307eada.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n l1_batches.timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND protocol_versions.bootloader_code_hash = $1\n AND protocol_versions.default_account_code_hash = $2\n AND commitment IS NOT NULL\n AND (\n protocol_versions.id = $3\n OR protocol_versions.upgrade_tx_hash IS NULL\n )\n ORDER BY\n number\n LIMIT\n $4\n ", + "query": "\n SELECT\n number,\n l1_batches.timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND protocol_versions.bootloader_code_hash = $1\n AND protocol_versions.default_account_code_hash = $2\n AND commitment IS NOT NULL\n AND (\n protocol_versions.id = $3\n OR protocol_versions.upgrade_tx_hash IS NULL\n )\n ORDER BY\n number\n LIMIT\n $4\n ", "describe": { "columns": [ { @@ -171,5 +171,5 @@ true ] }, - "hash": "b7cd7c40282c2ca2287eef93ee79c69a9e494bf1f873291b4ae7bf68b7e3c549" + "hash": "2dc550a35fb0f0ddb1aded83d54a2e93066a5cffbb3857dfd3c6fe00c307eada" } diff --git a/core/lib/dal/.sqlx/query-2e5b9ae1b81b0abfe7a962c93b3119a0a60dc9804175b2baf8b45939c74bd583.json b/core/lib/dal/.sqlx/query-2e5b9ae1b81b0abfe7a962c93b3119a0a60dc9804175b2baf8b45939c74bd583.json deleted file mode 100644 index 205487768306..000000000000 --- a/core/lib/dal/.sqlx/query-2e5b9ae1b81b0abfe7a962c93b3119a0a60dc9804175b2baf8b45939c74bd583.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n compiler_versions (VERSION, compiler, created_at, updated_at)\n SELECT\n u.version,\n $2,\n NOW(),\n NOW()\n FROM\n UNNEST($1::TEXT[]) AS u (VERSION)\n ON CONFLICT (VERSION, compiler) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "TextArray", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2e5b9ae1b81b0abfe7a962c93b3119a0a60dc9804175b2baf8b45939c74bd583" -} diff --git a/core/lib/dal/.sqlx/query-5d341e334cbc2d38efc8a060325677d57040037da0e07cef2c7b7246851a3703.json b/core/lib/dal/.sqlx/query-2fa2ba4a62f79d780d239409d426b602aa0cf9b0c5b1ef39b7d07d6309454fcd.json similarity index 80% rename from core/lib/dal/.sqlx/query-5d341e334cbc2d38efc8a060325677d57040037da0e07cef2c7b7246851a3703.json rename to core/lib/dal/.sqlx/query-2fa2ba4a62f79d780d239409d426b602aa0cf9b0c5b1ef39b7d07d6309454fcd.json index f0d8b01d57c0..1d515edba819 100644 --- a/core/lib/dal/.sqlx/query-5d341e334cbc2d38efc8a060325677d57040037da0e07cef2c7b7246851a3703.json +++ b/core/lib/dal/.sqlx/query-2fa2ba4a62f79d780d239409d426b602aa0cf9b0c5b1ef39b7d07d6309454fcd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE contract_verification_requests\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id = (\n SELECT\n id\n FROM\n contract_verification_requests\n WHERE\n status = 'queued'\n OR (\n status = 'in_progress'\n AND processing_started_at < NOW() - $1::INTERVAL\n )\n ORDER BY\n created_at\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n id,\n contract_address,\n source_code,\n contract_name,\n zk_compiler_version,\n compiler_version,\n optimization_used,\n optimizer_mode,\n constructor_arguments,\n is_system,\n force_evmla\n ", + "query": "\n UPDATE contract_verification_requests\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id = (\n SELECT\n id\n FROM\n contract_verification_requests\n WHERE\n status = 'queued'\n OR (\n status = 'in_progress'\n AND processing_started_at < NOW() - $1::INTERVAL\n )\n ORDER BY\n created_at\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n id,\n contract_address,\n source_code,\n contract_name,\n zk_compiler_version,\n compiler_version,\n optimization_used,\n optimizer_mode,\n constructor_arguments,\n is_system,\n force_evmla\n ", "describe": { "columns": [ { @@ -78,5 +78,5 @@ false ] }, - "hash": "5d341e334cbc2d38efc8a060325677d57040037da0e07cef2c7b7246851a3703" + "hash": "2fa2ba4a62f79d780d239409d426b602aa0cf9b0c5b1ef39b7d07d6309454fcd" } diff --git a/core/lib/dal/.sqlx/query-2506e9edfd4b41ca1e187909631ae942bab5d71daaed7017e3fa62dc5e42ab0a.json b/core/lib/dal/.sqlx/query-2fc088b319ff8f197e50bb379b77de8ba36685dde66d1b3fcf549a52c5001d06.json similarity index 80% rename from core/lib/dal/.sqlx/query-2506e9edfd4b41ca1e187909631ae942bab5d71daaed7017e3fa62dc5e42ab0a.json rename to core/lib/dal/.sqlx/query-2fc088b319ff8f197e50bb379b77de8ba36685dde66d1b3fcf549a52c5001d06.json index c4f8057011d4..679d2ff917d9 100644 --- a/core/lib/dal/.sqlx/query-2506e9edfd4b41ca1e187909631ae942bab5d71daaed7017e3fa62dc5e42ab0a.json +++ b/core/lib/dal/.sqlx/query-2fc088b319ff8f197e50bb379b77de8ba36685dde66d1b3fcf549a52c5001d06.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n hashed_key,\n l1_batch_number,\n INDEX\n FROM\n initial_writes\n ", + "query": "\n SELECT\n hashed_key,\n l1_batch_number,\n index\n FROM\n initial_writes\n ", "describe": { "columns": [ { @@ -28,5 +28,5 @@ false ] }, - "hash": "2506e9edfd4b41ca1e187909631ae942bab5d71daaed7017e3fa62dc5e42ab0a" + "hash": "2fc088b319ff8f197e50bb379b77de8ba36685dde66d1b3fcf549a52c5001d06" } diff --git a/core/lib/dal/.sqlx/query-30e5c8710b1611872da06b72ac681aff512b3a9b2587b8e59848345c07dd8f3b.json b/core/lib/dal/.sqlx/query-3010d02e02391732c622a7515e1e494ce1d8e3b6cfb0b897745fb596f283be79.json similarity index 89% rename from core/lib/dal/.sqlx/query-30e5c8710b1611872da06b72ac681aff512b3a9b2587b8e59848345c07dd8f3b.json rename to core/lib/dal/.sqlx/query-3010d02e02391732c622a7515e1e494ce1d8e3b6cfb0b897745fb596f283be79.json index 1ddc86f29a0a..6012c6326515 100644 --- a/core/lib/dal/.sqlx/query-30e5c8710b1611872da06b72ac681aff512b3a9b2587b8e59848345c07dd8f3b.json +++ b/core/lib/dal/.sqlx/query-3010d02e02391732c622a7515e1e494ce1d8e3b6cfb0b897745fb596f283be79.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE tee_verifier_input_producer_jobs\n SET\n status = $1,\n updated_at = NOW(),\n time_taken = $3,\n error = $4\n WHERE\n l1_batch_number = $2\n AND status != $5\n RETURNING\n tee_verifier_input_producer_jobs.attempts\n ", + "query": "\n UPDATE tee_verifier_input_producer_jobs\n SET\n status = $1,\n updated_at = NOW(),\n time_taken = $3,\n error = $4\n WHERE\n l1_batch_number = $2\n AND status != $5\n RETURNING\n tee_verifier_input_producer_jobs.attempts\n ", "describe": { "columns": [ { @@ -48,5 +48,5 @@ false ] }, - "hash": "30e5c8710b1611872da06b72ac681aff512b3a9b2587b8e59848345c07dd8f3b" + "hash": "3010d02e02391732c622a7515e1e494ce1d8e3b6cfb0b897745fb596f283be79" } diff --git a/core/lib/dal/.sqlx/query-de255be5d2e5ef215428e9a886e7c9dc036873c60b8b916ce8c446e310447b66.json b/core/lib/dal/.sqlx/query-30268c71e4bd0d08015af6ae130d3ee5d5140714297401b4bde1e950ed6e971e.json similarity index 91% rename from core/lib/dal/.sqlx/query-de255be5d2e5ef215428e9a886e7c9dc036873c60b8b916ce8c446e310447b66.json rename to core/lib/dal/.sqlx/query-30268c71e4bd0d08015af6ae130d3ee5d5140714297401b4bde1e950ed6e971e.json index 8a492376557b..a96d94a5c55f 100644 --- a/core/lib/dal/.sqlx/query-de255be5d2e5ef215428e9a886e7c9dc036873c60b8b916ce8c446e310447b66.json +++ b/core/lib/dal/.sqlx/query-30268c71e4bd0d08015af6ae130d3ee5d5140714297401b4bde1e950ed6e971e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number = 0\n OR eth_commit_tx_id IS NOT NULL\n AND commitment IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number = 0\n OR eth_commit_tx_id IS NOT NULL\n AND commitment IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -166,5 +166,5 @@ true ] }, - "hash": "de255be5d2e5ef215428e9a886e7c9dc036873c60b8b916ce8c446e310447b66" + "hash": "30268c71e4bd0d08015af6ae130d3ee5d5140714297401b4bde1e950ed6e971e" } diff --git a/core/lib/dal/.sqlx/query-307f15e00a97440868189f25e4487ed365c0369f94bc457cb162a5c876a123c7.json b/core/lib/dal/.sqlx/query-307f15e00a97440868189f25e4487ed365c0369f94bc457cb162a5c876a123c7.json deleted file mode 100644 index 6c55bf34eabb..000000000000 --- a/core/lib/dal/.sqlx/query-307f15e00a97440868189f25e4487ed365c0369f94bc457cb162a5c876a123c7.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n commitments (l1_batch_number, events_queue_commitment, bootloader_initial_content_commitment)\n VALUES\n ($1, $2, $3)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Bytea", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "307f15e00a97440868189f25e4487ed365c0369f94bc457cb162a5c876a123c7" -} diff --git a/core/lib/dal/.sqlx/query-6c6b8045f9dd7bdb9ada0d71974f28f7b515cf894e63fc95165c9211f71daa36.json b/core/lib/dal/.sqlx/query-30e7d640a731e5c7dccc6d34b94f7116562896314c4d413847854c09c4a14d4e.json similarity index 69% rename from core/lib/dal/.sqlx/query-6c6b8045f9dd7bdb9ada0d71974f28f7b515cf894e63fc95165c9211f71daa36.json rename to core/lib/dal/.sqlx/query-30e7d640a731e5c7dccc6d34b94f7116562896314c4d413847854c09c4a14d4e.json index 1a538831c96f..09e0a9360eea 100644 --- a/core/lib/dal/.sqlx/query-6c6b8045f9dd7bdb9ada0d71974f28f7b515cf894e63fc95165c9211f71daa36.json +++ b/core/lib/dal/.sqlx/query-30e7d640a731e5c7dccc6d34b94f7116562896314c4d413847854c09c4a14d4e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n VERSION,\n l1_batch_number,\n factory_deps_filepath,\n storage_logs_filepaths\n FROM\n snapshots\n WHERE\n l1_batch_number = $1\n ", + "query": "\n SELECT\n VERSION,\n L1_BATCH_NUMBER,\n FACTORY_DEPS_FILEPATH,\n STORAGE_LOGS_FILEPATHS\n FROM\n SNAPSHOTS\n WHERE\n L1_BATCH_NUMBER = $1\n ", "describe": { "columns": [ { @@ -36,5 +36,5 @@ false ] }, - "hash": "6c6b8045f9dd7bdb9ada0d71974f28f7b515cf894e63fc95165c9211f71daa36" + "hash": "30e7d640a731e5c7dccc6d34b94f7116562896314c4d413847854c09c4a14d4e" } diff --git a/core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json b/core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json deleted file mode 100644 index cabe0a3dc557..000000000000 --- a/core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1" -} diff --git a/core/lib/dal/.sqlx/query-32e8bdbf16fdd2b7617d7a909c3eee66178533c3c0f51e2bfa9ff201e17e4014.json b/core/lib/dal/.sqlx/query-32e8bdbf16fdd2b7617d7a909c3eee66178533c3c0f51e2bfa9ff201e17e4014.json new file mode 100644 index 000000000000..f2fdebd416cd --- /dev/null +++ b/core/lib/dal/.sqlx/query-32e8bdbf16fdd2b7617d7a909c3eee66178533c3c0f51e2bfa9ff201e17e4014.json @@ -0,0 +1,44 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n table_name,\n PG_TABLE_SIZE(\n ('public.' || QUOTE_IDENT(table_name))::regclass\n ) AS table_size,\n PG_INDEXES_SIZE(\n ('public.' || QUOTE_IDENT(table_name))::regclass\n ) AS indexes_size,\n PG_RELATION_SIZE(\n ('public.' || QUOTE_IDENT(table_name))::regclass\n ) AS relation_size,\n PG_TOTAL_RELATION_SIZE(\n ('public.' || QUOTE_IDENT(table_name))::regclass\n ) AS total_size\n FROM\n information_schema.tables\n WHERE\n table_schema = 'public'\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "table_name", + "type_info": "Name" + }, + { + "ordinal": 1, + "name": "table_size", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "indexes_size", + "type_info": "Int8" + }, + { + "ordinal": 3, + "name": "relation_size", + "type_info": "Int8" + }, + { + "ordinal": 4, + "name": "total_size", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + true, + null, + null, + null, + null + ] + }, + "hash": "32e8bdbf16fdd2b7617d7a909c3eee66178533c3c0f51e2bfa9ff201e17e4014" +} diff --git a/core/lib/dal/.sqlx/query-3353dd735addf184732843151dd47e1ed84929bf75bb814ee2280d241912d38f.json b/core/lib/dal/.sqlx/query-3353dd735addf184732843151dd47e1ed84929bf75bb814ee2280d241912d38f.json new file mode 100644 index 000000000000..aea0d7128575 --- /dev/null +++ b/core/lib/dal/.sqlx/query-3353dd735addf184732843151dd47e1ed84929bf75bb814ee2280d241912d38f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n l1_batches_consensus_committees (l1_batch_number, attesters, updated_at)\n VALUES\n ($1, $2, NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n l1_batch_number = $1,\n attesters = $2,\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "3353dd735addf184732843151dd47e1ed84929bf75bb814ee2280d241912d38f" +} diff --git a/core/lib/dal/.sqlx/query-33a78184559d0c0d13469fa799e2c5eeab06ff664141fa542229e7c9a46d4410.json b/core/lib/dal/.sqlx/query-33a78184559d0c0d13469fa799e2c5eeab06ff664141fa542229e7c9a46d4410.json deleted file mode 100644 index 6dcc1acfd358..000000000000 --- a/core/lib/dal/.sqlx/query-33a78184559d0c0d13469fa799e2c5eeab06ff664141fa542229e7c9a46d4410.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n hash = data_table.hash,\n signature = data_table.signature,\n gas_limit = data_table.gas_limit,\n max_fee_per_gas = data_table.max_fee_per_gas,\n max_priority_fee_per_gas = data_table.max_priority_fee_per_gas,\n gas_per_pubdata_limit = data_table.gas_per_pubdata_limit,\n input = data_table.input,\n data = data_table.data,\n tx_format = data_table.tx_format,\n miniblock_number = $21,\n index_in_block = data_table.index_in_block,\n error = NULLIF(data_table.error, ''),\n effective_gas_price = data_table.effective_gas_price,\n execution_info = data_table.new_execution_info,\n refunded_gas = data_table.refunded_gas,\n value = data_table.value,\n contract_address = data_table.contract_address,\n paymaster = data_table.paymaster,\n paymaster_input = data_table.paymaster_input,\n in_mempool = FALSE,\n updated_at = NOW()\n FROM\n (\n SELECT\n data_table_temp.*\n FROM\n (\n SELECT\n UNNEST($1::bytea[]) AS initiator_address,\n UNNEST($2::INT[]) AS nonce,\n UNNEST($3::bytea[]) AS hash,\n UNNEST($4::bytea[]) AS signature,\n UNNEST($5::NUMERIC[]) AS gas_limit,\n UNNEST($6::NUMERIC[]) AS max_fee_per_gas,\n UNNEST($7::NUMERIC[]) AS max_priority_fee_per_gas,\n UNNEST($8::NUMERIC[]) AS gas_per_pubdata_limit,\n UNNEST($9::INT[]) AS tx_format,\n UNNEST($10::INTEGER[]) AS index_in_block,\n UNNEST($11::VARCHAR[]) AS error,\n UNNEST($12::NUMERIC[]) AS effective_gas_price,\n UNNEST($13::jsonb[]) AS new_execution_info,\n UNNEST($14::bytea[]) AS input,\n UNNEST($15::jsonb[]) AS data,\n UNNEST($16::BIGINT[]) AS refunded_gas,\n UNNEST($17::NUMERIC[]) AS value,\n UNNEST($18::bytea[]) AS contract_address,\n UNNEST($19::bytea[]) AS paymaster,\n UNNEST($20::bytea[]) AS paymaster_input\n ) AS data_table_temp\n JOIN transactions ON transactions.initiator_address = data_table_temp.initiator_address\n AND transactions.nonce = data_table_temp.nonce\n ORDER BY\n transactions.hash\n ) AS data_table\n WHERE\n transactions.initiator_address = data_table.initiator_address\n AND transactions.nonce = data_table.nonce\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "Int4Array", - "ByteaArray", - "ByteaArray", - "NumericArray", - "NumericArray", - "NumericArray", - "NumericArray", - "Int4Array", - "Int4Array", - "VarcharArray", - "NumericArray", - "JsonbArray", - "ByteaArray", - "JsonbArray", - "Int8Array", - "NumericArray", - "ByteaArray", - "ByteaArray", - "ByteaArray", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "33a78184559d0c0d13469fa799e2c5eeab06ff664141fa542229e7c9a46d4410" -} diff --git a/core/lib/dal/.sqlx/query-8ce0812420fbf35cbbbb0f77f850a54653a5c06c665433718f7ccbbf936f76ca.json b/core/lib/dal/.sqlx/query-33bfa40b6519f05ec2ee8c7a2372b9764b5b4b840573c35b57e011330bd132a3.json similarity index 61% rename from core/lib/dal/.sqlx/query-8ce0812420fbf35cbbbb0f77f850a54653a5c06c665433718f7ccbbf936f76ca.json rename to core/lib/dal/.sqlx/query-33bfa40b6519f05ec2ee8c7a2372b9764b5b4b840573c35b57e011330bd132a3.json index 7ad183d57e56..b17fcff6d61e 100644 --- a/core/lib/dal/.sqlx/query-8ce0812420fbf35cbbbb0f77f850a54653a5c06c665433718f7ccbbf936f76ca.json +++ b/core/lib/dal/.sqlx/query-33bfa40b6519f05ec2ee8c7a2372b9764b5b4b840573c35b57e011330bd132a3.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n COUNT(*) AS COUNT\n FROM\n storage_logs\n WHERE\n miniblock_number <= $1\n ", + "query": "\n SELECT\n COUNT(*) AS COUNT\n FROM\n STORAGE_LOGS\n WHERE\n MINIBLOCK_NUMBER <= $1\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ null ] }, - "hash": "8ce0812420fbf35cbbbb0f77f850a54653a5c06c665433718f7ccbbf936f76ca" + "hash": "33bfa40b6519f05ec2ee8c7a2372b9764b5b4b840573c35b57e011330bd132a3" } diff --git a/core/lib/dal/.sqlx/query-3518a3e93da8115b54426d72aea0800383e6b73a8b48dc3e589a29a4367cbb5a.json b/core/lib/dal/.sqlx/query-3518a3e93da8115b54426d72aea0800383e6b73a8b48dc3e589a29a4367cbb5a.json deleted file mode 100644 index a2351b5eef86..000000000000 --- a/core/lib/dal/.sqlx/query-3518a3e93da8115b54426d72aea0800383e6b73a8b48dc3e589a29a4367cbb5a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n call_traces (tx_hash, call_trace)\n SELECT\n u.tx_hash,\n u.call_trace\n FROM\n UNNEST($1::bytea[], $2::bytea[]) AS u (tx_hash, call_trace)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray" - ] - }, - "nullable": [] - }, - "hash": "3518a3e93da8115b54426d72aea0800383e6b73a8b48dc3e589a29a4367cbb5a" -} diff --git a/core/lib/dal/.sqlx/query-be2c8e525d6867c0d2bd254c73ef1719fd1284af1dbb60ea128550224b52da93.json b/core/lib/dal/.sqlx/query-369f8f652335176ab22ee45fd6f1717e73c5e6b063be3553d82bfecb98334980.json similarity index 79% rename from core/lib/dal/.sqlx/query-be2c8e525d6867c0d2bd254c73ef1719fd1284af1dbb60ea128550224b52da93.json rename to core/lib/dal/.sqlx/query-369f8f652335176ab22ee45fd6f1717e73c5e6b063be3553d82bfecb98334980.json index 21964d27d60a..7245fa3059ed 100644 --- a/core/lib/dal/.sqlx/query-be2c8e525d6867c0d2bd254c73ef1719fd1284af1dbb60ea128550224b52da93.json +++ b/core/lib/dal/.sqlx/query-369f8f652335176ab22ee45fd6f1717e73c5e6b063be3553d82bfecb98334980.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n bytecode\n FROM\n (\n SELECT\n *\n FROM\n storage_logs\n WHERE\n storage_logs.hashed_key = $1\n AND storage_logs.miniblock_number <= $2\n ORDER BY\n storage_logs.miniblock_number DESC,\n storage_logs.operation_number DESC\n LIMIT\n 1\n ) t\n JOIN factory_deps ON value = factory_deps.bytecode_hash\n WHERE\n value != $3\n ", + "query": "\n SELECT\n bytecode\n FROM\n (\n SELECT\n *\n FROM\n storage_logs\n WHERE\n storage_logs.hashed_key = $1\n AND storage_logs.miniblock_number <= $2\n ORDER BY\n storage_logs.miniblock_number DESC,\n storage_logs.operation_number DESC\n LIMIT\n 1\n ) t\n JOIN factory_deps ON value = factory_deps.bytecode_hash\n WHERE\n value != $3\n ", "describe": { "columns": [ { @@ -20,5 +20,5 @@ false ] }, - "hash": "be2c8e525d6867c0d2bd254c73ef1719fd1284af1dbb60ea128550224b52da93" + "hash": "369f8f652335176ab22ee45fd6f1717e73c5e6b063be3553d82bfecb98334980" } diff --git a/core/lib/dal/.sqlx/query-37890022be6b5e893cf051266fa16618914d6dedb39a9a40d36484741e8b01f4.json b/core/lib/dal/.sqlx/query-37890022be6b5e893cf051266fa16618914d6dedb39a9a40d36484741e8b01f4.json deleted file mode 100644 index a39a1bdb07b8..000000000000 --- a/core/lib/dal/.sqlx/query-37890022be6b5e893cf051266fa16618914d6dedb39a9a40d36484741e8b01f4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n tee_attestations (pubkey, attestation)\n VALUES\n ($1, $2)\n ON CONFLICT (pubkey) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Bytea", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "37890022be6b5e893cf051266fa16618914d6dedb39a9a40d36484741e8b01f4" -} diff --git a/core/lib/dal/.sqlx/query-469db79fcf8d692507317080e0d843620210aff3a9a7aa8a249db50c1c56d927.json b/core/lib/dal/.sqlx/query-37b653ba8a544224ef6fb88e073d1e4657024c66a42e1bbc261c92c9e1c79930.json similarity index 60% rename from core/lib/dal/.sqlx/query-469db79fcf8d692507317080e0d843620210aff3a9a7aa8a249db50c1c56d927.json rename to core/lib/dal/.sqlx/query-37b653ba8a544224ef6fb88e073d1e4657024c66a42e1bbc261c92c9e1c79930.json index fe91d27abb11..f4b52c688cb0 100644 --- a/core/lib/dal/.sqlx/query-469db79fcf8d692507317080e0d843620210aff3a9a7aa8a249db50c1c56d927.json +++ b/core/lib/dal/.sqlx/query-37b653ba8a544224ef6fb88e073d1e4657024c66a42e1bbc261c92c9e1c79930.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n miniblock_number = $1,\n index_in_block = data_table.index_in_block,\n error = NULLIF(data_table.error, ''),\n in_mempool = FALSE,\n execution_info = execution_info || data_table.new_execution_info,\n refunded_gas = data_table.refunded_gas,\n effective_gas_price = data_table.effective_gas_price,\n updated_at = NOW()\n FROM\n (\n SELECT\n UNNEST($2::bytea[]) AS hash,\n UNNEST($3::INTEGER[]) AS index_in_block,\n UNNEST($4::VARCHAR[]) AS error,\n UNNEST($5::jsonb[]) AS new_execution_info,\n UNNEST($6::BIGINT[]) AS refunded_gas,\n UNNEST($7::NUMERIC[]) AS effective_gas_price\n ) AS data_table\n WHERE\n transactions.hash = data_table.hash\n ", + "query": "\n UPDATE transactions\n SET\n miniblock_number = $1,\n index_in_block = data_table.index_in_block,\n error = NULLIF(data_table.error, ''),\n in_mempool = FALSE,\n execution_info = execution_info || data_table.new_execution_info,\n refunded_gas = data_table.refunded_gas,\n effective_gas_price = data_table.effective_gas_price,\n updated_at = NOW()\n FROM\n (\n SELECT\n UNNEST($2::bytea []) AS hash,\n UNNEST($3::integer []) AS index_in_block,\n UNNEST($4::varchar []) AS error,\n UNNEST($5::jsonb []) AS new_execution_info,\n UNNEST($6::bigint []) AS refunded_gas,\n UNNEST($7::numeric []) AS effective_gas_price\n ) AS data_table\n WHERE\n transactions.hash = data_table.hash\n ", "describe": { "columns": [], "parameters": { @@ -16,5 +16,5 @@ }, "nullable": [] }, - "hash": "469db79fcf8d692507317080e0d843620210aff3a9a7aa8a249db50c1c56d927" + "hash": "37b653ba8a544224ef6fb88e073d1e4657024c66a42e1bbc261c92c9e1c79930" } diff --git a/core/lib/dal/.sqlx/query-3b4d5009ec22f54cc7d305aa11d96ec397767a063dc21aa3add974cb9b070361.json b/core/lib/dal/.sqlx/query-3b4d5009ec22f54cc7d305aa11d96ec397767a063dc21aa3add974cb9b070361.json deleted file mode 100644 index 38890ae58f2e..000000000000 --- a/core/lib/dal/.sqlx/query-3b4d5009ec22f54cc7d305aa11d96ec397767a063dc21aa3add974cb9b070361.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at)\n SELECT\n u.bytecode_hash,\n u.bytecode,\n $3,\n NOW(),\n NOW()\n FROM\n UNNEST($1::bytea[], $2::bytea[]) AS u (bytecode_hash, bytecode)\n ON CONFLICT (bytecode_hash) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "3b4d5009ec22f54cc7d305aa11d96ec397767a063dc21aa3add974cb9b070361" -} diff --git a/core/lib/dal/.sqlx/query-3ddb13ffbafae2374527886e592b3c0210383d8698f6f84f694fece9fd59f3d5.json b/core/lib/dal/.sqlx/query-3ddb13ffbafae2374527886e592b3c0210383d8698f6f84f694fece9fd59f3d5.json deleted file mode 100644 index 5652e186ceb9..000000000000 --- a/core/lib/dal/.sqlx/query-3ddb13ffbafae2374527886e592b3c0210383d8698f6f84f694fece9fd59f3d5.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n protocol_patches (minor, patch, snark_wrapper_vk_hash, created_at)\n VALUES\n ($1, $2, $3, NOW())\n ON CONFLICT DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int4", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "3ddb13ffbafae2374527886e592b3c0210383d8698f6f84f694fece9fd59f3d5" -} diff --git a/core/lib/dal/.sqlx/query-26c80e9bafcf7989e7d40c6e424240b34ce29aad3ac6571116e084d45574c448.json b/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json similarity index 79% rename from core/lib/dal/.sqlx/query-26c80e9bafcf7989e7d40c6e424240b34ce29aad3ac6571116e084d45574c448.json rename to core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json index ee5de53d6e65..e2a808d41f89 100644 --- a/core/lib/dal/.sqlx/query-26c80e9bafcf7989e7d40c6e424240b34ce29aad3ac6571116e084d45574c448.json +++ b/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n next_block_to_process\n FROM\n processed_events\n WHERE\n TYPE = $1\n AND chain_id = $2\n ", + "query": "\n SELECT\n next_block_to_process\n FROM\n processed_events\n WHERE\n type = $1\n AND chain_id = $2\n ", "describe": { "columns": [ { @@ -29,5 +29,5 @@ false ] }, - "hash": "26c80e9bafcf7989e7d40c6e424240b34ce29aad3ac6571116e084d45574c448" + "hash": "3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd" } diff --git a/core/lib/dal/.sqlx/query-0fede71ed258790cf70d6d6a32dcf9654c06dfef57863281601c947830ad448a.json b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json similarity index 76% rename from core/lib/dal/.sqlx/query-0fede71ed258790cf70d6d6a32dcf9654c06dfef57863281601c947830ad448a.json rename to core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json index 6a3174958db8..3e64cc5f5b2f 100644 --- a/core/lib/dal/.sqlx/query-0fede71ed258790cf70d6d6a32dcf9654c06dfef57863281601c947830ad448a.json +++ b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n eth_txs (\n raw_tx,\n nonce,\n tx_type,\n contract_address,\n predicted_gas_cost,\n created_at,\n updated_at,\n from_addr,\n blob_sidecar,\n is_gateway\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, $8)\n RETURNING\n *\n ", + "query": "\n INSERT INTO\n eth_txs (\n raw_tx,\n nonce,\n tx_type,\n contract_address,\n predicted_gas_cost,\n created_at,\n updated_at,\n from_addr,\n blob_sidecar,\n is_gateway\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, $8)\n RETURNING\n *\n ", "describe": { "columns": [ { @@ -115,5 +115,5 @@ true ] }, - "hash": "0fede71ed258790cf70d6d6a32dcf9654c06dfef57863281601c947830ad448a" + "hash": "400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9" } diff --git a/core/lib/dal/.sqlx/query-403b0b1c93f973aedb41aad7700d656e2a26752fa71ae936ff2eb821b0734b61.json b/core/lib/dal/.sqlx/query-403b0b1c93f973aedb41aad7700d656e2a26752fa71ae936ff2eb821b0734b61.json new file mode 100644 index 000000000000..6cb9dec6838c --- /dev/null +++ b/core/lib/dal/.sqlx/query-403b0b1c93f973aedb41aad7700d656e2a26752fa71ae936ff2eb821b0734b61.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n proof_generation_details (l1_batch_number, status, created_at, updated_at)\n VALUES\n ($1, 'unpicked', NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [] + }, + "hash": "403b0b1c93f973aedb41aad7700d656e2a26752fa71ae936ff2eb821b0734b61" +} diff --git a/core/lib/dal/.sqlx/query-406e51d7884cdff36632ccf97912484f0a0d76a8097b61ead5f1f20301ce524d.json b/core/lib/dal/.sqlx/query-406e51d7884cdff36632ccf97912484f0a0d76a8097b61ead5f1f20301ce524d.json deleted file mode 100644 index cc3c2a344eb4..000000000000 --- a/core/lib/dal/.sqlx/query-406e51d7884cdff36632ccf97912484f0a0d76a8097b61ead5f1f20301ce524d.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n snapshots (\n VERSION,\n l1_batch_number,\n storage_logs_filepaths,\n factory_deps_filepath,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, ARRAY_FILL(''::TEXT, ARRAY[$3::INTEGER]), $4, NOW(), NOW())\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int8", - "Int4", - "Text" - ] - }, - "nullable": [] - }, - "hash": "406e51d7884cdff36632ccf97912484f0a0d76a8097b61ead5f1f20301ce524d" -} diff --git a/core/lib/dal/.sqlx/query-40c17194a2089a7d3fa6b7923c9e03def94f4bf4674def1893e2232be80f57a0.json b/core/lib/dal/.sqlx/query-40c17194a2089a7d3fa6b7923c9e03def94f4bf4674def1893e2232be80f57a0.json deleted file mode 100644 index c655704fd842..000000000000 --- a/core/lib/dal/.sqlx/query-40c17194a2089a7d3fa6b7923c9e03def94f4bf4674def1893e2232be80f57a0.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n contract_verification_requests (\n contract_address,\n source_code,\n contract_name,\n zk_compiler_version,\n compiler_version,\n optimization_used,\n optimizer_mode,\n constructor_arguments,\n is_system,\n force_evmla,\n status,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 'queued', NOW(), NOW())\n RETURNING\n id\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Bytea", - "Text", - "Text", - "Text", - "Text", - "Bool", - "Text", - "Bytea", - "Bool", - "Bool" - ] - }, - "nullable": [ - false - ] - }, - "hash": "40c17194a2089a7d3fa6b7923c9e03def94f4bf4674def1893e2232be80f57a0" -} diff --git a/core/lib/dal/.sqlx/query-546c729829083b7eba94fea742c162d717ffcf46fdf5d2ce5d32555353b6da6b.json b/core/lib/dal/.sqlx/query-41b2d575151bff136037d6f1d75f36d50db45560befec6418020b01c55d94a98.json similarity index 52% rename from core/lib/dal/.sqlx/query-546c729829083b7eba94fea742c162d717ffcf46fdf5d2ce5d32555353b6da6b.json rename to core/lib/dal/.sqlx/query-41b2d575151bff136037d6f1d75f36d50db45560befec6418020b01c55d94a98.json index 70b94f739098..f5dccac1a01c 100644 --- a/core/lib/dal/.sqlx/query-546c729829083b7eba94fea742c162d717ffcf46fdf5d2ce5d32555353b6da6b.json +++ b/core/lib/dal/.sqlx/query-41b2d575151bff136037d6f1d75f36d50db45560befec6418020b01c55d94a98.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n in_mempool = FALSE\n FROM\n UNNEST($1::bytea[]) AS s (address)\n WHERE\n transactions.in_mempool = TRUE\n AND transactions.initiator_address = s.address\n ", + "query": "\n UPDATE transactions\n SET\n in_mempool = FALSE\n FROM\n UNNEST($1::bytea []) AS s (address)\n WHERE\n transactions.in_mempool = TRUE\n AND transactions.initiator_address = s.address\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "546c729829083b7eba94fea742c162d717ffcf46fdf5d2ce5d32555353b6da6b" + "hash": "41b2d575151bff136037d6f1d75f36d50db45560befec6418020b01c55d94a98" } diff --git a/core/lib/dal/.sqlx/query-8b9e5d525c026de97c0a732b1adc8dc4bd57e32dfefe1017acba9a15fc14b895.json b/core/lib/dal/.sqlx/query-442212bb5f28f234cd624f2acc27944b2acedce201da4454aadb79f3545713ae.json similarity index 61% rename from core/lib/dal/.sqlx/query-8b9e5d525c026de97c0a732b1adc8dc4bd57e32dfefe1017acba9a15fc14b895.json rename to core/lib/dal/.sqlx/query-442212bb5f28f234cd624f2acc27944b2acedce201da4454aadb79f3545713ae.json index de369bccec54..621295d4ab81 100644 --- a/core/lib/dal/.sqlx/query-8b9e5d525c026de97c0a732b1adc8dc4bd57e32dfefe1017acba9a15fc14b895.json +++ b/core/lib/dal/.sqlx/query-442212bb5f28f234cd624f2acc27944b2acedce201da4454aadb79f3545713ae.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n storage_logs.hashed_key,\n storage_logs.value,\n initial_writes.index\n FROM\n storage_logs\n INNER JOIN initial_writes ON storage_logs.hashed_key = initial_writes.hashed_key\n WHERE\n storage_logs.miniblock_number = $1\n AND storage_logs.hashed_key >= $2::bytea\n AND storage_logs.hashed_key <= $3::bytea\n ORDER BY\n storage_logs.hashed_key\n ", + "query": "\n SELECT\n storage_logs.hashed_key,\n storage_logs.value,\n initial_writes.index\n FROM\n storage_logs\n INNER JOIN initial_writes ON storage_logs.hashed_key = initial_writes.hashed_key\n WHERE\n storage_logs.miniblock_number = $1\n AND storage_logs.hashed_key >= $2::bytea\n AND storage_logs.hashed_key <= $3::bytea\n ORDER BY\n storage_logs.hashed_key\n ", "describe": { "columns": [ { @@ -32,5 +32,5 @@ false ] }, - "hash": "8b9e5d525c026de97c0a732b1adc8dc4bd57e32dfefe1017acba9a15fc14b895" + "hash": "442212bb5f28f234cd624f2acc27944b2acedce201da4454aadb79f3545713ae" } diff --git a/core/lib/dal/.sqlx/query-45a968c6d667b13bbe9d895e7734fc05eaa158a6f38a87187d7f2c2068a0112a.json b/core/lib/dal/.sqlx/query-45a968c6d667b13bbe9d895e7734fc05eaa158a6f38a87187d7f2c2068a0112a.json deleted file mode 100644 index 36da129b5b77..000000000000 --- a/core/lib/dal/.sqlx/query-45a968c6d667b13bbe9d895e7734fc05eaa158a6f38a87187d7f2c2068a0112a.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n eth_txs_history (\n eth_tx_id,\n base_fee_per_gas,\n priority_fee_per_gas,\n tx_hash,\n signed_raw_tx,\n created_at,\n updated_at,\n blob_base_fee_per_gas,\n sent_at_block,\n sent_at\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, NOW())\n ON CONFLICT (tx_hash) DO NOTHING\n RETURNING\n id\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [ - "Int4", - "Int8", - "Int8", - "Text", - "Bytea", - "Int8", - "Int4" - ] - }, - "nullable": [ - false - ] - }, - "hash": "45a968c6d667b13bbe9d895e7734fc05eaa158a6f38a87187d7f2c2068a0112a" -} diff --git a/core/lib/dal/.sqlx/query-ada54322a28012b1b761f3631c4cd6ca26aa2fa565fcf208b6985f461c1868f2.json b/core/lib/dal/.sqlx/query-497e1c08e8460be6e838a47dada8375d56609cd6b7f425361acfd0a411dc48bd.json similarity index 77% rename from core/lib/dal/.sqlx/query-ada54322a28012b1b761f3631c4cd6ca26aa2fa565fcf208b6985f461c1868f2.json rename to core/lib/dal/.sqlx/query-497e1c08e8460be6e838a47dada8375d56609cd6b7f425361acfd0a411dc48bd.json index 04fde45469fa..4a47d5b560ad 100644 --- a/core/lib/dal/.sqlx/query-ada54322a28012b1b761f3631c4cd6ca26aa2fa565fcf208b6985f461c1868f2.json +++ b/core/lib/dal/.sqlx/query-497e1c08e8460be6e838a47dada8375d56609cd6b7f425361acfd0a411dc48bd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE eth_txs_history\n SET\n updated_at = NOW(),\n confirmed_at = NOW()\n WHERE\n tx_hash = $1\n RETURNING\n id,\n eth_tx_id\n ", + "query": "\n UPDATE eth_txs_history\n SET\n updated_at = NOW(),\n confirmed_at = NOW()\n WHERE\n tx_hash = $1\n RETURNING\n id,\n eth_tx_id\n ", "describe": { "columns": [ { @@ -24,5 +24,5 @@ false ] }, - "hash": "ada54322a28012b1b761f3631c4cd6ca26aa2fa565fcf208b6985f461c1868f2" + "hash": "497e1c08e8460be6e838a47dada8375d56609cd6b7f425361acfd0a411dc48bd" } diff --git a/core/lib/dal/.sqlx/query-03e00f422f991f8f12aad0083e1c42cfea253a182ca5df143a183cd522ecac33.json b/core/lib/dal/.sqlx/query-499571f0484f4a54541450f935853bb67bd12f2b635af783897f9d2a4f4ead2e.json similarity index 81% rename from core/lib/dal/.sqlx/query-03e00f422f991f8f12aad0083e1c42cfea253a182ca5df143a183cd522ecac33.json rename to core/lib/dal/.sqlx/query-499571f0484f4a54541450f935853bb67bd12f2b635af783897f9d2a4f4ead2e.json index 12498582adaa..ddc3772a1a5c 100644 --- a/core/lib/dal/.sqlx/query-03e00f422f991f8f12aad0083e1c42cfea253a182ca5df143a183cd522ecac33.json +++ b/core/lib/dal/.sqlx/query-499571f0484f4a54541450f935853bb67bd12f2b635af783897f9d2a4f4ead2e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n l1_batch_number = NULL,\n miniblock_number = NULL,\n error = NULL,\n index_in_block = NULL,\n execution_info = '{}'\n WHERE\n miniblock_number > $1\n RETURNING\n hash\n ", + "query": "\n UPDATE transactions\n SET\n l1_batch_number = NULL,\n miniblock_number = NULL,\n error = NULL,\n index_in_block = NULL,\n execution_info = '{}'\n WHERE\n miniblock_number > $1\n RETURNING\n hash\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "03e00f422f991f8f12aad0083e1c42cfea253a182ca5df143a183cd522ecac33" + "hash": "499571f0484f4a54541450f935853bb67bd12f2b635af783897f9d2a4f4ead2e" } diff --git a/core/lib/dal/.sqlx/query-4b6fdc5021c536e622373dca8729250962832a0d95d0d82bdd56271d6a07e497.json b/core/lib/dal/.sqlx/query-4b6fdc5021c536e622373dca8729250962832a0d95d0d82bdd56271d6a07e497.json new file mode 100644 index 000000000000..e4dfb7298a79 --- /dev/null +++ b/core/lib/dal/.sqlx/query-4b6fdc5021c536e622373dca8729250962832a0d95d0d82bdd56271d6a07e497.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n miniblocks_consensus (number, certificate)\n VALUES\n ($1, $2)\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "4b6fdc5021c536e622373dca8729250962832a0d95d0d82bdd56271d6a07e497" +} diff --git a/core/lib/dal/.sqlx/query-38dea171e4c49f54bf1db5ac9bfb3be9cf3928755be5f5fcfcdc086e73fb15e2.json b/core/lib/dal/.sqlx/query-4ef330359df85ad6e0110a068ef3afa9cf50eafc7ac542975edea9bd592ce862.json similarity index 90% rename from core/lib/dal/.sqlx/query-38dea171e4c49f54bf1db5ac9bfb3be9cf3928755be5f5fcfcdc086e73fb15e2.json rename to core/lib/dal/.sqlx/query-4ef330359df85ad6e0110a068ef3afa9cf50eafc7ac542975edea9bd592ce862.json index 7ac6785d8e64..10e2a76618f6 100644 --- a/core/lib/dal/.sqlx/query-38dea171e4c49f54bf1db5ac9bfb3be9cf3928755be5f5fcfcdc086e73fb15e2.json +++ b/core/lib/dal/.sqlx/query-4ef330359df85ad6e0110a068ef3afa9cf50eafc7ac542975edea9bd592ce862.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n eth_prove_tx_id IS NOT NULL\n AND eth_execute_tx_id IS NULL\n ORDER BY\n number\n LIMIT\n $1\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n eth_prove_tx_id IS NOT NULL\n AND eth_execute_tx_id IS NULL\n ORDER BY\n number\n LIMIT\n $1\n ", "describe": { "columns": [ { @@ -168,5 +168,5 @@ true ] }, - "hash": "38dea171e4c49f54bf1db5ac9bfb3be9cf3928755be5f5fcfcdc086e73fb15e2" + "hash": "4ef330359df85ad6e0110a068ef3afa9cf50eafc7ac542975edea9bd592ce862" } diff --git a/core/lib/dal/.sqlx/query-5017fb273e532be3a093d682d916aaa0430eeeb48c19ec3eabe78996baa9b140.json b/core/lib/dal/.sqlx/query-5017fb273e532be3a093d682d916aaa0430eeeb48c19ec3eabe78996baa9b140.json new file mode 100644 index 000000000000..42fd4087a1fe --- /dev/null +++ b/core/lib/dal/.sqlx/query-5017fb273e532be3a093d682d916aaa0430eeeb48c19ec3eabe78996baa9b140.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n eth_txs_history (\n eth_tx_id,\n base_fee_per_gas,\n priority_fee_per_gas,\n tx_hash,\n signed_raw_tx,\n created_at,\n updated_at,\n blob_base_fee_per_gas,\n sent_at_block,\n sent_at\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, NOW())\n ON CONFLICT (tx_hash) DO NOTHING\n RETURNING\n id\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int8", + "Int8", + "Text", + "Bytea", + "Int8", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "5017fb273e532be3a093d682d916aaa0430eeeb48c19ec3eabe78996baa9b140" +} diff --git a/core/lib/dal/.sqlx/query-e073cfdc7a00559994ce04eca15f35d55901fb1e6805f23413ea43e3637540a0.json b/core/lib/dal/.sqlx/query-50687903977b973d72acac96b08880eef9af91f5b4fcaebb7beb3a415d4b231d.json similarity index 85% rename from core/lib/dal/.sqlx/query-e073cfdc7a00559994ce04eca15f35d55901fb1e6805f23413ea43e3637540a0.json rename to core/lib/dal/.sqlx/query-50687903977b973d72acac96b08880eef9af91f5b4fcaebb7beb3a415d4b231d.json index 929e4de8c1b3..e58a0ec88213 100644 --- a/core/lib/dal/.sqlx/query-e073cfdc7a00559994ce04eca15f35d55901fb1e6805f23413ea43e3637540a0.json +++ b/core/lib/dal/.sqlx/query-50687903977b973d72acac96b08880eef9af91f5b4fcaebb7beb3a415d4b231d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n bytecode,\n bytecode_hash\n FROM\n factory_deps\n WHERE\n bytecode_hash = ANY ($1)\n ", + "query": "\n SELECT\n bytecode,\n bytecode_hash\n FROM\n factory_deps\n WHERE\n bytecode_hash = ANY($1)\n ", "describe": { "columns": [ { @@ -24,5 +24,5 @@ false ] }, - "hash": "e073cfdc7a00559994ce04eca15f35d55901fb1e6805f23413ea43e3637540a0" + "hash": "50687903977b973d72acac96b08880eef9af91f5b4fcaebb7beb3a415d4b231d" } diff --git a/core/lib/dal/.sqlx/query-5137159db7d3ff456e368e6246b07554ce738a2d7005472e7e76a64a8fbd57ad.json b/core/lib/dal/.sqlx/query-5137159db7d3ff456e368e6246b07554ce738a2d7005472e7e76a64a8fbd57ad.json deleted file mode 100644 index 07ef0aba074d..000000000000 --- a/core/lib/dal/.sqlx/query-5137159db7d3ff456e368e6246b07554ce738a2d7005472e7e76a64a8fbd57ad.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n proof_generation_details (l1_batch_number, status, created_at, updated_at)\n VALUES\n ($1, 'unpicked', NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - }, - "hash": "5137159db7d3ff456e368e6246b07554ce738a2d7005472e7e76a64a8fbd57ad" -} diff --git a/core/lib/dal/.sqlx/query-05b0050aa9d2944542abbcef31af3fe8d35800340d1c6e9d02c15226b699c93b.json b/core/lib/dal/.sqlx/query-5250341acd42582e41570b6d7e380ae6c8a26f425429116a62892be84c2ff9fb.json similarity index 91% rename from core/lib/dal/.sqlx/query-05b0050aa9d2944542abbcef31af3fe8d35800340d1c6e9d02c15226b699c93b.json rename to core/lib/dal/.sqlx/query-5250341acd42582e41570b6d7e380ae6c8a26f425429116a62892be84c2ff9fb.json index b577e7535eb0..93d522f5fb73 100644 --- a/core/lib/dal/.sqlx/query-05b0050aa9d2944542abbcef31af3fe8d35800340d1c6e9d02c15226b699c93b.json +++ b/core/lib/dal/.sqlx/query-5250341acd42582e41570b6d7e380ae6c8a26f425429116a62892be84c2ff9fb.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n eth_commit_tx_id IS NOT NULL\n AND eth_prove_tx_id IS NULL\n ORDER BY\n number\n LIMIT\n $1\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n eth_commit_tx_id IS NOT NULL\n AND eth_prove_tx_id IS NULL\n ORDER BY\n number\n LIMIT\n $1\n ", "describe": { "columns": [ { @@ -168,5 +168,5 @@ true ] }, - "hash": "05b0050aa9d2944542abbcef31af3fe8d35800340d1c6e9d02c15226b699c93b" + "hash": "5250341acd42582e41570b6d7e380ae6c8a26f425429116a62892be84c2ff9fb" } diff --git a/core/lib/dal/.sqlx/query-8903ba5db3f87851c12da133573b4207b69cc48b4ba648e797211631be612b69.json b/core/lib/dal/.sqlx/query-5730de5e37535cf126667b89da6e3a2976d6c4fd581e66dd27439ae42a04b7f5.json similarity index 66% rename from core/lib/dal/.sqlx/query-8903ba5db3f87851c12da133573b4207b69cc48b4ba648e797211631be612b69.json rename to core/lib/dal/.sqlx/query-5730de5e37535cf126667b89da6e3a2976d6c4fd581e66dd27439ae42a04b7f5.json index 3d47a756f3e6..275191d04f54 100644 --- a/core/lib/dal/.sqlx/query-8903ba5db3f87851c12da133573b4207b69cc48b4ba648e797211631be612b69.json +++ b/core/lib/dal/.sqlx/query-5730de5e37535cf126667b89da6e3a2976d6c4fd581e66dd27439ae42a04b7f5.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n bytecode_hash,\n bytecode\n FROM\n factory_deps\n INNER JOIN miniblocks ON miniblocks.number = factory_deps.miniblock_number\n WHERE\n miniblocks.l1_batch_number = $1\n ", + "query": "\n SELECT\n bytecode_hash,\n bytecode\n FROM\n factory_deps\n INNER JOIN miniblocks ON miniblocks.number = factory_deps.miniblock_number\n WHERE\n miniblocks.l1_batch_number = $1\n ", "describe": { "columns": [ { @@ -24,5 +24,5 @@ false ] }, - "hash": "8903ba5db3f87851c12da133573b4207b69cc48b4ba648e797211631be612b69" + "hash": "5730de5e37535cf126667b89da6e3a2976d6c4fd581e66dd27439ae42a04b7f5" } diff --git a/core/lib/dal/.sqlx/query-57851c16dce02999bf386e549791b74555863b0cc8281ef2e9c830fa1d38e227.json b/core/lib/dal/.sqlx/query-57851c16dce02999bf386e549791b74555863b0cc8281ef2e9c830fa1d38e227.json new file mode 100644 index 000000000000..f08a75e5800f --- /dev/null +++ b/core/lib/dal/.sqlx/query-57851c16dce02999bf386e549791b74555863b0cc8281ef2e9c830fa1d38e227.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n tee_proof_generation_details (\n l1_batch_number, tee_type, status, created_at, updated_at\n )\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ON CONFLICT (l1_batch_number, tee_type) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "57851c16dce02999bf386e549791b74555863b0cc8281ef2e9c830fa1d38e227" +} diff --git a/core/lib/dal/.sqlx/query-2d862097cfae49a1fb28ec0a05176085385c3a79d72f49669b4215a9454323c2.json b/core/lib/dal/.sqlx/query-5b25851e01f30307391412ced12ee7053fe3ba7ec852cfb43b249eed9af8209b.json similarity index 58% rename from core/lib/dal/.sqlx/query-2d862097cfae49a1fb28ec0a05176085385c3a79d72f49669b4215a9454323c2.json rename to core/lib/dal/.sqlx/query-5b25851e01f30307391412ced12ee7053fe3ba7ec852cfb43b249eed9af8209b.json index e08f0c855175..02b638851db4 100644 --- a/core/lib/dal/.sqlx/query-2d862097cfae49a1fb28ec0a05176085385c3a79d72f49669b4215a9454323c2.json +++ b/core/lib/dal/.sqlx/query-5b25851e01f30307391412ced12ee7053fe3ba7ec852cfb43b249eed9af8209b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n INDEX\n FROM\n initial_writes\n WHERE\n l1_batch_number <= $1\n ORDER BY\n l1_batch_number DESC,\n INDEX DESC\n LIMIT\n 1;\n ", + "query": "\n SELECT\n INDEX\n FROM\n INITIAL_WRITES\n WHERE\n L1_BATCH_NUMBER <= $1\n ORDER BY\n L1_BATCH_NUMBER DESC,\n INDEX DESC\n LIMIT\n 1;\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "2d862097cfae49a1fb28ec0a05176085385c3a79d72f49669b4215a9454323c2" + "hash": "5b25851e01f30307391412ced12ee7053fe3ba7ec852cfb43b249eed9af8209b" } diff --git a/core/lib/dal/.sqlx/query-5dba5f8b178decfd77db0ca4f415e94ad6bdd84c31e4b2e0c629e51857533974.json b/core/lib/dal/.sqlx/query-5dba5f8b178decfd77db0ca4f415e94ad6bdd84c31e4b2e0c629e51857533974.json new file mode 100644 index 000000000000..c2d9fe2e1ac5 --- /dev/null +++ b/core/lib/dal/.sqlx/query-5dba5f8b178decfd77db0ca4f415e94ad6bdd84c31e4b2e0c629e51857533974.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n available_batches AS (\n SELECT\n MAX(number) AS \"last_batch\"\n FROM\n l1_batches\n ),\n \n processed_batches AS (\n SELECT\n COALESCE(MAX(l1_batch_number), $1) + $2 AS \"last_ready_batch\"\n FROM\n vm_runner_bwip\n WHERE\n time_taken IS NOT NULL\n )\n \n SELECT\n LEAST(last_batch, last_ready_batch) AS \"last_ready_batch!\"\n FROM\n available_batches\n FULL JOIN processed_batches ON TRUE\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "last_ready_batch!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [ + true + ] + }, + "hash": "5dba5f8b178decfd77db0ca4f415e94ad6bdd84c31e4b2e0c629e51857533974" +} diff --git a/core/lib/dal/.sqlx/query-5d1f588b2b652105b4452be1cc6c7573fe040d47d17d9bd4e2a2b6d3131a4f9c.json b/core/lib/dal/.sqlx/query-6083e429948c139e36cfce2c5ed41edf3965f7ce67341d957ec680a18a0c39ea.json similarity index 57% rename from core/lib/dal/.sqlx/query-5d1f588b2b652105b4452be1cc6c7573fe040d47d17d9bd4e2a2b6d3131a4f9c.json rename to core/lib/dal/.sqlx/query-6083e429948c139e36cfce2c5ed41edf3965f7ce67341d957ec680a18a0c39ea.json index 8d566e0c6cf2..c6760a336dc6 100644 --- a/core/lib/dal/.sqlx/query-5d1f588b2b652105b4452be1cc6c7573fe040d47d17d9bd4e2a2b6d3131a4f9c.json +++ b/core/lib/dal/.sqlx/query-6083e429948c139e36cfce2c5ed41edf3965f7ce67341d957ec680a18a0c39ea.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n l1_batch_number = $3,\n l1_batch_tx_index = data_table.l1_batch_tx_index,\n updated_at = NOW()\n FROM\n (\n SELECT\n UNNEST($1::INT[]) AS l1_batch_tx_index,\n UNNEST($2::bytea[]) AS hash\n ) AS data_table\n WHERE\n transactions.hash = data_table.hash\n ", + "query": "\n UPDATE transactions\n SET\n l1_batch_number = $3,\n l1_batch_tx_index = data_table.l1_batch_tx_index,\n updated_at = NOW()\n FROM\n (\n SELECT\n UNNEST($1::INT []) AS l1_batch_tx_index,\n UNNEST($2::BYTEA []) AS hash\n ) AS data_table\n WHERE\n transactions.hash = data_table.hash\n ", "describe": { "columns": [], "parameters": { @@ -12,5 +12,5 @@ }, "nullable": [] }, - "hash": "5d1f588b2b652105b4452be1cc6c7573fe040d47d17d9bd4e2a2b6d3131a4f9c" + "hash": "6083e429948c139e36cfce2c5ed41edf3965f7ce67341d957ec680a18a0c39ea" } diff --git a/core/lib/dal/.sqlx/query-52bb6de515e1edf4dcf34a31600edb31cfd855014dfca5041833b9d5d9f7a55e.json b/core/lib/dal/.sqlx/query-60e68195b375775fc8bc293f6a053681759272f74c47836d34e0ee6de1f639f7.json similarity index 94% rename from core/lib/dal/.sqlx/query-52bb6de515e1edf4dcf34a31600edb31cfd855014dfca5041833b9d5d9f7a55e.json rename to core/lib/dal/.sqlx/query-60e68195b375775fc8bc293f6a053681759272f74c47836d34e0ee6de1f639f7.json index b872e2ce6297..a9eae0bd01dc 100644 --- a/core/lib/dal/.sqlx/query-52bb6de515e1edf4dcf34a31600edb31cfd855014dfca5041833b9d5d9f7a55e.json +++ b/core/lib/dal/.sqlx/query-60e68195b375775fc8bc293f6a053681759272f74c47836d34e0ee6de1f639f7.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n system_logs,\n compressed_state_diffs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number = $1\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n system_logs,\n compressed_state_diffs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number = $1\n ", "describe": { "columns": [ { @@ -168,5 +168,5 @@ true ] }, - "hash": "52bb6de515e1edf4dcf34a31600edb31cfd855014dfca5041833b9d5d9f7a55e" + "hash": "60e68195b375775fc8bc293f6a053681759272f74c47836d34e0ee6de1f639f7" } diff --git a/core/lib/dal/.sqlx/query-6179c3c1a0b2aeb01c0527f6ca4d0651174fd63cf6a8950fa6e7c4838ac5abbf.json b/core/lib/dal/.sqlx/query-6179c3c1a0b2aeb01c0527f6ca4d0651174fd63cf6a8950fa6e7c4838ac5abbf.json deleted file mode 100644 index 443dbf36ea16..000000000000 --- a/core/lib/dal/.sqlx/query-6179c3c1a0b2aeb01c0527f6ca4d0651174fd63cf6a8950fa6e7c4838ac5abbf.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n pruning_log (\n pruned_l1_batch,\n pruned_miniblock,\n TYPE,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int8", - { - "Custom": { - "name": "prune_type", - "kind": { - "Enum": [ - "Soft", - "Hard" - ] - } - } - } - ] - }, - "nullable": [] - }, - "hash": "6179c3c1a0b2aeb01c0527f6ca4d0651174fd63cf6a8950fa6e7c4838ac5abbf" -} diff --git a/core/lib/dal/.sqlx/query-718d29517c100ad9d258a7ee90c48449c1c4bed4d0236fcedc177c9478e72262.json b/core/lib/dal/.sqlx/query-6307b42717586a13ac8bc30fc3e5aea6710351dea1f1e57d73447476c3fcd199.json similarity index 57% rename from core/lib/dal/.sqlx/query-718d29517c100ad9d258a7ee90c48449c1c4bed4d0236fcedc177c9478e72262.json rename to core/lib/dal/.sqlx/query-6307b42717586a13ac8bc30fc3e5aea6710351dea1f1e57d73447476c3fcd199.json index 4e523efe3fc8..01ede1d8643a 100644 --- a/core/lib/dal/.sqlx/query-718d29517c100ad9d258a7ee90c48449c1c4bed4d0236fcedc177c9478e72262.json +++ b/core/lib/dal/.sqlx/query-6307b42717586a13ac8bc30fc3e5aea6710351dea1f1e57d73447476c3fcd199.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n tee_verifier_input_producer_jobs (l1_batch_number, status, created_at, updated_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "query": "\n INSERT INTO\n tee_verifier_input_producer_jobs (\n l1_batch_number, status, created_at, updated_at\n )\n VALUES\n ($1, $2, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", "describe": { "columns": [], "parameters": { @@ -24,5 +24,5 @@ }, "nullable": [] }, - "hash": "718d29517c100ad9d258a7ee90c48449c1c4bed4d0236fcedc177c9478e72262" + "hash": "6307b42717586a13ac8bc30fc3e5aea6710351dea1f1e57d73447476c3fcd199" } diff --git a/core/lib/dal/.sqlx/query-66510caa7683ed90729cb545ac8528f012c2ecaebf6622ca1ae481045604e58d.json b/core/lib/dal/.sqlx/query-66510caa7683ed90729cb545ac8528f012c2ecaebf6622ca1ae481045604e58d.json deleted file mode 100644 index 76900667a9c9..000000000000 --- a/core/lib/dal/.sqlx/query-66510caa7683ed90729cb545ac8528f012c2ecaebf6622ca1ae481045604e58d.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n snapshot_recovery (\n l1_batch_number,\n l1_batch_timestamp,\n l1_batch_root_hash,\n miniblock_number,\n miniblock_timestamp,\n miniblock_hash,\n protocol_version,\n storage_logs_chunks_processed,\n updated_at,\n created_at\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, NOW(), NOW())\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int8", - "Bytea", - "Int8", - "Int8", - "Bytea", - "Int4", - "BoolArray" - ] - }, - "nullable": [] - }, - "hash": "66510caa7683ed90729cb545ac8528f012c2ecaebf6622ca1ae481045604e58d" -} diff --git a/core/lib/dal/.sqlx/query-66b3f476cf4487239190175d2940fd5e1330393d8b04c7cf03b8c7ab2edad5d1.json b/core/lib/dal/.sqlx/query-66b3f476cf4487239190175d2940fd5e1330393d8b04c7cf03b8c7ab2edad5d1.json deleted file mode 100644 index 0cf4a1e32005..000000000000 --- a/core/lib/dal/.sqlx/query-66b3f476cf4487239190175d2940fd5e1330393d8b04c7cf03b8c7ab2edad5d1.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n upgrade_id,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n miniblock_number,\n index_in_block,\n error,\n execution_info,\n refunded_gas,\n effective_gas_price,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n TRUE,\n data_table.initiator_address,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.data,\n data_table.upgrade_id,\n data_table.contract_address,\n data_table.l1_block_number,\n data_table.value,\n '\\x0000000000000000000000000000000000000000'::bytea,\n '\\x'::bytea,\n data_table.tx_format,\n data_table.l1_tx_mint,\n data_table.l1_tx_refund_recipient,\n $19,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.execution_info,\n data_table.refunded_gas,\n data_table.effective_gas_price,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::BYTEA[]) AS hash,\n UNNEST($2::BYTEA[]) AS initiator_address,\n UNNEST($3::NUMERIC[]) AS gas_limit,\n UNNEST($4::NUMERIC[]) AS max_fee_per_gas,\n UNNEST($5::NUMERIC[]) AS gas_per_pubdata_limit,\n UNNEST($6::JSONB[]) AS data,\n UNNEST($7::INT[]) AS upgrade_id,\n UNNEST($8::BYTEA[]) AS contract_address,\n UNNEST($9::INT[]) AS l1_block_number,\n UNNEST($10::NUMERIC[]) AS value,\n UNNEST($11::INTEGER[]) AS tx_format,\n UNNEST($12::NUMERIC[]) AS l1_tx_mint,\n UNNEST($13::BYTEA[]) AS l1_tx_refund_recipient,\n UNNEST($14::INT[]) AS index_in_block,\n UNNEST($15::VARCHAR[]) AS error,\n UNNEST($16::JSONB[]) AS execution_info,\n UNNEST($17::BIGINT[]) AS refunded_gas,\n UNNEST($18::NUMERIC[]) AS effective_gas_price\n ) AS data_table\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray", - "NumericArray", - "NumericArray", - "NumericArray", - "JsonbArray", - "Int4Array", - "ByteaArray", - "Int4Array", - "NumericArray", - "Int4Array", - "NumericArray", - "ByteaArray", - "Int4Array", - "VarcharArray", - "JsonbArray", - "Int8Array", - "NumericArray", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "66b3f476cf4487239190175d2940fd5e1330393d8b04c7cf03b8c7ab2edad5d1" -} diff --git a/core/lib/dal/.sqlx/query-68327709a740a09b198770ec1746bd6ec3a1cd9db6187e99af40ca8fea4c6ace.json b/core/lib/dal/.sqlx/query-68327709a740a09b198770ec1746bd6ec3a1cd9db6187e99af40ca8fea4c6ace.json new file mode 100644 index 000000000000..5d34e780b68f --- /dev/null +++ b/core/lib/dal/.sqlx/query-68327709a740a09b198770ec1746bd6ec3a1cd9db6187e99af40ca8fea4c6ace.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT DISTINCT\n ON (hashed_key)\n hashed_key,\n miniblock_number,\n value\n FROM\n storage_logs\n WHERE\n hashed_key = ANY($1)\n AND miniblock_number <= $2\n AND miniblock_number <= COALESCE(\n (\n SELECT\n MAX(number)\n FROM\n miniblocks\n ),\n (\n SELECT\n miniblock_number\n FROM\n snapshot_recovery\n )\n )\n ORDER BY\n hashed_key,\n miniblock_number DESC,\n operation_number DESC\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "hashed_key", + "type_info": "Bytea" + }, + { + "ordinal": 1, + "name": "miniblock_number", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "value", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "ByteaArray", + "Int8" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "68327709a740a09b198770ec1746bd6ec3a1cd9db6187e99af40ca8fea4c6ace" +} diff --git a/core/lib/dal/.sqlx/query-b42fc86726ac40d0ca38640884da192a143f6a7501b7da65bb7df40a0a4ead70.json b/core/lib/dal/.sqlx/query-6da05c9ac3d0f30b856177e28d28aaad910ca46830c470f8fc1d4265f9ed8631.json similarity index 76% rename from core/lib/dal/.sqlx/query-b42fc86726ac40d0ca38640884da192a143f6a7501b7da65bb7df40a0a4ead70.json rename to core/lib/dal/.sqlx/query-6da05c9ac3d0f30b856177e28d28aaad910ca46830c470f8fc1d4265f9ed8631.json index 625fa4ab36e6..b246c1e9f3a5 100644 --- a/core/lib/dal/.sqlx/query-b42fc86726ac40d0ca38640884da192a143f6a7501b7da65bb7df40a0a4ead70.json +++ b/core/lib/dal/.sqlx/query-6da05c9ac3d0f30b856177e28d28aaad910ca46830c470f8fc1d4265f9ed8631.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM snapshots\n WHERE\n l1_batch_number > $1\n RETURNING\n VERSION,\n l1_batch_number,\n factory_deps_filepath,\n storage_logs_filepaths\n ", + "query": "\n DELETE FROM snapshots\n WHERE\n l1_batch_number > $1\n RETURNING\n version,\n l1_batch_number,\n factory_deps_filepath,\n storage_logs_filepaths\n ", "describe": { "columns": [ { @@ -36,5 +36,5 @@ false ] }, - "hash": "b42fc86726ac40d0ca38640884da192a143f6a7501b7da65bb7df40a0a4ead70" + "hash": "6da05c9ac3d0f30b856177e28d28aaad910ca46830c470f8fc1d4265f9ed8631" } diff --git a/core/lib/dal/.sqlx/query-6e725f38a8f04ca5516ba3128569973527841e234d8b4635fb337e4b659b7f71.json b/core/lib/dal/.sqlx/query-6e725f38a8f04ca5516ba3128569973527841e234d8b4635fb337e4b659b7f71.json new file mode 100644 index 000000000000..3a773579b240 --- /dev/null +++ b/core/lib/dal/.sqlx/query-6e725f38a8f04ca5516ba3128569973527841e234d8b4635fb337e4b659b7f71.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n tee_attestations (pubkey, attestation)\n VALUES\n ($1, $2)\n ON CONFLICT (pubkey) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "6e725f38a8f04ca5516ba3128569973527841e234d8b4635fb337e4b659b7f71" +} diff --git a/core/lib/dal/.sqlx/query-6e3a3ef443ce8aab55b10eea55f9c8ff11775885aebaf457075c6825305244e5.json b/core/lib/dal/.sqlx/query-6f4463a2f95fec4f8b511d28566babfb146e9932d4142139a49599c4bdbd659f.json similarity index 68% rename from core/lib/dal/.sqlx/query-6e3a3ef443ce8aab55b10eea55f9c8ff11775885aebaf457075c6825305244e5.json rename to core/lib/dal/.sqlx/query-6f4463a2f95fec4f8b511d28566babfb146e9932d4142139a49599c4bdbd659f.json index de474897307a..ef514ba7905b 100644 --- a/core/lib/dal/.sqlx/query-6e3a3ef443ce8aab55b10eea55f9c8ff11775885aebaf457075c6825305244e5.json +++ b/core/lib/dal/.sqlx/query-6f4463a2f95fec4f8b511d28566babfb146e9932d4142139a49599c4bdbd659f.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n transactions.is_priority,\n transactions.initiator_address,\n transactions.gas_limit,\n transactions.gas_per_pubdata_limit,\n transactions.received_at,\n miniblocks.number AS \"miniblock_number?\",\n transactions.error,\n transactions.effective_gas_price,\n transactions.refunded_gas,\n commit_tx.tx_hash AS \"eth_commit_tx_hash?\",\n prove_tx.tx_hash AS \"eth_prove_tx_hash?\",\n execute_tx.tx_hash AS \"eth_execute_tx_hash?\"\n FROM\n transactions\n LEFT JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number\n LEFT JOIN eth_txs_history AS commit_tx ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n transactions.hash = $1\n AND transactions.data != '{}'::jsonb\n ", + "query": "\n SELECT\n transactions.is_priority,\n transactions.initiator_address,\n transactions.gas_limit,\n transactions.gas_per_pubdata_limit,\n transactions.received_at,\n miniblocks.number AS \"miniblock_number?\",\n transactions.error,\n transactions.effective_gas_price,\n transactions.refunded_gas,\n commit_tx.tx_hash AS \"eth_commit_tx_hash?\",\n prove_tx.tx_hash AS \"eth_prove_tx_hash?\",\n execute_tx.tx_hash AS \"eth_execute_tx_hash?\"\n FROM\n transactions\n LEFT JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n transactions.hash = $1\n AND transactions.data != '{}'::jsonb\n ", "describe": { "columns": [ { @@ -84,5 +84,5 @@ false ] }, - "hash": "6e3a3ef443ce8aab55b10eea55f9c8ff11775885aebaf457075c6825305244e5" + "hash": "6f4463a2f95fec4f8b511d28566babfb146e9932d4142139a49599c4bdbd659f" } diff --git a/core/lib/dal/.sqlx/query-7204d08f6fb83c83c09eb2942ecb671fa559dfdb29b315b17ae2f86533d247e9.json b/core/lib/dal/.sqlx/query-7204d08f6fb83c83c09eb2942ecb671fa559dfdb29b315b17ae2f86533d247e9.json new file mode 100644 index 000000000000..01adb17775c3 --- /dev/null +++ b/core/lib/dal/.sqlx/query-7204d08f6fb83c83c09eb2942ecb671fa559dfdb29b315b17ae2f86533d247e9.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n protocol_patches (minor, patch, snark_wrapper_vk_hash, created_at)\n VALUES\n ($1, $2, $3, NOW())\n ON CONFLICT DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "7204d08f6fb83c83c09eb2942ecb671fa559dfdb29b315b17ae2f86533d247e9" +} diff --git a/core/lib/dal/.sqlx/query-6171f2d631f69dba52cd913742a46bd1b7b9269375f11f050099cb6d3c1427aa.json b/core/lib/dal/.sqlx/query-7235e50f9ce4b5c4f6f8325117eaccc7108538405743fe1ad71451d0f1842561.json similarity index 67% rename from core/lib/dal/.sqlx/query-6171f2d631f69dba52cd913742a46bd1b7b9269375f11f050099cb6d3c1427aa.json rename to core/lib/dal/.sqlx/query-7235e50f9ce4b5c4f6f8325117eaccc7108538405743fe1ad71451d0f1842561.json index 84ff845b0d01..f46674b08bc6 100644 --- a/core/lib/dal/.sqlx/query-6171f2d631f69dba52cd913742a46bd1b7b9269375f11f050099cb6d3c1427aa.json +++ b/core/lib/dal/.sqlx/query-7235e50f9ce4b5c4f6f8325117eaccc7108538405743fe1ad71451d0f1842561.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n transactions.hash AS tx_hash,\n transactions.index_in_block AS tx_index_in_block,\n call_trace\n FROM\n call_traces\n INNER JOIN transactions ON tx_hash = transactions.hash\n WHERE\n transactions.miniblock_number = $1\n ORDER BY\n transactions.index_in_block\n ", + "query": "\n SELECT\n transactions.hash AS tx_hash,\n transactions.index_in_block AS tx_index_in_block,\n call_trace\n FROM\n call_traces\n INNER JOIN transactions ON tx_hash = transactions.hash\n WHERE\n transactions.miniblock_number = $1\n ORDER BY\n transactions.index_in_block\n ", "describe": { "columns": [ { @@ -30,5 +30,5 @@ false ] }, - "hash": "6171f2d631f69dba52cd913742a46bd1b7b9269375f11f050099cb6d3c1427aa" + "hash": "7235e50f9ce4b5c4f6f8325117eaccc7108538405743fe1ad71451d0f1842561" } diff --git a/core/lib/dal/.sqlx/query-dac29d7eb16782713acb7aa68aaa8b12b67678e983dc2570be28fe9b1e016c28.json b/core/lib/dal/.sqlx/query-7f3ca3f1d0b3414575e71af98b810ff145ac2f388a246b9c7b32193e2d4208dd.json similarity index 62% rename from core/lib/dal/.sqlx/query-dac29d7eb16782713acb7aa68aaa8b12b67678e983dc2570be28fe9b1e016c28.json rename to core/lib/dal/.sqlx/query-7f3ca3f1d0b3414575e71af98b810ff145ac2f388a246b9c7b32193e2d4208dd.json index c0258c12311b..830e43b00ed3 100644 --- a/core/lib/dal/.sqlx/query-dac29d7eb16782713acb7aa68aaa8b12b67678e983dc2570be28fe9b1e016c28.json +++ b/core/lib/dal/.sqlx/query-7f3ca3f1d0b3414575e71af98b810ff145ac2f388a246b9c7b32193e2d4208dd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM call_traces\n WHERE\n tx_hash = ANY ($1)\n ", + "query": "\n DELETE FROM call_traces\n WHERE\n tx_hash = ANY($1)\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "dac29d7eb16782713acb7aa68aaa8b12b67678e983dc2570be28fe9b1e016c28" + "hash": "7f3ca3f1d0b3414575e71af98b810ff145ac2f388a246b9c7b32193e2d4208dd" } diff --git a/core/lib/dal/.sqlx/query-a71a87d91dcf0f624dbd64eb8828f65ff83204ebab2ea31847ae305a098823b0.json b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json similarity index 83% rename from core/lib/dal/.sqlx/query-a71a87d91dcf0f624dbd64eb8828f65ff83204ebab2ea31847ae305a098823b0.json rename to core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json index 272f20e5268a..c2e662ef376e 100644 --- a/core/lib/dal/.sqlx/query-a71a87d91dcf0f624dbd64eb8828f65ff83204ebab2ea31847ae305a098823b0.json +++ b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n *\n FROM\n eth_txs\n WHERE\n from_addr IS NOT DISTINCT FROM $1 -- can't just use equality as NULL != NULL\n AND confirmed_eth_tx_history_id IS NULL\n AND is_gateway = $2\n AND id <= (\n SELECT\n COALESCE(MAX(eth_tx_id), 0)\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NOT NULL\n AND eth_txs.from_addr IS NOT DISTINCT FROM $1\n AND is_gateway = $2\n )\n ORDER BY\n id\n ", + "query": "\n SELECT\n *\n FROM\n eth_txs\n WHERE\n from_addr IS NOT DISTINCT FROM $1 -- can't just use equality as NULL != NULL\n AND confirmed_eth_tx_history_id IS NULL\n AND is_gateway = $2\n AND id <= (\n SELECT\n COALESCE(MAX(eth_tx_id), 0)\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NOT NULL\n AND eth_txs.from_addr IS NOT DISTINCT FROM $1\n AND is_gateway = $2\n )\n ORDER BY\n id\n ", "describe": { "columns": [ { @@ -109,5 +109,5 @@ true ] }, - "hash": "a71a87d91dcf0f624dbd64eb8828f65ff83204ebab2ea31847ae305a098823b0" + "hash": "868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057" } diff --git a/core/lib/dal/.sqlx/query-cb0a9f6137fb6bee5d17d644714b3b22ea2cd184932fcd59f5931239c7a78003.json b/core/lib/dal/.sqlx/query-87e968b1ef6b95203b5d1e41ddf73be52d97128642d8528535975f8dea798e6c.json similarity index 85% rename from core/lib/dal/.sqlx/query-cb0a9f6137fb6bee5d17d644714b3b22ea2cd184932fcd59f5931239c7a78003.json rename to core/lib/dal/.sqlx/query-87e968b1ef6b95203b5d1e41ddf73be52d97128642d8528535975f8dea798e6c.json index d2da8dff92c8..1211bea560b0 100644 --- a/core/lib/dal/.sqlx/query-cb0a9f6137fb6bee5d17d644714b3b22ea2cd184932fcd59f5931239c7a78003.json +++ b/core/lib/dal/.sqlx/query-87e968b1ef6b95203b5d1e41ddf73be52d97128642d8528535975f8dea798e6c.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n eth_txs_history.*,\n eth_txs.blob_sidecar\n FROM\n eth_txs_history\n LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id\n WHERE\n eth_tx_id = $1\n ORDER BY\n eth_txs_history.created_at DESC\n ", + "query": "\n SELECT\n eth_txs_history.*,\n eth_txs.blob_sidecar\n FROM\n eth_txs_history\n LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id\n WHERE\n eth_tx_id = $1\n ORDER BY\n eth_txs_history.created_at DESC\n ", "describe": { "columns": [ { @@ -90,5 +90,5 @@ true ] }, - "hash": "cb0a9f6137fb6bee5d17d644714b3b22ea2cd184932fcd59f5931239c7a78003" + "hash": "87e968b1ef6b95203b5d1e41ddf73be52d97128642d8528535975f8dea798e6c" } diff --git a/core/lib/dal/.sqlx/query-2cba440c2925631655a7f67486a5a8869da8f10738ba77e3d8e048057b0e7b12.json b/core/lib/dal/.sqlx/query-8ab1634beba74aaef952562a3bcc84b0dd496700a61569929dcc7602ec678b09.json similarity index 70% rename from core/lib/dal/.sqlx/query-2cba440c2925631655a7f67486a5a8869da8f10738ba77e3d8e048057b0e7b12.json rename to core/lib/dal/.sqlx/query-8ab1634beba74aaef952562a3bcc84b0dd496700a61569929dcc7602ec678b09.json index b01a5b41649b..5869c1d37a04 100644 --- a/core/lib/dal/.sqlx/query-2cba440c2925631655a7f67486a5a8869da8f10738ba77e3d8e048057b0e7b12.json +++ b/core/lib/dal/.sqlx/query-8ab1634beba74aaef952562a3bcc84b0dd496700a61569929dcc7602ec678b09.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n factory_deps.bytecode,\n transactions.data AS \"data?\",\n transactions.contract_address AS \"contract_address?\"\n FROM\n (\n SELECT\n miniblock_number,\n tx_hash,\n topic3\n FROM\n events\n WHERE\n address = $1\n AND topic1 = $2\n AND topic4 = $3\n LIMIT\n 1\n ) deploy_event\n JOIN factory_deps ON factory_deps.bytecode_hash = deploy_event.topic3\n LEFT JOIN transactions ON transactions.hash = deploy_event.tx_hash\n WHERE\n deploy_event.miniblock_number <= (\n SELECT\n MAX(number)\n FROM\n miniblocks\n )\n ", + "query": "\n SELECT\n factory_deps.bytecode,\n transactions.data AS \"data?\",\n transactions.contract_address AS \"contract_address?\"\n FROM\n (\n SELECT\n miniblock_number,\n tx_hash,\n topic3\n FROM\n events\n WHERE\n address = $1\n AND topic1 = $2\n AND topic4 = $3\n LIMIT\n 1\n ) deploy_event\n JOIN factory_deps ON factory_deps.bytecode_hash = deploy_event.topic3\n LEFT JOIN transactions ON transactions.hash = deploy_event.tx_hash\n WHERE\n deploy_event.miniblock_number <= (\n SELECT\n MAX(number)\n FROM\n miniblocks\n )\n ", "describe": { "columns": [ { @@ -32,5 +32,5 @@ true ] }, - "hash": "2cba440c2925631655a7f67486a5a8869da8f10738ba77e3d8e048057b0e7b12" + "hash": "8ab1634beba74aaef952562a3bcc84b0dd496700a61569929dcc7602ec678b09" } diff --git a/core/lib/dal/.sqlx/query-526a8e1c231e99faadd5dbbe9c49ed811faffcc108d04b59fdec5a0ab9d13fa3.json b/core/lib/dal/.sqlx/query-8dd9596258c4e9eeb9178b32ffefaf767e790a54957218de908c7144658b4681.json similarity index 83% rename from core/lib/dal/.sqlx/query-526a8e1c231e99faadd5dbbe9c49ed811faffcc108d04b59fdec5a0ab9d13fa3.json rename to core/lib/dal/.sqlx/query-8dd9596258c4e9eeb9178b32ffefaf767e790a54957218de908c7144658b4681.json index dbdec4ac5d65..151d2ece97f4 100644 --- a/core/lib/dal/.sqlx/query-526a8e1c231e99faadd5dbbe9c49ed811faffcc108d04b59fdec5a0ab9d13fa3.json +++ b/core/lib/dal/.sqlx/query-8dd9596258c4e9eeb9178b32ffefaf767e790a54957218de908c7144658b4681.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n address,\n topic1,\n topic2,\n topic3,\n topic4,\n value,\n NULL::bytea AS \"block_hash\",\n NULL::BIGINT AS \"l1_batch_number?\",\n miniblock_number,\n tx_hash,\n tx_index_in_block,\n event_index_in_block,\n event_index_in_tx,\n NULL::BIGINT AS \"block_timestamp?\"\n FROM\n events\n WHERE\n tx_hash = ANY ($1)\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n ", + "query": "\n SELECT\n address,\n topic1,\n topic2,\n topic3,\n topic4,\n value,\n NULL::bytea AS \"block_hash\",\n NULL::bigint AS \"l1_batch_number?\",\n miniblock_number,\n tx_hash,\n tx_index_in_block,\n event_index_in_block,\n event_index_in_tx,\n NULL::bigint AS \"block_timestamp?\"\n FROM\n events\n WHERE\n tx_hash = ANY($1)\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n ", "describe": { "columns": [ { @@ -96,5 +96,5 @@ null ] }, - "hash": "526a8e1c231e99faadd5dbbe9c49ed811faffcc108d04b59fdec5a0ab9d13fa3" + "hash": "8dd9596258c4e9eeb9178b32ffefaf767e790a54957218de908c7144658b4681" } diff --git a/core/lib/dal/.sqlx/query-41c9f45d6eb727aafad0d8c18024cee5c602d275bb812022cc8fdabf0a60e151.json b/core/lib/dal/.sqlx/query-8de8fd9aa54e2285a14daf95af18c5de2c9f8f3cf22d0f1145ae67879039e28d.json similarity index 77% rename from core/lib/dal/.sqlx/query-41c9f45d6eb727aafad0d8c18024cee5c602d275bb812022cc8fdabf0a60e151.json rename to core/lib/dal/.sqlx/query-8de8fd9aa54e2285a14daf95af18c5de2c9f8f3cf22d0f1145ae67879039e28d.json index 8c51c26131bd..36ecf511a9ae 100644 --- a/core/lib/dal/.sqlx/query-41c9f45d6eb727aafad0d8c18024cee5c602d275bb812022cc8fdabf0a60e151.json +++ b/core/lib/dal/.sqlx/query-8de8fd9aa54e2285a14daf95af18c5de2c9f8f3cf22d0f1145ae67879039e28d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n eth_txs_history.id,\n eth_txs_history.eth_tx_id,\n eth_txs_history.tx_hash,\n eth_txs_history.base_fee_per_gas,\n eth_txs_history.priority_fee_per_gas,\n eth_txs_history.signed_raw_tx,\n eth_txs.nonce\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NULL\n AND eth_txs.confirmed_eth_tx_history_id IS NULL\n ORDER BY\n eth_txs_history.id DESC\n ", + "query": "\n SELECT\n eth_txs_history.id,\n eth_txs_history.eth_tx_id,\n eth_txs_history.tx_hash,\n eth_txs_history.base_fee_per_gas,\n eth_txs_history.priority_fee_per_gas,\n eth_txs_history.signed_raw_tx,\n eth_txs.nonce\n FROM\n eth_txs_history\n JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id\n WHERE\n eth_txs_history.sent_at_block IS NULL\n AND eth_txs.confirmed_eth_tx_history_id IS NULL\n ORDER BY\n eth_txs_history.id DESC\n ", "describe": { "columns": [ { @@ -52,5 +52,5 @@ false ] }, - "hash": "41c9f45d6eb727aafad0d8c18024cee5c602d275bb812022cc8fdabf0a60e151" + "hash": "8de8fd9aa54e2285a14daf95af18c5de2c9f8f3cf22d0f1145ae67879039e28d" } diff --git a/core/lib/dal/.sqlx/query-928139bf23bd0d57b8dbdb3283b139300ad3b80ac9e70c00864c3d9f6521b028.json b/core/lib/dal/.sqlx/query-928139bf23bd0d57b8dbdb3283b139300ad3b80ac9e70c00864c3d9f6521b028.json deleted file mode 100644 index e192763b189b..000000000000 --- a/core/lib/dal/.sqlx/query-928139bf23bd0d57b8dbdb3283b139300ad3b80ac9e70c00864c3d9f6521b028.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN data_availability ON data_availability.l1_batch_number = l1_batches.number\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND data_availability.blob_id IS NULL\n AND pubdata_input IS NOT NULL\n ORDER BY\n number\n LIMIT\n $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "pubdata_input", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - true - ] - }, - "hash": "928139bf23bd0d57b8dbdb3283b139300ad3b80ac9e70c00864c3d9f6521b028" -} diff --git a/core/lib/dal/.sqlx/query-2486f8404e8cfcb9c178acd6dccae32e8812becbe5ce85e63694385f015f2cfe.json b/core/lib/dal/.sqlx/query-932ec4483be7ebf34579f17694f6d14963cbfc84261824e47fbab1323895371d.json similarity index 91% rename from core/lib/dal/.sqlx/query-2486f8404e8cfcb9c178acd6dccae32e8812becbe5ce85e63694385f015f2cfe.json rename to core/lib/dal/.sqlx/query-932ec4483be7ebf34579f17694f6d14963cbfc84261824e47fbab1323895371d.json index f28e3d044ccc..0b1daaa10e5f 100644 --- a/core/lib/dal/.sqlx/query-2486f8404e8cfcb9c178acd6dccae32e8812becbe5ce85e63694385f015f2cfe.json +++ b/core/lib/dal/.sqlx/query-932ec4483be7ebf34579f17694f6d14963cbfc84261824e47fbab1323895371d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number BETWEEN $1 AND $2\n ORDER BY\n number\n LIMIT\n $3\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n WHERE\n number BETWEEN $1 AND $2\n ORDER BY\n number\n LIMIT\n $3\n ", "describe": { "columns": [ { @@ -170,5 +170,5 @@ true ] }, - "hash": "2486f8404e8cfcb9c178acd6dccae32e8812becbe5ce85e63694385f015f2cfe" + "hash": "932ec4483be7ebf34579f17694f6d14963cbfc84261824e47fbab1323895371d" } diff --git a/core/lib/dal/.sqlx/query-39849c30cdfa1827d69313357f92c495462e5aa430fe135d1db1f9bad1e72156.json b/core/lib/dal/.sqlx/query-96936c827caf26f93532bab309020b623d73e1b33024023f4bce7985e58be99e.json similarity index 67% rename from core/lib/dal/.sqlx/query-39849c30cdfa1827d69313357f92c495462e5aa430fe135d1db1f9bad1e72156.json rename to core/lib/dal/.sqlx/query-96936c827caf26f93532bab309020b623d73e1b33024023f4bce7985e58be99e.json index e196502056c6..3d6663efb969 100644 --- a/core/lib/dal/.sqlx/query-39849c30cdfa1827d69313357f92c495462e5aa430fe135d1db1f9bad1e72156.json +++ b/core/lib/dal/.sqlx/query-96936c827caf26f93532bab309020b623d73e1b33024023f4bce7985e58be99e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n VERSION,\n l1_batch_number,\n factory_deps_filepath,\n storage_logs_filepaths\n FROM\n snapshots\n ORDER BY\n l1_batch_number DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n VERSION,\n L1_BATCH_NUMBER,\n FACTORY_DEPS_FILEPATH,\n STORAGE_LOGS_FILEPATHS\n FROM\n SNAPSHOTS\n ORDER BY\n L1_BATCH_NUMBER DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -34,5 +34,5 @@ false ] }, - "hash": "39849c30cdfa1827d69313357f92c495462e5aa430fe135d1db1f9bad1e72156" + "hash": "96936c827caf26f93532bab309020b623d73e1b33024023f4bce7985e58be99e" } diff --git a/core/lib/dal/.sqlx/query-bdfd7e9d4462ac9cf6f91fced84355e6aec05ba4af297a03169e3122a67ae53e.json b/core/lib/dal/.sqlx/query-96adbd0c9a5786a6cca74324353c7d8bbdbee28d4ac2a2c0a331298c5e39b71d.json similarity index 66% rename from core/lib/dal/.sqlx/query-bdfd7e9d4462ac9cf6f91fced84355e6aec05ba4af297a03169e3122a67ae53e.json rename to core/lib/dal/.sqlx/query-96adbd0c9a5786a6cca74324353c7d8bbdbee28d4ac2a2c0a331298c5e39b71d.json index 0b1f56ef9f33..3b8accb4fda2 100644 --- a/core/lib/dal/.sqlx/query-bdfd7e9d4462ac9cf6f91fced84355e6aec05ba4af297a03169e3122a67ae53e.json +++ b/core/lib/dal/.sqlx/query-96adbd0c9a5786a6cca74324353c7d8bbdbee28d4ac2a2c0a331298c5e39b71d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n protocol_version,\n index_in_block\n FROM\n transactions\n INNER JOIN miniblocks ON transactions.miniblock_number = miniblocks.number\n WHERE\n transactions.hash = $1\n ", + "query": "\n SELECT\n protocol_version,\n index_in_block\n FROM\n transactions\n INNER JOIN miniblocks ON transactions.miniblock_number = miniblocks.number\n WHERE\n transactions.hash = $1\n ", "describe": { "columns": [ { @@ -24,5 +24,5 @@ true ] }, - "hash": "bdfd7e9d4462ac9cf6f91fced84355e6aec05ba4af297a03169e3122a67ae53e" + "hash": "96adbd0c9a5786a6cca74324353c7d8bbdbee28d4ac2a2c0a331298c5e39b71d" } diff --git a/core/lib/dal/.sqlx/query-443b5c62c2c274369764ac5279d8f6f962ff3f07aa1cf7f0ffcefffccb633cdd.json b/core/lib/dal/.sqlx/query-99915c717193ff872b9cf8f5e9d1b84a6dfe1976b4ddb64cc288a846a0a7fda4.json similarity index 60% rename from core/lib/dal/.sqlx/query-443b5c62c2c274369764ac5279d8f6f962ff3f07aa1cf7f0ffcefffccb633cdd.json rename to core/lib/dal/.sqlx/query-99915c717193ff872b9cf8f5e9d1b84a6dfe1976b4ddb64cc288a846a0a7fda4.json index 3e2a8752dd2c..4fe387aaa5b0 100644 --- a/core/lib/dal/.sqlx/query-443b5c62c2c274369764ac5279d8f6f962ff3f07aa1cf7f0ffcefffccb633cdd.json +++ b/core/lib/dal/.sqlx/query-99915c717193ff872b9cf8f5e9d1b84a6dfe1976b4ddb64cc288a846a0a7fda4.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n INDEX\n FROM\n initial_writes\n WHERE\n hashed_key = $1\n AND l1_batch_number <= $2\n ", + "query": "\n SELECT\n INDEX\n FROM\n INITIAL_WRITES\n WHERE\n HASHED_KEY = $1\n AND L1_BATCH_NUMBER <= $2\n ", "describe": { "columns": [ { @@ -19,5 +19,5 @@ false ] }, - "hash": "443b5c62c2c274369764ac5279d8f6f962ff3f07aa1cf7f0ffcefffccb633cdd" + "hash": "99915c717193ff872b9cf8f5e9d1b84a6dfe1976b4ddb64cc288a846a0a7fda4" } diff --git a/core/lib/dal/.sqlx/query-99c6597a6edfb8736a9f2f5a5d77ca44a1f6cb5e46bf9e5ffe38741bf61c5cc0.json b/core/lib/dal/.sqlx/query-99c6597a6edfb8736a9f2f5a5d77ca44a1f6cb5e46bf9e5ffe38741bf61c5cc0.json new file mode 100644 index 000000000000..fd8786ca92ca --- /dev/null +++ b/core/lib/dal/.sqlx/query-99c6597a6edfb8736a9f2f5a5d77ca44a1f6cb5e46bf9e5ffe38741bf61c5cc0.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n DISTINCT\n hashed_key\n FROM\n storage_logs\n WHERE\n miniblock_number BETWEEN $1 AND $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "hashed_key", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [ + false + ] + }, + "hash": "99c6597a6edfb8736a9f2f5a5d77ca44a1f6cb5e46bf9e5ffe38741bf61c5cc0" +} diff --git a/core/lib/dal/.sqlx/query-9badf9f287fd5f8a11cc855b230d23f83a260adf56000748c4b19752e2948ab5.json b/core/lib/dal/.sqlx/query-9badf9f287fd5f8a11cc855b230d23f83a260adf56000748c4b19752e2948ab5.json new file mode 100644 index 000000000000..aa120d6b8f6e --- /dev/null +++ b/core/lib/dal/.sqlx/query-9badf9f287fd5f8a11cc855b230d23f83a260adf56000748c4b19752e2948ab5.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE transactions\n SET\n hash = data_table.hash,\n signature = data_table.signature,\n gas_limit = data_table.gas_limit,\n max_fee_per_gas = data_table.max_fee_per_gas,\n max_priority_fee_per_gas = data_table.max_priority_fee_per_gas,\n gas_per_pubdata_limit = data_table.gas_per_pubdata_limit,\n input = data_table.input,\n data = data_table.data,\n tx_format = data_table.tx_format,\n miniblock_number = $21,\n index_in_block = data_table.index_in_block,\n error = NULLIF(data_table.error, ''),\n effective_gas_price = data_table.effective_gas_price,\n execution_info = data_table.new_execution_info,\n refunded_gas = data_table.refunded_gas,\n value = data_table.value,\n contract_address = data_table.contract_address,\n paymaster = data_table.paymaster,\n paymaster_input = data_table.paymaster_input,\n in_mempool = FALSE,\n updated_at = NOW()\n FROM\n (\n SELECT\n data_table_temp.*\n FROM\n (\n SELECT\n UNNEST($1::bytea []) AS initiator_address,\n UNNEST($2::int []) AS nonce,\n UNNEST($3::bytea []) AS hash,\n UNNEST($4::bytea []) AS signature,\n UNNEST($5::numeric []) AS gas_limit,\n UNNEST($6::numeric []) AS max_fee_per_gas,\n UNNEST($7::numeric []) AS max_priority_fee_per_gas,\n UNNEST($8::numeric []) AS gas_per_pubdata_limit,\n UNNEST($9::int []) AS tx_format,\n UNNEST($10::integer []) AS index_in_block,\n UNNEST($11::varchar []) AS error,\n UNNEST($12::numeric []) AS effective_gas_price,\n UNNEST($13::jsonb []) AS new_execution_info,\n UNNEST($14::bytea []) AS input,\n UNNEST($15::jsonb []) AS data,\n UNNEST($16::bigint []) AS refunded_gas,\n UNNEST($17::numeric []) AS value,\n UNNEST($18::bytea []) AS contract_address,\n UNNEST($19::bytea []) AS paymaster,\n UNNEST($20::bytea []) AS paymaster_input\n ) AS data_table_temp\n JOIN transactions\n ON\n transactions.initiator_address\n = data_table_temp.initiator_address\n AND transactions.nonce = data_table_temp.nonce\n ORDER BY\n transactions.hash\n ) AS data_table\n WHERE\n transactions.initiator_address = data_table.initiator_address\n AND transactions.nonce = data_table.nonce\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "Int4Array", + "ByteaArray", + "ByteaArray", + "NumericArray", + "NumericArray", + "NumericArray", + "NumericArray", + "Int4Array", + "Int4Array", + "VarcharArray", + "NumericArray", + "JsonbArray", + "ByteaArray", + "JsonbArray", + "Int8Array", + "NumericArray", + "ByteaArray", + "ByteaArray", + "ByteaArray", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "9badf9f287fd5f8a11cc855b230d23f83a260adf56000748c4b19752e2948ab5" +} diff --git a/core/lib/dal/.sqlx/query-9c6e1d3bd95d03ef32835dc454663f500b8358757e5a453cf0a87d5cd9620d7e.json b/core/lib/dal/.sqlx/query-9c6e1d3bd95d03ef32835dc454663f500b8358757e5a453cf0a87d5cd9620d7e.json new file mode 100644 index 000000000000..d2c999a70d4c --- /dev/null +++ b/core/lib/dal/.sqlx/query-9c6e1d3bd95d03ef32835dc454663f500b8358757e5a453cf0a87d5cd9620d7e.json @@ -0,0 +1,33 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n l1_batches (\n number,\n l1_tx_count,\n l2_tx_count,\n timestamp,\n l2_to_l1_messages,\n bloom,\n priority_ops_onchain_data,\n predicted_commit_gas_cost,\n predicted_prove_gas_cost,\n predicted_execute_gas_cost,\n initial_bootloader_heap_content,\n used_contract_hashes,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n system_logs,\n storage_refunds,\n pubdata_costs,\n pubdata_input,\n predicted_circuits_by_type,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n $19,\n $20,\n NOW(),\n NOW()\n )\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Int4", + "Int8", + "ByteaArray", + "Bytea", + "ByteaArray", + "Int8", + "Int8", + "Int8", + "Jsonb", + "Jsonb", + "Bytea", + "Bytea", + "Int4", + "ByteaArray", + "Int8Array", + "Int8Array", + "Bytea", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "9c6e1d3bd95d03ef32835dc454663f500b8358757e5a453cf0a87d5cd9620d7e" +} diff --git a/core/lib/dal/.sqlx/query-9f2c06e6b14434ac4f3b556dc97994cc05ebeb4e5aeeaee50b7c4d8baf58ca44.json b/core/lib/dal/.sqlx/query-9f2c06e6b14434ac4f3b556dc97994cc05ebeb4e5aeeaee50b7c4d8baf58ca44.json deleted file mode 100644 index 54f0d27bab26..000000000000 --- a/core/lib/dal/.sqlx/query-9f2c06e6b14434ac4f3b556dc97994cc05ebeb4e5aeeaee50b7c4d8baf58ca44.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n l1_batches (\n number,\n l1_tx_count,\n l2_tx_count,\n timestamp,\n l2_to_l1_messages,\n bloom,\n priority_ops_onchain_data,\n predicted_commit_gas_cost,\n predicted_prove_gas_cost,\n predicted_execute_gas_cost,\n initial_bootloader_heap_content,\n used_contract_hashes,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n system_logs,\n storage_refunds,\n pubdata_costs,\n pubdata_input,\n predicted_circuits_by_type,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n $19,\n $20,\n NOW(),\n NOW()\n )\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int4", - "Int8", - "ByteaArray", - "Bytea", - "ByteaArray", - "Int8", - "Int8", - "Int8", - "Jsonb", - "Jsonb", - "Bytea", - "Bytea", - "Int4", - "ByteaArray", - "Int8Array", - "Int8Array", - "Bytea", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "9f2c06e6b14434ac4f3b556dc97994cc05ebeb4e5aeeaee50b7c4d8baf58ca44" -} diff --git a/core/lib/dal/.sqlx/query-9f7b35311f0afff1be7dc489348ec87cf78f40429222b3163f3c5235c87e007f.json b/core/lib/dal/.sqlx/query-9f7b35311f0afff1be7dc489348ec87cf78f40429222b3163f3c5235c87e007f.json new file mode 100644 index 000000000000..30d66d0890b8 --- /dev/null +++ b/core/lib/dal/.sqlx/query-9f7b35311f0afff1be7dc489348ec87cf78f40429222b3163f3c5235c87e007f.json @@ -0,0 +1,31 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n TRUE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n NOW(),\n NOW()\n )\n ON CONFLICT (hash) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Numeric", + "Numeric", + "Numeric", + "Jsonb", + "Int8", + "Numeric", + "Numeric", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Timestamp" + ] + }, + "nullable": [] + }, + "hash": "9f7b35311f0afff1be7dc489348ec87cf78f40429222b3163f3c5235c87e007f" +} diff --git a/core/lib/dal/.sqlx/query-a329c468b25d6d5533766b8ad3d0c8fdca5c5731d490c1ac3ed56266b1d5a8a5.json b/core/lib/dal/.sqlx/query-a329c468b25d6d5533766b8ad3d0c8fdca5c5731d490c1ac3ed56266b1d5a8a5.json new file mode 100644 index 000000000000..d7947345cf61 --- /dev/null +++ b/core/lib/dal/.sqlx/query-a329c468b25d6d5533766b8ad3d0c8fdca5c5731d490c1ac3ed56266b1d5a8a5.json @@ -0,0 +1,32 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n upgrade_id,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n miniblock_number,\n index_in_block,\n error,\n execution_info,\n refunded_gas,\n effective_gas_price,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n TRUE,\n data_table.initiator_address,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.data,\n data_table.upgrade_id,\n data_table.contract_address,\n data_table.l1_block_number,\n data_table.value,\n '\\x0000000000000000000000000000000000000000'::bytea,\n '\\x'::bytea,\n data_table.tx_format,\n data_table.l1_tx_mint,\n data_table.l1_tx_refund_recipient,\n $19,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.execution_info,\n data_table.refunded_gas,\n data_table.effective_gas_price,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::bytea []) AS hash,\n UNNEST($2::bytea []) AS initiator_address,\n UNNEST($3::numeric []) AS gas_limit,\n UNNEST($4::numeric []) AS max_fee_per_gas,\n UNNEST($5::numeric []) AS gas_per_pubdata_limit,\n UNNEST($6::jsonb []) AS data,\n UNNEST($7::int []) AS upgrade_id,\n UNNEST($8::bytea []) AS contract_address,\n UNNEST($9::int []) AS l1_block_number,\n UNNEST($10::numeric []) AS value,\n UNNEST($11::integer []) AS tx_format,\n UNNEST($12::numeric []) AS l1_tx_mint,\n UNNEST($13::bytea []) AS l1_tx_refund_recipient,\n UNNEST($14::int []) AS index_in_block,\n UNNEST($15::varchar []) AS error,\n UNNEST($16::jsonb []) AS execution_info,\n UNNEST($17::bigint []) AS refunded_gas,\n UNNEST($18::numeric []) AS effective_gas_price\n ) AS data_table\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray", + "NumericArray", + "NumericArray", + "NumericArray", + "JsonbArray", + "Int4Array", + "ByteaArray", + "Int4Array", + "NumericArray", + "Int4Array", + "NumericArray", + "ByteaArray", + "Int4Array", + "VarcharArray", + "JsonbArray", + "Int8Array", + "NumericArray", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "a329c468b25d6d5533766b8ad3d0c8fdca5c5731d490c1ac3ed56266b1d5a8a5" +} diff --git a/core/lib/dal/.sqlx/query-6621de90a024cc85946f17948e5c171cd0e4d38bd6e9cfec58b2d7f53a3204e1.json b/core/lib/dal/.sqlx/query-a36135b5908992324c4308f549ea77a428820fdcea9969aff3b29ca16727357b.json similarity index 97% rename from core/lib/dal/.sqlx/query-6621de90a024cc85946f17948e5c171cd0e4d38bd6e9cfec58b2d7f53a3204e1.json rename to core/lib/dal/.sqlx/query-a36135b5908992324c4308f549ea77a428820fdcea9969aff3b29ca16727357b.json index 8ba437fe2cee..1d27af2bbc1a 100644 --- a/core/lib/dal/.sqlx/query-6621de90a024cc85946f17948e5c171cd0e4d38bd6e9cfec58b2d7f53a3204e1.json +++ b/core/lib/dal/.sqlx/query-a36135b5908992324c4308f549ea77a428820fdcea9969aff3b29ca16727357b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE transactions\n SET\n in_mempool = TRUE\n FROM\n (\n SELECT\n hash\n FROM\n (\n SELECT\n hash\n FROM\n transactions\n WHERE\n miniblock_number IS NULL\n AND in_mempool = FALSE\n AND error IS NULL\n AND (\n is_priority = TRUE\n OR (\n max_fee_per_gas >= $2\n AND gas_per_pubdata_limit >= $3\n )\n )\n AND tx_format != $4\n ORDER BY\n is_priority DESC,\n priority_op_id,\n received_at\n LIMIT\n $1\n ) AS subquery1\n ORDER BY\n hash\n ) AS subquery2\n WHERE\n transactions.hash = subquery2.hash\n RETURNING\n transactions.*\n ", + "query": "\n UPDATE transactions\n SET\n in_mempool = TRUE\n FROM\n (\n SELECT\n hash\n FROM\n (\n SELECT\n hash\n FROM\n transactions\n WHERE\n miniblock_number IS NULL\n AND in_mempool = FALSE\n AND error IS NULL\n AND (\n is_priority = TRUE\n OR (\n max_fee_per_gas >= $2\n AND gas_per_pubdata_limit >= $3\n )\n )\n AND tx_format != $4\n ORDER BY\n is_priority DESC,\n priority_op_id,\n received_at\n LIMIT\n $1\n ) AS subquery1\n ORDER BY\n hash\n ) AS subquery2\n WHERE\n transactions.hash = subquery2.hash\n RETURNING\n transactions.*\n ", "describe": { "columns": [ { @@ -231,5 +231,5 @@ true ] }, - "hash": "6621de90a024cc85946f17948e5c171cd0e4d38bd6e9cfec58b2d7f53a3204e1" + "hash": "a36135b5908992324c4308f549ea77a428820fdcea9969aff3b29ca16727357b" } diff --git a/core/lib/dal/.sqlx/query-a4fcd075b68467bb119e49e6b20a69138206dfeb41f3daff4a3eef1de0bed4e4.json b/core/lib/dal/.sqlx/query-a4fcd075b68467bb119e49e6b20a69138206dfeb41f3daff4a3eef1de0bed4e4.json deleted file mode 100644 index 39b0c391ef59..000000000000 --- a/core/lib/dal/.sqlx/query-a4fcd075b68467bb119e49e6b20a69138206dfeb41f3daff4a3eef1de0bed4e4.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n initial_writes (hashed_key, INDEX, l1_batch_number, created_at, updated_at)\n SELECT\n u.hashed_key,\n u.index,\n $3,\n NOW(),\n NOW()\n FROM\n UNNEST($1::bytea[], $2::BIGINT[]) AS u (hashed_key, INDEX)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "Int8Array", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "a4fcd075b68467bb119e49e6b20a69138206dfeb41f3daff4a3eef1de0bed4e4" -} diff --git a/core/lib/dal/.sqlx/query-a65364d10a20420211022dc8234d0a586ce73d09ee28887cb1ad1c0392250629.json b/core/lib/dal/.sqlx/query-a65364d10a20420211022dc8234d0a586ce73d09ee28887cb1ad1c0392250629.json new file mode 100644 index 000000000000..58195689f5d4 --- /dev/null +++ b/core/lib/dal/.sqlx/query-a65364d10a20420211022dc8234d0a586ce73d09ee28887cb1ad1c0392250629.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n nonce,\n signature,\n gas_limit,\n max_fee_per_gas,\n max_priority_fee_per_gas,\n gas_per_pubdata_limit,\n input,\n data,\n tx_format,\n contract_address,\n value,\n paymaster,\n paymaster_input,\n execution_info,\n miniblock_number,\n index_in_block,\n error,\n effective_gas_price,\n refunded_gas,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n FALSE,\n data_table.initiator_address,\n data_table.nonce,\n data_table.signature,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.max_priority_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.input,\n data_table.data,\n data_table.tx_format,\n data_table.contract_address,\n data_table.value,\n data_table.paymaster,\n data_table.paymaster_input,\n data_table.new_execution_info,\n $21,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.effective_gas_price,\n data_table.refunded_gas,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::bytea []) AS hash,\n UNNEST($2::bytea []) AS initiator_address,\n UNNEST($3::int []) AS nonce,\n UNNEST($4::bytea []) AS signature,\n UNNEST($5::numeric []) AS gas_limit,\n UNNEST($6::numeric []) AS max_fee_per_gas,\n UNNEST($7::numeric []) AS max_priority_fee_per_gas,\n UNNEST($8::numeric []) AS gas_per_pubdata_limit,\n UNNEST($9::bytea []) AS input,\n UNNEST($10::jsonb []) AS data,\n UNNEST($11::int []) AS tx_format,\n UNNEST($12::bytea []) AS contract_address,\n UNNEST($13::numeric []) AS value,\n UNNEST($14::bytea []) AS paymaster,\n UNNEST($15::bytea []) AS paymaster_input,\n UNNEST($16::jsonb []) AS new_execution_info,\n UNNEST($17::integer []) AS index_in_block,\n UNNEST($18::varchar []) AS error,\n UNNEST($19::numeric []) AS effective_gas_price,\n UNNEST($20::bigint []) AS refunded_gas\n ) AS data_table\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray", + "Int4Array", + "ByteaArray", + "NumericArray", + "NumericArray", + "NumericArray", + "NumericArray", + "ByteaArray", + "JsonbArray", + "Int4Array", + "ByteaArray", + "NumericArray", + "ByteaArray", + "ByteaArray", + "JsonbArray", + "Int4Array", + "VarcharArray", + "NumericArray", + "Int8Array", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "a65364d10a20420211022dc8234d0a586ce73d09ee28887cb1ad1c0392250629" +} diff --git a/core/lib/dal/.sqlx/query-a8d55f14de2f489fdc12c8da540e0d51f86d30d5ad92496e4aa087a3c4aae09f.json b/core/lib/dal/.sqlx/query-a8d55f14de2f489fdc12c8da540e0d51f86d30d5ad92496e4aa087a3c4aae09f.json deleted file mode 100644 index b00999f21448..000000000000 --- a/core/lib/dal/.sqlx/query-a8d55f14de2f489fdc12c8da540e0d51f86d30d5ad92496e4aa087a3c4aae09f.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n miniblock_number,\n index_in_block,\n error,\n execution_info,\n refunded_gas,\n effective_gas_price,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n TRUE,\n data_table.initiator_address,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.data,\n data_table.priority_op_id,\n data_table.full_fee,\n data_table.layer_2_tip_fee,\n data_table.contract_address,\n data_table.l1_block_number,\n data_table.value,\n '\\x0000000000000000000000000000000000000000'::bytea,\n '\\x'::bytea,\n data_table.tx_format,\n data_table.l1_tx_mint,\n data_table.l1_tx_refund_recipient,\n $21,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.execution_info,\n data_table.refunded_gas,\n data_table.effective_gas_price,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::BYTEA[]) AS hash,\n UNNEST($2::BYTEA[]) AS initiator_address,\n UNNEST($3::NUMERIC[]) AS gas_limit,\n UNNEST($4::NUMERIC[]) AS max_fee_per_gas,\n UNNEST($5::NUMERIC[]) AS gas_per_pubdata_limit,\n UNNEST($6::JSONB[]) AS data,\n UNNEST($7::BIGINT[]) AS priority_op_id,\n UNNEST($8::NUMERIC[]) AS full_fee,\n UNNEST($9::NUMERIC[]) AS layer_2_tip_fee,\n UNNEST($10::BYTEA[]) AS contract_address,\n UNNEST($11::INT[]) AS l1_block_number,\n UNNEST($12::NUMERIC[]) AS value,\n UNNEST($13::INTEGER[]) AS tx_format,\n UNNEST($14::NUMERIC[]) AS l1_tx_mint,\n UNNEST($15::BYTEA[]) AS l1_tx_refund_recipient,\n UNNEST($16::INT[]) AS index_in_block,\n UNNEST($17::VARCHAR[]) AS error,\n UNNEST($18::JSONB[]) AS execution_info,\n UNNEST($19::BIGINT[]) AS refunded_gas,\n UNNEST($20::NUMERIC[]) AS effective_gas_price\n ) AS data_table\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray", - "NumericArray", - "NumericArray", - "NumericArray", - "JsonbArray", - "Int8Array", - "NumericArray", - "NumericArray", - "ByteaArray", - "Int4Array", - "NumericArray", - "Int4Array", - "NumericArray", - "ByteaArray", - "Int4Array", - "VarcharArray", - "JsonbArray", - "Int8Array", - "NumericArray", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "a8d55f14de2f489fdc12c8da540e0d51f86d30d5ad92496e4aa087a3c4aae09f" -} diff --git a/core/lib/dal/.sqlx/query-a8fcb4d43b702d561a573a30790372281e8502002ff9fec82294ea6b972447d8.json b/core/lib/dal/.sqlx/query-a8fcb4d43b702d561a573a30790372281e8502002ff9fec82294ea6b972447d8.json new file mode 100644 index 000000000000..33187f131dfa --- /dev/null +++ b/core/lib/dal/.sqlx/query-a8fcb4d43b702d561a573a30790372281e8502002ff9fec82294ea6b972447d8.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at)\n SELECT\n u.bytecode_hash,\n u.bytecode,\n $3,\n NOW(),\n NOW()\n FROM\n UNNEST($1::bytea [], $2::bytea []) AS u (bytecode_hash, bytecode)\n ON CONFLICT (bytecode_hash) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "a8fcb4d43b702d561a573a30790372281e8502002ff9fec82294ea6b972447d8" +} diff --git a/core/lib/dal/.sqlx/query-e3f4af790fca9149f4edff070170294ec464d184ad732692faa61d2ef99c84e9.json b/core/lib/dal/.sqlx/query-aa68653ef4ff7e0cfddfc0a7c8f3c39e774c405508e73e77cdd0c01f924c97c0.json similarity index 53% rename from core/lib/dal/.sqlx/query-e3f4af790fca9149f4edff070170294ec464d184ad732692faa61d2ef99c84e9.json rename to core/lib/dal/.sqlx/query-aa68653ef4ff7e0cfddfc0a7c8f3c39e774c405508e73e77cdd0c01f924c97c0.json index abe74036f4c6..b17b58282110 100644 --- a/core/lib/dal/.sqlx/query-e3f4af790fca9149f4edff070170294ec464d184ad732692faa61d2ef99c84e9.json +++ b/core/lib/dal/.sqlx/query-aa68653ef4ff7e0cfddfc0a7c8f3c39e774c405508e73e77cdd0c01f924c97c0.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE tee_proof_generation_details\n SET\n status = $1,\n updated_at = NOW(),\n prover_taken_at = NOW()\n WHERE\n tee_type = $2\n AND l1_batch_number = (\n SELECT\n proofs.l1_batch_number\n FROM\n tee_proof_generation_details AS proofs\n JOIN tee_verifier_input_producer_jobs AS inputs ON proofs.l1_batch_number = inputs.l1_batch_number\n WHERE\n inputs.status = $3\n AND (\n proofs.status = $4\n OR (\n proofs.status = $1\n AND proofs.prover_taken_at < NOW() - $5::INTERVAL\n )\n )\n AND proofs.l1_batch_number >= $6\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n tee_proof_generation_details.l1_batch_number\n ", + "query": "\n UPDATE tee_proof_generation_details\n SET\n status = $1,\n updated_at = NOW(),\n prover_taken_at = NOW()\n WHERE\n tee_type = $2\n AND l1_batch_number = (\n SELECT\n proofs.l1_batch_number\n FROM\n tee_proof_generation_details AS proofs\n JOIN\n tee_verifier_input_producer_jobs AS inputs\n ON proofs.l1_batch_number = inputs.l1_batch_number\n WHERE\n inputs.status = $3\n AND (\n proofs.status = $4\n OR (\n proofs.status = $1\n AND proofs.prover_taken_at < NOW() - $5::INTERVAL\n )\n )\n AND proofs.l1_batch_number >= $6\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n tee_proof_generation_details.l1_batch_number\n ", "describe": { "columns": [ { @@ -36,5 +36,5 @@ false ] }, - "hash": "e3f4af790fca9149f4edff070170294ec464d184ad732692faa61d2ef99c84e9" + "hash": "aa68653ef4ff7e0cfddfc0a7c8f3c39e774c405508e73e77cdd0c01f924c97c0" } diff --git a/core/lib/dal/.sqlx/query-63f95c6cdcfd933e2cf8f62c0d408f2dce89f7b700896fcc0f242e0e15ba058e.json b/core/lib/dal/.sqlx/query-ac4f1e7af7d866daf45b6997a8ce0a02a40c9f37be949bd4d088744f9c842ef3.json similarity index 78% rename from core/lib/dal/.sqlx/query-63f95c6cdcfd933e2cf8f62c0d408f2dce89f7b700896fcc0f242e0e15ba058e.json rename to core/lib/dal/.sqlx/query-ac4f1e7af7d866daf45b6997a8ce0a02a40c9f37be949bd4d088744f9c842ef3.json index cb68e7622524..671b56760d6b 100644 --- a/core/lib/dal/.sqlx/query-63f95c6cdcfd933e2cf8f62c0d408f2dce89f7b700896fcc0f242e0e15ba058e.json +++ b/core/lib/dal/.sqlx/query-ac4f1e7af7d866daf45b6997a8ce0a02a40c9f37be949bd4d088744f9c842ef3.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n l1_batches.timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n LEFT JOIN data_availability ON data_availability.l1_batch_number = l1_batches.number\n JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND protocol_versions.bootloader_code_hash = $1\n AND protocol_versions.default_account_code_hash = $2\n AND commitment IS NOT NULL\n AND (\n protocol_versions.id = $3\n OR protocol_versions.upgrade_tx_hash IS NULL\n )\n AND events_queue_commitment IS NOT NULL\n AND bootloader_initial_content_commitment IS NOT NULL\n AND (\n data_availability.inclusion_data IS NOT NULL\n OR $4 IS FALSE\n )\n ORDER BY\n number\n LIMIT\n $5\n ", + "query": "\n SELECT\n number,\n l1_batches.timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n protocol_version,\n compressed_state_diffs,\n system_logs,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n l1_batches\n LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number\n LEFT JOIN\n data_availability\n ON data_availability.l1_batch_number = l1_batches.number\n JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version\n WHERE\n eth_commit_tx_id IS NULL\n AND number != 0\n AND protocol_versions.bootloader_code_hash = $1\n AND protocol_versions.default_account_code_hash = $2\n AND commitment IS NOT NULL\n AND (\n protocol_versions.id = $3\n OR protocol_versions.upgrade_tx_hash IS NULL\n )\n AND events_queue_commitment IS NOT NULL\n AND bootloader_initial_content_commitment IS NOT NULL\n AND (\n data_availability.inclusion_data IS NOT NULL\n OR $4 IS FALSE\n )\n ORDER BY\n number\n LIMIT\n $5\n ", "describe": { "columns": [ { @@ -172,5 +172,5 @@ true ] }, - "hash": "63f95c6cdcfd933e2cf8f62c0d408f2dce89f7b700896fcc0f242e0e15ba058e" + "hash": "ac4f1e7af7d866daf45b6997a8ce0a02a40c9f37be949bd4d088744f9c842ef3" } diff --git a/core/lib/dal/.sqlx/query-acfd5a60fda5782bddb8cba033a5d3a0eed793f7b64ad3ed035f20e896371721.json b/core/lib/dal/.sqlx/query-acfd5a60fda5782bddb8cba033a5d3a0eed793f7b64ad3ed035f20e896371721.json deleted file mode 100644 index 9232ef6d0096..000000000000 --- a/core/lib/dal/.sqlx/query-acfd5a60fda5782bddb8cba033a5d3a0eed793f7b64ad3ed035f20e896371721.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n TRUE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n NOW(),\n NOW()\n )\n ON CONFLICT (hash) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Bytea", - "Bytea", - "Numeric", - "Numeric", - "Numeric", - "Jsonb", - "Int8", - "Numeric", - "Numeric", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Timestamp" - ] - }, - "nullable": [] - }, - "hash": "acfd5a60fda5782bddb8cba033a5d3a0eed793f7b64ad3ed035f20e896371721" -} diff --git a/core/lib/dal/.sqlx/query-ad8cbc084ef8bc5995031c807bbbd2225e57ae8d42042ac107b35a36c522f0d8.json b/core/lib/dal/.sqlx/query-ad8cbc084ef8bc5995031c807bbbd2225e57ae8d42042ac107b35a36c522f0d8.json new file mode 100644 index 000000000000..b07701218c31 --- /dev/null +++ b/core/lib/dal/.sqlx/query-ad8cbc084ef8bc5995031c807bbbd2225e57ae8d42042ac107b35a36c522f0d8.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n miniblock_number,\n index_in_block,\n error,\n execution_info,\n refunded_gas,\n effective_gas_price,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n TRUE,\n data_table.initiator_address,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.data,\n data_table.priority_op_id,\n data_table.full_fee,\n data_table.layer_2_tip_fee,\n data_table.contract_address,\n data_table.l1_block_number,\n data_table.value,\n '\\x0000000000000000000000000000000000000000'::bytea,\n '\\x'::bytea,\n data_table.tx_format,\n data_table.l1_tx_mint,\n data_table.l1_tx_refund_recipient,\n $21,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.execution_info,\n data_table.refunded_gas,\n data_table.effective_gas_price,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::bytea []) AS hash,\n UNNEST($2::bytea []) AS initiator_address,\n UNNEST($3::numeric []) AS gas_limit,\n UNNEST($4::numeric []) AS max_fee_per_gas,\n UNNEST($5::numeric []) AS gas_per_pubdata_limit,\n UNNEST($6::jsonb []) AS data,\n UNNEST($7::bigint []) AS priority_op_id,\n UNNEST($8::numeric []) AS full_fee,\n UNNEST($9::numeric []) AS layer_2_tip_fee,\n UNNEST($10::bytea []) AS contract_address,\n UNNEST($11::int []) AS l1_block_number,\n UNNEST($12::numeric []) AS value,\n UNNEST($13::integer []) AS tx_format,\n UNNEST($14::numeric []) AS l1_tx_mint,\n UNNEST($15::bytea []) AS l1_tx_refund_recipient,\n UNNEST($16::int []) AS index_in_block,\n UNNEST($17::varchar []) AS error,\n UNNEST($18::jsonb []) AS execution_info,\n UNNEST($19::bigint []) AS refunded_gas,\n UNNEST($20::numeric []) AS effective_gas_price\n ) AS data_table\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray", + "NumericArray", + "NumericArray", + "NumericArray", + "JsonbArray", + "Int8Array", + "NumericArray", + "NumericArray", + "ByteaArray", + "Int4Array", + "NumericArray", + "Int4Array", + "NumericArray", + "ByteaArray", + "Int4Array", + "VarcharArray", + "JsonbArray", + "Int8Array", + "NumericArray", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "ad8cbc084ef8bc5995031c807bbbd2225e57ae8d42042ac107b35a36c522f0d8" +} diff --git a/core/lib/dal/.sqlx/query-659f616d3af4a79f898e84f890e06de9633d1086da972a467d89831e7a07c67e.json b/core/lib/dal/.sqlx/query-ae30067056fe29febd68408c2ca2e604958488a41d3ee2bcbd05d269bcdfc7aa.json similarity index 93% rename from core/lib/dal/.sqlx/query-659f616d3af4a79f898e84f890e06de9633d1086da972a467d89831e7a07c67e.json rename to core/lib/dal/.sqlx/query-ae30067056fe29febd68408c2ca2e604958488a41d3ee2bcbd05d269bcdfc7aa.json index 9116a25c1673..9e212249490c 100644 --- a/core/lib/dal/.sqlx/query-659f616d3af4a79f898e84f890e06de9633d1086da972a467d89831e7a07c67e.json +++ b/core/lib/dal/.sqlx/query-ae30067056fe29febd68408c2ca2e604958488a41d3ee2bcbd05d269bcdfc7aa.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n system_logs,\n compressed_state_diffs,\n protocol_version,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n (\n SELECT\n l1_batches.*,\n ROW_NUMBER() OVER (\n ORDER BY\n number ASC\n ) AS ROW_NUMBER\n FROM\n l1_batches\n WHERE\n eth_commit_tx_id IS NOT NULL\n AND l1_batches.skip_proof = TRUE\n AND l1_batches.number > $1\n ORDER BY\n number\n LIMIT\n $2\n ) inn\n LEFT JOIN commitments ON commitments.l1_batch_number = inn.number\n WHERE\n number - ROW_NUMBER = $1\n ", + "query": "\n SELECT\n number,\n timestamp,\n l1_tx_count,\n l2_tx_count,\n bloom,\n priority_ops_onchain_data,\n hash,\n commitment,\n l2_to_l1_messages,\n used_contract_hashes,\n compressed_initial_writes,\n compressed_repeated_writes,\n l2_l1_merkle_root,\n rollup_last_leaf_index,\n zkporter_is_available,\n bootloader_code_hash,\n default_aa_code_hash,\n aux_data_hash,\n pass_through_data_hash,\n meta_parameters_hash,\n system_logs,\n compressed_state_diffs,\n protocol_version,\n events_queue_commitment,\n bootloader_initial_content_commitment,\n pubdata_input\n FROM\n (\n SELECT\n l1_batches.*,\n ROW_NUMBER() OVER (\n ORDER BY\n number ASC\n ) AS row_number\n FROM\n l1_batches\n WHERE\n eth_commit_tx_id IS NOT NULL\n AND l1_batches.skip_proof = TRUE\n AND l1_batches.number > $1\n ORDER BY\n number\n LIMIT\n $2\n ) inn\n LEFT JOIN commitments ON commitments.l1_batch_number = inn.number\n WHERE\n number - row_number = $1\n ", "describe": { "columns": [ { @@ -169,5 +169,5 @@ true ] }, - "hash": "659f616d3af4a79f898e84f890e06de9633d1086da972a467d89831e7a07c67e" + "hash": "ae30067056fe29febd68408c2ca2e604958488a41d3ee2bcbd05d269bcdfc7aa" } diff --git a/core/lib/dal/.sqlx/query-a1f4334b6bc1642c1bc0ff4ffa34470914b52e2d714e9deb903d62a5d66f0e04.json b/core/lib/dal/.sqlx/query-afe66b4684f2ab1187b49f64f16f21c9bacd8badc624de7664b82dba97d6c9b9.json similarity index 86% rename from core/lib/dal/.sqlx/query-a1f4334b6bc1642c1bc0ff4ffa34470914b52e2d714e9deb903d62a5d66f0e04.json rename to core/lib/dal/.sqlx/query-afe66b4684f2ab1187b49f64f16f21c9bacd8badc624de7664b82dba97d6c9b9.json index 82612fb53277..6bb3c4e97313 100644 --- a/core/lib/dal/.sqlx/query-a1f4334b6bc1642c1bc0ff4ffa34470914b52e2d714e9deb903d62a5d66f0e04.json +++ b/core/lib/dal/.sqlx/query-afe66b4684f2ab1187b49f64f16f21c9bacd8badc624de7664b82dba97d6c9b9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n l1_address,\n l2_address,\n NAME,\n symbol,\n decimals\n FROM\n tokens\n ORDER BY\n symbol\n ", + "query": "\n SELECT\n l1_address,\n l2_address,\n name,\n symbol,\n decimals\n FROM\n tokens\n ORDER BY\n symbol\n ", "describe": { "columns": [ { @@ -40,5 +40,5 @@ false ] }, - "hash": "a1f4334b6bc1642c1bc0ff4ffa34470914b52e2d714e9deb903d62a5d66f0e04" + "hash": "afe66b4684f2ab1187b49f64f16f21c9bacd8badc624de7664b82dba97d6c9b9" } diff --git a/core/lib/dal/.sqlx/query-b1486215ce220d6d2faa7690a5cdd13a572f665e0a5c0edba8076438ba9f044c.json b/core/lib/dal/.sqlx/query-b1486215ce220d6d2faa7690a5cdd13a572f665e0a5c0edba8076438ba9f044c.json new file mode 100644 index 000000000000..aab080c3a51a --- /dev/null +++ b/core/lib/dal/.sqlx/query-b1486215ce220d6d2faa7690a5cdd13a572f665e0a5c0edba8076438ba9f044c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "b1486215ce220d6d2faa7690a5cdd13a572f665e0a5c0edba8076438ba9f044c" +} diff --git a/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json b/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json deleted file mode 100644 index 356fd8e9d999..000000000000 --- a/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n l1_batches_consensus_committees (l1_batch_number, attesters, updated_at)\n VALUES\n ($1, $2, NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n l1_batch_number = $1,\n attesters = $2,\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7" -} diff --git a/core/lib/dal/.sqlx/query-ef70506e90e8add3b95940a7333f8222bd9fbe8ce82d8963f7da03fe6fcf9225.json b/core/lib/dal/.sqlx/query-b3bccd33945c657856f12b9ced6addab6569d897e748d39abca9538872d986ad.json similarity index 79% rename from core/lib/dal/.sqlx/query-ef70506e90e8add3b95940a7333f8222bd9fbe8ce82d8963f7da03fe6fcf9225.json rename to core/lib/dal/.sqlx/query-b3bccd33945c657856f12b9ced6addab6569d897e748d39abca9538872d986ad.json index cf102b828aa8..f440a2655937 100644 --- a/core/lib/dal/.sqlx/query-ef70506e90e8add3b95940a7333f8222bd9fbe8ce82d8963f7da03fe6fcf9225.json +++ b/core/lib/dal/.sqlx/query-b3bccd33945c657856f12b9ced6addab6569d897e748d39abca9538872d986ad.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n miniblocks.number,\n COALESCE(\n miniblocks.l1_batch_number,\n (\n SELECT\n (MAX(number) + 1)\n FROM\n l1_batches\n )\n ) AS \"l1_batch_number!\",\n miniblocks.timestamp,\n miniblocks.l1_tx_count,\n miniblocks.l2_tx_count,\n miniblocks.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n miniblocks.l1_gas_price,\n miniblocks.l2_fair_gas_price,\n miniblocks.fair_pubdata_price,\n miniblocks.bootloader_code_hash,\n miniblocks.default_aa_code_hash,\n miniblocks.protocol_version,\n miniblocks.fee_account_address\n FROM\n miniblocks\n LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number\n LEFT JOIN eth_txs_history AS commit_tx ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n miniblocks.number = $1\n ", + "query": "\n SELECT\n miniblocks.number,\n COALESCE(\n miniblocks.l1_batch_number,\n (\n SELECT\n (MAX(number) + 1)\n FROM\n l1_batches\n )\n ) AS \"l1_batch_number!\",\n miniblocks.timestamp,\n miniblocks.l1_tx_count,\n miniblocks.l2_tx_count,\n miniblocks.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n miniblocks.l1_gas_price,\n miniblocks.l2_fair_gas_price,\n miniblocks.fair_pubdata_price,\n miniblocks.bootloader_code_hash,\n miniblocks.default_aa_code_hash,\n miniblocks.protocol_version,\n miniblocks.fee_account_address\n FROM\n miniblocks\n LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n miniblocks.number = $1\n ", "describe": { "columns": [ { @@ -126,5 +126,5 @@ false ] }, - "hash": "ef70506e90e8add3b95940a7333f8222bd9fbe8ce82d8963f7da03fe6fcf9225" + "hash": "b3bccd33945c657856f12b9ced6addab6569d897e748d39abca9538872d986ad" } diff --git a/core/lib/dal/.sqlx/query-b47a2961dc2f1347864682c572dd1f5e03924dbf6dd1e824d4aca837e604b7e9.json b/core/lib/dal/.sqlx/query-b47a2961dc2f1347864682c572dd1f5e03924dbf6dd1e824d4aca837e604b7e9.json deleted file mode 100644 index 63acfcb30dc7..000000000000 --- a/core/lib/dal/.sqlx/query-b47a2961dc2f1347864682c572dd1f5e03924dbf6dd1e824d4aca837e604b7e9.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n table_name,\n PG_TABLE_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS table_size,\n PG_INDEXES_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS indexes_size,\n PG_RELATION_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS relation_size,\n PG_TOTAL_RELATION_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS total_size\n FROM\n information_schema.tables\n WHERE\n table_schema = 'public'\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "table_name", - "type_info": "Name" - }, - { - "ordinal": 1, - "name": "table_size", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "indexes_size", - "type_info": "Int8" - }, - { - "ordinal": 3, - "name": "relation_size", - "type_info": "Int8" - }, - { - "ordinal": 4, - "name": "total_size", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - true, - null, - null, - null, - null - ] - }, - "hash": "b47a2961dc2f1347864682c572dd1f5e03924dbf6dd1e824d4aca837e604b7e9" -} diff --git a/core/lib/dal/.sqlx/query-b6bfb2d998857f165ee04e282e299bf19b587a16ad70a671b0de48fd608bf31c.json b/core/lib/dal/.sqlx/query-b6bfb2d998857f165ee04e282e299bf19b587a16ad70a671b0de48fd608bf31c.json new file mode 100644 index 000000000000..120fac1021f5 --- /dev/null +++ b/core/lib/dal/.sqlx/query-b6bfb2d998857f165ee04e282e299bf19b587a16ad70a671b0de48fd608bf31c.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n available_batches AS (\n SELECT\n MAX(number) AS \"last_batch\"\n FROM\n l1_batches\n ),\n \n processed_batches AS (\n SELECT\n COALESCE(MAX(l1_batch_number), $1) + $2 AS \"last_ready_batch\"\n FROM\n vm_runner_protective_reads\n WHERE\n time_taken IS NOT NULL\n )\n \n SELECT\n LEAST(last_batch, last_ready_batch) AS \"last_ready_batch!\"\n FROM\n available_batches\n FULL JOIN processed_batches ON TRUE\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "last_ready_batch!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [ + true + ] + }, + "hash": "b6bfb2d998857f165ee04e282e299bf19b587a16ad70a671b0de48fd608bf31c" +} diff --git a/core/lib/dal/.sqlx/query-e1e8ab0cb11c6081d3525228eacbad74e1bab808c744fa14bf24332b39120767.json b/core/lib/dal/.sqlx/query-bba037e1fcffc4415afe3016ff266d19f7ba92c40566e1d098c435da41e95274.json similarity index 50% rename from core/lib/dal/.sqlx/query-e1e8ab0cb11c6081d3525228eacbad74e1bab808c744fa14bf24332b39120767.json rename to core/lib/dal/.sqlx/query-bba037e1fcffc4415afe3016ff266d19f7ba92c40566e1d098c435da41e95274.json index de9937ef7b95..a72b621dae59 100644 --- a/core/lib/dal/.sqlx/query-e1e8ab0cb11c6081d3525228eacbad74e1bab808c744fa14bf24332b39120767.json +++ b/core/lib/dal/.sqlx/query-bba037e1fcffc4415afe3016ff266d19f7ba92c40566e1d098c435da41e95274.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n WITH\n events AS (\n SELECT DISTINCT\n ON (events.tx_hash) *\n FROM\n events\n WHERE\n events.address = $1\n AND events.topic1 = $2\n AND events.tx_hash = ANY ($3)\n ORDER BY\n events.tx_hash,\n events.event_index_in_tx DESC\n )\n SELECT\n transactions.hash AS tx_hash,\n transactions.index_in_block AS index_in_block,\n transactions.l1_batch_tx_index AS l1_batch_tx_index,\n transactions.miniblock_number AS \"block_number!\",\n transactions.error AS error,\n transactions.effective_gas_price AS effective_gas_price,\n transactions.initiator_address AS initiator_address,\n transactions.data -> 'to' AS \"transfer_to?\",\n transactions.data -> 'contractAddress' AS \"execute_contract_address?\",\n transactions.tx_format AS \"tx_format?\",\n transactions.refunded_gas AS refunded_gas,\n transactions.gas_limit AS gas_limit,\n miniblocks.hash AS \"block_hash\",\n miniblocks.l1_batch_number AS \"l1_batch_number?\",\n events.topic4 AS \"contract_address?\",\n miniblocks.timestamp AS \"block_timestamp?\"\n FROM\n transactions\n JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n LEFT JOIN events ON events.tx_hash = transactions.hash\n WHERE\n transactions.hash = ANY ($3)\n AND transactions.data != '{}'::jsonb\n ", + "query": "\n WITH\n events AS (\n SELECT DISTINCT\n ON (events.tx_hash) *\n FROM\n events\n WHERE\n events.address = $1\n AND events.topic1 = $2\n AND events.tx_hash = ANY($3)\n ORDER BY\n events.tx_hash,\n events.event_index_in_tx DESC\n )\n \n SELECT\n transactions.hash AS tx_hash,\n transactions.index_in_block,\n transactions.l1_batch_tx_index,\n transactions.miniblock_number AS \"block_number!\",\n transactions.error,\n transactions.effective_gas_price,\n transactions.initiator_address,\n transactions.data -> 'to' AS \"transfer_to?\",\n transactions.data -> 'contractAddress' AS \"execute_contract_address?\",\n transactions.tx_format AS \"tx_format?\",\n transactions.refunded_gas,\n transactions.gas_limit,\n miniblocks.hash AS \"block_hash\",\n miniblocks.l1_batch_number AS \"l1_batch_number?\",\n events.topic4 AS \"contract_address?\",\n miniblocks.timestamp AS \"block_timestamp?\"\n FROM\n transactions\n JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n LEFT JOIN events ON events.tx_hash = transactions.hash\n WHERE\n transactions.hash = ANY($3)\n AND transactions.data != '{}'::jsonb\n ", "describe": { "columns": [ { @@ -110,5 +110,5 @@ false ] }, - "hash": "e1e8ab0cb11c6081d3525228eacbad74e1bab808c744fa14bf24332b39120767" + "hash": "bba037e1fcffc4415afe3016ff266d19f7ba92c40566e1d098c435da41e95274" } diff --git a/core/lib/dal/.sqlx/query-bd51c9d93b103292f5acbdb266ba4b4e2af48907fa9321064ddb24ac02ab17cd.json b/core/lib/dal/.sqlx/query-bd51c9d93b103292f5acbdb266ba4b4e2af48907fa9321064ddb24ac02ab17cd.json deleted file mode 100644 index 7f1fc9b176c5..000000000000 --- a/core/lib/dal/.sqlx/query-bd51c9d93b103292f5acbdb266ba4b4e2af48907fa9321064ddb24ac02ab17cd.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN eth_txs_history AS commit_tx ON (l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id)\n WHERE\n commit_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false - ] - }, - "hash": "bd51c9d93b103292f5acbdb266ba4b4e2af48907fa9321064ddb24ac02ab17cd" -} diff --git a/core/lib/dal/.sqlx/query-bf481c2b498420f80765b837059cab02b0656d863dbfce4b5dad7bc72e52b05d.json b/core/lib/dal/.sqlx/query-bf481c2b498420f80765b837059cab02b0656d863dbfce4b5dad7bc72e52b05d.json deleted file mode 100644 index c353a35ec5e1..000000000000 --- a/core/lib/dal/.sqlx/query-bf481c2b498420f80765b837059cab02b0656d863dbfce4b5dad7bc72e52b05d.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n nonce,\n signature,\n gas_limit,\n max_fee_per_gas,\n max_priority_fee_per_gas,\n gas_per_pubdata_limit,\n input,\n data,\n tx_format,\n contract_address,\n value,\n paymaster,\n paymaster_input,\n execution_info,\n miniblock_number,\n index_in_block,\n error,\n effective_gas_price,\n refunded_gas,\n received_at,\n created_at,\n updated_at\n )\n SELECT\n data_table.hash,\n FALSE,\n data_table.initiator_address,\n data_table.nonce,\n data_table.signature,\n data_table.gas_limit,\n data_table.max_fee_per_gas,\n data_table.max_priority_fee_per_gas,\n data_table.gas_per_pubdata_limit,\n data_table.input,\n data_table.data,\n data_table.tx_format,\n data_table.contract_address,\n data_table.value,\n data_table.paymaster,\n data_table.paymaster_input,\n data_table.new_execution_info,\n $21,\n data_table.index_in_block,\n NULLIF(data_table.error, ''),\n data_table.effective_gas_price,\n data_table.refunded_gas,\n NOW(),\n NOW(),\n NOW()\n FROM\n (\n SELECT\n UNNEST($1::bytea[]) AS hash,\n UNNEST($2::bytea[]) AS initiator_address,\n UNNEST($3::INT[]) AS nonce,\n UNNEST($4::bytea[]) AS signature,\n UNNEST($5::NUMERIC[]) AS gas_limit,\n UNNEST($6::NUMERIC[]) AS max_fee_per_gas,\n UNNEST($7::NUMERIC[]) AS max_priority_fee_per_gas,\n UNNEST($8::NUMERIC[]) AS gas_per_pubdata_limit,\n UNNEST($9::bytea[]) AS input,\n UNNEST($10::jsonb[]) AS data,\n UNNEST($11::INT[]) AS tx_format,\n UNNEST($12::bytea[]) AS contract_address,\n UNNEST($13::NUMERIC[]) AS value,\n UNNEST($14::bytea[]) AS paymaster,\n UNNEST($15::bytea[]) AS paymaster_input,\n UNNEST($16::jsonb[]) AS new_execution_info,\n UNNEST($17::INTEGER[]) AS index_in_block,\n UNNEST($18::VARCHAR[]) AS error,\n UNNEST($19::NUMERIC[]) AS effective_gas_price,\n UNNEST($20::BIGINT[]) AS refunded_gas\n ) AS data_table\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray", - "Int4Array", - "ByteaArray", - "NumericArray", - "NumericArray", - "NumericArray", - "NumericArray", - "ByteaArray", - "JsonbArray", - "Int4Array", - "ByteaArray", - "NumericArray", - "ByteaArray", - "ByteaArray", - "JsonbArray", - "Int4Array", - "VarcharArray", - "NumericArray", - "Int8Array", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "bf481c2b498420f80765b837059cab02b0656d863dbfce4b5dad7bc72e52b05d" -} diff --git a/core/lib/dal/.sqlx/query-bfc84bcf0985446b337467dd1da709dbee508ad6d1cae43e477cf1bef8cb4aa9.json b/core/lib/dal/.sqlx/query-bfc84bcf0985446b337467dd1da709dbee508ad6d1cae43e477cf1bef8cb4aa9.json deleted file mode 100644 index 8079d52a7036..000000000000 --- a/core/lib/dal/.sqlx/query-bfc84bcf0985446b337467dd1da709dbee508ad6d1cae43e477cf1bef8cb4aa9.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT DISTINCT\n hashed_key\n FROM\n storage_logs\n WHERE\n miniblock_number BETWEEN $1 AND $2\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "hashed_key", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, - "nullable": [ - false - ] - }, - "hash": "bfc84bcf0985446b337467dd1da709dbee508ad6d1cae43e477cf1bef8cb4aa9" -} diff --git a/core/lib/dal/.sqlx/query-c02f404ce9b0f92b8052ef6f3eaabda70cb9c56ae3e30dc0a8257e43d6714155.json b/core/lib/dal/.sqlx/query-c013947660883612b83bfd207c26c5e9dc50b533524bf856740215aacb8ff5bd.json similarity index 83% rename from core/lib/dal/.sqlx/query-c02f404ce9b0f92b8052ef6f3eaabda70cb9c56ae3e30dc0a8257e43d6714155.json rename to core/lib/dal/.sqlx/query-c013947660883612b83bfd207c26c5e9dc50b533524bf856740215aacb8ff5bd.json index 53a0aa152f95..b8728de2dacc 100644 --- a/core/lib/dal/.sqlx/query-c02f404ce9b0f92b8052ef6f3eaabda70cb9c56ae3e30dc0a8257e43d6714155.json +++ b/core/lib/dal/.sqlx/query-c013947660883612b83bfd207c26c5e9dc50b533524bf856740215aacb8ff5bd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n eth_txs_history.*,\n eth_txs.blob_sidecar\n FROM\n eth_txs_history\n LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id\n WHERE\n eth_tx_id = $1\n ORDER BY\n eth_txs_history.created_at DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n eth_txs_history.*,\n eth_txs.blob_sidecar\n FROM\n eth_txs_history\n LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id\n WHERE\n eth_tx_id = $1\n ORDER BY\n eth_txs_history.created_at DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -90,5 +90,5 @@ true ] }, - "hash": "c02f404ce9b0f92b8052ef6f3eaabda70cb9c56ae3e30dc0a8257e43d6714155" + "hash": "c013947660883612b83bfd207c26c5e9dc50b533524bf856740215aacb8ff5bd" } diff --git a/core/lib/dal/.sqlx/query-c138d84e1af2e2ef20395201f55db71f3457e1619a170683e03ddf0e78abaf29.json b/core/lib/dal/.sqlx/query-c138d84e1af2e2ef20395201f55db71f3457e1619a170683e03ddf0e78abaf29.json new file mode 100644 index 000000000000..0d80845d8f77 --- /dev/null +++ b/core/lib/dal/.sqlx/query-c138d84e1af2e2ef20395201f55db71f3457e1619a170683e03ddf0e78abaf29.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n MAX(l1_batches.number)\n FROM\n l1_batches\n JOIN eth_txs ON (l1_batches.eth_commit_tx_id = eth_txs.id)\n JOIN\n eth_txs_history AS commit_tx\n ON (eth_txs.confirmed_eth_tx_history_id = commit_tx.id)\n WHERE\n commit_tx.confirmed_at IS NOT NULL\n AND eth_prove_tx_id IS NOT NULL\n AND eth_execute_tx_id IS NULL\n AND EXTRACT(\n EPOCH\n FROM\n commit_tx.confirmed_at\n ) < $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "max", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Numeric" + ] + }, + "nullable": [ + null + ] + }, + "hash": "c138d84e1af2e2ef20395201f55db71f3457e1619a170683e03ddf0e78abaf29" +} diff --git a/core/lib/dal/.sqlx/query-afdeecb78e3af802c2b8ffb0f5ab9863082ccd1ce45b2d20e1119f1e78171d66.json b/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json similarity index 52% rename from core/lib/dal/.sqlx/query-afdeecb78e3af802c2b8ffb0f5ab9863082ccd1ce45b2d20e1119f1e78171d66.json rename to core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json index bb0d73ee6c85..61832d25fd24 100644 --- a/core/lib/dal/.sqlx/query-afdeecb78e3af802c2b8ffb0f5ab9863082ccd1ce45b2d20e1119f1e78171d66.json +++ b/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n processed_events (\n TYPE,\n chain_id,\n next_block_to_process\n )\n VALUES\n ($1, $2, $3)\n ", + "query": "\n INSERT INTO\n processed_events (\n type,\n chain_id,\n next_block_to_process\n )\n VALUES\n ($1, $2, $3)\n ", "describe": { "columns": [], "parameters": { @@ -22,5 +22,5 @@ }, "nullable": [] }, - "hash": "afdeecb78e3af802c2b8ffb0f5ab9863082ccd1ce45b2d20e1119f1e78171d66" + "hash": "c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1" } diff --git a/core/lib/dal/.sqlx/query-c2fe6a5476e69c9588eec73baba9d0e2d571533d4d5f683919987b6f8cbb00e0.json b/core/lib/dal/.sqlx/query-c2fe6a5476e69c9588eec73baba9d0e2d571533d4d5f683919987b6f8cbb00e0.json deleted file mode 100644 index bdabc52d1379..000000000000 --- a/core/lib/dal/.sqlx/query-c2fe6a5476e69c9588eec73baba9d0e2d571533d4d5f683919987b6f8cbb00e0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n miniblocks_consensus (number, certificate)\n VALUES\n ($1, $2)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "c2fe6a5476e69c9588eec73baba9d0e2d571533d4d5f683919987b6f8cbb00e0" -} diff --git a/core/lib/dal/.sqlx/query-c3af06cc232adb93f16456da07733acd2066a5e238088b39b982b10770f51479.json b/core/lib/dal/.sqlx/query-c3af06cc232adb93f16456da07733acd2066a5e238088b39b982b10770f51479.json deleted file mode 100644 index 1c15bde02fdf..000000000000 --- a/core/lib/dal/.sqlx/query-c3af06cc232adb93f16456da07733acd2066a5e238088b39b982b10770f51479.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n events_select AS (\n SELECT\n address,\n topic1,\n topic2,\n topic3,\n topic4,\n value,\n miniblock_number,\n tx_hash,\n tx_index_in_block,\n event_index_in_block,\n event_index_in_tx\n FROM\n events\n WHERE\n miniblock_number > $1\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n )\n SELECT\n miniblocks.hash AS \"block_hash?\",\n address AS \"address!\",\n topic1 AS \"topic1!\",\n topic2 AS \"topic2!\",\n topic3 AS \"topic3!\",\n topic4 AS \"topic4!\",\n value AS \"value!\",\n miniblock_number AS \"miniblock_number!\",\n miniblocks.l1_batch_number AS \"l1_batch_number?\",\n tx_hash AS \"tx_hash!\",\n tx_index_in_block AS \"tx_index_in_block!\",\n event_index_in_block AS \"event_index_in_block!\",\n event_index_in_tx AS \"event_index_in_tx!\",\n miniblocks.timestamp AS \"block_timestamp\"\n FROM\n events_select\n INNER JOIN miniblocks ON events_select.miniblock_number = miniblocks.number\n ORDER BY\n miniblock_number ASC,\n event_index_in_block ASC\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "block_hash?", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "address!", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "topic1!", - "type_info": "Bytea" - }, - { - "ordinal": 3, - "name": "topic2!", - "type_info": "Bytea" - }, - { - "ordinal": 4, - "name": "topic3!", - "type_info": "Bytea" - }, - { - "ordinal": 5, - "name": "topic4!", - "type_info": "Bytea" - }, - { - "ordinal": 6, - "name": "value!", - "type_info": "Bytea" - }, - { - "ordinal": 7, - "name": "miniblock_number!", - "type_info": "Int8" - }, - { - "ordinal": 8, - "name": "l1_batch_number?", - "type_info": "Int8" - }, - { - "ordinal": 9, - "name": "tx_hash!", - "type_info": "Bytea" - }, - { - "ordinal": 10, - "name": "tx_index_in_block!", - "type_info": "Int4" - }, - { - "ordinal": 11, - "name": "event_index_in_block!", - "type_info": "Int4" - }, - { - "ordinal": 12, - "name": "event_index_in_tx!", - "type_info": "Int4" - }, - { - "ordinal": 13, - "name": "block_timestamp", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false - ] - }, - "hash": "c3af06cc232adb93f16456da07733acd2066a5e238088b39b982b10770f51479" -} diff --git a/core/lib/dal/.sqlx/query-c4835d40921af47bfb4f60102bbba3af74e8e7b5944cb2943b5badb906167046.json b/core/lib/dal/.sqlx/query-c4835d40921af47bfb4f60102bbba3af74e8e7b5944cb2943b5badb906167046.json deleted file mode 100644 index 9ae9d2e50cde..000000000000 --- a/core/lib/dal/.sqlx/query-c4835d40921af47bfb4f60102bbba3af74e8e7b5944cb2943b5badb906167046.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n miniblocks (\n number,\n timestamp,\n hash,\n l1_tx_count,\n l2_tx_count,\n fee_account_address,\n base_fee_per_gas,\n l1_gas_price,\n l2_fair_gas_price,\n gas_per_pubdata_limit,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n virtual_blocks,\n fair_pubdata_price,\n gas_limit,\n logs_bloom,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n NOW(),\n NOW()\n )\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int8", - "Bytea", - "Int4", - "Int4", - "Bytea", - "Numeric", - "Int8", - "Int8", - "Int8", - "Bytea", - "Bytea", - "Int4", - "Int8", - "Int8", - "Int8", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "c4835d40921af47bfb4f60102bbba3af74e8e7b5944cb2943b5badb906167046" -} diff --git a/core/lib/dal/.sqlx/query-85576fdbb4bd6e3a6e43511c065a2e3eaf72dfe0fa96b335b76c9506cb1ebdcc.json b/core/lib/dal/.sqlx/query-c4e81f78ef078cbed2d588be91418997f003e26768c5de663160d89af54a1ee7.json similarity index 78% rename from core/lib/dal/.sqlx/query-85576fdbb4bd6e3a6e43511c065a2e3eaf72dfe0fa96b335b76c9506cb1ebdcc.json rename to core/lib/dal/.sqlx/query-c4e81f78ef078cbed2d588be91418997f003e26768c5de663160d89af54a1ee7.json index 3297d411d8a7..162c722add9b 100644 --- a/core/lib/dal/.sqlx/query-85576fdbb4bd6e3a6e43511c065a2e3eaf72dfe0fa96b335b76c9506cb1ebdcc.json +++ b/core/lib/dal/.sqlx/query-c4e81f78ef078cbed2d588be91418997f003e26768c5de663160d89af54a1ee7.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n protocol_versions.id AS \"minor!\",\n protocol_versions.timestamp,\n protocol_versions.bootloader_code_hash,\n protocol_versions.default_account_code_hash,\n protocol_patches.patch,\n protocol_patches.snark_wrapper_vk_hash\n FROM\n protocol_versions\n JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id\n WHERE\n id = $1\n ORDER BY\n protocol_patches.patch DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n protocol_versions.id AS \"minor!\",\n protocol_versions.timestamp,\n protocol_versions.bootloader_code_hash,\n protocol_versions.default_account_code_hash,\n protocol_patches.patch,\n protocol_patches.snark_wrapper_vk_hash\n FROM\n protocol_versions\n JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id\n WHERE\n id = $1\n ORDER BY\n protocol_patches.patch DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -48,5 +48,5 @@ false ] }, - "hash": "85576fdbb4bd6e3a6e43511c065a2e3eaf72dfe0fa96b335b76c9506cb1ebdcc" + "hash": "c4e81f78ef078cbed2d588be91418997f003e26768c5de663160d89af54a1ee7" } diff --git a/core/lib/dal/.sqlx/query-c5480ba88a93bb7da027e36e0939f1fd7606fdf3e6d4c882cea76eb579c24a93.json b/core/lib/dal/.sqlx/query-c5480ba88a93bb7da027e36e0939f1fd7606fdf3e6d4c882cea76eb579c24a93.json new file mode 100644 index 000000000000..09e34a7e33ac --- /dev/null +++ b/core/lib/dal/.sqlx/query-c5480ba88a93bb7da027e36e0939f1fd7606fdf3e6d4c882cea76eb579c24a93.json @@ -0,0 +1,30 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n miniblocks (\n number,\n timestamp,\n hash,\n l1_tx_count,\n l2_tx_count,\n fee_account_address,\n base_fee_per_gas,\n l1_gas_price,\n l2_fair_gas_price,\n gas_per_pubdata_limit,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n virtual_blocks,\n fair_pubdata_price,\n gas_limit,\n logs_bloom,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n NOW(),\n NOW()\n )\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int8", + "Bytea", + "Int4", + "Int4", + "Bytea", + "Numeric", + "Int8", + "Int8", + "Int8", + "Bytea", + "Bytea", + "Int4", + "Int8", + "Int8", + "Int8", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "c5480ba88a93bb7da027e36e0939f1fd7606fdf3e6d4c882cea76eb579c24a93" +} diff --git a/core/lib/dal/.sqlx/query-c5aef75dbeb520c965a0996abed9713f437db492e2075ca69e11e2ef5728ccaa.json b/core/lib/dal/.sqlx/query-c5aef75dbeb520c965a0996abed9713f437db492e2075ca69e11e2ef5728ccaa.json deleted file mode 100644 index 6dd2f6cc7a9f..000000000000 --- a/core/lib/dal/.sqlx/query-c5aef75dbeb520c965a0996abed9713f437db492e2075ca69e11e2ef5728ccaa.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n base_token_ratios (numerator, denominator, ratio_timestamp, created_at, updated_at)\n VALUES\n ($1, $2, $3, NOW(), NOW())\n RETURNING\n id\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [ - "Numeric", - "Numeric", - "Timestamp" - ] - }, - "nullable": [ - false - ] - }, - "hash": "c5aef75dbeb520c965a0996abed9713f437db492e2075ca69e11e2ef5728ccaa" -} diff --git a/core/lib/dal/.sqlx/query-c5dfe49f8042f773ced96f8363819da280e72546298b615b88662fa4a19f2bdf.json b/core/lib/dal/.sqlx/query-c5dfe49f8042f773ced96f8363819da280e72546298b615b88662fa4a19f2bdf.json new file mode 100644 index 000000000000..532d1d929b47 --- /dev/null +++ b/core/lib/dal/.sqlx/query-c5dfe49f8042f773ced96f8363819da280e72546298b615b88662fa4a19f2bdf.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n vm_runner_bwip (l1_batch_number, created_at, updated_at, processing_started_at)\n VALUES\n ($1, NOW(), NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW(),\n processing_started_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [] + }, + "hash": "c5dfe49f8042f773ced96f8363819da280e72546298b615b88662fa4a19f2bdf" +} diff --git a/core/lib/dal/.sqlx/query-c69d19005dd28bd0abfc84e29fd9442f610a6c57280615eb8c982a4afb847aff.json b/core/lib/dal/.sqlx/query-c69d19005dd28bd0abfc84e29fd9442f610a6c57280615eb8c982a4afb847aff.json new file mode 100644 index 000000000000..b12a7fb24906 --- /dev/null +++ b/core/lib/dal/.sqlx/query-c69d19005dd28bd0abfc84e29fd9442f610a6c57280615eb8c982a4afb847aff.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n snapshots (\n version,\n l1_batch_number,\n storage_logs_filepaths,\n factory_deps_filepath,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, ARRAY_FILL(''::TEXT, ARRAY[$3::INTEGER]), $4, NOW(), NOW())\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int8", + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "c69d19005dd28bd0abfc84e29fd9442f610a6c57280615eb8c982a4afb847aff" +} diff --git a/core/lib/dal/.sqlx/query-c6d523c6ae857022318350a2f210d7eaeeb4549ed59b58f8d984be2a22a80355.json b/core/lib/dal/.sqlx/query-c6d523c6ae857022318350a2f210d7eaeeb4549ed59b58f8d984be2a22a80355.json deleted file mode 100644 index ebae1f42fbbb..000000000000 --- a/core/lib/dal/.sqlx/query-c6d523c6ae857022318350a2f210d7eaeeb4549ed59b58f8d984be2a22a80355.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n MAX(l1_batches.number)\n FROM\n l1_batches\n JOIN eth_txs ON (l1_batches.eth_commit_tx_id = eth_txs.id)\n JOIN eth_txs_history AS commit_tx ON (eth_txs.confirmed_eth_tx_history_id = commit_tx.id)\n WHERE\n commit_tx.confirmed_at IS NOT NULL\n AND eth_prove_tx_id IS NOT NULL\n AND eth_execute_tx_id IS NULL\n AND EXTRACT(\n epoch\n FROM\n commit_tx.confirmed_at\n ) < $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "max", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Numeric" - ] - }, - "nullable": [ - null - ] - }, - "hash": "c6d523c6ae857022318350a2f210d7eaeeb4549ed59b58f8d984be2a22a80355" -} diff --git a/core/lib/dal/.sqlx/query-c8dd57fb86247e67896485c6295d5cfa6c8498e8a58b8ae6fe3a1584401d3b4b.json b/core/lib/dal/.sqlx/query-c8dd57fb86247e67896485c6295d5cfa6c8498e8a58b8ae6fe3a1584401d3b4b.json new file mode 100644 index 000000000000..f442976281d5 --- /dev/null +++ b/core/lib/dal/.sqlx/query-c8dd57fb86247e67896485c6295d5cfa6c8498e8a58b8ae6fe3a1584401d3b4b.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n consensus_replica_state (fake_key, global_config, genesis, state)\n VALUES\n (TRUE, $1, $2, $3)\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Jsonb", + "Jsonb", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "c8dd57fb86247e67896485c6295d5cfa6c8498e8a58b8ae6fe3a1584401d3b4b" +} diff --git a/core/lib/dal/.sqlx/query-6849be0788a509e4e68acc2da4bfadbcfc343374fad173df0cc8db38419a9726.json b/core/lib/dal/.sqlx/query-c9742c7f58c5c0f676cee0d0d3a9309c1b45d0134a6c6e15533443353db3bee6.json similarity index 63% rename from core/lib/dal/.sqlx/query-6849be0788a509e4e68acc2da4bfadbcfc343374fad173df0cc8db38419a9726.json rename to core/lib/dal/.sqlx/query-c9742c7f58c5c0f676cee0d0d3a9309c1b45d0134a6c6e15533443353db3bee6.json index 72dbb2a4178b..cabf48d4df78 100644 --- a/core/lib/dal/.sqlx/query-6849be0788a509e4e68acc2da4bfadbcfc343374fad173df0cc8db38419a9726.json +++ b/core/lib/dal/.sqlx/query-c9742c7f58c5c0f676cee0d0d3a9309c1b45d0134a6c6e15533443353db3bee6.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM tokens\n WHERE\n l2_address = ANY ($1)\n ", + "query": "\n DELETE FROM tokens\n WHERE\n l2_address = ANY($1)\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "6849be0788a509e4e68acc2da4bfadbcfc343374fad173df0cc8db38419a9726" + "hash": "c9742c7f58c5c0f676cee0d0d3a9309c1b45d0134a6c6e15533443353db3bee6" } diff --git a/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json b/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json new file mode 100644 index 000000000000..fb28539ccdf6 --- /dev/null +++ b/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json @@ -0,0 +1,38 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH\n soft AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Soft'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n ),\n \n hard AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Hard'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n )\n \n SELECT\n soft.pruned_l1_batch AS last_soft_pruned_l1_batch,\n soft.pruned_miniblock AS last_soft_pruned_miniblock,\n hard.pruned_l1_batch AS last_hard_pruned_l1_batch,\n hard.pruned_miniblock AS last_hard_pruned_miniblock\n FROM\n soft\n FULL JOIN hard ON TRUE\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "last_soft_pruned_l1_batch", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "last_soft_pruned_miniblock", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "last_hard_pruned_l1_batch", + "type_info": "Int8" + }, + { + "ordinal": 3, + "name": "last_hard_pruned_miniblock", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + true, + true, + true, + true + ] + }, + "hash": "c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d" +} diff --git a/core/lib/dal/.sqlx/query-ca428423f278feea2942fd2c78fc5223c9d5e2e42d89bb456d24c601edc06a05.json b/core/lib/dal/.sqlx/query-ca428423f278feea2942fd2c78fc5223c9d5e2e42d89bb456d24c601edc06a05.json new file mode 100644 index 000000000000..c234cbe42356 --- /dev/null +++ b/core/lib/dal/.sqlx/query-ca428423f278feea2942fd2c78fc5223c9d5e2e42d89bb456d24c601edc06a05.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n nonce,\n signature,\n gas_limit,\n max_fee_per_gas,\n max_priority_fee_per_gas,\n gas_per_pubdata_limit,\n input,\n data,\n tx_format,\n contract_address,\n value,\n paymaster,\n paymaster_input,\n execution_info,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n FALSE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n JSONB_BUILD_OBJECT(\n 'gas_used',\n $16::BIGINT,\n 'storage_writes',\n $17::INT,\n 'contracts_used',\n $18::INT\n ),\n $19,\n NOW(),\n NOW()\n )\n ON CONFLICT (initiator_address, nonce) DO\n UPDATE\n SET\n hash = $1,\n signature = $4,\n gas_limit = $5,\n max_fee_per_gas = $6,\n max_priority_fee_per_gas = $7,\n gas_per_pubdata_limit = $8,\n input = $9,\n data = $10,\n tx_format = $11,\n contract_address = $12,\n value = $13,\n paymaster = $14,\n paymaster_input = $15,\n execution_info\n = JSONB_BUILD_OBJECT(\n 'gas_used',\n $16::BIGINT,\n 'storage_writes',\n $17::INT,\n 'contracts_used',\n $18::INT\n ),\n in_mempool = FALSE,\n received_at = $19,\n created_at = NOW(),\n updated_at = NOW(),\n error = NULL\n WHERE\n transactions.is_priority = FALSE\n AND transactions.miniblock_number IS NULL\n RETURNING\n (\n SELECT\n hash\n FROM\n transactions\n WHERE\n transactions.initiator_address = $2\n AND transactions.nonce = $3\n ) IS NOT NULL AS \"is_replaced!\"\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "is_replaced!", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Int8", + "Bytea", + "Numeric", + "Numeric", + "Numeric", + "Numeric", + "Bytea", + "Jsonb", + "Int4", + "Bytea", + "Numeric", + "Bytea", + "Bytea", + "Int8", + "Int4", + "Int4", + "Timestamp" + ] + }, + "nullable": [ + null + ] + }, + "hash": "ca428423f278feea2942fd2c78fc5223c9d5e2e42d89bb456d24c601edc06a05" +} diff --git a/core/lib/dal/.sqlx/query-58f900812efdb615f6286eb4212c3252680594256dccb0d7e51444f613011980.json b/core/lib/dal/.sqlx/query-cda64a69c8df8eaf67d09324f8283c5b416cbb2c1a1e2712dce1f01835181c3b.json similarity index 85% rename from core/lib/dal/.sqlx/query-58f900812efdb615f6286eb4212c3252680594256dccb0d7e51444f613011980.json rename to core/lib/dal/.sqlx/query-cda64a69c8df8eaf67d09324f8283c5b416cbb2c1a1e2712dce1f01835181c3b.json index 0b45e2c25c2c..69718cebdbe0 100644 --- a/core/lib/dal/.sqlx/query-58f900812efdb615f6286eb4212c3252680594256dccb0d7e51444f613011980.json +++ b/core/lib/dal/.sqlx/query-cda64a69c8df8eaf67d09324f8283c5b416cbb2c1a1e2712dce1f01835181c3b.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n miniblock_number,\n log_index_in_miniblock,\n log_index_in_tx,\n tx_hash,\n l1_batch_number,\n shard_id,\n is_service,\n tx_index_in_miniblock,\n tx_index_in_l1_batch,\n sender,\n key,\n value\n FROM\n l2_to_l1_logs\n JOIN miniblocks ON l2_to_l1_logs.miniblock_number = miniblocks.number\n WHERE\n l1_batch_number = $1\n ORDER BY\n miniblock_number,\n log_index_in_miniblock\n ", + "query": "\n SELECT\n miniblock_number,\n log_index_in_miniblock,\n log_index_in_tx,\n tx_hash,\n l1_batch_number,\n shard_id,\n is_service,\n tx_index_in_miniblock,\n tx_index_in_l1_batch,\n sender,\n key,\n value\n FROM\n l2_to_l1_logs\n JOIN miniblocks ON l2_to_l1_logs.miniblock_number = miniblocks.number\n WHERE\n l1_batch_number = $1\n ORDER BY\n miniblock_number,\n log_index_in_miniblock\n ", "describe": { "columns": [ { @@ -84,5 +84,5 @@ false ] }, - "hash": "58f900812efdb615f6286eb4212c3252680594256dccb0d7e51444f613011980" + "hash": "cda64a69c8df8eaf67d09324f8283c5b416cbb2c1a1e2712dce1f01835181c3b" } diff --git a/core/lib/dal/.sqlx/query-29a9350164fc0b2983f753e105a70e583b455383eec526eee3acfe6670e30f2f.json b/core/lib/dal/.sqlx/query-cda66c56ab9ff1dcb1b2882a23c4acdfc5af364d7271c06db0c95e0f1b0e33f9.json similarity index 56% rename from core/lib/dal/.sqlx/query-29a9350164fc0b2983f753e105a70e583b455383eec526eee3acfe6670e30f2f.json rename to core/lib/dal/.sqlx/query-cda66c56ab9ff1dcb1b2882a23c4acdfc5af364d7271c06db0c95e0f1b0e33f9.json index 7582e0f64e75..ec79549adbd8 100644 --- a/core/lib/dal/.sqlx/query-29a9350164fc0b2983f753e105a70e583b455383eec526eee3acfe6670e30f2f.json +++ b/core/lib/dal/.sqlx/query-cda66c56ab9ff1dcb1b2882a23c4acdfc5af364d7271c06db0c95e0f1b0e33f9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE miniblocks\n SET\n logs_bloom = data.logs_bloom\n FROM\n (\n SELECT\n UNNEST($1::BIGINT[]) AS number,\n UNNEST($2::BYTEA[]) AS logs_bloom\n ) AS data\n WHERE\n miniblocks.number = data.number\n ", + "query": "\n UPDATE miniblocks\n SET\n logs_bloom = data.logs_bloom\n FROM\n (\n SELECT\n UNNEST($1::BIGINT []) AS number,\n UNNEST($2::BYTEA []) AS logs_bloom\n ) AS data\n WHERE\n miniblocks.number = data.number\n ", "describe": { "columns": [], "parameters": { @@ -11,5 +11,5 @@ }, "nullable": [] }, - "hash": "29a9350164fc0b2983f753e105a70e583b455383eec526eee3acfe6670e30f2f" + "hash": "cda66c56ab9ff1dcb1b2882a23c4acdfc5af364d7271c06db0c95e0f1b0e33f9" } diff --git a/core/lib/dal/.sqlx/query-cf8cff1e6d277088519ef7dfbdb1885d320c146cd8fad77c107ef12fa38e6c98.json b/core/lib/dal/.sqlx/query-cf8cff1e6d277088519ef7dfbdb1885d320c146cd8fad77c107ef12fa38e6c98.json deleted file mode 100644 index 1bd791a3f829..000000000000 --- a/core/lib/dal/.sqlx/query-cf8cff1e6d277088519ef7dfbdb1885d320c146cd8fad77c107ef12fa38e6c98.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n nonce,\n signature,\n gas_limit,\n max_fee_per_gas,\n max_priority_fee_per_gas,\n gas_per_pubdata_limit,\n input,\n data,\n tx_format,\n contract_address,\n value,\n paymaster,\n paymaster_input,\n execution_info,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n FALSE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n JSONB_BUILD_OBJECT('gas_used', $16::BIGINT, 'storage_writes', $17::INT, 'contracts_used', $18::INT),\n $19,\n NOW(),\n NOW()\n )\n ON CONFLICT (initiator_address, nonce) DO\n UPDATE\n SET\n hash = $1,\n signature = $4,\n gas_limit = $5,\n max_fee_per_gas = $6,\n max_priority_fee_per_gas = $7,\n gas_per_pubdata_limit = $8,\n input = $9,\n data = $10,\n tx_format = $11,\n contract_address = $12,\n value = $13,\n paymaster = $14,\n paymaster_input = $15,\n execution_info = JSONB_BUILD_OBJECT('gas_used', $16::BIGINT, 'storage_writes', $17::INT, 'contracts_used', $18::INT),\n in_mempool = FALSE,\n received_at = $19,\n created_at = NOW(),\n updated_at = NOW(),\n error = NULL\n WHERE\n transactions.is_priority = FALSE\n AND transactions.miniblock_number IS NULL\n RETURNING\n (\n SELECT\n hash\n FROM\n transactions\n WHERE\n transactions.initiator_address = $2\n AND transactions.nonce = $3\n ) IS NOT NULL AS \"is_replaced!\"\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "is_replaced!", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Bytea", - "Bytea", - "Int8", - "Bytea", - "Numeric", - "Numeric", - "Numeric", - "Numeric", - "Bytea", - "Jsonb", - "Int4", - "Bytea", - "Numeric", - "Bytea", - "Bytea", - "Int8", - "Int4", - "Int4", - "Timestamp" - ] - }, - "nullable": [ - null - ] - }, - "hash": "cf8cff1e6d277088519ef7dfbdb1885d320c146cd8fad77c107ef12fa38e6c98" -} diff --git a/core/lib/dal/.sqlx/query-0385576f1fb3836fc04a6cde3e92c03e1de8292eb0ea1e026ba1b32a3745c261.json b/core/lib/dal/.sqlx/query-cff500ffe0b6586dd96eb2d3620dd6542fd54ceac41dd41b995a8409c5ab046c.json similarity index 55% rename from core/lib/dal/.sqlx/query-0385576f1fb3836fc04a6cde3e92c03e1de8292eb0ea1e026ba1b32a3745c261.json rename to core/lib/dal/.sqlx/query-cff500ffe0b6586dd96eb2d3620dd6542fd54ceac41dd41b995a8409c5ab046c.json index a98cbb18034a..ec8bfeafc781 100644 --- a/core/lib/dal/.sqlx/query-0385576f1fb3836fc04a6cde3e92c03e1de8292eb0ea1e026ba1b32a3745c261.json +++ b/core/lib/dal/.sqlx/query-cff500ffe0b6586dd96eb2d3620dd6542fd54ceac41dd41b995a8409c5ab046c.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n storage_logs.hashed_key AS \"hashed_key!\",\n storage_logs.value AS \"value!\",\n storage_logs.miniblock_number AS \"miniblock_number!\",\n initial_writes.l1_batch_number AS \"l1_batch_number!\",\n initial_writes.index\n FROM\n (\n SELECT\n hashed_key,\n MAX(ARRAY[miniblock_number, operation_number]::INT[]) AS op\n FROM\n storage_logs\n WHERE\n miniblock_number <= $1\n AND hashed_key >= $3\n AND hashed_key <= $4\n GROUP BY\n hashed_key\n ORDER BY\n hashed_key\n ) AS keys\n INNER JOIN storage_logs ON keys.hashed_key = storage_logs.hashed_key\n AND storage_logs.miniblock_number = keys.op[1]\n AND storage_logs.operation_number = keys.op[2]\n INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key\n WHERE\n initial_writes.l1_batch_number <= $2\n ", + "query": "\n SELECT\n storage_logs.hashed_key AS \"hashed_key!\",\n storage_logs.value AS \"value!\",\n storage_logs.miniblock_number AS \"miniblock_number!\",\n initial_writes.l1_batch_number AS \"l1_batch_number!\",\n initial_writes.index\n FROM\n (\n SELECT\n hashed_key,\n MAX(ARRAY[miniblock_number, operation_number]::INT []) AS op\n FROM\n storage_logs\n WHERE\n miniblock_number <= $1\n AND hashed_key >= $3\n AND hashed_key <= $4\n GROUP BY\n hashed_key\n ORDER BY\n hashed_key\n ) AS keys\n INNER JOIN storage_logs\n ON\n keys.hashed_key = storage_logs.hashed_key\n AND storage_logs.miniblock_number = keys.op[1]\n AND storage_logs.operation_number = keys.op[2]\n INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key\n WHERE\n initial_writes.l1_batch_number <= $2\n ", "describe": { "columns": [ { @@ -45,5 +45,5 @@ false ] }, - "hash": "0385576f1fb3836fc04a6cde3e92c03e1de8292eb0ea1e026ba1b32a3745c261" + "hash": "cff500ffe0b6586dd96eb2d3620dd6542fd54ceac41dd41b995a8409c5ab046c" } diff --git a/core/lib/dal/.sqlx/query-4aeb7dcd79000540c03fb12c0608ab71005d70f13ed32172e47166f71b3aef80.json b/core/lib/dal/.sqlx/query-d08cb5418fe30fd7417f8bf0505c7fbb13c7719f73dba603053044b794d786eb.json similarity index 56% rename from core/lib/dal/.sqlx/query-4aeb7dcd79000540c03fb12c0608ab71005d70f13ed32172e47166f71b3aef80.json rename to core/lib/dal/.sqlx/query-d08cb5418fe30fd7417f8bf0505c7fbb13c7719f73dba603053044b794d786eb.json index feb8f29855e4..677563873e0d 100644 --- a/core/lib/dal/.sqlx/query-4aeb7dcd79000540c03fb12c0608ab71005d70f13ed32172e47166f71b3aef80.json +++ b/core/lib/dal/.sqlx/query-d08cb5418fe30fd7417f8bf0505c7fbb13c7719f73dba603053044b794d786eb.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n nonce\n FROM\n eth_txs\n WHERE\n from_addr IS NOT DISTINCT FROM $1 -- can't just use equality as NULL != NULL\\\n AND is_gateway = $2\n ORDER BY\n id DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n nonce\n FROM\n eth_txs\n WHERE\n -- can't just use equality as NULL != NULL\n from_addr IS NOT DISTINCT FROM $1\n AND is_gateway = $2\n ORDER BY\n id DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -19,5 +19,5 @@ false ] }, - "hash": "4aeb7dcd79000540c03fb12c0608ab71005d70f13ed32172e47166f71b3aef80" + "hash": "d08cb5418fe30fd7417f8bf0505c7fbb13c7719f73dba603053044b794d786eb" } diff --git a/core/lib/dal/.sqlx/query-d0db89030ed6979ecba6786aef1ac9ff144a09e68db07e4ca1c1de105765711f.json b/core/lib/dal/.sqlx/query-d0db89030ed6979ecba6786aef1ac9ff144a09e68db07e4ca1c1de105765711f.json new file mode 100644 index 000000000000..a4f55f53f8cb --- /dev/null +++ b/core/lib/dal/.sqlx/query-d0db89030ed6979ecba6786aef1ac9ff144a09e68db07e4ca1c1de105765711f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n compiler_versions (version, compiler, created_at, updated_at)\n SELECT\n u.version,\n $2,\n NOW(),\n NOW()\n FROM\n UNNEST($1::TEXT []) AS u (version)\n ON CONFLICT (version, compiler) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "TextArray", + "Text" + ] + }, + "nullable": [] + }, + "hash": "d0db89030ed6979ecba6786aef1ac9ff144a09e68db07e4ca1c1de105765711f" +} diff --git a/core/lib/dal/.sqlx/query-d1490262c7a2a583928a611ae69eb0539849f7fd590712103db7d45d119caca2.json b/core/lib/dal/.sqlx/query-d1490262c7a2a583928a611ae69eb0539849f7fd590712103db7d45d119caca2.json new file mode 100644 index 000000000000..e3b05aff72a2 --- /dev/null +++ b/core/lib/dal/.sqlx/query-d1490262c7a2a583928a611ae69eb0539849f7fd590712103db7d45d119caca2.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n call_traces (tx_hash, call_trace)\n SELECT\n u.tx_hash,\n u.call_trace\n FROM\n UNNEST($1::bytea [], $2::bytea []) AS u (tx_hash, call_trace)\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray" + ] + }, + "nullable": [] + }, + "hash": "d1490262c7a2a583928a611ae69eb0539849f7fd590712103db7d45d119caca2" +} diff --git a/core/lib/dal/.sqlx/query-d3abe74360732659a1a35a176679411ba30ac67080552279d821d66b1b804db3.json b/core/lib/dal/.sqlx/query-d3abe74360732659a1a35a176679411ba30ac67080552279d821d66b1b804db3.json deleted file mode 100644 index 2b5eeec2e638..000000000000 --- a/core/lib/dal/.sqlx/query-d3abe74360732659a1a35a176679411ba30ac67080552279d821d66b1b804db3.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n vm_runner_protective_reads (l1_batch_number, created_at, updated_at, processing_started_at)\n VALUES\n ($1, NOW(), NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW(),\n processing_started_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [] - }, - "hash": "d3abe74360732659a1a35a176679411ba30ac67080552279d821d66b1b804db3" -} diff --git a/core/lib/dal/.sqlx/query-d3b09cbcddf6238b358d32d57678242aad3e9a47400f6d6837a35f4c54a216b9.json b/core/lib/dal/.sqlx/query-d3b09cbcddf6238b358d32d57678242aad3e9a47400f6d6837a35f4c54a216b9.json deleted file mode 100644 index 8770a9b596ea..000000000000 --- a/core/lib/dal/.sqlx/query-d3b09cbcddf6238b358d32d57678242aad3e9a47400f6d6837a35f4c54a216b9.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN eth_txs_history AS execute_tx ON (l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id)\n WHERE\n execute_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false - ] - }, - "hash": "d3b09cbcddf6238b358d32d57678242aad3e9a47400f6d6837a35f4c54a216b9" -} diff --git a/core/lib/dal/.sqlx/query-ba2343a38e37d104786f9276d91f67d2ef1428c61ae84003c9b52b03204d1f0a.json b/core/lib/dal/.sqlx/query-d43ae07cf1539826363573d121392687cfe890fe89c748f836bad6eb0cc0fcf5.json similarity index 70% rename from core/lib/dal/.sqlx/query-ba2343a38e37d104786f9276d91f67d2ef1428c61ae84003c9b52b03204d1f0a.json rename to core/lib/dal/.sqlx/query-d43ae07cf1539826363573d121392687cfe890fe89c748f836bad6eb0cc0fcf5.json index ff6082651184..650b9f8d4399 100644 --- a/core/lib/dal/.sqlx/query-ba2343a38e37d104786f9276d91f67d2ef1428c61ae84003c9b52b03204d1f0a.json +++ b/core/lib/dal/.sqlx/query-d43ae07cf1539826363573d121392687cfe890fe89c748f836bad6eb0cc0fcf5.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n DELETE FROM transactions\n WHERE\n in_mempool = TRUE\n AND initiator_address = ANY ($1)\n ", + "query": "\n DELETE FROM transactions\n WHERE\n in_mempool = TRUE\n AND initiator_address = ANY($1)\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "ba2343a38e37d104786f9276d91f67d2ef1428c61ae84003c9b52b03204d1f0a" + "hash": "d43ae07cf1539826363573d121392687cfe890fe89c748f836bad6eb0cc0fcf5" } diff --git a/core/lib/dal/.sqlx/query-b75e3d2fecbf5d85e93848b7a35180abbd76956e073432af8d8500327b74e488.json b/core/lib/dal/.sqlx/query-d46fcdcb100b240aa5f2b23d07e6abe3514e755546ac39a5fddae03a3a435e3d.json similarity index 64% rename from core/lib/dal/.sqlx/query-b75e3d2fecbf5d85e93848b7a35180abbd76956e073432af8d8500327b74e488.json rename to core/lib/dal/.sqlx/query-d46fcdcb100b240aa5f2b23d07e6abe3514e755546ac39a5fddae03a3a435e3d.json index 91d7b677959a..f9c72f3d34f6 100644 --- a/core/lib/dal/.sqlx/query-b75e3d2fecbf5d85e93848b7a35180abbd76956e073432af8d8500327b74e488.json +++ b/core/lib/dal/.sqlx/query-d46fcdcb100b240aa5f2b23d07e6abe3514e755546ac39a5fddae03a3a435e3d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n VERSION\n FROM\n compiler_versions\n WHERE\n compiler = $1\n ORDER BY\n VERSION\n ", + "query": "\n SELECT\n VERSION\n FROM\n COMPILER_VERSIONS\n WHERE\n COMPILER = $1\n ORDER BY\n VERSION\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "b75e3d2fecbf5d85e93848b7a35180abbd76956e073432af8d8500327b74e488" + "hash": "d46fcdcb100b240aa5f2b23d07e6abe3514e755546ac39a5fddae03a3a435e3d" } diff --git a/core/lib/dal/.sqlx/query-d47574939bdfb157a621f86a3ea3a61bf579a0dbeb01c545fa61b10a0047297b.json b/core/lib/dal/.sqlx/query-d47574939bdfb157a621f86a3ea3a61bf579a0dbeb01c545fa61b10a0047297b.json new file mode 100644 index 000000000000..0915ef2b1950 --- /dev/null +++ b/core/lib/dal/.sqlx/query-d47574939bdfb157a621f86a3ea3a61bf579a0dbeb01c545fa61b10a0047297b.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n pruning_log (\n pruned_l1_batch,\n pruned_miniblock,\n type,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, $3, NOW(), NOW())\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int8", + { + "Custom": { + "name": "prune_type", + "kind": { + "Enum": [ + "Soft", + "Hard" + ] + } + } + } + ] + }, + "nullable": [] + }, + "hash": "d47574939bdfb157a621f86a3ea3a61bf579a0dbeb01c545fa61b10a0047297b" +} diff --git a/core/lib/dal/.sqlx/query-f1a90090c192d68367e799188356efe8d41759bbdcdd6d39db93208f2664f03a.json b/core/lib/dal/.sqlx/query-d7bd14e6550df54657c37d389c4ed79cde6d6d0a75702953b16df1a9748b11f5.json similarity index 64% rename from core/lib/dal/.sqlx/query-f1a90090c192d68367e799188356efe8d41759bbdcdd6d39db93208f2664f03a.json rename to core/lib/dal/.sqlx/query-d7bd14e6550df54657c37d389c4ed79cde6d6d0a75702953b16df1a9748b11f5.json index 616173355a94..5d47321965c5 100644 --- a/core/lib/dal/.sqlx/query-f1a90090c192d68367e799188356efe8d41759bbdcdd6d39db93208f2664f03a.json +++ b/core/lib/dal/.sqlx/query-d7bd14e6550df54657c37d389c4ed79cde6d6d0a75702953b16df1a9748b11f5.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n INDEX\n FROM\n initial_writes\n WHERE\n hashed_key = $1\n ", + "query": "\n SELECT\n INDEX\n FROM\n INITIAL_WRITES\n WHERE\n HASHED_KEY = $1\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "f1a90090c192d68367e799188356efe8d41759bbdcdd6d39db93208f2664f03a" + "hash": "d7bd14e6550df54657c37d389c4ed79cde6d6d0a75702953b16df1a9748b11f5" } diff --git a/core/lib/dal/.sqlx/query-0fef49a649d20c9fd263c1dfa40daa9b94d398c635c37746736e98f1f18fcca7.json b/core/lib/dal/.sqlx/query-d89eabd1edb4ee4657249f9f4ab729b9149fee37c5ef7d69e259ee33cb8ca860.json similarity index 89% rename from core/lib/dal/.sqlx/query-0fef49a649d20c9fd263c1dfa40daa9b94d398c635c37746736e98f1f18fcca7.json rename to core/lib/dal/.sqlx/query-d89eabd1edb4ee4657249f9f4ab729b9149fee37c5ef7d69e259ee33cb8ca860.json index adfd1919db51..fa1a5d6741ad 100644 --- a/core/lib/dal/.sqlx/query-0fef49a649d20c9fd263c1dfa40daa9b94d398c635c37746736e98f1f18fcca7.json +++ b/core/lib/dal/.sqlx/query-d89eabd1edb4ee4657249f9f4ab729b9149fee37c5ef7d69e259ee33cb8ca860.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE tee_verifier_input_producer_jobs\n SET\n status = $1,\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n tee_verifier_input_producer_jobs\n WHERE\n status = $2\n OR (\n status = $1\n AND processing_started_at < NOW() - $4::INTERVAL\n )\n OR (\n status = $3\n AND attempts < $5\n )\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n tee_verifier_input_producer_jobs.l1_batch_number\n ", + "query": "\n UPDATE tee_verifier_input_producer_jobs\n SET\n status = $1,\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n tee_verifier_input_producer_jobs\n WHERE\n status = $2\n OR (\n status = $1\n AND processing_started_at < NOW() - $4::INTERVAL\n )\n OR (\n status = $3\n AND attempts < $5\n )\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n tee_verifier_input_producer_jobs.l1_batch_number\n ", "describe": { "columns": [ { @@ -61,5 +61,5 @@ false ] }, - "hash": "0fef49a649d20c9fd263c1dfa40daa9b94d398c635c37746736e98f1f18fcca7" + "hash": "d89eabd1edb4ee4657249f9f4ab729b9149fee37c5ef7d69e259ee33cb8ca860" } diff --git a/core/lib/dal/.sqlx/query-dcfe6ef35a598098276d2cc69a05320b4081c66e965f359d70fba7670b88a5f6.json b/core/lib/dal/.sqlx/query-dcfe6ef35a598098276d2cc69a05320b4081c66e965f359d70fba7670b88a5f6.json new file mode 100644 index 000000000000..183fe4a0ab2a --- /dev/null +++ b/core/lib/dal/.sqlx/query-dcfe6ef35a598098276d2cc69a05320b4081c66e965f359d70fba7670b88a5f6.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n MAX(INDEX) AS \"max?\"\n FROM\n INITIAL_WRITES\n WHERE\n L1_BATCH_NUMBER = (\n SELECT\n MAX(L1_BATCH_NUMBER) AS \"max?\"\n FROM\n INITIAL_WRITES\n WHERE\n L1_BATCH_NUMBER <= $1\n )\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "max?", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + null + ] + }, + "hash": "dcfe6ef35a598098276d2cc69a05320b4081c66e965f359d70fba7670b88a5f6" +} diff --git a/core/lib/dal/.sqlx/query-ddfb7ba0592f1e6714a4496cee18e7265828e3ae78e391ef235b700f0adfe5e4.json b/core/lib/dal/.sqlx/query-ddfb7ba0592f1e6714a4496cee18e7265828e3ae78e391ef235b700f0adfe5e4.json new file mode 100644 index 000000000000..472c0cb26953 --- /dev/null +++ b/core/lib/dal/.sqlx/query-ddfb7ba0592f1e6714a4496cee18e7265828e3ae78e391ef235b700f0adfe5e4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE proof_generation_details\n SET\n status = 'picked_by_prover',\n updated_at = NOW(),\n prover_taken_at = NOW()\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n proof_generation_details\n LEFT JOIN l1_batches ON l1_batch_number = l1_batches.number\n WHERE\n (\n vm_run_data_blob_url IS NOT NULL\n AND proof_gen_data_blob_url IS NOT NULL\n AND l1_batches.hash IS NOT NULL\n AND l1_batches.aux_data_hash IS NOT NULL\n AND l1_batches.meta_parameters_hash IS NOT NULL\n AND status = 'unpicked'\n )\n OR (\n status = 'picked_by_prover'\n AND prover_taken_at < NOW() - $1::INTERVAL\n )\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n )\n RETURNING\n proof_generation_details.l1_batch_number\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Interval" + ] + }, + "nullable": [ + false + ] + }, + "hash": "ddfb7ba0592f1e6714a4496cee18e7265828e3ae78e391ef235b700f0adfe5e4" +} diff --git a/core/lib/dal/.sqlx/query-5f7034d22251a893249208c5ff8fa5c8bf46bc0cea4ac2b25ecde236c30ae32d.json b/core/lib/dal/.sqlx/query-de784f549ceda62e37459519b52e7be93b12319c041751bc4138fa64258ecd5c.json similarity index 87% rename from core/lib/dal/.sqlx/query-5f7034d22251a893249208c5ff8fa5c8bf46bc0cea4ac2b25ecde236c30ae32d.json rename to core/lib/dal/.sqlx/query-de784f549ceda62e37459519b52e7be93b12319c041751bc4138fa64258ecd5c.json index 0ae6e3bff4b1..9cc6312f70e8 100644 --- a/core/lib/dal/.sqlx/query-5f7034d22251a893249208c5ff8fa5c8bf46bc0cea4ac2b25ecde236c30ae32d.json +++ b/core/lib/dal/.sqlx/query-de784f549ceda62e37459519b52e7be93b12319c041751bc4138fa64258ecd5c.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n l1_address,\n l2_address,\n NAME,\n symbol,\n decimals\n FROM\n tokens\n WHERE\n well_known = TRUE\n ORDER BY\n symbol\n ", + "query": "\n SELECT\n l1_address,\n l2_address,\n name,\n symbol,\n decimals\n FROM\n tokens\n WHERE\n well_known = TRUE\n ORDER BY\n symbol\n ", "describe": { "columns": [ { @@ -40,5 +40,5 @@ false ] }, - "hash": "5f7034d22251a893249208c5ff8fa5c8bf46bc0cea4ac2b25ecde236c30ae32d" + "hash": "de784f549ceda62e37459519b52e7be93b12319c041751bc4138fa64258ecd5c" } diff --git a/core/lib/dal/.sqlx/query-e7d0b7c132b80195dae7cbf50355eb148aa6d1dbd69bf3fe48522101a6ea0bcb.json b/core/lib/dal/.sqlx/query-e7d0b7c132b80195dae7cbf50355eb148aa6d1dbd69bf3fe48522101a6ea0bcb.json deleted file mode 100644 index 576484cd4206..000000000000 --- a/core/lib/dal/.sqlx/query-e7d0b7c132b80195dae7cbf50355eb148aa6d1dbd69bf3fe48522101a6ea0bcb.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n available_batches AS (\n SELECT\n MAX(number) AS \"last_batch\"\n FROM\n l1_batches\n ),\n processed_batches AS (\n SELECT\n COALESCE(MAX(l1_batch_number), $1) + $2 AS \"last_ready_batch\"\n FROM\n vm_runner_bwip\n WHERE\n time_taken IS NOT NULL\n )\n SELECT\n LEAST(last_batch, last_ready_batch) AS \"last_ready_batch!\"\n FROM\n available_batches\n FULL JOIN processed_batches ON TRUE\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "last_ready_batch!", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, - "nullable": [ - true - ] - }, - "hash": "e7d0b7c132b80195dae7cbf50355eb148aa6d1dbd69bf3fe48522101a6ea0bcb" -} diff --git a/core/lib/dal/.sqlx/query-a48c92f557e5e3a2674ce0dee9cd92f5a547150590b8c221c4065eab11175c7a.json b/core/lib/dal/.sqlx/query-ea4a4f5e0b2abe5e8f2745cf42e51063eae38da5d4b874f74c57b26f188fdeea.json similarity index 69% rename from core/lib/dal/.sqlx/query-a48c92f557e5e3a2674ce0dee9cd92f5a547150590b8c221c4065eab11175c7a.json rename to core/lib/dal/.sqlx/query-ea4a4f5e0b2abe5e8f2745cf42e51063eae38da5d4b874f74c57b26f188fdeea.json index 49e547e5564c..53ba11c6dbaf 100644 --- a/core/lib/dal/.sqlx/query-a48c92f557e5e3a2674ce0dee9cd92f5a547150590b8c221c4065eab11175c7a.json +++ b/core/lib/dal/.sqlx/query-ea4a4f5e0b2abe5e8f2745cf42e51063eae38da5d4b874f74c57b26f188fdeea.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n MAX(INDEX) AS \"max?\"\n FROM\n initial_writes\n ", + "query": "\n SELECT\n MAX(INDEX) AS \"max?\"\n FROM\n INITIAL_WRITES\n ", "describe": { "columns": [ { @@ -16,5 +16,5 @@ null ] }, - "hash": "a48c92f557e5e3a2674ce0dee9cd92f5a547150590b8c221c4065eab11175c7a" + "hash": "ea4a4f5e0b2abe5e8f2745cf42e51063eae38da5d4b874f74c57b26f188fdeea" } diff --git a/core/lib/dal/.sqlx/query-ead71ae66fe4685132c03a973612fe98364aa684180dd6fbf540bb0b68d96a64.json b/core/lib/dal/.sqlx/query-ead71ae66fe4685132c03a973612fe98364aa684180dd6fbf540bb0b68d96a64.json deleted file mode 100644 index 02cd6733e811..000000000000 --- a/core/lib/dal/.sqlx/query-ead71ae66fe4685132c03a973612fe98364aa684180dd6fbf540bb0b68d96a64.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n new_logs AS MATERIALIZED (\n SELECT DISTINCT\n ON (hashed_key) hashed_key,\n miniblock_number,\n operation_number\n FROM\n storage_logs\n WHERE\n miniblock_number BETWEEN $1 AND $2\n ORDER BY\n hashed_key,\n miniblock_number DESC,\n operation_number DESC\n )\n DELETE FROM storage_logs USING new_logs\n WHERE\n storage_logs.hashed_key = new_logs.hashed_key\n AND storage_logs.miniblock_number <= $2\n AND (storage_logs.miniblock_number, storage_logs.operation_number) < (new_logs.miniblock_number, new_logs.operation_number)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - }, - "nullable": [] - }, - "hash": "ead71ae66fe4685132c03a973612fe98364aa684180dd6fbf540bb0b68d96a64" -} diff --git a/core/lib/dal/.sqlx/query-0f1856e55a370280a078d048f09e2d457914c737660b37e9f66b576bbc9a7904.json b/core/lib/dal/.sqlx/query-eb27e1b82b8ecbb9711c417888564a8e245ecee4866264d38146938595b07f37.json similarity index 91% rename from core/lib/dal/.sqlx/query-0f1856e55a370280a078d048f09e2d457914c737660b37e9f66b576bbc9a7904.json rename to core/lib/dal/.sqlx/query-eb27e1b82b8ecbb9711c417888564a8e245ecee4866264d38146938595b07f37.json index 498e839a63d7..2419082dcc23 100644 --- a/core/lib/dal/.sqlx/query-0f1856e55a370280a078d048f09e2d457914c737660b37e9f66b576bbc9a7904.json +++ b/core/lib/dal/.sqlx/query-eb27e1b82b8ecbb9711c417888564a8e245ecee4866264d38146938595b07f37.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n transactions.*\n FROM\n transactions\n INNER JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n WHERE\n miniblocks.number BETWEEN $1 AND $2\n ORDER BY\n miniblock_number,\n index_in_block\n ", + "query": "\n SELECT\n transactions.*\n FROM\n transactions\n INNER JOIN miniblocks ON miniblocks.number = transactions.miniblock_number\n WHERE\n miniblocks.number BETWEEN $1 AND $2\n ORDER BY\n miniblock_number,\n index_in_block\n ", "describe": { "columns": [ { @@ -229,5 +229,5 @@ true ] }, - "hash": "0f1856e55a370280a078d048f09e2d457914c737660b37e9f66b576bbc9a7904" + "hash": "eb27e1b82b8ecbb9711c417888564a8e245ecee4866264d38146938595b07f37" } diff --git a/core/lib/dal/.sqlx/query-cea9fe027a6a0ada827f23b48ac32432295b2f7ee40bf13522a6edbd236f1970.json b/core/lib/dal/.sqlx/query-ec2942fecedb7ee47279bf0418eb020b1036f002312271eec76ec3d40f77eb71.json similarity index 86% rename from core/lib/dal/.sqlx/query-cea9fe027a6a0ada827f23b48ac32432295b2f7ee40bf13522a6edbd236f1970.json rename to core/lib/dal/.sqlx/query-ec2942fecedb7ee47279bf0418eb020b1036f002312271eec76ec3d40f77eb71.json index b1eae968a897..be93834b26c4 100644 --- a/core/lib/dal/.sqlx/query-cea9fe027a6a0ada827f23b48ac32432295b2f7ee40bf13522a6edbd236f1970.json +++ b/core/lib/dal/.sqlx/query-ec2942fecedb7ee47279bf0418eb020b1036f002312271eec76ec3d40f77eb71.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n u.hashed_key AS \"hashed_key!\",\n (\n SELECT\n value\n FROM\n storage_logs\n WHERE\n hashed_key = u.hashed_key\n AND miniblock_number <= $2\n ORDER BY\n miniblock_number DESC,\n operation_number DESC\n LIMIT\n 1\n ) AS \"value?\"\n FROM\n UNNEST($1::bytea[]) AS u (hashed_key)\n ", + "query": "\n SELECT\n u.hashed_key AS \"hashed_key!\",\n (\n SELECT\n value\n FROM\n storage_logs\n WHERE\n hashed_key = u.hashed_key\n AND miniblock_number <= $2\n ORDER BY\n miniblock_number DESC,\n operation_number DESC\n LIMIT\n 1\n ) AS \"value?\"\n FROM\n UNNEST($1::bytea []) AS u (hashed_key)\n ", "describe": { "columns": [ { @@ -25,5 +25,5 @@ null ] }, - "hash": "cea9fe027a6a0ada827f23b48ac32432295b2f7ee40bf13522a6edbd236f1970" + "hash": "ec2942fecedb7ee47279bf0418eb020b1036f002312271eec76ec3d40f77eb71" } diff --git a/core/lib/dal/.sqlx/query-4cfdfb32d808e33779ea4566e9cf9bb44a0952d475c3e6f207443b72ebddb0cd.json b/core/lib/dal/.sqlx/query-ee50258050e7a08be67335cddf258ed14ea4ed363db1501e7268909bc18f2043.json similarity index 78% rename from core/lib/dal/.sqlx/query-4cfdfb32d808e33779ea4566e9cf9bb44a0952d475c3e6f207443b72ebddb0cd.json rename to core/lib/dal/.sqlx/query-ee50258050e7a08be67335cddf258ed14ea4ed363db1501e7268909bc18f2043.json index 4ea4aea2ea63..733a7d36eabf 100644 --- a/core/lib/dal/.sqlx/query-4cfdfb32d808e33779ea4566e9cf9bb44a0952d475c3e6f207443b72ebddb0cd.json +++ b/core/lib/dal/.sqlx/query-ee50258050e7a08be67335cddf258ed14ea4ed363db1501e7268909bc18f2043.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n miniblocks.hash AS \"block_hash\",\n miniblocks.number AS \"block_number\",\n prev_miniblock.hash AS \"parent_hash?\",\n miniblocks.timestamp AS \"block_timestamp\",\n miniblocks.base_fee_per_gas AS \"base_fee_per_gas\",\n miniblocks.gas_limit AS \"block_gas_limit?\",\n miniblocks.logs_bloom AS \"block_logs_bloom?\",\n transactions.gas_limit AS \"transaction_gas_limit?\",\n transactions.refunded_gas AS \"transaction_refunded_gas?\"\n FROM\n miniblocks\n LEFT JOIN miniblocks prev_miniblock ON prev_miniblock.number = miniblocks.number - 1\n LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number\n WHERE\n miniblocks.number > $1\n ORDER BY\n miniblocks.number ASC,\n transactions.index_in_block ASC\n ", + "query": "\n SELECT\n miniblocks.hash AS \"block_hash\",\n miniblocks.number AS \"block_number\",\n prev_miniblock.hash AS \"parent_hash?\",\n miniblocks.timestamp AS \"block_timestamp\",\n miniblocks.base_fee_per_gas AS \"base_fee_per_gas\",\n miniblocks.gas_limit AS \"block_gas_limit?\",\n miniblocks.logs_bloom AS \"block_logs_bloom?\",\n transactions.gas_limit AS \"transaction_gas_limit?\",\n transactions.refunded_gas AS \"transaction_refunded_gas?\"\n FROM\n miniblocks\n LEFT JOIN\n miniblocks prev_miniblock\n ON prev_miniblock.number = miniblocks.number - 1\n LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number\n WHERE\n miniblocks.number > $1\n ORDER BY\n miniblocks.number ASC,\n transactions.index_in_block ASC\n ", "describe": { "columns": [ { @@ -66,5 +66,5 @@ false ] }, - "hash": "4cfdfb32d808e33779ea4566e9cf9bb44a0952d475c3e6f207443b72ebddb0cd" + "hash": "ee50258050e7a08be67335cddf258ed14ea4ed363db1501e7268909bc18f2043" } diff --git a/core/lib/dal/.sqlx/query-f012d0922265269746396dac8f25ff66f2c3b2b83d45360818a8782e56aa3d66.json b/core/lib/dal/.sqlx/query-f012d0922265269746396dac8f25ff66f2c3b2b83d45360818a8782e56aa3d66.json deleted file mode 100644 index 9815b5d3895e..000000000000 --- a/core/lib/dal/.sqlx/query-f012d0922265269746396dac8f25ff66f2c3b2b83d45360818a8782e56aa3d66.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH\n sl AS (\n SELECT\n (\n SELECT\n ARRAY[hashed_key, value] AS kv\n FROM\n storage_logs\n WHERE\n storage_logs.miniblock_number = $1\n AND storage_logs.hashed_key >= u.start_key\n AND storage_logs.hashed_key <= u.end_key\n ORDER BY\n storage_logs.hashed_key\n LIMIT\n 1\n )\n FROM\n UNNEST($2::bytea[], $3::bytea[]) AS u (start_key, end_key)\n )\n SELECT\n sl.kv[1] AS \"hashed_key?\",\n sl.kv[2] AS \"value?\",\n initial_writes.index\n FROM\n sl\n LEFT OUTER JOIN initial_writes ON initial_writes.hashed_key = sl.kv[1]\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "hashed_key?", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "value?", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "index", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int8", - "ByteaArray", - "ByteaArray" - ] - }, - "nullable": [ - null, - null, - true - ] - }, - "hash": "f012d0922265269746396dac8f25ff66f2c3b2b83d45360818a8782e56aa3d66" -} diff --git a/core/lib/dal/.sqlx/query-f3a049c7eb0d8903737f02fa154b50ebc862a133734382bad8fdfa3a93d8b743.json b/core/lib/dal/.sqlx/query-f3a049c7eb0d8903737f02fa154b50ebc862a133734382bad8fdfa3a93d8b743.json deleted file mode 100644 index 6869b4f50b18..000000000000 --- a/core/lib/dal/.sqlx/query-f3a049c7eb0d8903737f02fa154b50ebc862a133734382bad8fdfa3a93d8b743.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n upgrade_id,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n TRUE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n NOW(),\n NOW()\n )\n ON CONFLICT (hash) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Bytea", - "Bytea", - "Numeric", - "Numeric", - "Numeric", - "Jsonb", - "Int4", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Timestamp" - ] - }, - "nullable": [] - }, - "hash": "f3a049c7eb0d8903737f02fa154b50ebc862a133734382bad8fdfa3a93d8b743" -} diff --git a/core/lib/dal/.sqlx/query-f551ac609521345b0dbcce65df2ce3d957afdb5f9809929dbe7a67a4a164e741.json b/core/lib/dal/.sqlx/query-f551ac609521345b0dbcce65df2ce3d957afdb5f9809929dbe7a67a4a164e741.json new file mode 100644 index 000000000000..9297d4a9cf8e --- /dev/null +++ b/core/lib/dal/.sqlx/query-f551ac609521345b0dbcce65df2ce3d957afdb5f9809929dbe7a67a4a164e741.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n number\n FROM\n l1_batches\n LEFT JOIN\n eth_txs_history AS execute_tx\n ON (l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id)\n WHERE\n execute_tx.confirmed_at IS NOT NULL\n ORDER BY\n number DESC\n LIMIT\n 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "f551ac609521345b0dbcce65df2ce3d957afdb5f9809929dbe7a67a4a164e741" +} diff --git a/core/lib/dal/.sqlx/query-f90a87a0c8a3ad95d722fbcf1b05371292d0bfbb23eaa2db163ef6fd1e1374d9.json b/core/lib/dal/.sqlx/query-f90a87a0c8a3ad95d722fbcf1b05371292d0bfbb23eaa2db163ef6fd1e1374d9.json new file mode 100644 index 000000000000..5235d03dc3af --- /dev/null +++ b/core/lib/dal/.sqlx/query-f90a87a0c8a3ad95d722fbcf1b05371292d0bfbb23eaa2db163ef6fd1e1374d9.json @@ -0,0 +1,31 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n contract_verification_requests (\n contract_address,\n source_code,\n contract_name,\n zk_compiler_version,\n compiler_version,\n optimization_used,\n optimizer_mode,\n constructor_arguments,\n is_system,\n force_evmla,\n status,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 'queued', NOW(), NOW())\n RETURNING\n id\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Bytea", + "Text", + "Text", + "Text", + "Text", + "Bool", + "Text", + "Bytea", + "Bool", + "Bool" + ] + }, + "nullable": [ + false + ] + }, + "hash": "f90a87a0c8a3ad95d722fbcf1b05371292d0bfbb23eaa2db163ef6fd1e1374d9" +} diff --git a/core/lib/dal/.sqlx/query-fce6fff384875df689dc422153a2745b90c68ebec5706b106ef69cb61333466e.json b/core/lib/dal/.sqlx/query-fce6fff384875df689dc422153a2745b90c68ebec5706b106ef69cb61333466e.json new file mode 100644 index 000000000000..8c4129fec07a --- /dev/null +++ b/core/lib/dal/.sqlx/query-fce6fff384875df689dc422153a2745b90c68ebec5706b106ef69cb61333466e.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n transactions (\n hash,\n is_priority,\n initiator_address,\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n data,\n upgrade_id,\n contract_address,\n l1_block_number,\n value,\n paymaster,\n paymaster_input,\n tx_format,\n l1_tx_mint,\n l1_tx_refund_recipient,\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n TRUE,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n NOW(),\n NOW()\n )\n ON CONFLICT (hash) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Numeric", + "Numeric", + "Numeric", + "Jsonb", + "Int4", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Timestamp" + ] + }, + "nullable": [] + }, + "hash": "fce6fff384875df689dc422153a2745b90c68ebec5706b106ef69cb61333466e" +} diff --git a/core/lib/dal/.sqlx/query-f4e7e2dd109aab2714845b028eba780c75468aa36615bcfcf7f7d8ace23cd1aa.json b/core/lib/dal/.sqlx/query-fd4b42f90ffe24f76a35a005460cc3cec1dbc3e9af406bb900c3ec52590978bc.json similarity index 65% rename from core/lib/dal/.sqlx/query-f4e7e2dd109aab2714845b028eba780c75468aa36615bcfcf7f7d8ace23cd1aa.json rename to core/lib/dal/.sqlx/query-fd4b42f90ffe24f76a35a005460cc3cec1dbc3e9af406bb900c3ec52590978bc.json index a8e5dbf66d5e..271924b8b6c3 100644 --- a/core/lib/dal/.sqlx/query-f4e7e2dd109aab2714845b028eba780c75468aa36615bcfcf7f7d8ace23cd1aa.json +++ b/core/lib/dal/.sqlx/query-fd4b42f90ffe24f76a35a005460cc3cec1dbc3e9af406bb900c3ec52590978bc.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n PG_LAST_WAL_RECEIVE_LSN() = PG_LAST_WAL_REPLAY_LSN() AS synced,\n EXTRACT(\n SECONDS\n FROM\n NOW() - PG_LAST_XACT_REPLAY_TIMESTAMP()\n )::INT AS LAG\n ", + "query": "\n SELECT\n PG_LAST_WAL_RECEIVE_LSN() = PG_LAST_WAL_REPLAY_LSN() AS synced,\n EXTRACT(\n seconds\n FROM\n NOW() - PG_LAST_XACT_REPLAY_TIMESTAMP()\n )::INT AS lag\n ", "describe": { "columns": [ { @@ -22,5 +22,5 @@ null ] }, - "hash": "f4e7e2dd109aab2714845b028eba780c75468aa36615bcfcf7f7d8ace23cd1aa" + "hash": "fd4b42f90ffe24f76a35a005460cc3cec1dbc3e9af406bb900c3ec52590978bc" } diff --git a/core/lib/dal/.sqlx/query-99d9ee2a0d0450acefa0d9b6c031e30606fddf6631c859ab03819ec476bcf005.json b/core/lib/dal/.sqlx/query-fd8aaef58e1b9bf4f389fb2943adea2b254fed4b5437ee2968707dffe6e6869d.json similarity index 75% rename from core/lib/dal/.sqlx/query-99d9ee2a0d0450acefa0d9b6c031e30606fddf6631c859ab03819ec476bcf005.json rename to core/lib/dal/.sqlx/query-fd8aaef58e1b9bf4f389fb2943adea2b254fed4b5437ee2968707dffe6e6869d.json index ab00c7b26ce3..198ab2d802bf 100644 --- a/core/lib/dal/.sqlx/query-99d9ee2a0d0450acefa0d9b6c031e30606fddf6631c859ab03819ec476bcf005.json +++ b/core/lib/dal/.sqlx/query-fd8aaef58e1b9bf4f389fb2943adea2b254fed4b5437ee2968707dffe6e6869d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n hashed_key\n FROM\n initial_writes\n WHERE\n hashed_key = ANY ($1)\n ", + "query": "\n SELECT\n hashed_key\n FROM\n initial_writes\n WHERE\n hashed_key = ANY($1)\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "99d9ee2a0d0450acefa0d9b6c031e30606fddf6631c859ab03819ec476bcf005" + "hash": "fd8aaef58e1b9bf4f389fb2943adea2b254fed4b5437ee2968707dffe6e6869d" } diff --git a/core/lib/dal/.sqlx/query-9f29aa31d4698031e9f3fe2eb273724dcce382936af0d4c386143399995cd325.json b/core/lib/dal/.sqlx/query-febd2b039a686631e3c943882864f6cb289fdec08f4db49ee40ba67371df1927.json similarity index 59% rename from core/lib/dal/.sqlx/query-9f29aa31d4698031e9f3fe2eb273724dcce382936af0d4c386143399995cd325.json rename to core/lib/dal/.sqlx/query-febd2b039a686631e3c943882864f6cb289fdec08f4db49ee40ba67371df1927.json index 2e1bf7c3e61c..ff702280a632 100644 --- a/core/lib/dal/.sqlx/query-9f29aa31d4698031e9f3fe2eb273724dcce382936af0d4c386143399995cd325.json +++ b/core/lib/dal/.sqlx/query-febd2b039a686631e3c943882864f6cb289fdec08f4db49ee40ba67371df1927.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n storage_logs.address AS \"address!\",\n storage_logs.key AS \"key!\",\n storage_logs.value AS \"value!\",\n storage_logs.miniblock_number AS \"miniblock_number!\",\n initial_writes.l1_batch_number AS \"l1_batch_number!\",\n initial_writes.index\n FROM\n (\n SELECT\n hashed_key,\n MAX(ARRAY[miniblock_number, operation_number]::INT[]) AS op\n FROM\n storage_logs\n WHERE\n miniblock_number <= $1\n AND hashed_key >= $3\n AND hashed_key <= $4\n GROUP BY\n hashed_key\n ORDER BY\n hashed_key\n ) AS keys\n INNER JOIN storage_logs ON keys.hashed_key = storage_logs.hashed_key\n AND storage_logs.miniblock_number = keys.op[1]\n AND storage_logs.operation_number = keys.op[2]\n INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key\n WHERE\n initial_writes.l1_batch_number <= $2\n ", + "query": "\n SELECT\n storage_logs.address AS \"address!\",\n storage_logs.key AS \"key!\",\n storage_logs.value AS \"value!\",\n storage_logs.miniblock_number AS \"miniblock_number!\",\n initial_writes.l1_batch_number AS \"l1_batch_number!\",\n initial_writes.index\n FROM\n (\n SELECT\n hashed_key,\n MAX(ARRAY[miniblock_number, operation_number]::INT []) AS op\n FROM\n storage_logs\n WHERE\n miniblock_number <= $1\n AND hashed_key >= $3\n AND hashed_key <= $4\n GROUP BY\n hashed_key\n ORDER BY\n hashed_key\n ) AS keys\n INNER JOIN storage_logs\n ON\n keys.hashed_key = storage_logs.hashed_key\n AND storage_logs.miniblock_number = keys.op[1]\n AND storage_logs.operation_number = keys.op[2]\n INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key\n WHERE\n initial_writes.l1_batch_number <= $2\n ", "describe": { "columns": [ { @@ -51,5 +51,5 @@ false ] }, - "hash": "9f29aa31d4698031e9f3fe2eb273724dcce382936af0d4c386143399995cd325" + "hash": "febd2b039a686631e3c943882864f6cb289fdec08f4db49ee40ba67371df1927" } diff --git a/core/lib/dal/src/base_token_dal.rs b/core/lib/dal/src/base_token_dal.rs index a8bf51d0c603..52389bdcb62b 100644 --- a/core/lib/dal/src/base_token_dal.rs +++ b/core/lib/dal/src/base_token_dal.rs @@ -21,11 +21,13 @@ impl BaseTokenDal<'_, '_> { let row = sqlx::query!( r#" INSERT INTO - base_token_ratios (numerator, denominator, ratio_timestamp, created_at, updated_at) + base_token_ratios ( + numerator, denominator, ratio_timestamp, created_at, updated_at + ) VALUES - ($1, $2, $3, NOW(), NOW()) + ($1, $2, $3, NOW(), NOW()) RETURNING - id + id "#, BigDecimal::from_u64(numerator.get()), BigDecimal::from_u64(denominator.get()), diff --git a/core/lib/dal/src/blocks_dal.rs b/core/lib/dal/src/blocks_dal.rs index 1f4cc3b0b98c..5b351511a06d 100644 --- a/core/lib/dal/src/blocks_dal.rs +++ b/core/lib/dal/src/blocks_dal.rs @@ -336,7 +336,7 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number = $1 "#, @@ -595,55 +595,55 @@ impl BlocksDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - l1_batches ( - number, - l1_tx_count, - l2_tx_count, - timestamp, - l2_to_l1_messages, - bloom, - priority_ops_onchain_data, - predicted_commit_gas_cost, - predicted_prove_gas_cost, - predicted_execute_gas_cost, - initial_bootloader_heap_content, - used_contract_hashes, - bootloader_code_hash, - default_aa_code_hash, - protocol_version, - system_logs, - storage_refunds, - pubdata_costs, - pubdata_input, - predicted_circuits_by_type, - created_at, - updated_at - ) + l1_batches ( + number, + l1_tx_count, + l2_tx_count, + timestamp, + l2_to_l1_messages, + bloom, + priority_ops_onchain_data, + predicted_commit_gas_cost, + predicted_prove_gas_cost, + predicted_execute_gas_cost, + initial_bootloader_heap_content, + used_contract_hashes, + bootloader_code_hash, + default_aa_code_hash, + protocol_version, + system_logs, + storage_refunds, + pubdata_costs, + pubdata_input, + predicted_circuits_by_type, + created_at, + updated_at + ) VALUES - ( - $1, - $2, - $3, - $4, - $5, - $6, - $7, - $8, - $9, - $10, - $11, - $12, - $13, - $14, - $15, - $16, - $17, - $18, - $19, - $20, - NOW(), - NOW() - ) + ( + $1, + $2, + $3, + $4, + $5, + $6, + $7, + $8, + $9, + $10, + $11, + $12, + $13, + $14, + $15, + $16, + $17, + $18, + $19, + $20, + NOW(), + NOW() + ) "#, i64::from(header.number.0), i32::from(header.l1_tx_count), @@ -690,49 +690,49 @@ impl BlocksDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - miniblocks ( - number, - timestamp, - hash, - l1_tx_count, - l2_tx_count, - fee_account_address, - base_fee_per_gas, - l1_gas_price, - l2_fair_gas_price, - gas_per_pubdata_limit, - bootloader_code_hash, - default_aa_code_hash, - protocol_version, - virtual_blocks, - fair_pubdata_price, - gas_limit, - logs_bloom, - created_at, - updated_at - ) + miniblocks ( + number, + timestamp, + hash, + l1_tx_count, + l2_tx_count, + fee_account_address, + base_fee_per_gas, + l1_gas_price, + l2_fair_gas_price, + gas_per_pubdata_limit, + bootloader_code_hash, + default_aa_code_hash, + protocol_version, + virtual_blocks, + fair_pubdata_price, + gas_limit, + logs_bloom, + created_at, + updated_at + ) VALUES - ( - $1, - $2, - $3, - $4, - $5, - $6, - $7, - $8, - $9, - $10, - $11, - $12, - $13, - $14, - $15, - $16, - $17, - NOW(), - NOW() - ) + ( + $1, + $2, + $3, + $4, + $5, + $6, + $7, + $8, + $9, + $10, + $11, + $12, + $13, + $14, + $15, + $16, + $17, + NOW(), + NOW() + ) "#, i64::from(l2_block_header.number.0), l2_block_header.timestamp as i64, @@ -986,14 +986,21 @@ impl BlocksDal<'_, '_> { sqlx::query!( r#" INSERT INTO - commitments (l1_batch_number, events_queue_commitment, bootloader_initial_content_commitment) + commitments ( + l1_batch_number, + events_queue_commitment, + bootloader_initial_content_commitment + ) VALUES - ($1, $2, $3) + ($1, $2, $3) ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::from(number.0), - commitment_artifacts.aux_commitments.map(|a| a.events_queue_commitment.0.to_vec()), - commitment_artifacts.aux_commitments + commitment_artifacts + .aux_commitments + .map(|a| a.events_queue_commitment.0.to_vec()), + commitment_artifacts + .aux_commitments .map(|a| a.bootloader_initial_content_commitment.0.to_vec()), ) .instrument("save_batch_aux_commitments") @@ -1042,7 +1049,7 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number = 0 OR eth_commit_tx_id IS NOT NULL @@ -1074,7 +1081,9 @@ impl BlocksDal<'_, '_> { number FROM l1_batches - LEFT JOIN eth_txs_history AS commit_tx ON (l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id) + LEFT JOIN + eth_txs_history AS commit_tx + ON (l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id) WHERE commit_tx.confirmed_at IS NOT NULL ORDER BY @@ -1141,7 +1150,9 @@ impl BlocksDal<'_, '_> { number FROM l1_batches - LEFT JOIN eth_txs_history AS prove_tx ON (l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id) + LEFT JOIN + eth_txs_history AS prove_tx + ON (l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id) WHERE prove_tx.confirmed_at IS NOT NULL ORDER BY @@ -1166,7 +1177,9 @@ impl BlocksDal<'_, '_> { number FROM l1_batches - LEFT JOIN eth_txs_history AS execute_tx ON (l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id) + LEFT JOIN + eth_txs_history AS execute_tx + ON (l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id) WHERE execute_tx.confirmed_at IS NOT NULL ORDER BY @@ -1222,7 +1235,7 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE eth_commit_tx_id IS NOT NULL AND eth_prove_tx_id IS NULL @@ -1307,7 +1320,7 @@ impl BlocksDal<'_, '_> { ROW_NUMBER() OVER ( ORDER BY number ASC - ) AS ROW_NUMBER + ) AS row_number FROM l1_batches WHERE @@ -1319,9 +1332,9 @@ impl BlocksDal<'_, '_> { LIMIT $2 ) inn - LEFT JOIN commitments ON commitments.l1_batch_number = inn.number + LEFT JOIN commitments ON commitments.l1_batch_number = inn.number WHERE - number - ROW_NUMBER = $1 + number - row_number = $1 "#, last_proved_batch_number.0 as i32, limit as i32 @@ -1375,7 +1388,7 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL @@ -1447,16 +1460,18 @@ impl BlocksDal<'_, '_> { MAX(l1_batches.number) FROM l1_batches - JOIN eth_txs ON (l1_batches.eth_commit_tx_id = eth_txs.id) - JOIN eth_txs_history AS commit_tx ON (eth_txs.confirmed_eth_tx_history_id = commit_tx.id) + JOIN eth_txs ON (l1_batches.eth_commit_tx_id = eth_txs.id) + JOIN + eth_txs_history AS commit_tx + ON (eth_txs.confirmed_eth_tx_history_id = commit_tx.id) WHERE commit_tx.confirmed_at IS NOT NULL AND eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL AND EXTRACT( - epoch + EPOCH FROM - commit_tx.confirmed_at + commit_tx.confirmed_at ) < $1 "#, max_l1_batch_timestamp_seconds_bd, @@ -1500,7 +1515,7 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number BETWEEN $1 AND $2 ORDER BY @@ -1564,8 +1579,8 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number - JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version WHERE eth_commit_tx_id IS NULL AND number != 0 @@ -1642,9 +1657,11 @@ impl BlocksDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number - LEFT JOIN data_availability ON data_availability.l1_batch_number = l1_batches.number - JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number + LEFT JOIN + data_availability + ON data_availability.l1_batch_number = l1_batches.number + JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version WHERE eth_commit_tx_id IS NULL AND number != 0 @@ -1843,7 +1860,7 @@ impl BlocksDal<'_, '_> { bytecode FROM factory_deps - INNER JOIN miniblocks ON miniblocks.number = factory_deps.miniblock_number + INNER JOIN miniblocks ON miniblocks.number = factory_deps.miniblock_number WHERE miniblocks.l1_batch_number = $1 "#, @@ -2339,7 +2356,7 @@ impl BlocksDal<'_, '_> { value FROM l2_to_l1_logs - JOIN miniblocks ON l2_to_l1_logs.miniblock_number = miniblocks.number + JOIN miniblocks ON l2_to_l1_logs.miniblock_number = miniblocks.number WHERE l1_batch_number = $1 ORDER BY @@ -2437,8 +2454,8 @@ impl BlocksDal<'_, '_> { FROM ( SELECT - UNNEST($1::BIGINT[]) AS number, - UNNEST($2::BYTEA[]) AS logs_bloom + UNNEST($1::BIGINT []) AS number, + UNNEST($2::BYTEA []) AS logs_bloom ) AS data WHERE miniblocks.number = data.number diff --git a/core/lib/dal/src/blocks_web3_dal.rs b/core/lib/dal/src/blocks_web3_dal.rs index 3d17a919a073..904e167d1a6f 100644 --- a/core/lib/dal/src/blocks_web3_dal.rs +++ b/core/lib/dal/src/blocks_web3_dal.rs @@ -52,9 +52,11 @@ impl BlocksWeb3Dal<'_, '_> { transactions.hash AS "tx_hash?" FROM miniblocks - LEFT JOIN miniblocks prev_miniblock ON prev_miniblock.number = miniblocks.number - 1 - LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number - LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number + LEFT JOIN + miniblocks prev_miniblock + ON prev_miniblock.number = miniblocks.number - 1 + LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number + LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number WHERE miniblocks.number = $1 ORDER BY @@ -184,8 +186,10 @@ impl BlocksWeb3Dal<'_, '_> { transactions.refunded_gas AS "transaction_refunded_gas?" FROM miniblocks - LEFT JOIN miniblocks prev_miniblock ON prev_miniblock.number = miniblocks.number - 1 - LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number + LEFT JOIN + miniblocks prev_miniblock + ON prev_miniblock.number = miniblocks.number - 1 + LEFT JOIN transactions ON transactions.miniblock_number = miniblocks.number WHERE miniblocks.number > $1 ORDER BY @@ -559,7 +563,7 @@ impl BlocksWeb3Dal<'_, '_> { call_trace FROM call_traces - INNER JOIN transactions ON tx_hash = transactions.hash + INNER JOIN transactions ON tx_hash = transactions.hash WHERE transactions.miniblock_number = $1 ORDER BY @@ -673,16 +677,19 @@ impl BlocksWeb3Dal<'_, '_> { miniblocks.fee_account_address FROM miniblocks - LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number - LEFT JOIN eth_txs_history AS commit_tx ON ( + LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number + LEFT JOIN eth_txs_history AS commit_tx + ON ( l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id AND commit_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS prove_tx ON ( + LEFT JOIN eth_txs_history AS prove_tx + ON ( l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id AND prove_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS execute_tx ON ( + LEFT JOIN eth_txs_history AS execute_tx + ON ( l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id AND execute_tx.confirmed_at IS NOT NULL ) @@ -708,18 +715,19 @@ impl BlocksWeb3Dal<'_, '_> { StorageL1BatchDetails, r#" WITH - mb AS ( - SELECT - l1_gas_price, - l2_fair_gas_price, - fair_pubdata_price - FROM - miniblocks - WHERE - l1_batch_number = $1 - LIMIT - 1 - ) + mb AS ( + SELECT + l1_gas_price, + l2_fair_gas_price, + fair_pubdata_price + FROM + miniblocks + WHERE + l1_batch_number = $1 + LIMIT + 1 + ) + SELECT l1_batches.number, l1_batches.timestamp, @@ -739,16 +747,19 @@ impl BlocksWeb3Dal<'_, '_> { l1_batches.default_aa_code_hash FROM l1_batches - INNER JOIN mb ON TRUE - LEFT JOIN eth_txs_history AS commit_tx ON ( + INNER JOIN mb ON TRUE + LEFT JOIN eth_txs_history AS commit_tx + ON ( l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id AND commit_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS prove_tx ON ( + LEFT JOIN eth_txs_history AS prove_tx + ON ( l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id AND prove_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS execute_tx ON ( + LEFT JOIN eth_txs_history AS execute_tx + ON ( l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id AND execute_tx.confirmed_at IS NOT NULL ) diff --git a/core/lib/dal/src/consensus_dal.rs b/core/lib/dal/src/consensus_dal.rs index f2e499ce562e..dd976f22086c 100644 --- a/core/lib/dal/src/consensus_dal.rs +++ b/core/lib/dal/src/consensus_dal.rs @@ -165,9 +165,9 @@ impl ConsensusDal<'_, '_> { sqlx::query!( r#" INSERT INTO - consensus_replica_state (fake_key, global_config, genesis, state) + consensus_replica_state (fake_key, global_config, genesis, state) VALUES - (TRUE, $1, $2, $3) + (TRUE, $1, $2, $3) "#, global_config, genesis, @@ -479,9 +479,9 @@ impl ConsensusDal<'_, '_> { sqlx::query!( r#" INSERT INTO - miniblocks_consensus (number, certificate) + miniblocks_consensus (number, certificate) VALUES - ($1, $2) + ($1, $2) "#, i64::try_from(header.number.0).context("overflow")?, zksync_protobuf::serde::Serialize @@ -507,15 +507,15 @@ impl ConsensusDal<'_, '_> { sqlx::query!( r#" INSERT INTO - l1_batches_consensus_committees (l1_batch_number, attesters, updated_at) + l1_batches_consensus_committees (l1_batch_number, attesters, updated_at) VALUES - ($1, $2, NOW()) + ($1, $2, NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - l1_batch_number = $1, - attesters = $2, - updated_at = NOW() + l1_batch_number = $1, + attesters = $2, + updated_at = NOW() "#, i64::try_from(number.0).context("overflow")?, committee @@ -582,9 +582,9 @@ impl ConsensusDal<'_, '_> { sqlx::query!( r#" INSERT INTO - l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at) + l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at) VALUES - ($1, $2, NOW(), NOW()) + ($1, $2, NOW(), NOW()) "#, i64::try_from(cert.message.number.0).context("overflow")?, // Unwrap is ok, because serialization should always succeed. diff --git a/core/lib/dal/src/contract_verification_dal.rs b/core/lib/dal/src/contract_verification_dal.rs index 194d85323b61..291e60a50d90 100644 --- a/core/lib/dal/src/contract_verification_dal.rs +++ b/core/lib/dal/src/contract_verification_dal.rs @@ -67,25 +67,25 @@ impl ContractVerificationDal<'_, '_> { sqlx::query!( r#" INSERT INTO - contract_verification_requests ( - contract_address, - source_code, - contract_name, - zk_compiler_version, - compiler_version, - optimization_used, - optimizer_mode, - constructor_arguments, - is_system, - force_evmla, - status, - created_at, - updated_at - ) + contract_verification_requests ( + contract_address, + source_code, + contract_name, + zk_compiler_version, + compiler_version, + optimization_used, + optimizer_mode, + constructor_arguments, + is_system, + force_evmla, + status, + created_at, + updated_at + ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 'queued', NOW(), NOW()) + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 'queued', NOW(), NOW()) RETURNING - id + id "#, query.contract_address.as_bytes(), // Serialization should always succeed. @@ -143,20 +143,20 @@ impl ContractVerificationDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - id, - contract_address, - source_code, - contract_name, - zk_compiler_version, - compiler_version, - optimization_used, - optimizer_mode, - constructor_arguments, - is_system, - force_evmla + id, + contract_address, + source_code, + contract_name, + zk_compiler_version, + compiler_version, + optimization_used, + optimizer_mode, + constructor_arguments, + is_system, + force_evmla "#, &processing_timeout ) @@ -198,13 +198,13 @@ impl ContractVerificationDal<'_, '_> { sqlx::query!( r#" INSERT INTO - contracts_verification_info (address, verification_info) + contracts_verification_info (address, verification_info) VALUES - ($1, $2) + ($1, $2) ON CONFLICT (address) DO UPDATE SET - verification_info = $2 + verification_info = $2 "#, address.as_bytes(), &verification_info_json @@ -313,8 +313,8 @@ impl ContractVerificationDal<'_, '_> { LIMIT 1 ) deploy_event - JOIN factory_deps ON factory_deps.bytecode_hash = deploy_event.topic3 - LEFT JOIN transactions ON transactions.hash = deploy_event.tx_hash + JOIN factory_deps ON factory_deps.bytecode_hash = deploy_event.topic3 + LEFT JOIN transactions ON transactions.hash = deploy_event.tx_hash WHERE deploy_event.miniblock_number <= ( SELECT @@ -375,9 +375,9 @@ impl ContractVerificationDal<'_, '_> { SELECT VERSION FROM - compiler_versions + COMPILER_VERSIONS WHERE - compiler = $1 + COMPILER = $1 ORDER BY VERSION "#, @@ -433,15 +433,15 @@ impl ContractVerificationDal<'_, '_> { sqlx::query!( r#" INSERT INTO - compiler_versions (VERSION, compiler, created_at, updated_at) + compiler_versions (version, compiler, created_at, updated_at) SELECT u.version, $2, NOW(), NOW() FROM - UNNEST($1::TEXT[]) AS u (VERSION) - ON CONFLICT (VERSION, compiler) DO NOTHING + UNNEST($1::TEXT []) AS u (version) + ON CONFLICT (version, compiler) DO NOTHING "#, &versions, &compiler, diff --git a/core/lib/dal/src/data_availability_dal.rs b/core/lib/dal/src/data_availability_dal.rs index 24048ec4fa19..41dd7efe2732 100644 --- a/core/lib/dal/src/data_availability_dal.rs +++ b/core/lib/dal/src/data_availability_dal.rs @@ -28,9 +28,9 @@ impl DataAvailabilityDal<'_, '_> { let update_result = sqlx::query!( r#" INSERT INTO - data_availability (l1_batch_number, blob_id, sent_at, created_at, updated_at) + data_availability (l1_batch_number, blob_id, sent_at, created_at, updated_at) VALUES - ($1, $2, $3, NOW(), NOW()) + ($1, $2, $3, NOW(), NOW()) ON CONFLICT DO NOTHING "#, i64::from(number.0), @@ -187,7 +187,9 @@ impl DataAvailabilityDal<'_, '_> { pubdata_input FROM l1_batches - LEFT JOIN data_availability ON data_availability.l1_batch_number = l1_batches.number + LEFT JOIN + data_availability + ON data_availability.l1_batch_number = l1_batches.number WHERE eth_commit_tx_id IS NULL AND number != 0 diff --git a/core/lib/dal/src/eth_sender_dal.rs b/core/lib/dal/src/eth_sender_dal.rs index 2266d6fb60f9..4ce76547ac9b 100644 --- a/core/lib/dal/src/eth_sender_dal.rs +++ b/core/lib/dal/src/eth_sender_dal.rs @@ -43,7 +43,7 @@ impl EthSenderDal<'_, '_> { COALESCE(MAX(eth_tx_id), 0) FROM eth_txs_history - JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id + JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id WHERE eth_txs_history.sent_at_block IS NOT NULL AND eth_txs.from_addr IS NOT DISTINCT FROM $1 @@ -174,7 +174,7 @@ impl EthSenderDal<'_, '_> { COALESCE(MAX(eth_tx_id), 0) FROM eth_txs_history - JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id + JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id WHERE eth_txs_history.sent_at_block IS NOT NULL AND eth_txs.from_addr IS NOT DISTINCT FROM $2 @@ -208,7 +208,7 @@ impl EthSenderDal<'_, '_> { eth_txs.nonce FROM eth_txs_history - JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id + JOIN eth_txs ON eth_txs.id = eth_txs_history.eth_tx_id WHERE eth_txs_history.sent_at_block IS NULL AND eth_txs.confirmed_eth_tx_history_id IS NULL @@ -238,22 +238,22 @@ impl EthSenderDal<'_, '_> { StorageEthTx, r#" INSERT INTO - eth_txs ( - raw_tx, - nonce, - tx_type, - contract_address, - predicted_gas_cost, - created_at, - updated_at, - from_addr, - blob_sidecar, - is_gateway - ) + eth_txs ( + raw_tx, + nonce, + tx_type, + contract_address, + predicted_gas_cost, + created_at, + updated_at, + from_addr, + blob_sidecar, + is_gateway + ) VALUES - ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, $8) + ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, $8) RETURNING - * + * "#, raw_tx, nonce as i64, @@ -290,23 +290,23 @@ impl EthSenderDal<'_, '_> { Ok(sqlx::query!( r#" INSERT INTO - eth_txs_history ( - eth_tx_id, - base_fee_per_gas, - priority_fee_per_gas, - tx_hash, - signed_raw_tx, - created_at, - updated_at, - blob_base_fee_per_gas, - sent_at_block, - sent_at - ) + eth_txs_history ( + eth_tx_id, + base_fee_per_gas, + priority_fee_per_gas, + tx_hash, + signed_raw_tx, + created_at, + updated_at, + blob_base_fee_per_gas, + sent_at_block, + sent_at + ) VALUES - ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, NOW()) + ($1, $2, $3, $4, $5, NOW(), NOW(), $6, $7, NOW()) ON CONFLICT (tx_hash) DO NOTHING RETURNING - id + id "#, eth_tx_id as i32, base_fee_per_gas, @@ -376,8 +376,8 @@ impl EthSenderDal<'_, '_> { WHERE tx_hash = $1 RETURNING - id, - eth_tx_id + id, + eth_tx_id "#, tx_hash, ) @@ -551,7 +551,7 @@ impl EthSenderDal<'_, '_> { eth_txs.blob_sidecar FROM eth_txs_history - LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id + LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id WHERE eth_tx_id = $1 ORDER BY @@ -602,7 +602,7 @@ impl EthSenderDal<'_, '_> { eth_txs.blob_sidecar FROM eth_txs_history - LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id + LEFT JOIN eth_txs ON eth_tx_id = eth_txs.id WHERE eth_tx_id = $1 ORDER BY @@ -636,7 +636,8 @@ impl EthSenderDal<'_, '_> { FROM eth_txs WHERE - from_addr IS NOT DISTINCT FROM $1 -- can't just use equality as NULL != NULL\ + -- can't just use equality as NULL != NULL + from_addr IS NOT DISTINCT FROM $1 AND is_gateway = $2 ORDER BY id DESC diff --git a/core/lib/dal/src/eth_watcher_dal.rs b/core/lib/dal/src/eth_watcher_dal.rs index 3220868decf6..bdfc7f24c7b5 100644 --- a/core/lib/dal/src/eth_watcher_dal.rs +++ b/core/lib/dal/src/eth_watcher_dal.rs @@ -30,8 +30,8 @@ impl EthWatcherDal<'_, '_> { FROM processed_events WHERE - TYPE = $1 - AND chain_id = $2 + type = $1 + AND chain_id = $2 "#, event_type as EventType, chain_id.0 as i64 @@ -48,13 +48,13 @@ impl EthWatcherDal<'_, '_> { sqlx::query!( r#" INSERT INTO - processed_events ( - TYPE, - chain_id, - next_block_to_process - ) + processed_events ( + type, + chain_id, + next_block_to_process + ) VALUES - ($1, $2, $3) + ($1, $2, $3) "#, event_type as EventType, chain_id.0 as i64, @@ -82,8 +82,8 @@ impl EthWatcherDal<'_, '_> { SET next_block_to_process = $3 WHERE - TYPE = $1 - AND chain_id = $2 + type = $1 + AND chain_id = $2 "#, event_type as EventType, chain_id.0 as i64, diff --git a/core/lib/dal/src/events_dal.rs b/core/lib/dal/src/events_dal.rs index 4050acf7135b..487871e3be7c 100644 --- a/core/lib/dal/src/events_dal.rs +++ b/core/lib/dal/src/events_dal.rs @@ -217,17 +217,17 @@ impl EventsDal<'_, '_> { topic4, value, NULL::bytea AS "block_hash", - NULL::BIGINT AS "l1_batch_number?", + NULL::bigint AS "l1_batch_number?", miniblock_number, tx_hash, tx_index_in_block, event_index_in_block, event_index_in_tx, - NULL::BIGINT AS "block_timestamp?" + NULL::bigint AS "block_timestamp?" FROM events WHERE - tx_hash = ANY ($1) + tx_hash = ANY($1) ORDER BY miniblock_number ASC, event_index_in_block ASC @@ -319,7 +319,7 @@ impl EventsDal<'_, '_> { FROM l2_to_l1_logs WHERE - tx_hash = ANY ($1) + tx_hash = ANY($1) ORDER BY tx_index_in_l1_batch ASC, log_index_in_tx ASC diff --git a/core/lib/dal/src/events_web3_dal.rs b/core/lib/dal/src/events_web3_dal.rs index fc21cc36460c..8b7eb96b7146 100644 --- a/core/lib/dal/src/events_web3_dal.rs +++ b/core/lib/dal/src/events_web3_dal.rs @@ -189,27 +189,28 @@ impl EventsWeb3Dal<'_, '_> { StorageWeb3Log, r#" WITH - events_select AS ( - SELECT - address, - topic1, - topic2, - topic3, - topic4, - value, - miniblock_number, - tx_hash, - tx_index_in_block, - event_index_in_block, - event_index_in_tx - FROM - events - WHERE - miniblock_number > $1 - ORDER BY - miniblock_number ASC, - event_index_in_block ASC - ) + events_select AS ( + SELECT + address, + topic1, + topic2, + topic3, + topic4, + value, + miniblock_number, + tx_hash, + tx_index_in_block, + event_index_in_block, + event_index_in_tx + FROM + events + WHERE + miniblock_number > $1 + ORDER BY + miniblock_number ASC, + event_index_in_block ASC + ) + SELECT miniblocks.hash AS "block_hash?", address AS "address!", @@ -227,7 +228,7 @@ impl EventsWeb3Dal<'_, '_> { miniblocks.timestamp AS "block_timestamp" FROM events_select - INNER JOIN miniblocks ON events_select.miniblock_number = miniblocks.number + INNER JOIN miniblocks ON events_select.miniblock_number = miniblocks.number ORDER BY miniblock_number ASC, event_index_in_block ASC diff --git a/core/lib/dal/src/factory_deps_dal.rs b/core/lib/dal/src/factory_deps_dal.rs index 02ce32306cfb..36dfaa1a466d 100644 --- a/core/lib/dal/src/factory_deps_dal.rs +++ b/core/lib/dal/src/factory_deps_dal.rs @@ -31,7 +31,7 @@ impl FactoryDepsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at) + factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at) SELECT u.bytecode_hash, u.bytecode, @@ -39,7 +39,7 @@ impl FactoryDepsDal<'_, '_> { NOW(), NOW() FROM - UNNEST($1::bytea[], $2::bytea[]) AS u (bytecode_hash, bytecode) + UNNEST($1::bytea [], $2::bytea []) AS u (bytecode_hash, bytecode) ON CONFLICT (bytecode_hash) DO NOTHING "#, &bytecode_hashes as &[&[u8]], @@ -136,7 +136,7 @@ impl FactoryDepsDal<'_, '_> { FROM factory_deps WHERE - bytecode_hash = ANY ($1) + bytecode_hash = ANY($1) "#, &hashes_as_bytes as &[&[u8]], ) diff --git a/core/lib/dal/src/proof_generation_dal.rs b/core/lib/dal/src/proof_generation_dal.rs index dada6c69ed34..7943a9302779 100644 --- a/core/lib/dal/src/proof_generation_dal.rs +++ b/core/lib/dal/src/proof_generation_dal.rs @@ -55,7 +55,7 @@ impl ProofGenerationDal<'_, '_> { l1_batch_number FROM proof_generation_details - LEFT JOIN l1_batches ON l1_batch_number = l1_batches.number + LEFT JOIN l1_batches ON l1_batch_number = l1_batches.number WHERE ( vm_run_data_blob_url IS NOT NULL @@ -75,7 +75,7 @@ impl ProofGenerationDal<'_, '_> { 1 ) RETURNING - proof_generation_details.l1_batch_number + proof_generation_details.l1_batch_number "#, &processing_timeout, ) @@ -254,9 +254,9 @@ impl ProofGenerationDal<'_, '_> { let result = sqlx::query!( r#" INSERT INTO - proof_generation_details (l1_batch_number, status, created_at, updated_at) + proof_generation_details (l1_batch_number, status, created_at, updated_at) VALUES - ($1, 'unpicked', NOW(), NOW()) + ($1, 'unpicked', NOW(), NOW()) ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::from(l1_batch_number.0), diff --git a/core/lib/dal/src/protocol_versions_dal.rs b/core/lib/dal/src/protocol_versions_dal.rs index 8cb5094fd49e..72ae811ce764 100644 --- a/core/lib/dal/src/protocol_versions_dal.rs +++ b/core/lib/dal/src/protocol_versions_dal.rs @@ -40,16 +40,16 @@ impl ProtocolVersionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - protocol_versions ( - id, - timestamp, - bootloader_code_hash, - default_account_code_hash, - upgrade_tx_hash, - created_at - ) + protocol_versions ( + id, + timestamp, + bootloader_code_hash, + default_account_code_hash, + upgrade_tx_hash, + created_at + ) VALUES - ($1, $2, $3, $4, $5, NOW()) + ($1, $2, $3, $4, $5, NOW()) ON CONFLICT DO NOTHING "#, version.minor as i32, @@ -71,9 +71,9 @@ impl ProtocolVersionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - protocol_patches (minor, patch, snark_wrapper_vk_hash, created_at) + protocol_patches (minor, patch, snark_wrapper_vk_hash, created_at) VALUES - ($1, $2, $3, NOW()) + ($1, $2, $3, NOW()) ON CONFLICT DO NOTHING "#, version.minor as i32, @@ -236,7 +236,7 @@ impl ProtocolVersionsDal<'_, '_> { protocol_patches.snark_wrapper_vk_hash FROM protocol_versions - JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id + JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id WHERE id = $1 ORDER BY diff --git a/core/lib/dal/src/pruning_dal/mod.rs b/core/lib/dal/src/pruning_dal/mod.rs index 0d1584ebba36..bcd9fdcfc3e1 100644 --- a/core/lib/dal/src/pruning_dal/mod.rs +++ b/core/lib/dal/src/pruning_dal/mod.rs @@ -45,32 +45,34 @@ impl PruningDal<'_, '_> { let pruning_info = sqlx::query!( r#" WITH - soft AS ( - SELECT - pruned_l1_batch, - pruned_miniblock - FROM - pruning_log - WHERE - TYPE = 'Soft' - ORDER BY - pruned_l1_batch DESC - LIMIT - 1 - ), - hard AS ( - SELECT - pruned_l1_batch, - pruned_miniblock - FROM - pruning_log - WHERE - TYPE = 'Hard' - ORDER BY - pruned_l1_batch DESC - LIMIT - 1 - ) + soft AS ( + SELECT + pruned_l1_batch, + pruned_miniblock + FROM + pruning_log + WHERE + type = 'Soft' + ORDER BY + pruned_l1_batch DESC + LIMIT + 1 + ), + + hard AS ( + SELECT + pruned_l1_batch, + pruned_miniblock + FROM + pruning_log + WHERE + type = 'Hard' + ORDER BY + pruned_l1_batch DESC + LIMIT + 1 + ) + SELECT soft.pruned_l1_batch AS last_soft_pruned_l1_batch, soft.pruned_miniblock AS last_soft_pruned_miniblock, @@ -78,7 +80,7 @@ impl PruningDal<'_, '_> { hard.pruned_miniblock AS last_hard_pruned_miniblock FROM soft - FULL JOIN hard ON TRUE + FULL JOIN hard ON TRUE "# ) .map(|row| PruningInfo { @@ -110,15 +112,15 @@ impl PruningDal<'_, '_> { sqlx::query!( r#" INSERT INTO - pruning_log ( - pruned_l1_batch, - pruned_miniblock, - TYPE, - created_at, - updated_at - ) + pruning_log ( + pruned_l1_batch, + pruned_miniblock, + type, + created_at, + updated_at + ) VALUES - ($1, $2, $3, NOW(), NOW()) + ($1, $2, $3, NOW(), NOW()) "#, i64::from(last_l1_batch_to_prune.0), i64::from(last_l2_block_to_prune.0), @@ -319,25 +321,28 @@ impl PruningDal<'_, '_> { let execution_result = sqlx::query!( r#" WITH - new_logs AS MATERIALIZED ( - SELECT DISTINCT - ON (hashed_key) hashed_key, - miniblock_number, - operation_number - FROM - storage_logs - WHERE - miniblock_number BETWEEN $1 AND $2 - ORDER BY - hashed_key, - miniblock_number DESC, - operation_number DESC - ) + new_logs AS MATERIALIZED ( + SELECT DISTINCT + ON (hashed_key) + hashed_key, + miniblock_number, + operation_number + FROM + storage_logs + WHERE + miniblock_number BETWEEN $1 AND $2 + ORDER BY + hashed_key, + miniblock_number DESC, + operation_number DESC + ) + DELETE FROM storage_logs USING new_logs WHERE storage_logs.hashed_key = new_logs.hashed_key AND storage_logs.miniblock_number <= $2 - AND (storage_logs.miniblock_number, storage_logs.operation_number) < (new_logs.miniblock_number, new_logs.operation_number) + AND (storage_logs.miniblock_number, storage_logs.operation_number) + < (new_logs.miniblock_number, new_logs.operation_number) "#, i64::from(l2_blocks_to_prune.start().0), i64::from(l2_blocks_to_prune.end().0) @@ -392,15 +397,15 @@ impl PruningDal<'_, '_> { sqlx::query!( r#" INSERT INTO - pruning_log ( - pruned_l1_batch, - pruned_miniblock, - TYPE, - created_at, - updated_at - ) + pruning_log ( + pruned_l1_batch, + pruned_miniblock, + type, + created_at, + updated_at + ) VALUES - ($1, $2, $3, NOW(), NOW()) + ($1, $2, $3, NOW(), NOW()) "#, i64::from(last_l1_batch_to_prune.0), i64::from(last_l2_block_to_prune.0), diff --git a/core/lib/dal/src/snapshot_recovery_dal.rs b/core/lib/dal/src/snapshot_recovery_dal.rs index 0b0c0e1735fd..72cde14b9c56 100644 --- a/core/lib/dal/src/snapshot_recovery_dal.rs +++ b/core/lib/dal/src/snapshot_recovery_dal.rs @@ -18,20 +18,20 @@ impl SnapshotRecoveryDal<'_, '_> { sqlx::query!( r#" INSERT INTO - snapshot_recovery ( - l1_batch_number, - l1_batch_timestamp, - l1_batch_root_hash, - miniblock_number, - miniblock_timestamp, - miniblock_hash, - protocol_version, - storage_logs_chunks_processed, - updated_at, - created_at - ) + snapshot_recovery ( + l1_batch_number, + l1_batch_timestamp, + l1_batch_root_hash, + miniblock_number, + miniblock_timestamp, + miniblock_hash, + protocol_version, + storage_logs_chunks_processed, + updated_at, + created_at + ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, NOW(), NOW()) + ($1, $2, $3, $4, $5, $6, $7, $8, NOW(), NOW()) "#, i64::from(status.l1_batch_number.0), status.l1_batch_timestamp as i64, diff --git a/core/lib/dal/src/snapshots_creator_dal.rs b/core/lib/dal/src/snapshots_creator_dal.rs index b076240173b1..fdfc2ccf4691 100644 --- a/core/lib/dal/src/snapshots_creator_dal.rs +++ b/core/lib/dal/src/snapshots_creator_dal.rs @@ -21,11 +21,11 @@ impl SnapshotsCreatorDal<'_, '_> { SELECT INDEX FROM - initial_writes + INITIAL_WRITES WHERE - l1_batch_number <= $1 + L1_BATCH_NUMBER <= $1 ORDER BY - l1_batch_number DESC, + L1_BATCH_NUMBER DESC, INDEX DESC LIMIT 1; @@ -64,7 +64,7 @@ impl SnapshotsCreatorDal<'_, '_> { ( SELECT hashed_key, - MAX(ARRAY[miniblock_number, operation_number]::INT[]) AS op + MAX(ARRAY[miniblock_number, operation_number]::INT []) AS op FROM storage_logs WHERE @@ -76,10 +76,12 @@ impl SnapshotsCreatorDal<'_, '_> { ORDER BY hashed_key ) AS keys - INNER JOIN storage_logs ON keys.hashed_key = storage_logs.hashed_key - AND storage_logs.miniblock_number = keys.op[1] - AND storage_logs.operation_number = keys.op[2] - INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key + INNER JOIN storage_logs + ON + keys.hashed_key = storage_logs.hashed_key + AND storage_logs.miniblock_number = keys.op[1] + AND storage_logs.operation_number = keys.op[2] + INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key WHERE initial_writes.l1_batch_number <= $2 "#, @@ -130,7 +132,7 @@ impl SnapshotsCreatorDal<'_, '_> { ( SELECT hashed_key, - MAX(ARRAY[miniblock_number, operation_number]::INT[]) AS op + MAX(ARRAY[miniblock_number, operation_number]::INT []) AS op FROM storage_logs WHERE @@ -142,10 +144,12 @@ impl SnapshotsCreatorDal<'_, '_> { ORDER BY hashed_key ) AS keys - INNER JOIN storage_logs ON keys.hashed_key = storage_logs.hashed_key - AND storage_logs.miniblock_number = keys.op[1] - AND storage_logs.operation_number = keys.op[2] - INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key + INNER JOIN storage_logs + ON + keys.hashed_key = storage_logs.hashed_key + AND storage_logs.miniblock_number = keys.op[1] + AND storage_logs.operation_number = keys.op[2] + INNER JOIN initial_writes ON keys.hashed_key = initial_writes.hashed_key WHERE initial_writes.l1_batch_number <= $2 "#, diff --git a/core/lib/dal/src/snapshots_dal.rs b/core/lib/dal/src/snapshots_dal.rs index 009efd3da078..5ddad933aad1 100644 --- a/core/lib/dal/src/snapshots_dal.rs +++ b/core/lib/dal/src/snapshots_dal.rs @@ -54,16 +54,16 @@ impl SnapshotsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - snapshots ( - VERSION, - l1_batch_number, - storage_logs_filepaths, - factory_deps_filepath, - created_at, - updated_at - ) + snapshots ( + version, + l1_batch_number, + storage_logs_filepaths, + factory_deps_filepath, + created_at, + updated_at + ) VALUES - ($1, $2, ARRAY_FILL(''::TEXT, ARRAY[$3::INTEGER]), $4, NOW(), NOW()) + ($1, $2, ARRAY_FILL(''::TEXT, ARRAY[$3::INTEGER]), $4, NOW(), NOW()) "#, version as i32, l1_batch_number.0 as i32, @@ -115,7 +115,7 @@ impl SnapshotsDal<'_, '_> { FROM snapshots WHERE - NOT (''::TEXT = ANY (storage_logs_filepaths)) + NOT (''::TEXT = ANY(storage_logs_filepaths)) ORDER BY l1_batch_number DESC "# @@ -141,13 +141,13 @@ impl SnapshotsDal<'_, '_> { r#" SELECT VERSION, - l1_batch_number, - factory_deps_filepath, - storage_logs_filepaths + L1_BATCH_NUMBER, + FACTORY_DEPS_FILEPATH, + STORAGE_LOGS_FILEPATHS FROM - snapshots + SNAPSHOTS ORDER BY - l1_batch_number DESC + L1_BATCH_NUMBER DESC LIMIT 1 "# @@ -168,13 +168,13 @@ impl SnapshotsDal<'_, '_> { r#" SELECT VERSION, - l1_batch_number, - factory_deps_filepath, - storage_logs_filepaths + L1_BATCH_NUMBER, + FACTORY_DEPS_FILEPATH, + STORAGE_LOGS_FILEPATHS FROM - snapshots + SNAPSHOTS WHERE - l1_batch_number = $1 + L1_BATCH_NUMBER = $1 "#, l1_batch_number.0 as i32 ) @@ -198,10 +198,10 @@ impl SnapshotsDal<'_, '_> { WHERE l1_batch_number > $1 RETURNING - VERSION, - l1_batch_number, - factory_deps_filepath, - storage_logs_filepaths + version, + l1_batch_number, + factory_deps_filepath, + storage_logs_filepaths "#, last_retained_l1_batch_number.0 as i32 ) diff --git a/core/lib/dal/src/storage_logs_dal.rs b/core/lib/dal/src/storage_logs_dal.rs index d5de66037b49..adad6eb7e1db 100644 --- a/core/lib/dal/src/storage_logs_dal.rs +++ b/core/lib/dal/src/storage_logs_dal.rs @@ -186,7 +186,8 @@ impl StorageLogsDal<'_, '_> { ) -> DalResult> { let rows = sqlx::query!( r#" - SELECT DISTINCT + SELECT + DISTINCT hashed_key FROM storage_logs @@ -290,13 +291,14 @@ impl StorageLogsDal<'_, '_> { let rows = sqlx::query!( r#" SELECT DISTINCT - ON (hashed_key) hashed_key, + ON (hashed_key) + hashed_key, miniblock_number, value FROM storage_logs WHERE - hashed_key = ANY ($1) + hashed_key = ANY($1) AND miniblock_number <= $2 AND miniblock_number <= COALESCE( ( @@ -539,11 +541,11 @@ impl StorageLogsDal<'_, '_> { SELECT hashed_key, l1_batch_number, - INDEX + index FROM initial_writes WHERE - hashed_key = ANY ($1::bytea[]) + hashed_key = ANY($1::bytea []) "#, &hashed_keys as &[&[u8]], ) @@ -621,7 +623,7 @@ impl StorageLogsDal<'_, '_> { 1 ) AS "value?" FROM - UNNEST($1::bytea[]) AS u (hashed_key) + UNNEST($1::bytea []) AS u (hashed_key) "#, &hashed_keys as &[&[u8]], i64::from(l2_block_number.0) @@ -688,9 +690,9 @@ impl StorageLogsDal<'_, '_> { SELECT COUNT(*) AS COUNT FROM - storage_logs + STORAGE_LOGS WHERE - miniblock_number <= $1 + MINIBLOCK_NUMBER <= $1 "#, i64::from(at_l2_block.0) ) @@ -717,32 +719,33 @@ impl StorageLogsDal<'_, '_> { let rows = sqlx::query!( r#" WITH - sl AS ( - SELECT - ( - SELECT - ARRAY[hashed_key, value] AS kv - FROM - storage_logs - WHERE - storage_logs.miniblock_number = $1 - AND storage_logs.hashed_key >= u.start_key - AND storage_logs.hashed_key <= u.end_key - ORDER BY - storage_logs.hashed_key - LIMIT - 1 - ) - FROM - UNNEST($2::bytea[], $3::bytea[]) AS u (start_key, end_key) - ) + sl AS ( + SELECT + ( + SELECT + ARRAY[hashed_key, value] AS kv + FROM + storage_logs + WHERE + storage_logs.miniblock_number = $1 + AND storage_logs.hashed_key >= u.start_key + AND storage_logs.hashed_key <= u.end_key + ORDER BY + storage_logs.hashed_key + LIMIT + 1 + ) + FROM + UNNEST($2::bytea [], $3::bytea []) AS u (start_key, end_key) + ) + SELECT sl.kv[1] AS "hashed_key?", sl.kv[2] AS "value?", initial_writes.index FROM sl - LEFT OUTER JOIN initial_writes ON initial_writes.hashed_key = sl.kv[1] + LEFT OUTER JOIN initial_writes ON initial_writes.hashed_key = sl.kv[1] "#, i64::from(l2_block_number.0), &start_keys as &[&[u8]], @@ -779,7 +782,7 @@ impl StorageLogsDal<'_, '_> { initial_writes.index FROM storage_logs - INNER JOIN initial_writes ON storage_logs.hashed_key = initial_writes.hashed_key + INNER JOIN initial_writes ON storage_logs.hashed_key = initial_writes.hashed_key WHERE storage_logs.miniblock_number = $1 AND storage_logs.hashed_key >= $2::bytea diff --git a/core/lib/dal/src/storage_logs_dedup_dal.rs b/core/lib/dal/src/storage_logs_dedup_dal.rs index 02049f3e9ade..a94c237bc5b1 100644 --- a/core/lib/dal/src/storage_logs_dedup_dal.rs +++ b/core/lib/dal/src/storage_logs_dedup_dal.rs @@ -93,7 +93,7 @@ impl StorageLogsDedupDal<'_, '_> { sqlx::query!( r#" INSERT INTO - initial_writes (hashed_key, INDEX, l1_batch_number, created_at, updated_at) + initial_writes (hashed_key, index, l1_batch_number, created_at, updated_at) SELECT u.hashed_key, u.index, @@ -101,7 +101,7 @@ impl StorageLogsDedupDal<'_, '_> { NOW(), NOW() FROM - UNNEST($1::bytea[], $2::BIGINT[]) AS u (hashed_key, INDEX) + UNNEST($1::bytea [], $2::bigint []) AS u (hashed_key, index) "#, &hashed_keys as &[&[u8]], &indices, @@ -154,7 +154,7 @@ impl StorageLogsDedupDal<'_, '_> { SELECT MAX(INDEX) AS "max?" FROM - initial_writes + INITIAL_WRITES "#, ) .instrument("max_enumeration_index") @@ -174,15 +174,15 @@ impl StorageLogsDedupDal<'_, '_> { SELECT MAX(INDEX) AS "max?" FROM - initial_writes + INITIAL_WRITES WHERE - l1_batch_number = ( + L1_BATCH_NUMBER = ( SELECT - MAX(l1_batch_number) AS "max?" + MAX(L1_BATCH_NUMBER) AS "max?" FROM - initial_writes + INITIAL_WRITES WHERE - l1_batch_number <= $1 + L1_BATCH_NUMBER <= $1 ) "#, i64::from(l1_batch_number.0) @@ -202,13 +202,13 @@ impl StorageLogsDedupDal<'_, '_> { r#" SELECT hashed_key, - INDEX + index FROM initial_writes WHERE l1_batch_number = $1 ORDER BY - INDEX + index "#, i64::from(l1_batch_number.0) ) @@ -230,9 +230,9 @@ impl StorageLogsDedupDal<'_, '_> { SELECT INDEX FROM - initial_writes + INITIAL_WRITES WHERE - hashed_key = $1 + HASHED_KEY = $1 "#, hashed_key.as_bytes() ) @@ -253,10 +253,10 @@ impl StorageLogsDedupDal<'_, '_> { SELECT INDEX FROM - initial_writes + INITIAL_WRITES WHERE - hashed_key = $1 - AND l1_batch_number <= $2 + HASHED_KEY = $1 + AND L1_BATCH_NUMBER <= $2 "#, hashed_key.as_bytes(), l1_batch_number.0 as i32, @@ -279,7 +279,7 @@ impl StorageLogsDedupDal<'_, '_> { FROM initial_writes WHERE - hashed_key = ANY ($1) + hashed_key = ANY($1) "#, &hashed_keys as &[&[u8]], ) @@ -299,7 +299,7 @@ impl StorageLogsDedupDal<'_, '_> { SELECT hashed_key, l1_batch_number, - INDEX + index FROM initial_writes "# diff --git a/core/lib/dal/src/storage_web3_dal.rs b/core/lib/dal/src/storage_web3_dal.rs index f54ac766ee8c..f3a20ac39fa0 100644 --- a/core/lib/dal/src/storage_web3_dal.rs +++ b/core/lib/dal/src/storage_web3_dal.rs @@ -253,7 +253,7 @@ impl StorageWeb3Dal<'_, '_> { LIMIT 1 ) t - JOIN factory_deps ON value = factory_deps.bytecode_hash + JOIN factory_deps ON value = factory_deps.bytecode_hash WHERE value != $3 "#, diff --git a/core/lib/dal/src/system_dal.rs b/core/lib/dal/src/system_dal.rs index f6dda53b1584..105665fa2ec6 100644 --- a/core/lib/dal/src/system_dal.rs +++ b/core/lib/dal/src/system_dal.rs @@ -28,10 +28,10 @@ impl SystemDal<'_, '_> { SELECT PG_LAST_WAL_RECEIVE_LSN() = PG_LAST_WAL_REPLAY_LSN() AS synced, EXTRACT( - SECONDS + seconds FROM - NOW() - PG_LAST_XACT_REPLAY_TIMESTAMP() - )::INT AS LAG + NOW() - PG_LAST_XACT_REPLAY_TIMESTAMP() + )::INT AS lag "# ) .instrument("get_replication_lag") @@ -49,10 +49,18 @@ impl SystemDal<'_, '_> { r#" SELECT table_name, - PG_TABLE_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS table_size, - PG_INDEXES_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS indexes_size, - PG_RELATION_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS relation_size, - PG_TOTAL_RELATION_SIZE(('public.' || QUOTE_IDENT(table_name))::regclass) AS total_size + PG_TABLE_SIZE( + ('public.' || QUOTE_IDENT(table_name))::regclass + ) AS table_size, + PG_INDEXES_SIZE( + ('public.' || QUOTE_IDENT(table_name))::regclass + ) AS indexes_size, + PG_RELATION_SIZE( + ('public.' || QUOTE_IDENT(table_name))::regclass + ) AS relation_size, + PG_TOTAL_RELATION_SIZE( + ('public.' || QUOTE_IDENT(table_name))::regclass + ) AS total_size FROM information_schema.tables WHERE diff --git a/core/lib/dal/src/tee_proof_generation_dal.rs b/core/lib/dal/src/tee_proof_generation_dal.rs index cc6b87a07aca..db56b9d0e3e7 100644 --- a/core/lib/dal/src/tee_proof_generation_dal.rs +++ b/core/lib/dal/src/tee_proof_generation_dal.rs @@ -53,7 +53,9 @@ impl TeeProofGenerationDal<'_, '_> { proofs.l1_batch_number FROM tee_proof_generation_details AS proofs - JOIN tee_verifier_input_producer_jobs AS inputs ON proofs.l1_batch_number = inputs.l1_batch_number + JOIN + tee_verifier_input_producer_jobs AS inputs + ON proofs.l1_batch_number = inputs.l1_batch_number WHERE inputs.status = $3 AND ( @@ -69,10 +71,10 @@ impl TeeProofGenerationDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - tee_proof_generation_details.l1_batch_number + tee_proof_generation_details.l1_batch_number "#, TeeProofGenerationJobStatus::PickedByProver.to_string(), tee_type.to_string(), @@ -183,9 +185,11 @@ impl TeeProofGenerationDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - tee_proof_generation_details (l1_batch_number, tee_type, status, created_at, updated_at) + tee_proof_generation_details ( + l1_batch_number, tee_type, status, created_at, updated_at + ) VALUES - ($1, $2, $3, NOW(), NOW()) + ($1, $2, $3, NOW(), NOW()) ON CONFLICT (l1_batch_number, tee_type) DO NOTHING "#, batch_number, @@ -208,9 +212,9 @@ impl TeeProofGenerationDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - tee_attestations (pubkey, attestation) + tee_attestations (pubkey, attestation) VALUES - ($1, $2) + ($1, $2) ON CONFLICT (pubkey) DO NOTHING "#, pubkey, @@ -274,7 +278,9 @@ impl TeeProofGenerationDal<'_, '_> { proofs.l1_batch_number FROM tee_proof_generation_details AS proofs - JOIN tee_verifier_input_producer_jobs AS inputs ON proofs.l1_batch_number = inputs.l1_batch_number + JOIN + tee_verifier_input_producer_jobs AS inputs + ON proofs.l1_batch_number = inputs.l1_batch_number WHERE inputs.status = $1 AND proofs.status = $2 diff --git a/core/lib/dal/src/tee_verifier_input_producer_dal.rs b/core/lib/dal/src/tee_verifier_input_producer_dal.rs index 4a178fd52253..dddb451a2d7d 100644 --- a/core/lib/dal/src/tee_verifier_input_producer_dal.rs +++ b/core/lib/dal/src/tee_verifier_input_producer_dal.rs @@ -55,9 +55,11 @@ impl TeeVerifierInputProducerDal<'_, '_> { sqlx::query!( r#" INSERT INTO - tee_verifier_input_producer_jobs (l1_batch_number, status, created_at, updated_at) + tee_verifier_input_producer_jobs ( + l1_batch_number, status, created_at, updated_at + ) VALUES - ($1, $2, NOW(), NOW()) + ($1, $2, NOW(), NOW()) ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::from(l1_batch_number.0), @@ -104,10 +106,10 @@ impl TeeVerifierInputProducerDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - tee_verifier_input_producer_jobs.l1_batch_number + tee_verifier_input_producer_jobs.l1_batch_number "#, TeeVerifierInputProducerJobStatus::InProgress as TeeVerifierInputProducerJobStatus, TeeVerifierInputProducerJobStatus::Queued as TeeVerifierInputProducerJobStatus, @@ -197,7 +199,7 @@ impl TeeVerifierInputProducerDal<'_, '_> { l1_batch_number = $2 AND status != $5 RETURNING - tee_verifier_input_producer_jobs.attempts + tee_verifier_input_producer_jobs.attempts "#, TeeVerifierInputProducerJobStatus::Failed as TeeVerifierInputProducerJobStatus, i64::from(l1_batch_number.0), diff --git a/core/lib/dal/src/tokens_dal.rs b/core/lib/dal/src/tokens_dal.rs index b34b913c45c3..218e152fa82a 100644 --- a/core/lib/dal/src/tokens_dal.rs +++ b/core/lib/dal/src/tokens_dal.rs @@ -110,7 +110,7 @@ impl TokensDal<'_, '_> { r#" DELETE FROM tokens WHERE - l2_address = ANY ($1) + l2_address = ANY($1) "#, &token_addresses_to_be_removed as &[_] ) diff --git a/core/lib/dal/src/tokens_web3_dal.rs b/core/lib/dal/src/tokens_web3_dal.rs index 00c7a69385db..794de18163ec 100644 --- a/core/lib/dal/src/tokens_web3_dal.rs +++ b/core/lib/dal/src/tokens_web3_dal.rs @@ -43,7 +43,7 @@ impl TokensWeb3Dal<'_, '_> { SELECT l1_address, l2_address, - NAME, + name, symbol, decimals FROM @@ -95,7 +95,7 @@ impl TokensWeb3Dal<'_, '_> { SELECT l1_address, l2_address, - NAME, + name, symbol, decimals FROM diff --git a/core/lib/dal/src/transactions_dal.rs b/core/lib/dal/src/transactions_dal.rs index 408837d699e6..67c965312bd4 100644 --- a/core/lib/dal/src/transactions_dal.rs +++ b/core/lib/dal/src/transactions_dal.rs @@ -88,53 +88,53 @@ impl TransactionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - gas_limit, - max_fee_per_gas, - gas_per_pubdata_limit, - data, - priority_op_id, - full_fee, - layer_2_tip_fee, - contract_address, - l1_block_number, - value, - paymaster, - paymaster_input, - tx_format, - l1_tx_mint, - l1_tx_refund_recipient, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + gas_limit, + max_fee_per_gas, + gas_per_pubdata_limit, + data, + priority_op_id, + full_fee, + layer_2_tip_fee, + contract_address, + l1_block_number, + value, + paymaster, + paymaster_input, + tx_format, + l1_tx_mint, + l1_tx_refund_recipient, + received_at, + created_at, + updated_at + ) VALUES - ( - $1, - TRUE, - $2, - $3, - $4, - $5, - $6, - $7, - $8, - $9, - $10, - $11, - $12, - $13, - $14, - $15, - $16, - $17, - $18, - NOW(), - NOW() - ) + ( + $1, + TRUE, + $2, + $3, + $4, + $5, + $6, + $7, + $8, + $9, + $10, + $11, + $12, + $13, + $14, + $15, + $16, + $17, + $18, + NOW(), + NOW() + ) ON CONFLICT (hash) DO NOTHING "#, tx_hash_bytes, @@ -190,49 +190,49 @@ impl TransactionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - gas_limit, - max_fee_per_gas, - gas_per_pubdata_limit, - data, - upgrade_id, - contract_address, - l1_block_number, - value, - paymaster, - paymaster_input, - tx_format, - l1_tx_mint, - l1_tx_refund_recipient, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + gas_limit, + max_fee_per_gas, + gas_per_pubdata_limit, + data, + upgrade_id, + contract_address, + l1_block_number, + value, + paymaster, + paymaster_input, + tx_format, + l1_tx_mint, + l1_tx_refund_recipient, + received_at, + created_at, + updated_at + ) VALUES - ( - $1, - TRUE, - $2, - $3, - $4, - $5, - $6, - $7, - $8, - $9, - $10, - $11, - $12, - $13, - $14, - $15, - $16, - NOW(), - NOW() - ) + ( + $1, + TRUE, + $2, + $3, + $4, + $5, + $6, + $7, + $8, + $9, + $10, + $11, + $12, + $13, + $14, + $15, + $16, + NOW(), + NOW() + ) ON CONFLICT (hash) DO NOTHING "#, tx_hash, @@ -326,86 +326,101 @@ impl TransactionsDal<'_, '_> { let query_result = sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - nonce, - signature, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - gas_per_pubdata_limit, - input, - data, - tx_format, - contract_address, - value, - paymaster, - paymaster_input, - execution_info, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + nonce, + signature, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + gas_per_pubdata_limit, + input, + data, + tx_format, + contract_address, + value, + paymaster, + paymaster_input, + execution_info, + received_at, + created_at, + updated_at + ) VALUES - ( - $1, - FALSE, - $2, - $3, - $4, - $5, - $6, - $7, - $8, - $9, - $10, - $11, - $12, - $13, - $14, - $15, - JSONB_BUILD_OBJECT('gas_used', $16::BIGINT, 'storage_writes', $17::INT, 'contracts_used', $18::INT), - $19, - NOW(), - NOW() - ) + ( + $1, + FALSE, + $2, + $3, + $4, + $5, + $6, + $7, + $8, + $9, + $10, + $11, + $12, + $13, + $14, + $15, + JSONB_BUILD_OBJECT( + 'gas_used', + $16::BIGINT, + 'storage_writes', + $17::INT, + 'contracts_used', + $18::INT + ), + $19, + NOW(), + NOW() + ) ON CONFLICT (initiator_address, nonce) DO UPDATE SET - hash = $1, - signature = $4, - gas_limit = $5, - max_fee_per_gas = $6, - max_priority_fee_per_gas = $7, - gas_per_pubdata_limit = $8, - input = $9, - data = $10, - tx_format = $11, - contract_address = $12, - value = $13, - paymaster = $14, - paymaster_input = $15, - execution_info = JSONB_BUILD_OBJECT('gas_used', $16::BIGINT, 'storage_writes', $17::INT, 'contracts_used', $18::INT), - in_mempool = FALSE, - received_at = $19, - created_at = NOW(), - updated_at = NOW(), - error = NULL + hash = $1, + signature = $4, + gas_limit = $5, + max_fee_per_gas = $6, + max_priority_fee_per_gas = $7, + gas_per_pubdata_limit = $8, + input = $9, + data = $10, + tx_format = $11, + contract_address = $12, + value = $13, + paymaster = $14, + paymaster_input = $15, + execution_info + = JSONB_BUILD_OBJECT( + 'gas_used', + $16::BIGINT, + 'storage_writes', + $17::INT, + 'contracts_used', + $18::INT + ), + in_mempool = FALSE, + received_at = $19, + created_at = NOW(), + updated_at = NOW(), + error = NULL WHERE - transactions.is_priority = FALSE - AND transactions.miniblock_number IS NULL + transactions.is_priority = FALSE + AND transactions.miniblock_number IS NULL RETURNING - ( - SELECT - hash - FROM - transactions - WHERE - transactions.initiator_address = $2 - AND transactions.nonce = $3 - ) IS NOT NULL AS "is_replaced!" + ( + SELECT + hash + FROM + transactions + WHERE + transactions.initiator_address = $2 + AND transactions.nonce = $3 + ) IS NOT NULL AS "is_replaced!" "#, tx_hash.as_bytes(), initiator_address.as_bytes(), @@ -489,8 +504,8 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($1::INT[]) AS l1_batch_tx_index, - UNNEST($2::bytea[]) AS hash + UNNEST($1::INT []) AS l1_batch_tx_index, + UNNEST($2::BYTEA []) AS hash ) AS data_table WHERE transactions.hash = data_table.hash @@ -535,7 +550,7 @@ impl TransactionsDal<'_, '_> { r#" DELETE FROM transactions WHERE - hash = ANY ($1) + hash = ANY($1) "#, &tx_hashes as &[&[u8]], ) @@ -604,12 +619,12 @@ impl TransactionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - call_traces (tx_hash, call_trace) + call_traces (tx_hash, call_trace) SELECT u.tx_hash, u.call_trace FROM - UNNEST($1::bytea[], $2::bytea[]) AS u (tx_hash, call_trace) + UNNEST($1::bytea [], $2::bytea []) AS u (tx_hash, call_trace) "#, &call_traces_tx_hashes as &[&[u8]], &bytea_call_traces @@ -735,33 +750,33 @@ impl TransactionsDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - nonce, - signature, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - gas_per_pubdata_limit, - input, - data, - tx_format, - contract_address, - value, - paymaster, - paymaster_input, - execution_info, - miniblock_number, - index_in_block, - error, - effective_gas_price, - refunded_gas, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + nonce, + signature, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + gas_per_pubdata_limit, + input, + data, + tx_format, + contract_address, + value, + paymaster, + paymaster_input, + execution_info, + miniblock_number, + index_in_block, + error, + effective_gas_price, + refunded_gas, + received_at, + created_at, + updated_at + ) SELECT data_table.hash, FALSE, @@ -791,26 +806,26 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($1::bytea[]) AS hash, - UNNEST($2::bytea[]) AS initiator_address, - UNNEST($3::INT[]) AS nonce, - UNNEST($4::bytea[]) AS signature, - UNNEST($5::NUMERIC[]) AS gas_limit, - UNNEST($6::NUMERIC[]) AS max_fee_per_gas, - UNNEST($7::NUMERIC[]) AS max_priority_fee_per_gas, - UNNEST($8::NUMERIC[]) AS gas_per_pubdata_limit, - UNNEST($9::bytea[]) AS input, - UNNEST($10::jsonb[]) AS data, - UNNEST($11::INT[]) AS tx_format, - UNNEST($12::bytea[]) AS contract_address, - UNNEST($13::NUMERIC[]) AS value, - UNNEST($14::bytea[]) AS paymaster, - UNNEST($15::bytea[]) AS paymaster_input, - UNNEST($16::jsonb[]) AS new_execution_info, - UNNEST($17::INTEGER[]) AS index_in_block, - UNNEST($18::VARCHAR[]) AS error, - UNNEST($19::NUMERIC[]) AS effective_gas_price, - UNNEST($20::BIGINT[]) AS refunded_gas + UNNEST($1::bytea []) AS hash, + UNNEST($2::bytea []) AS initiator_address, + UNNEST($3::int []) AS nonce, + UNNEST($4::bytea []) AS signature, + UNNEST($5::numeric []) AS gas_limit, + UNNEST($6::numeric []) AS max_fee_per_gas, + UNNEST($7::numeric []) AS max_priority_fee_per_gas, + UNNEST($8::numeric []) AS gas_per_pubdata_limit, + UNNEST($9::bytea []) AS input, + UNNEST($10::jsonb []) AS data, + UNNEST($11::int []) AS tx_format, + UNNEST($12::bytea []) AS contract_address, + UNNEST($13::numeric []) AS value, + UNNEST($14::bytea []) AS paymaster, + UNNEST($15::bytea []) AS paymaster_input, + UNNEST($16::jsonb []) AS new_execution_info, + UNNEST($17::integer []) AS index_in_block, + UNNEST($18::varchar []) AS error, + UNNEST($19::numeric []) AS effective_gas_price, + UNNEST($20::bigint []) AS refunded_gas ) AS data_table "#, &l2_hashes as &[&[u8]], @@ -974,29 +989,32 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($1::bytea[]) AS initiator_address, - UNNEST($2::INT[]) AS nonce, - UNNEST($3::bytea[]) AS hash, - UNNEST($4::bytea[]) AS signature, - UNNEST($5::NUMERIC[]) AS gas_limit, - UNNEST($6::NUMERIC[]) AS max_fee_per_gas, - UNNEST($7::NUMERIC[]) AS max_priority_fee_per_gas, - UNNEST($8::NUMERIC[]) AS gas_per_pubdata_limit, - UNNEST($9::INT[]) AS tx_format, - UNNEST($10::INTEGER[]) AS index_in_block, - UNNEST($11::VARCHAR[]) AS error, - UNNEST($12::NUMERIC[]) AS effective_gas_price, - UNNEST($13::jsonb[]) AS new_execution_info, - UNNEST($14::bytea[]) AS input, - UNNEST($15::jsonb[]) AS data, - UNNEST($16::BIGINT[]) AS refunded_gas, - UNNEST($17::NUMERIC[]) AS value, - UNNEST($18::bytea[]) AS contract_address, - UNNEST($19::bytea[]) AS paymaster, - UNNEST($20::bytea[]) AS paymaster_input + UNNEST($1::bytea []) AS initiator_address, + UNNEST($2::int []) AS nonce, + UNNEST($3::bytea []) AS hash, + UNNEST($4::bytea []) AS signature, + UNNEST($5::numeric []) AS gas_limit, + UNNEST($6::numeric []) AS max_fee_per_gas, + UNNEST($7::numeric []) AS max_priority_fee_per_gas, + UNNEST($8::numeric []) AS gas_per_pubdata_limit, + UNNEST($9::int []) AS tx_format, + UNNEST($10::integer []) AS index_in_block, + UNNEST($11::varchar []) AS error, + UNNEST($12::numeric []) AS effective_gas_price, + UNNEST($13::jsonb []) AS new_execution_info, + UNNEST($14::bytea []) AS input, + UNNEST($15::jsonb []) AS data, + UNNEST($16::bigint []) AS refunded_gas, + UNNEST($17::numeric []) AS value, + UNNEST($18::bytea []) AS contract_address, + UNNEST($19::bytea []) AS paymaster, + UNNEST($20::bytea []) AS paymaster_input ) AS data_table_temp - JOIN transactions ON transactions.initiator_address = data_table_temp.initiator_address - AND transactions.nonce = data_table_temp.nonce + JOIN transactions + ON + transactions.initiator_address + = data_table_temp.initiator_address + AND transactions.nonce = data_table_temp.nonce ORDER BY transactions.hash ) AS data_table @@ -1122,35 +1140,35 @@ impl TransactionsDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - gas_limit, - max_fee_per_gas, - gas_per_pubdata_limit, - data, - priority_op_id, - full_fee, - layer_2_tip_fee, - contract_address, - l1_block_number, - value, - paymaster, - paymaster_input, - tx_format, - l1_tx_mint, - l1_tx_refund_recipient, - miniblock_number, - index_in_block, - error, - execution_info, - refunded_gas, - effective_gas_price, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + gas_limit, + max_fee_per_gas, + gas_per_pubdata_limit, + data, + priority_op_id, + full_fee, + layer_2_tip_fee, + contract_address, + l1_block_number, + value, + paymaster, + paymaster_input, + tx_format, + l1_tx_mint, + l1_tx_refund_recipient, + miniblock_number, + index_in_block, + error, + execution_info, + refunded_gas, + effective_gas_price, + received_at, + created_at, + updated_at + ) SELECT data_table.hash, TRUE, @@ -1182,26 +1200,26 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($1::BYTEA[]) AS hash, - UNNEST($2::BYTEA[]) AS initiator_address, - UNNEST($3::NUMERIC[]) AS gas_limit, - UNNEST($4::NUMERIC[]) AS max_fee_per_gas, - UNNEST($5::NUMERIC[]) AS gas_per_pubdata_limit, - UNNEST($6::JSONB[]) AS data, - UNNEST($7::BIGINT[]) AS priority_op_id, - UNNEST($8::NUMERIC[]) AS full_fee, - UNNEST($9::NUMERIC[]) AS layer_2_tip_fee, - UNNEST($10::BYTEA[]) AS contract_address, - UNNEST($11::INT[]) AS l1_block_number, - UNNEST($12::NUMERIC[]) AS value, - UNNEST($13::INTEGER[]) AS tx_format, - UNNEST($14::NUMERIC[]) AS l1_tx_mint, - UNNEST($15::BYTEA[]) AS l1_tx_refund_recipient, - UNNEST($16::INT[]) AS index_in_block, - UNNEST($17::VARCHAR[]) AS error, - UNNEST($18::JSONB[]) AS execution_info, - UNNEST($19::BIGINT[]) AS refunded_gas, - UNNEST($20::NUMERIC[]) AS effective_gas_price + UNNEST($1::bytea []) AS hash, + UNNEST($2::bytea []) AS initiator_address, + UNNEST($3::numeric []) AS gas_limit, + UNNEST($4::numeric []) AS max_fee_per_gas, + UNNEST($5::numeric []) AS gas_per_pubdata_limit, + UNNEST($6::jsonb []) AS data, + UNNEST($7::bigint []) AS priority_op_id, + UNNEST($8::numeric []) AS full_fee, + UNNEST($9::numeric []) AS layer_2_tip_fee, + UNNEST($10::bytea []) AS contract_address, + UNNEST($11::int []) AS l1_block_number, + UNNEST($12::numeric []) AS value, + UNNEST($13::integer []) AS tx_format, + UNNEST($14::numeric []) AS l1_tx_mint, + UNNEST($15::bytea []) AS l1_tx_refund_recipient, + UNNEST($16::int []) AS index_in_block, + UNNEST($17::varchar []) AS error, + UNNEST($18::jsonb []) AS execution_info, + UNNEST($19::bigint []) AS refunded_gas, + UNNEST($20::numeric []) AS effective_gas_price ) AS data_table "#, &l1_hashes as &[&[u8]], @@ -1300,12 +1318,12 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($2::bytea[]) AS hash, - UNNEST($3::INTEGER[]) AS index_in_block, - UNNEST($4::VARCHAR[]) AS error, - UNNEST($5::jsonb[]) AS new_execution_info, - UNNEST($6::BIGINT[]) AS refunded_gas, - UNNEST($7::NUMERIC[]) AS effective_gas_price + UNNEST($2::bytea []) AS hash, + UNNEST($3::integer []) AS index_in_block, + UNNEST($4::varchar []) AS error, + UNNEST($5::jsonb []) AS new_execution_info, + UNNEST($6::bigint []) AS refunded_gas, + UNNEST($7::numeric []) AS effective_gas_price ) AS data_table WHERE transactions.hash = data_table.hash @@ -1413,33 +1431,33 @@ impl TransactionsDal<'_, '_> { let query = sqlx::query!( r#" INSERT INTO - transactions ( - hash, - is_priority, - initiator_address, - gas_limit, - max_fee_per_gas, - gas_per_pubdata_limit, - data, - upgrade_id, - contract_address, - l1_block_number, - value, - paymaster, - paymaster_input, - tx_format, - l1_tx_mint, - l1_tx_refund_recipient, - miniblock_number, - index_in_block, - error, - execution_info, - refunded_gas, - effective_gas_price, - received_at, - created_at, - updated_at - ) + transactions ( + hash, + is_priority, + initiator_address, + gas_limit, + max_fee_per_gas, + gas_per_pubdata_limit, + data, + upgrade_id, + contract_address, + l1_block_number, + value, + paymaster, + paymaster_input, + tx_format, + l1_tx_mint, + l1_tx_refund_recipient, + miniblock_number, + index_in_block, + error, + execution_info, + refunded_gas, + effective_gas_price, + received_at, + created_at, + updated_at + ) SELECT data_table.hash, TRUE, @@ -1469,24 +1487,24 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($1::BYTEA[]) AS hash, - UNNEST($2::BYTEA[]) AS initiator_address, - UNNEST($3::NUMERIC[]) AS gas_limit, - UNNEST($4::NUMERIC[]) AS max_fee_per_gas, - UNNEST($5::NUMERIC[]) AS gas_per_pubdata_limit, - UNNEST($6::JSONB[]) AS data, - UNNEST($7::INT[]) AS upgrade_id, - UNNEST($8::BYTEA[]) AS contract_address, - UNNEST($9::INT[]) AS l1_block_number, - UNNEST($10::NUMERIC[]) AS value, - UNNEST($11::INTEGER[]) AS tx_format, - UNNEST($12::NUMERIC[]) AS l1_tx_mint, - UNNEST($13::BYTEA[]) AS l1_tx_refund_recipient, - UNNEST($14::INT[]) AS index_in_block, - UNNEST($15::VARCHAR[]) AS error, - UNNEST($16::JSONB[]) AS execution_info, - UNNEST($17::BIGINT[]) AS refunded_gas, - UNNEST($18::NUMERIC[]) AS effective_gas_price + UNNEST($1::bytea []) AS hash, + UNNEST($2::bytea []) AS initiator_address, + UNNEST($3::numeric []) AS gas_limit, + UNNEST($4::numeric []) AS max_fee_per_gas, + UNNEST($5::numeric []) AS gas_per_pubdata_limit, + UNNEST($6::jsonb []) AS data, + UNNEST($7::int []) AS upgrade_id, + UNNEST($8::bytea []) AS contract_address, + UNNEST($9::int []) AS l1_block_number, + UNNEST($10::numeric []) AS value, + UNNEST($11::integer []) AS tx_format, + UNNEST($12::numeric []) AS l1_tx_mint, + UNNEST($13::bytea []) AS l1_tx_refund_recipient, + UNNEST($14::int []) AS index_in_block, + UNNEST($15::varchar []) AS error, + UNNEST($16::jsonb []) AS execution_info, + UNNEST($17::bigint []) AS refunded_gas, + UNNEST($18::numeric []) AS effective_gas_price ) AS data_table "#, &upgrade_hashes as &[&[u8]], @@ -1585,12 +1603,12 @@ impl TransactionsDal<'_, '_> { FROM ( SELECT - UNNEST($2::bytea[]) AS hash, - UNNEST($3::INTEGER[]) AS index_in_block, - UNNEST($4::VARCHAR[]) AS error, - UNNEST($5::jsonb[]) AS new_execution_info, - UNNEST($6::BIGINT[]) AS refunded_gas, - UNNEST($7::NUMERIC[]) AS effective_gas_price + UNNEST($2::bytea []) AS hash, + UNNEST($3::integer []) AS index_in_block, + UNNEST($4::varchar []) AS error, + UNNEST($5::jsonb []) AS new_execution_info, + UNNEST($6::bigint []) AS refunded_gas, + UNNEST($7::numeric []) AS effective_gas_price ) AS data_table WHERE transactions.hash = data_table.hash @@ -1651,7 +1669,7 @@ impl TransactionsDal<'_, '_> { WHERE miniblock_number > $1 RETURNING - hash + hash "#, i64::from(l2_block_number.0) ) @@ -1665,7 +1683,7 @@ impl TransactionsDal<'_, '_> { r#" DELETE FROM call_traces WHERE - tx_hash = ANY ($1) + tx_hash = ANY($1) "#, &tx_hashes as &[&[u8]] ) @@ -1688,7 +1706,7 @@ impl TransactionsDal<'_, '_> { AND is_priority = FALSE AND error IS NULL RETURNING - hash + hash "#, stuck_tx_timeout ) @@ -1717,7 +1735,7 @@ impl TransactionsDal<'_, '_> { SET in_mempool = FALSE FROM - UNNEST($1::bytea[]) AS s (address) + UNNEST($1::bytea []) AS s (address) WHERE transactions.in_mempool = TRUE AND transactions.initiator_address = s.address @@ -1735,7 +1753,7 @@ impl TransactionsDal<'_, '_> { DELETE FROM transactions WHERE in_mempool = TRUE - AND initiator_address = ANY ($1) + AND initiator_address = ANY($1) "#, &purged_addresses as &[&[u8]] ) @@ -1786,7 +1804,7 @@ impl TransactionsDal<'_, '_> { WHERE transactions.hash = subquery2.hash RETURNING - transactions.* + transactions.* "#, limit as i32, BigDecimal::from(fee_per_gas), @@ -2121,7 +2139,7 @@ impl TransactionsDal<'_, '_> { index_in_block FROM transactions - INNER JOIN miniblocks ON transactions.miniblock_number = miniblocks.number + INNER JOIN miniblocks ON transactions.miniblock_number = miniblocks.number WHERE transactions.hash = $1 "#, diff --git a/core/lib/dal/src/transactions_web3_dal.rs b/core/lib/dal/src/transactions_web3_dal.rs index f5a3c492f8af..dcf5f25f104d 100644 --- a/core/lib/dal/src/transactions_web3_dal.rs +++ b/core/lib/dal/src/transactions_web3_dal.rs @@ -49,42 +49,43 @@ impl TransactionsWeb3Dal<'_, '_> { StorageTransactionReceipt, r#" WITH - events AS ( - SELECT DISTINCT - ON (events.tx_hash) * - FROM - events - WHERE - events.address = $1 - AND events.topic1 = $2 - AND events.tx_hash = ANY ($3) - ORDER BY - events.tx_hash, - events.event_index_in_tx DESC - ) + events AS ( + SELECT DISTINCT + ON (events.tx_hash) * + FROM + events + WHERE + events.address = $1 + AND events.topic1 = $2 + AND events.tx_hash = ANY($3) + ORDER BY + events.tx_hash, + events.event_index_in_tx DESC + ) + SELECT transactions.hash AS tx_hash, - transactions.index_in_block AS index_in_block, - transactions.l1_batch_tx_index AS l1_batch_tx_index, + transactions.index_in_block, + transactions.l1_batch_tx_index, transactions.miniblock_number AS "block_number!", - transactions.error AS error, - transactions.effective_gas_price AS effective_gas_price, - transactions.initiator_address AS initiator_address, + transactions.error, + transactions.effective_gas_price, + transactions.initiator_address, transactions.data -> 'to' AS "transfer_to?", transactions.data -> 'contractAddress' AS "execute_contract_address?", transactions.tx_format AS "tx_format?", - transactions.refunded_gas AS refunded_gas, - transactions.gas_limit AS gas_limit, + transactions.refunded_gas, + transactions.gas_limit, miniblocks.hash AS "block_hash", miniblocks.l1_batch_number AS "l1_batch_number?", events.topic4 AS "contract_address?", miniblocks.timestamp AS "block_timestamp?" FROM transactions - JOIN miniblocks ON miniblocks.number = transactions.miniblock_number - LEFT JOIN events ON events.tx_hash = transactions.hash + JOIN miniblocks ON miniblocks.number = transactions.miniblock_number + LEFT JOIN events ON events.tx_hash = transactions.hash WHERE - transactions.hash = ANY ($3) + transactions.hash = ANY($3) AND transactions.data != '{}'::jsonb "#, // ^ Filter out transactions with pruned data, which would lead to potentially incomplete / bogus @@ -302,17 +303,20 @@ impl TransactionsWeb3Dal<'_, '_> { execute_tx.tx_hash AS "eth_execute_tx_hash?" FROM transactions - LEFT JOIN miniblocks ON miniblocks.number = transactions.miniblock_number - LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number - LEFT JOIN eth_txs_history AS commit_tx ON ( + LEFT JOIN miniblocks ON miniblocks.number = transactions.miniblock_number + LEFT JOIN l1_batches ON l1_batches.number = miniblocks.l1_batch_number + LEFT JOIN eth_txs_history AS commit_tx + ON ( l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id AND commit_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS prove_tx ON ( + LEFT JOIN eth_txs_history AS prove_tx + ON ( l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id AND prove_tx.confirmed_at IS NOT NULL ) - LEFT JOIN eth_txs_history AS execute_tx ON ( + LEFT JOIN eth_txs_history AS execute_tx + ON ( l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id AND execute_tx.confirmed_at IS NOT NULL ) @@ -439,7 +443,7 @@ impl TransactionsWeb3Dal<'_, '_> { transactions.* FROM transactions - INNER JOIN miniblocks ON miniblocks.number = transactions.miniblock_number + INNER JOIN miniblocks ON miniblocks.number = transactions.miniblock_number WHERE miniblocks.number BETWEEN $1 AND $2 ORDER BY diff --git a/core/lib/dal/src/vm_runner_dal.rs b/core/lib/dal/src/vm_runner_dal.rs index 37ef1517d54a..b12b02186808 100644 --- a/core/lib/dal/src/vm_runner_dal.rs +++ b/core/lib/dal/src/vm_runner_dal.rs @@ -37,25 +37,27 @@ impl VmRunnerDal<'_, '_> { let row = sqlx::query!( r#" WITH - available_batches AS ( - SELECT - MAX(number) AS "last_batch" - FROM - l1_batches - ), - processed_batches AS ( - SELECT - COALESCE(MAX(l1_batch_number), $1) + $2 AS "last_ready_batch" - FROM - vm_runner_protective_reads - WHERE - time_taken IS NOT NULL - ) + available_batches AS ( + SELECT + MAX(number) AS "last_batch" + FROM + l1_batches + ), + + processed_batches AS ( + SELECT + COALESCE(MAX(l1_batch_number), $1) + $2 AS "last_ready_batch" + FROM + vm_runner_protective_reads + WHERE + time_taken IS NOT NULL + ) + SELECT LEAST(last_batch, last_ready_batch) AS "last_ready_batch!" FROM available_batches - FULL JOIN processed_batches ON TRUE + FULL JOIN processed_batches ON TRUE "#, default_batch.0 as i32, window_size as i32 @@ -74,14 +76,16 @@ impl VmRunnerDal<'_, '_> { sqlx::query!( r#" INSERT INTO - vm_runner_protective_reads (l1_batch_number, created_at, updated_at, processing_started_at) + vm_runner_protective_reads ( + l1_batch_number, created_at, updated_at, processing_started_at + ) VALUES - ($1, NOW(), NOW(), NOW()) + ($1, NOW(), NOW(), NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - updated_at = NOW(), - processing_started_at = NOW() + updated_at = NOW(), + processing_started_at = NOW() "#, i64::from(l1_batch_number.0), ) @@ -196,25 +200,27 @@ impl VmRunnerDal<'_, '_> { let row = sqlx::query!( r#" WITH - available_batches AS ( - SELECT - MAX(number) AS "last_batch" - FROM - l1_batches - ), - processed_batches AS ( - SELECT - COALESCE(MAX(l1_batch_number), $1) + $2 AS "last_ready_batch" - FROM - vm_runner_bwip - WHERE - time_taken IS NOT NULL - ) + available_batches AS ( + SELECT + MAX(number) AS "last_batch" + FROM + l1_batches + ), + + processed_batches AS ( + SELECT + COALESCE(MAX(l1_batch_number), $1) + $2 AS "last_ready_batch" + FROM + vm_runner_bwip + WHERE + time_taken IS NOT NULL + ) + SELECT LEAST(last_batch, last_ready_batch) AS "last_ready_batch!" FROM available_batches - FULL JOIN processed_batches ON TRUE + FULL JOIN processed_batches ON TRUE "#, default_batch.0 as i32, window_size as i32 @@ -233,14 +239,14 @@ impl VmRunnerDal<'_, '_> { sqlx::query!( r#" INSERT INTO - vm_runner_bwip (l1_batch_number, created_at, updated_at, processing_started_at) + vm_runner_bwip (l1_batch_number, created_at, updated_at, processing_started_at) VALUES - ($1, NOW(), NOW(), NOW()) + ($1, NOW(), NOW(), NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - updated_at = NOW(), - processing_started_at = NOW() + updated_at = NOW(), + processing_started_at = NOW() "#, i64::from(l1_batch_number.0), ) diff --git a/prover/crates/lib/prover_dal/.sqlx/query-41af30620f8a1f20b8a6c46be162601d35fd2881ac1fd070f0f1a8add4bc388d.json b/prover/crates/lib/prover_dal/.sqlx/query-095c459e05aa4c7fad0d1fa74b2d52314178f8ab2aea7efb69ae18fbf40e8994.json similarity index 80% rename from prover/crates/lib/prover_dal/.sqlx/query-41af30620f8a1f20b8a6c46be162601d35fd2881ac1fd070f0f1a8add4bc388d.json rename to prover/crates/lib/prover_dal/.sqlx/query-095c459e05aa4c7fad0d1fa74b2d52314178f8ab2aea7efb69ae18fbf40e8994.json index b65633a904e3..435f6cd5a3bd 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-41af30620f8a1f20b8a6c46be162601d35fd2881ac1fd070f0f1a8add4bc388d.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-095c459e05aa4c7fad0d1fa74b2d52314178f8ab2aea7efb69ae18fbf40e8994.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n recursion_tip_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n recursion_tip_witness_jobs_fri.l1_batch_number,\n recursion_tip_witness_jobs_fri.number_of_final_node_jobs\n ", + "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n recursion_tip_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n recursion_tip_witness_jobs_fri.l1_batch_number,\n recursion_tip_witness_jobs_fri.number_of_final_node_jobs\n ", "describe": { "columns": [ { @@ -26,5 +26,5 @@ false ] }, - "hash": "41af30620f8a1f20b8a6c46be162601d35fd2881ac1fd070f0f1a8add4bc388d" + "hash": "095c459e05aa4c7fad0d1fa74b2d52314178f8ab2aea7efb69ae18fbf40e8994" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-0a1ec4690d6b4a67d6ad16badcbf113a19feb73c4cf9876855523499998b99c0.json b/prover/crates/lib/prover_dal/.sqlx/query-0a1ec4690d6b4a67d6ad16badcbf113a19feb73c4cf9876855523499998b99c0.json deleted file mode 100644 index b05230e1be44..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-0a1ec4690d6b4a67d6ad16badcbf113a19feb73c4cf9876855523499998b99c0.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n leaf_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n closed_form_inputs_blob_url,\n number_of_basic_circuits,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, 'waiting_for_proofs', NOW(), NOW(), $6)\n ON CONFLICT (l1_batch_number, circuit_id) DO\n UPDATE\n SET\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Text", - "Int4", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "0a1ec4690d6b4a67d6ad16badcbf113a19feb73c4cf9876855523499998b99c0" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-1080b95755b3047747a9fabc7c7c43ffc5f519d35c90c60f89579f0689906df5.json b/prover/crates/lib/prover_dal/.sqlx/query-1080b95755b3047747a9fabc7c7c43ffc5f519d35c90c60f89579f0689906df5.json new file mode 100644 index 000000000000..4b1cb2fe98a9 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-1080b95755b3047747a9fabc7c7c43ffc5f519d35c90c60f89579f0689906df5.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n proof_compression_jobs_fri (\n l1_batch_number,\n fri_proof_blob_url,\n status,\n created_at,\n updated_at,\n protocol_version,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, NOW(), NOW(), $4, $5)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Text", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "1080b95755b3047747a9fabc7c7c43ffc5f519d35c90c60f89579f0689906df5" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-eb2a85cb60c680a71203769db7baf89bbd72934e1405e320e746158e6d395d96.json b/prover/crates/lib/prover_dal/.sqlx/query-128b9be7a480a1ef132e5d477a43e4b3d55a0fee71105df880ff4f599844d06f.json similarity index 81% rename from prover/crates/lib/prover_dal/.sqlx/query-eb2a85cb60c680a71203769db7baf89bbd72934e1405e320e746158e6d395d96.json rename to prover/crates/lib/prover_dal/.sqlx/query-128b9be7a480a1ef132e5d477a43e4b3d55a0fee71105df880ff4f599844d06f.json index 27680c0bb46e..e4e02b7e0df4 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-eb2a85cb60c680a71203769db7baf89bbd72934e1405e320e746158e6d395d96.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-128b9be7a480a1ef132e5d477a43e4b3d55a0fee71105df880ff4f599844d06f.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "eb2a85cb60c680a71203769db7baf89bbd72934e1405e320e746158e6d395d96" + "hash": "128b9be7a480a1ef132e5d477a43e4b3d55a0fee71105df880ff4f599844d06f" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-fcddeb96dcd1611dedb2091c1be304e8a35fd65bf37e976b7106f57c57e70b9b.json b/prover/crates/lib/prover_dal/.sqlx/query-1a1b8595ccf645981050fdeb87c572f6c620f86bf6c53334878490c7004331f4.json similarity index 77% rename from prover/crates/lib/prover_dal/.sqlx/query-fcddeb96dcd1611dedb2091c1be304e8a35fd65bf37e976b7106f57c57e70b9b.json rename to prover/crates/lib/prover_dal/.sqlx/query-1a1b8595ccf645981050fdeb87c572f6c620f86bf6c53334878490c7004331f4.json index effc22d6a43b..ec61ec67e36a 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-fcddeb96dcd1611dedb2091c1be304e8a35fd65bf37e976b7106f57c57e70b9b.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-1a1b8595ccf645981050fdeb87c572f6c620f86bf6c53334878490c7004331f4.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = 'available',\n updated_at = NOW()\n WHERE\n instance_host = $1::TEXT::inet\n AND instance_port = $2\n AND instance_status = 'full'\n AND zone = $3\n ", + "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = 'available',\n updated_at = NOW()\n WHERE\n instance_host = $1::TEXT::INET\n AND instance_port = $2\n AND instance_status = 'full'\n AND zone = $3\n ", "describe": { "columns": [], "parameters": { @@ -12,5 +12,5 @@ }, "nullable": [] }, - "hash": "fcddeb96dcd1611dedb2091c1be304e8a35fd65bf37e976b7106f57c57e70b9b" + "hash": "1a1b8595ccf645981050fdeb87c572f6c620f86bf6c53334878490c7004331f4" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-29ff260b02f7b955f9fe0b657b87def3a97275b66ad33d214054dc9048ddf584.json b/prover/crates/lib/prover_dal/.sqlx/query-29ff260b02f7b955f9fe0b657b87def3a97275b66ad33d214054dc9048ddf584.json deleted file mode 100644 index 85e66ed78248..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-29ff260b02f7b955f9fe0b657b87def3a97275b66ad33d214054dc9048ddf584.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n proof_compression_jobs_fri (\n l1_batch_number,\n fri_proof_blob_url,\n status,\n created_at,\n updated_at,\n protocol_version,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, NOW(), NOW(), $4, $5)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Text", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "29ff260b02f7b955f9fe0b657b87def3a97275b66ad33d214054dc9048ddf584" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-d0be28042b50199075cb0eca26f6b93bfd5d96fdc68732fe38c79ccd44b84def.json b/prover/crates/lib/prover_dal/.sqlx/query-2d11a834e177596113b5ffd634067fadffc1d3091e8c050835d4f178a328fcc8.json similarity index 82% rename from prover/crates/lib/prover_dal/.sqlx/query-d0be28042b50199075cb0eca26f6b93bfd5d96fdc68732fe38c79ccd44b84def.json rename to prover/crates/lib/prover_dal/.sqlx/query-2d11a834e177596113b5ffd634067fadffc1d3091e8c050835d4f178a328fcc8.json index 3943480b896d..c997a53e4d90 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-d0be28042b50199075cb0eca26f6b93bfd5d96fdc68732fe38c79ccd44b84def.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-2d11a834e177596113b5ffd634067fadffc1d3091e8c050835d4f178a328fcc8.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id IN (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n (\n status IN ('in_progress', 'in_gpu_proof')\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id IN (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n (\n status IN ('in_progress', 'in_gpu_proof')\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -49,5 +49,5 @@ true ] }, - "hash": "d0be28042b50199075cb0eca26f6b93bfd5d96fdc68732fe38c79ccd44b84def" + "hash": "2d11a834e177596113b5ffd634067fadffc1d3091e8c050835d4f178a328fcc8" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-2e6e2b68efc28114f44616b68fcf1d4d9a4b83a8b42846d8373ea13b96d612cf.json b/prover/crates/lib/prover_dal/.sqlx/query-2e6e2b68efc28114f44616b68fcf1d4d9a4b83a8b42846d8373ea13b96d612cf.json deleted file mode 100644 index 41428e91feeb..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-2e6e2b68efc28114f44616b68fcf1d4d9a4b83a8b42846d8373ea13b96d612cf.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n gpu_prover_queue_fri (\n instance_host,\n instance_port,\n instance_status,\n specialized_prover_group_id,\n zone,\n created_at,\n updated_at,\n protocol_version,\n protocol_version_patch\n )\n VALUES\n (CAST($1::TEXT AS inet), $2, 'available', $3, $4, NOW(), NOW(), $5, $6)\n ON CONFLICT (instance_host, instance_port, zone) DO\n UPDATE\n SET\n instance_status = 'available',\n specialized_prover_group_id = $3,\n zone = $4,\n updated_at = NOW(),\n protocol_version = $5,\n protocol_version_patch = $6\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Int4", - "Int2", - "Text", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "2e6e2b68efc28114f44616b68fcf1d4d9a4b83a8b42846d8373ea13b96d612cf" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-2f194183f0140eee0dd801b2087c0a4dbcc7b955132056b5ff10f00cf5844874.json b/prover/crates/lib/prover_dal/.sqlx/query-2f194183f0140eee0dd801b2087c0a4dbcc7b955132056b5ff10f00cf5844874.json new file mode 100644 index 000000000000..e60e0f543c40 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-2f194183f0140eee0dd801b2087c0a4dbcc7b955132056b5ff10f00cf5844874.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n gpu_prover_queue_fri (\n instance_host,\n instance_port,\n instance_status,\n specialized_prover_group_id,\n zone,\n created_at,\n updated_at,\n protocol_version,\n protocol_version_patch\n )\n VALUES\n (CAST($1::TEXT AS INET), $2, 'available', $3, $4, NOW(), NOW(), $5, $6)\n ON CONFLICT (instance_host, instance_port, zone) DO\n UPDATE\n SET\n instance_status = 'available',\n specialized_prover_group_id = $3,\n zone = $4,\n updated_at = NOW(),\n protocol_version = $5,\n protocol_version_patch = $6\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Int4", + "Int2", + "Text", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "2f194183f0140eee0dd801b2087c0a4dbcc7b955132056b5ff10f00cf5844874" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-102b79726652d9150c802350bdca80c233a9fd3e892b5a867a5517c2e04497a8.json b/prover/crates/lib/prover_dal/.sqlx/query-30128c0642524295ab05c37c60db2fd05e27e9df6d760173bba37446988d1b8e.json similarity index 84% rename from prover/crates/lib/prover_dal/.sqlx/query-102b79726652d9150c802350bdca80c233a9fd3e892b5a867a5517c2e04497a8.json rename to prover/crates/lib/prover_dal/.sqlx/query-30128c0642524295ab05c37c60db2fd05e27e9df6d760173bba37446988d1b8e.json index f912d06de810..10ca762aee22 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-102b79726652d9150c802350bdca80c233a9fd3e892b5a867a5517c2e04497a8.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-30128c0642524295ab05c37c60db2fd05e27e9df6d760173bba37446988d1b8e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = 'queued',\n error = 'Manually requeued',\n attempts = 2,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = 'queued',\n error = 'Manually requeued',\n attempts = 2,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -37,5 +37,5 @@ true ] }, - "hash": "102b79726652d9150c802350bdca80c233a9fd3e892b5a867a5517c2e04497a8" + "hash": "30128c0642524295ab05c37c60db2fd05e27e9df6d760173bba37446988d1b8e" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-9895b2ded08be3e81a5357decf76b4d3d6a762761e45af2a73fe96da804e627e.json b/prover/crates/lib/prover_dal/.sqlx/query-332f1363f19160f9a7708635fd1691e08d28ca6796c0bbba95016d1899cf84fe.json similarity index 84% rename from prover/crates/lib/prover_dal/.sqlx/query-9895b2ded08be3e81a5357decf76b4d3d6a762761e45af2a73fe96da804e627e.json rename to prover/crates/lib/prover_dal/.sqlx/query-332f1363f19160f9a7708635fd1691e08d28ca6796c0bbba95016d1899cf84fe.json index 90ea99942062..a63ebc8f0e2d 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-9895b2ded08be3e81a5357decf76b4d3d6a762761e45af2a73fe96da804e627e.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-332f1363f19160f9a7708635fd1691e08d28ca6796c0bbba95016d1899cf84fe.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'queued',\n error = 'Manually requeued',\n attempts = 2,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'queued',\n error = 'Manually requeued',\n attempts = 2,\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -49,5 +49,5 @@ true ] }, - "hash": "9895b2ded08be3e81a5357decf76b4d3d6a762761e45af2a73fe96da804e627e" + "hash": "332f1363f19160f9a7708635fd1691e08d28ca6796c0bbba95016d1899cf84fe" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-340a84063719f9b837a61cbc63368ba43ba128a00a194dce65015bd9eeb1b42f.json b/prover/crates/lib/prover_dal/.sqlx/query-340a84063719f9b837a61cbc63368ba43ba128a00a194dce65015bd9eeb1b42f.json new file mode 100644 index 000000000000..a49edd4737f3 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-340a84063719f9b837a61cbc63368ba43ba128a00a194dce65015bd9eeb1b42f.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n scheduler_witness_jobs_fri (\n l1_batch_number,\n scheduler_partial_input_blob_url,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, 'waiting_for_proofs', NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "340a84063719f9b837a61cbc63368ba43ba128a00a194dce65015bd9eeb1b42f" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-37fa629a87113f13c89ce5c1a8fffd15b636d553794900596528e8fb03ca5aed.json b/prover/crates/lib/prover_dal/.sqlx/query-37fa629a87113f13c89ce5c1a8fffd15b636d553794900596528e8fb03ca5aed.json new file mode 100644 index 000000000000..3a8a78db9f0d --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-37fa629a87113f13c89ce5c1a8fffd15b636d553794900596528e8fb03ca5aed.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n recursion_tip_witness_jobs_fri (\n l1_batch_number,\n status,\n number_of_final_node_jobs,\n protocol_version,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, 'waiting_for_proofs', $2, $3, NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "37fa629a87113f13c89ce5c1a8fffd15b636d553794900596528e8fb03ca5aed" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-3941da180ee62a7c5d4e392ff4fe2d3a6ebb3657862b91e3ece34119f098fc2d.json b/prover/crates/lib/prover_dal/.sqlx/query-3941da180ee62a7c5d4e392ff4fe2d3a6ebb3657862b91e3ece34119f098fc2d.json deleted file mode 100644 index d0dd5f6976b5..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-3941da180ee62a7c5d4e392ff4fe2d3a6ebb3657862b91e3ece34119f098fc2d.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id, depth) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth\n FROM\n prover_jobs_fri\n JOIN node_aggregation_witness_jobs_fri nawj ON prover_jobs_fri.l1_batch_number = nawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = nawj.circuit_id\n AND prover_jobs_fri.depth = nawj.depth\n WHERE\n nawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 2\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth,\n nawj.number_of_dependent_jobs\n HAVING\n COUNT(*) = nawj.number_of_dependent_jobs\n )\n RETURNING\n l1_batch_number,\n circuit_id,\n depth;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "l1_batch_number", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "circuit_id", - "type_info": "Int2" - }, - { - "ordinal": 2, - "name": "depth", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false - ] - }, - "hash": "3941da180ee62a7c5d4e392ff4fe2d3a6ebb3657862b91e3ece34119f098fc2d" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-7d20c0bf35625185c1f6c675aa8fcddbb47c5e9965443f118f8edd7d562734a2.json b/prover/crates/lib/prover_dal/.sqlx/query-3b3193bfac70b5fe69bf3bb7ba5a234c19578572973094b21ddbb3876da6bb95.json similarity index 79% rename from prover/crates/lib/prover_dal/.sqlx/query-7d20c0bf35625185c1f6c675aa8fcddbb47c5e9965443f118f8edd7d562734a2.json rename to prover/crates/lib/prover_dal/.sqlx/query-3b3193bfac70b5fe69bf3bb7ba5a234c19578572973094b21ddbb3876da6bb95.json index 140b8f126750..962979344b4b 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-7d20c0bf35625185c1f6c675aa8fcddbb47c5e9965443f118f8edd7d562734a2.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-3b3193bfac70b5fe69bf3bb7ba5a234c19578572973094b21ddbb3876da6bb95.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n aggregation_round ASC,\n circuit_id ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n aggregation_round ASC,\n circuit_id ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", "describe": { "columns": [ { @@ -56,5 +56,5 @@ false ] }, - "hash": "7d20c0bf35625185c1f6c675aa8fcddbb47c5e9965443f118f8edd7d562734a2" + "hash": "3b3193bfac70b5fe69bf3bb7ba5a234c19578572973094b21ddbb3876da6bb95" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-3e0a1ebc684810c09ff83784bdd0ad195b0dd2a8ce56b1a9eb531103130b5e3e.json b/prover/crates/lib/prover_dal/.sqlx/query-3e0a1ebc684810c09ff83784bdd0ad195b0dd2a8ce56b1a9eb531103130b5e3e.json deleted file mode 100644 index 7646c87b847e..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-3e0a1ebc684810c09ff83784bdd0ad195b0dd2a8ce56b1a9eb531103130b5e3e.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n processing_started_at = NOW(),\n updated_at = NOW(),\n picked_by = $5\n WHERE\n id = (\n SELECT\n pj.id\n FROM\n (\n SELECT\n *\n FROM\n UNNEST($1::SMALLINT[], $2::SMALLINT[])\n ) AS tuple (circuit_id, ROUND)\n JOIN LATERAL (\n SELECT\n *\n FROM\n prover_jobs_fri AS pj\n WHERE\n pj.status = 'queued'\n AND pj.protocol_version = $3\n AND pj.protocol_version_patch = $4\n AND pj.circuit_id = tuple.circuit_id\n AND pj.aggregation_round = tuple.round\n ORDER BY\n pj.l1_batch_number ASC,\n pj.id ASC\n LIMIT\n 1\n ) AS pj ON TRUE\n ORDER BY\n pj.l1_batch_number ASC,\n pj.aggregation_round DESC,\n pj.id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "l1_batch_number", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "circuit_id", - "type_info": "Int2" - }, - { - "ordinal": 3, - "name": "aggregation_round", - "type_info": "Int2" - }, - { - "ordinal": 4, - "name": "sequence_number", - "type_info": "Int4" - }, - { - "ordinal": 5, - "name": "depth", - "type_info": "Int4" - }, - { - "ordinal": 6, - "name": "is_node_final_proof", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Int2Array", - "Int2Array", - "Int4", - "Int4", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3e0a1ebc684810c09ff83784bdd0ad195b0dd2a8ce56b1a9eb531103130b5e3e" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-216d0c263539739b53975a96a10332b826708800a2f72f09bd7aea08cf724e1a.json b/prover/crates/lib/prover_dal/.sqlx/query-3fead9a82ea277785a9ee5c075a2ad4da8f523aa84cd047216d8e3cf69c92106.json similarity index 82% rename from prover/crates/lib/prover_dal/.sqlx/query-216d0c263539739b53975a96a10332b826708800a2f72f09bd7aea08cf724e1a.json rename to prover/crates/lib/prover_dal/.sqlx/query-3fead9a82ea277785a9ee5c075a2ad4da8f523aa84cd047216d8e3cf69c92106.json index ec503eabee01..6a534c361e2b 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-216d0c263539739b53975a96a10332b826708800a2f72f09bd7aea08cf724e1a.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-3fead9a82ea277785a9ee5c075a2ad4da8f523aa84cd047216d8e3cf69c92106.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "216d0c263539739b53975a96a10332b826708800a2f72f09bd7aea08cf724e1a" + "hash": "3fead9a82ea277785a9ee5c075a2ad4da8f523aa84cd047216d8e3cf69c92106" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-3ffc042b13c185ca6963fcb2d4d10c3b232bbaaa12747f72e3b8c5ad64702a79.json b/prover/crates/lib/prover_dal/.sqlx/query-3ffc042b13c185ca6963fcb2d4d10c3b232bbaaa12747f72e3b8c5ad64702a79.json new file mode 100644 index 000000000000..a39cda265f0c --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-3ffc042b13c185ca6963fcb2d4d10c3b232bbaaa12747f72e3b8c5ad64702a79.json @@ -0,0 +1,32 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id, depth) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth\n FROM\n prover_jobs_fri\n JOIN node_aggregation_witness_jobs_fri nawj\n ON\n prover_jobs_fri.l1_batch_number = nawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = nawj.circuit_id\n AND prover_jobs_fri.depth = nawj.depth\n WHERE\n nawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 2\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth,\n nawj.number_of_dependent_jobs\n HAVING\n COUNT(*) = nawj.number_of_dependent_jobs\n )\n RETURNING\n l1_batch_number,\n circuit_id,\n depth;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "circuit_id", + "type_info": "Int2" + }, + { + "ordinal": 2, + "name": "depth", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "3ffc042b13c185ca6963fcb2d4d10c3b232bbaaa12747f72e3b8c5ad64702a79" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-bcc5d3d35652f49b41d4ee673b171570fc88c17822bebd5b92e3b2f726d9af3a.json b/prover/crates/lib/prover_dal/.sqlx/query-4580503b825352de7691478a5de103782558380c48caf8734cacee350e3841dd.json similarity index 82% rename from prover/crates/lib/prover_dal/.sqlx/query-bcc5d3d35652f49b41d4ee673b171570fc88c17822bebd5b92e3b2f726d9af3a.json rename to prover/crates/lib/prover_dal/.sqlx/query-4580503b825352de7691478a5de103782558380c48caf8734cacee350e3841dd.json index ab1c2dd6552a..ee786a1cabe6 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-bcc5d3d35652f49b41d4ee673b171570fc88c17822bebd5b92e3b2f726d9af3a.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-4580503b825352de7691478a5de103782558380c48caf8734cacee350e3841dd.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "bcc5d3d35652f49b41d4ee673b171570fc88c17822bebd5b92e3b2f726d9af3a" + "hash": "4580503b825352de7691478a5de103782558380c48caf8734cacee350e3841dd" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-48b57a279bfff34d44d1f5a6501e40978966fb2ad8b342907580dd17c0a52779.json b/prover/crates/lib/prover_dal/.sqlx/query-48b57a279bfff34d44d1f5a6501e40978966fb2ad8b342907580dd17c0a52779.json new file mode 100644 index 000000000000..6e6a6b4ac1af --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-48b57a279bfff34d44d1f5a6501e40978966fb2ad8b342907580dd17c0a52779.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n witness_inputs_fri (\n l1_batch_number,\n witness_inputs_blob_url,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, 'queued', NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "48b57a279bfff34d44d1f5a6501e40978966fb2ad8b342907580dd17c0a52779" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-d5bb897092bce2788fe02f31c9de6dde4142e09330557cc627fee2db278ace50.json b/prover/crates/lib/prover_dal/.sqlx/query-54cc92f95c07effcb08fa0b174c742fde93ffb610bff173f04f1b80e30754ad5.json similarity index 82% rename from prover/crates/lib/prover_dal/.sqlx/query-d5bb897092bce2788fe02f31c9de6dde4142e09330557cc627fee2db278ace50.json rename to prover/crates/lib/prover_dal/.sqlx/query-54cc92f95c07effcb08fa0b174c742fde93ffb610bff173f04f1b80e30754ad5.json index 9df8f1c849cb..5a5d61aa4365 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-d5bb897092bce2788fe02f31c9de6dde4142e09330557cc627fee2db278ace50.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-54cc92f95c07effcb08fa0b174c742fde93ffb610bff173f04f1b80e30754ad5.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -49,5 +49,5 @@ true ] }, - "hash": "d5bb897092bce2788fe02f31c9de6dde4142e09330557cc627fee2db278ace50" + "hash": "54cc92f95c07effcb08fa0b174c742fde93ffb610bff173f04f1b80e30754ad5" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-2b12c5d469e6220cc8ddc997c666e4aa4f797bcc6e05ec2f2e435a7e940d8cf9.json b/prover/crates/lib/prover_dal/.sqlx/query-6b7cf7ae3c66c46f4ecec2b0710f9f8bea0033f6727c2582f7f141330a47f440.json similarity index 82% rename from prover/crates/lib/prover_dal/.sqlx/query-2b12c5d469e6220cc8ddc997c666e4aa4f797bcc6e05ec2f2e435a7e940d8cf9.json rename to prover/crates/lib/prover_dal/.sqlx/query-6b7cf7ae3c66c46f4ecec2b0710f9f8bea0033f6727c2582f7f141330a47f440.json index 14b64e8122e5..88afcf436c24 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-2b12c5d469e6220cc8ddc997c666e4aa4f797bcc6e05ec2f2e435a7e940d8cf9.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-6b7cf7ae3c66c46f4ecec2b0710f9f8bea0033f6727c2582f7f141330a47f440.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", + "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n id,\n status,\n attempts,\n circuit_id,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -49,5 +49,5 @@ true ] }, - "hash": "2b12c5d469e6220cc8ddc997c666e4aa4f797bcc6e05ec2f2e435a7e940d8cf9" + "hash": "6b7cf7ae3c66c46f4ecec2b0710f9f8bea0033f6727c2582f7f141330a47f440" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-d272c91f1209c277189a31c59ee191a43dc8eafc33ee067bd41e20f25f7625f0.json b/prover/crates/lib/prover_dal/.sqlx/query-6c37c8a0a921408e3b812adf77d835d9a865ecbd87d38008a649e8943fdf8a43.json similarity index 92% rename from prover/crates/lib/prover_dal/.sqlx/query-d272c91f1209c277189a31c59ee191a43dc8eafc33ee067bd41e20f25f7625f0.json rename to prover/crates/lib/prover_dal/.sqlx/query-6c37c8a0a921408e3b812adf77d835d9a865ecbd87d38008a649e8943fdf8a43.json index 2c94853eacff..d2d8d265e695 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-d272c91f1209c277189a31c59ee191a43dc8eafc33ee067bd41e20f25f7625f0.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-6c37c8a0a921408e3b812adf77d835d9a865ecbd87d38008a649e8943fdf8a43.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n leaf_aggregation_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n leaf_aggregation_witness_jobs_fri.*\n ", + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n leaf_aggregation_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n leaf_aggregation_witness_jobs_fri.*\n ", "describe": { "columns": [ { @@ -104,5 +104,5 @@ false ] }, - "hash": "d272c91f1209c277189a31c59ee191a43dc8eafc33ee067bd41e20f25f7625f0" + "hash": "6c37c8a0a921408e3b812adf77d835d9a865ecbd87d38008a649e8943fdf8a43" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-2dc6b7bf08cced8791354fc47e319d03f894f40d2ec528382b5643c3d51ec8e7.json b/prover/crates/lib/prover_dal/.sqlx/query-705e3880df382c3c25f41630d83f2186aa86751cb3b4de26a60af1cf987ca636.json similarity index 92% rename from prover/crates/lib/prover_dal/.sqlx/query-2dc6b7bf08cced8791354fc47e319d03f894f40d2ec528382b5643c3d51ec8e7.json rename to prover/crates/lib/prover_dal/.sqlx/query-705e3880df382c3c25f41630d83f2186aa86751cb3b4de26a60af1cf987ca636.json index 0ad6413e1ec1..700a7e8bfd6e 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-2dc6b7bf08cced8791354fc47e319d03f894f40d2ec528382b5643c3d51ec8e7.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-705e3880df382c3c25f41630d83f2186aa86751cb3b4de26a60af1cf987ca636.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = 'reserved',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id IN (\n SELECT\n id\n FROM\n gpu_prover_queue_fri\n WHERE\n specialized_prover_group_id = $2\n AND zone = $3\n AND protocol_version = $4\n AND protocol_version_patch = $5\n AND (\n instance_status = 'available'\n OR (\n instance_status = 'reserved'\n AND processing_started_at < NOW() - $1::INTERVAL\n )\n )\n ORDER BY\n updated_at ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n gpu_prover_queue_fri.*\n ", + "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = 'reserved',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n id IN (\n SELECT\n id\n FROM\n gpu_prover_queue_fri\n WHERE\n specialized_prover_group_id = $2\n AND zone = $3\n AND protocol_version = $4\n AND protocol_version_patch = $5\n AND (\n instance_status = 'available'\n OR (\n instance_status = 'reserved'\n AND processing_started_at < NOW() - $1::INTERVAL\n )\n )\n ORDER BY\n updated_at ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n gpu_prover_queue_fri.*\n ", "describe": { "columns": [ { @@ -82,5 +82,5 @@ false ] }, - "hash": "2dc6b7bf08cced8791354fc47e319d03f894f40d2ec528382b5643c3d51ec8e7" + "hash": "705e3880df382c3c25f41630d83f2186aa86751cb3b4de26a60af1cf987ca636" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-7238cfe04ba59967fe5589665ad2c0214469edff6fc74965f1ec1366f8b46b8e.json b/prover/crates/lib/prover_dal/.sqlx/query-7238cfe04ba59967fe5589665ad2c0214469edff6fc74965f1ec1366f8b46b8e.json new file mode 100644 index 000000000000..227ff7dbe263 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-7238cfe04ba59967fe5589665ad2c0214469edff6fc74965f1ec1366f8b46b8e.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n node_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n depth,\n aggregations_url,\n number_of_dependent_jobs,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, 'waiting_for_proofs', NOW(), NOW(), $7)\n ON CONFLICT (l1_batch_number, circuit_id, depth) DO\n UPDATE\n SET\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Int4", + "Text", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "7238cfe04ba59967fe5589665ad2c0214469edff6fc74965f1ec1366f8b46b8e" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-73266a8526c6adc315900e2e95441976a264759c4060c1a38e466ee2052fc17d.json b/prover/crates/lib/prover_dal/.sqlx/query-73266a8526c6adc315900e2e95441976a264759c4060c1a38e466ee2052fc17d.json deleted file mode 100644 index f8b141a8dac9..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-73266a8526c6adc315900e2e95441976a264759c4060c1a38e466ee2052fc17d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n recursion_tip_witness_jobs_fri (l1_batch_number, status, number_of_final_node_jobs, created_at, updated_at)\n VALUES\n ($1, 'waiting_for_proofs', 1, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text" - ] - }, - "nullable": [] - }, - "hash": "73266a8526c6adc315900e2e95441976a264759c4060c1a38e466ee2052fc17d" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-8720d411e0c9640afd61e927a89c0b6c018e6a4d279acd24a4ea7d81b5cc5123.json b/prover/crates/lib/prover_dal/.sqlx/query-7493571411ee2cb4f7b09bcfc4eb86d3521faa0fbbfc7ca810c818ca9720b121.json similarity index 77% rename from prover/crates/lib/prover_dal/.sqlx/query-8720d411e0c9640afd61e927a89c0b6c018e6a4d279acd24a4ea7d81b5cc5123.json rename to prover/crates/lib/prover_dal/.sqlx/query-7493571411ee2cb4f7b09bcfc4eb86d3521faa0fbbfc7ca810c818ca9720b121.json index 12146fb75a90..9d10e7f7fd44 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-8720d411e0c9640afd61e927a89c0b6c018e6a4d279acd24a4ea7d81b5cc5123.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-7493571411ee2cb4f7b09bcfc4eb86d3521faa0fbbfc7ca810c818ca9720b121.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n aggregation_round DESC,\n l1_batch_number ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n prover_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n aggregation_round DESC,\n l1_batch_number ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", "describe": { "columns": [ { @@ -56,5 +56,5 @@ false ] }, - "hash": "8720d411e0c9640afd61e927a89c0b6c018e6a4d279acd24a4ea7d81b5cc5123" + "hash": "7493571411ee2cb4f7b09bcfc4eb86d3521faa0fbbfc7ca810c818ca9720b121" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-749d18c0fdae16ce0ed4e3c23e543d01cff938d3aed44c9bb1d864bfdf69e39a.json b/prover/crates/lib/prover_dal/.sqlx/query-749d18c0fdae16ce0ed4e3c23e543d01cff938d3aed44c9bb1d864bfdf69e39a.json new file mode 100644 index 000000000000..d01c5481fa6d --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-749d18c0fdae16ce0ed4e3c23e543d01cff938d3aed44c9bb1d864bfdf69e39a.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n prover_jobs_fri (\n l1_batch_number,\n circuit_id,\n circuit_blob_url,\n aggregation_round,\n sequence_number,\n depth,\n is_node_final_proof,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, 'queued', NOW(), NOW(), $9)\n ON CONFLICT (\n l1_batch_number, aggregation_round, circuit_id, depth, sequence_number\n ) DO\n UPDATE\n SET\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Text", + "Int2", + "Int4", + "Int4", + "Bool", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "749d18c0fdae16ce0ed4e3c23e543d01cff938d3aed44c9bb1d864bfdf69e39a" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-764693ceeb45f8478a20242b592d419667f11d80036cda021ecbf23b0b5f7f42.json b/prover/crates/lib/prover_dal/.sqlx/query-764693ceeb45f8478a20242b592d419667f11d80036cda021ecbf23b0b5f7f42.json deleted file mode 100644 index aac0fcd420cd..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-764693ceeb45f8478a20242b592d419667f11d80036cda021ecbf23b0b5f7f42.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n node_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n depth,\n aggregations_url,\n number_of_dependent_jobs,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, 'waiting_for_proofs', NOW(), NOW(), $7)\n ON CONFLICT (l1_batch_number, circuit_id, depth) DO\n UPDATE\n SET\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Int4", - "Text", - "Int4", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "764693ceeb45f8478a20242b592d419667f11d80036cda021ecbf23b0b5f7f42" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-7ab760de174d37c04373cf48489846983cb3f693c02159ba41c1a875aed7e03d.json b/prover/crates/lib/prover_dal/.sqlx/query-7ab760de174d37c04373cf48489846983cb3f693c02159ba41c1a875aed7e03d.json new file mode 100644 index 000000000000..6e0c60eeab08 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-7ab760de174d37c04373cf48489846983cb3f693c02159ba41c1a875aed7e03d.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n processing_started_at = NOW(),\n updated_at = NOW(),\n picked_by = $5\n WHERE\n id = (\n SELECT\n pj.id\n FROM\n (\n SELECT\n *\n FROM\n UNNEST($1::SMALLINT [], $2::SMALLINT [])\n ) AS tuple (circuit_id, round)\n JOIN LATERAL (\n SELECT\n *\n FROM\n prover_jobs_fri AS pj\n WHERE\n pj.status = 'queued'\n AND pj.protocol_version = $3\n AND pj.protocol_version_patch = $4\n AND pj.circuit_id = tuple.circuit_id\n AND pj.aggregation_round = tuple.round\n ORDER BY\n pj.l1_batch_number ASC,\n pj.id ASC\n LIMIT\n 1\n ) AS pj ON TRUE\n ORDER BY\n pj.l1_batch_number ASC,\n pj.aggregation_round DESC,\n pj.id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "l1_batch_number", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "circuit_id", + "type_info": "Int2" + }, + { + "ordinal": 3, + "name": "aggregation_round", + "type_info": "Int2" + }, + { + "ordinal": 4, + "name": "sequence_number", + "type_info": "Int4" + }, + { + "ordinal": 5, + "name": "depth", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "is_node_final_proof", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int2Array", + "Int2Array", + "Int4", + "Int4", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "7ab760de174d37c04373cf48489846983cb3f693c02159ba41c1a875aed7e03d" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-37ad15f54f4a6f4f79c71a857f3a8d4cc59246dda91b19526e73f27a17c8e3da.json b/prover/crates/lib/prover_dal/.sqlx/query-866bffdc527c079d128c1d21595ca5aec09b39b9d0367b0c29167f8a6a166d18.json similarity index 83% rename from prover/crates/lib/prover_dal/.sqlx/query-37ad15f54f4a6f4f79c71a857f3a8d4cc59246dda91b19526e73f27a17c8e3da.json rename to prover/crates/lib/prover_dal/.sqlx/query-866bffdc527c079d128c1d21595ca5aec09b39b9d0367b0c29167f8a6a166d18.json index c97fe7f4042b..e5a8f575d016 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-37ad15f54f4a6f4f79c71a857f3a8d4cc59246dda91b19526e73f27a17c8e3da.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-866bffdc527c079d128c1d21595ca5aec09b39b9d0367b0c29167f8a6a166d18.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "37ad15f54f4a6f4f79c71a857f3a8d4cc59246dda91b19526e73f27a17c8e3da" + "hash": "866bffdc527c079d128c1d21595ca5aec09b39b9d0367b0c29167f8a6a166d18" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-b4794e6a0c2366d5d95ab373c310103263af3ff5cb6c9dc5df59d3cd2a5e56b4.json b/prover/crates/lib/prover_dal/.sqlx/query-88b83c02ef8e3129ff6a416f5d71c765b3be3958cab0f3bde03f51e03777afd4.json similarity index 75% rename from prover/crates/lib/prover_dal/.sqlx/query-b4794e6a0c2366d5d95ab373c310103263af3ff5cb6c9dc5df59d3cd2a5e56b4.json rename to prover/crates/lib/prover_dal/.sqlx/query-88b83c02ef8e3129ff6a416f5d71c765b3be3958cab0f3bde03f51e03777afd4.json index 14b4115b30e8..63df4b26c817 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-b4794e6a0c2366d5d95ab373c310103263af3ff5cb6c9dc5df59d3cd2a5e56b4.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-88b83c02ef8e3129ff6a416f5d71c765b3be3958cab0f3bde03f51e03777afd4.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = $1,\n updated_at = NOW()\n WHERE\n instance_host = $2::TEXT::inet\n AND instance_port = $3\n AND zone = $4\n ", + "query": "\n UPDATE gpu_prover_queue_fri\n SET\n instance_status = $1,\n updated_at = NOW()\n WHERE\n instance_host = $2::TEXT::INET\n AND instance_port = $3\n AND zone = $4\n ", "describe": { "columns": [], "parameters": { @@ -13,5 +13,5 @@ }, "nullable": [] }, - "hash": "b4794e6a0c2366d5d95ab373c310103263af3ff5cb6c9dc5df59d3cd2a5e56b4" + "hash": "88b83c02ef8e3129ff6a416f5d71c765b3be3958cab0f3bde03f51e03777afd4" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-89a25708d0b0a15e1e56ee8fd69f5a15d2fc5ad3e5ce738a2f6ee3eecfc96736.json b/prover/crates/lib/prover_dal/.sqlx/query-89a25708d0b0a15e1e56ee8fd69f5a15d2fc5ad3e5ce738a2f6ee3eecfc96736.json deleted file mode 100644 index d8bd3223905c..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-89a25708d0b0a15e1e56ee8fd69f5a15d2fc5ad3e5ce738a2f6ee3eecfc96736.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n prover_fri_protocol_versions (id, snark_wrapper_vk_hash, created_at, protocol_version_patch)\n VALUES\n ($1, $2, NOW(), $3)\n ON CONFLICT (id, protocol_version_patch) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Bytea", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "89a25708d0b0a15e1e56ee8fd69f5a15d2fc5ad3e5ce738a2f6ee3eecfc96736" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-28397b5a0b7af832d2a4d3d7011a68a48db6a64afcd41bbe0e17d98fa38fdb19.json b/prover/crates/lib/prover_dal/.sqlx/query-8c5aba6ce584c1671f2d65fb47701426d60c56b526af5ed2e0c602f881c3bbf0.json similarity index 52% rename from prover/crates/lib/prover_dal/.sqlx/query-28397b5a0b7af832d2a4d3d7011a68a48db6a64afcd41bbe0e17d98fa38fdb19.json rename to prover/crates/lib/prover_dal/.sqlx/query-8c5aba6ce584c1671f2d65fb47701426d60c56b526af5ed2e0c602f881c3bbf0.json index d6e77daaa927..fc0594f64436 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-28397b5a0b7af832d2a4d3d7011a68a48db6a64afcd41bbe0e17d98fa38fdb19.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-8c5aba6ce584c1671f2d65fb47701426d60c56b526af5ed2e0c602f881c3bbf0.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n l1_batch_number IN (\n SELECT\n prover_jobs_fri.l1_batch_number\n FROM\n prover_jobs_fri\n JOIN scheduler_witness_jobs_fri swj ON prover_jobs_fri.l1_batch_number = swj.l1_batch_number\n WHERE\n swj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = $1\n )\n RETURNING\n l1_batch_number;\n ", + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n l1_batch_number IN (\n SELECT\n prover_jobs_fri.l1_batch_number\n FROM\n prover_jobs_fri\n JOIN\n scheduler_witness_jobs_fri swj\n ON prover_jobs_fri.l1_batch_number = swj.l1_batch_number\n WHERE\n swj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = $1\n )\n RETURNING\n l1_batch_number;\n ", "describe": { "columns": [ { @@ -18,5 +18,5 @@ false ] }, - "hash": "28397b5a0b7af832d2a4d3d7011a68a48db6a64afcd41bbe0e17d98fa38fdb19" + "hash": "8c5aba6ce584c1671f2d65fb47701426d60c56b526af5ed2e0c602f881c3bbf0" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-926cddf712322b476064a6efb2a8594776d64b8b5a4094fef979e35ab76d5bcd.json b/prover/crates/lib/prover_dal/.sqlx/query-926cddf712322b476064a6efb2a8594776d64b8b5a4094fef979e35ab76d5bcd.json new file mode 100644 index 000000000000..a2558f49e1bc --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-926cddf712322b476064a6efb2a8594776d64b8b5a4094fef979e35ab76d5bcd.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n proof_compression_jobs_fri (l1_batch_number, status, created_at, updated_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text" + ] + }, + "nullable": [] + }, + "hash": "926cddf712322b476064a6efb2a8594776d64b8b5a4094fef979e35ab76d5bcd" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-929419ad8dcc70e8ce986f17075cd21d4645563f93afd4428734196c2b212276.json b/prover/crates/lib/prover_dal/.sqlx/query-929419ad8dcc70e8ce986f17075cd21d4645563f93afd4428734196c2b212276.json deleted file mode 100644 index cf5fe8117b14..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-929419ad8dcc70e8ce986f17075cd21d4645563f93afd4428734196c2b212276.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n witness_inputs_fri (\n l1_batch_number,\n witness_inputs_blob_url,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, 'queued', NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "929419ad8dcc70e8ce986f17075cd21d4645563f93afd4428734196c2b212276" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-9b713312b539b4eefa58346f0070767a2cd4488e670674cd9149f7a332c0198d.json b/prover/crates/lib/prover_dal/.sqlx/query-9b713312b539b4eefa58346f0070767a2cd4488e670674cd9149f7a332c0198d.json deleted file mode 100644 index 2609a2ee0cfc..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-9b713312b539b4eefa58346f0070767a2cd4488e670674cd9149f7a332c0198d.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n l1_batch_number IN (\n SELECT\n prover_jobs_fri.l1_batch_number\n FROM\n prover_jobs_fri\n JOIN recursion_tip_witness_jobs_fri rtwj ON prover_jobs_fri.l1_batch_number = rtwj.l1_batch_number\n WHERE\n rtwj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = $1\n AND prover_jobs_fri.is_node_final_proof = TRUE\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n rtwj.number_of_final_node_jobs\n HAVING\n COUNT(*) = rtwj.number_of_final_node_jobs\n )\n RETURNING\n l1_batch_number;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "l1_batch_number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Int2" - ] - }, - "nullable": [ - false - ] - }, - "hash": "9b713312b539b4eefa58346f0070767a2cd4488e670674cd9149f7a332c0198d" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e438a4f0c705fcb39e017912ce8e1bb675a86ae14a863fa31eb513af65d606ed.json b/prover/crates/lib/prover_dal/.sqlx/query-9f5f6d6da7dbb7292b7fe60283993e804b9c2af8c98ae64ccace8c5035b3c499.json similarity index 80% rename from prover/crates/lib/prover_dal/.sqlx/query-e438a4f0c705fcb39e017912ce8e1bb675a86ae14a863fa31eb513af65d606ed.json rename to prover/crates/lib/prover_dal/.sqlx/query-9f5f6d6da7dbb7292b7fe60283993e804b9c2af8c98ae64ccace8c5035b3c499.json index cf9ff8396eff..fe84883ccd03 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-e438a4f0c705fcb39e017912ce8e1bb675a86ae14a863fa31eb513af65d606ed.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-9f5f6d6da7dbb7292b7fe60283993e804b9c2af8c98ae64ccace8c5035b3c499.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $2\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n witness_inputs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $3\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n witness_inputs_fri.l1_batch_number\n ", + "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $2\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n witness_inputs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $3\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n witness_inputs_fri.l1_batch_number\n ", "describe": { "columns": [ { @@ -20,5 +20,5 @@ false ] }, - "hash": "e438a4f0c705fcb39e017912ce8e1bb675a86ae14a863fa31eb513af65d606ed" + "hash": "9f5f6d6da7dbb7292b7fe60283993e804b9c2af8c98ae64ccace8c5035b3c499" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e9c9b69852fa68f463f17b6d63ab99cf505662036f2dd7a9f1807c4c1bad7c7b.json b/prover/crates/lib/prover_dal/.sqlx/query-a4407ac701423bc91505af3e7250ac1e4ed2a372922e55728de083bffb533e11.json similarity index 60% rename from prover/crates/lib/prover_dal/.sqlx/query-e9c9b69852fa68f463f17b6d63ab99cf505662036f2dd7a9f1807c4c1bad7c7b.json rename to prover/crates/lib/prover_dal/.sqlx/query-a4407ac701423bc91505af3e7250ac1e4ed2a372922e55728de083bffb533e11.json index 160eb31bf953..7a06e6557d60 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-e9c9b69852fa68f463f17b6d63ab99cf505662036f2dd7a9f1807c4c1bad7c7b.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-a4407ac701423bc91505af3e7250ac1e4ed2a372922e55728de083bffb533e11.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n protocol_version,\n protocol_version_patch,\n COUNT(*) FILTER (\n WHERE\n status = 'queued'\n ) AS queued,\n COUNT(*) FILTER (\n WHERE\n status = 'in_progress'\n ) AS in_progress\n FROM\n proof_compression_jobs_fri\n WHERE\n protocol_version IS NOT NULL\n GROUP BY\n protocol_version,\n protocol_version_patch\n ", + "query": "\n SELECT\n protocol_version,\n protocol_version_patch,\n COUNT(*) FILTER (\n WHERE\n status = 'queued'\n ) AS queued,\n COUNT(*) FILTER (\n WHERE\n status = 'in_progress'\n ) AS in_progress\n FROM\n proof_compression_jobs_fri\n WHERE\n protocol_version IS NOT NULL\n GROUP BY\n protocol_version,\n protocol_version_patch\n ", "describe": { "columns": [ { @@ -34,5 +34,5 @@ null ] }, - "hash": "e9c9b69852fa68f463f17b6d63ab99cf505662036f2dd7a9f1807c4c1bad7c7b" + "hash": "a4407ac701423bc91505af3e7250ac1e4ed2a372922e55728de083bffb533e11" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-2095e5646c382ccbc6e3bafdeddaae31358088e142dff51c9f0bde8f386900d3.json b/prover/crates/lib/prover_dal/.sqlx/query-a471aeb02911569bc201db0aa017c0d0f55630a33b69c9a0fefd9cb8be9356ee.json similarity index 78% rename from prover/crates/lib/prover_dal/.sqlx/query-2095e5646c382ccbc6e3bafdeddaae31358088e142dff51c9f0bde8f386900d3.json rename to prover/crates/lib/prover_dal/.sqlx/query-a471aeb02911569bc201db0aa017c0d0f55630a33b69c9a0fefd9cb8be9356ee.json index fd7c7c7874db..d21f1f185703 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-2095e5646c382ccbc6e3bafdeddaae31358088e142dff51c9f0bde8f386900d3.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-a471aeb02911569bc201db0aa017c0d0f55630a33b69c9a0fefd9cb8be9356ee.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n instance_status\n FROM\n gpu_prover_queue_fri\n WHERE\n instance_host = $1::TEXT::inet\n AND instance_port = $2\n AND zone = $3\n ", + "query": "\n SELECT\n instance_status\n FROM\n gpu_prover_queue_fri\n WHERE\n instance_host = $1::TEXT::INET\n AND instance_port = $2\n AND zone = $3\n ", "describe": { "columns": [ { @@ -20,5 +20,5 @@ false ] }, - "hash": "2095e5646c382ccbc6e3bafdeddaae31358088e142dff51c9f0bde8f386900d3" + "hash": "a471aeb02911569bc201db0aa017c0d0f55630a33b69c9a0fefd9cb8be9356ee" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-35a76415cb746d03da31481edc65adefab0bf3abf6853a6d36123c8adcaf813b.json b/prover/crates/lib/prover_dal/.sqlx/query-a6848b0c4cb256ca1d79d83dc5cb8c88cdb52125daedbade044934761fe2147d.json similarity index 83% rename from prover/crates/lib/prover_dal/.sqlx/query-35a76415cb746d03da31481edc65adefab0bf3abf6853a6d36123c8adcaf813b.json rename to prover/crates/lib/prover_dal/.sqlx/query-a6848b0c4cb256ca1d79d83dc5cb8c88cdb52125daedbade044934761fe2147d.json index bf8db798e7d4..270868d8981f 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-35a76415cb746d03da31481edc65adefab0bf3abf6853a6d36123c8adcaf813b.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-a6848b0c4cb256ca1d79d83dc5cb8c88cdb52125daedbade044934761fe2147d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "35a76415cb746d03da31481edc65adefab0bf3abf6853a6d36123c8adcaf813b" + "hash": "a6848b0c4cb256ca1d79d83dc5cb8c88cdb52125daedbade044934761fe2147d" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-a6eb7a1f1aa2f6f5d90fbe3b8c777313681560f538c6524c54648d6308533744.json b/prover/crates/lib/prover_dal/.sqlx/query-a6eb7a1f1aa2f6f5d90fbe3b8c777313681560f538c6524c54648d6308533744.json new file mode 100644 index 000000000000..319b00b4c61d --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-a6eb7a1f1aa2f6f5d90fbe3b8c777313681560f538c6524c54648d6308533744.json @@ -0,0 +1,32 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id, depth) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth\n FROM\n prover_jobs_fri\n JOIN node_aggregation_witness_jobs_fri nawj\n ON\n prover_jobs_fri.l1_batch_number = nawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = nawj.circuit_id\n AND prover_jobs_fri.depth = nawj.depth\n WHERE\n nawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 1\n AND prover_jobs_fri.depth = 0\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth,\n nawj.number_of_dependent_jobs\n HAVING\n COUNT(*) = nawj.number_of_dependent_jobs\n )\n RETURNING\n l1_batch_number,\n circuit_id,\n depth;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "circuit_id", + "type_info": "Int2" + }, + { + "ordinal": 2, + "name": "depth", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "a6eb7a1f1aa2f6f5d90fbe3b8c777313681560f538c6524c54648d6308533744" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-a817f0fec85388b3e2510ce259208a01b63ae4aa03c983c3a52c802d585e5a80.json b/prover/crates/lib/prover_dal/.sqlx/query-a817f0fec85388b3e2510ce259208a01b63ae4aa03c983c3a52c802d585e5a80.json deleted file mode 100644 index 93532150f7f8..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-a817f0fec85388b3e2510ce259208a01b63ae4aa03c983c3a52c802d585e5a80.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n proof_compression_jobs_fri (l1_batch_number, status, created_at, updated_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text" - ] - }, - "nullable": [] - }, - "hash": "a817f0fec85388b3e2510ce259208a01b63ae4aa03c983c3a52c802d585e5a80" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-abc93d27a8673b23e18d050e84c43c868c63c853edb5c4f41e48a3cc6378eca9.json b/prover/crates/lib/prover_dal/.sqlx/query-abc93d27a8673b23e18d050e84c43c868c63c853edb5c4f41e48a3cc6378eca9.json deleted file mode 100644 index fae5c1041a5d..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-abc93d27a8673b23e18d050e84c43c868c63c853edb5c4f41e48a3cc6378eca9.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id, depth) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth\n FROM\n prover_jobs_fri\n JOIN node_aggregation_witness_jobs_fri nawj ON prover_jobs_fri.l1_batch_number = nawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = nawj.circuit_id\n AND prover_jobs_fri.depth = nawj.depth\n WHERE\n nawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 1\n AND prover_jobs_fri.depth = 0\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.depth,\n nawj.number_of_dependent_jobs\n HAVING\n COUNT(*) = nawj.number_of_dependent_jobs\n )\n RETURNING\n l1_batch_number,\n circuit_id,\n depth;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "l1_batch_number", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "circuit_id", - "type_info": "Int2" - }, - { - "ordinal": 2, - "name": "depth", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false - ] - }, - "hash": "abc93d27a8673b23e18d050e84c43c868c63c853edb5c4f41e48a3cc6378eca9" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-ec04b89218111a5dc8d5ade506ac3465e2211ef3013386feb12d4cc04e0eade9.json b/prover/crates/lib/prover_dal/.sqlx/query-b9aaf5fe4d0261f7b05c8601a96b3027b4c2ce405d3bcc9821440408a394d7f5.json similarity index 73% rename from prover/crates/lib/prover_dal/.sqlx/query-ec04b89218111a5dc8d5ade506ac3465e2211ef3013386feb12d4cc04e0eade9.json rename to prover/crates/lib/prover_dal/.sqlx/query-b9aaf5fe4d0261f7b05c8601a96b3027b4c2ce405d3bcc9821440408a394d7f5.json index 7c0264b5646b..a7b33f51cb1e 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-ec04b89218111a5dc8d5ade506ac3465e2211ef3013386feb12d4cc04e0eade9.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-b9aaf5fe4d0261f7b05c8601a96b3027b4c2ce405d3bcc9821440408a394d7f5.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'successful',\n updated_at = NOW(),\n time_taken = $1,\n proof_blob_url = $2\n WHERE\n id = $3\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", + "query": "\n UPDATE prover_jobs_fri\n SET\n status = 'successful',\n updated_at = NOW(),\n time_taken = $1,\n proof_blob_url = $2\n WHERE\n id = $3\n RETURNING\n prover_jobs_fri.id,\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round,\n prover_jobs_fri.sequence_number,\n prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n ", "describe": { "columns": [ { @@ -56,5 +56,5 @@ false ] }, - "hash": "ec04b89218111a5dc8d5ade506ac3465e2211ef3013386feb12d4cc04e0eade9" + "hash": "b9aaf5fe4d0261f7b05c8601a96b3027b4c2ce405d3bcc9821440408a394d7f5" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-29f7a564a8373f7e44840e8e9e7d0cd5c6b1122c35d7ffdbbba30327ca3fb5a8.json b/prover/crates/lib/prover_dal/.sqlx/query-c01337f381828818b2b23a7fcc3d165108e64cc8cf1a2a5604cb180f6d8ac4fe.json similarity index 57% rename from prover/crates/lib/prover_dal/.sqlx/query-29f7a564a8373f7e44840e8e9e7d0cd5c6b1122c35d7ffdbbba30327ca3fb5a8.json rename to prover/crates/lib/prover_dal/.sqlx/query-c01337f381828818b2b23a7fcc3d165108e64cc8cf1a2a5604cb180f6d8ac4fe.json index 05163dcfa2e6..6c583ea19943 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-29f7a564a8373f7e44840e8e9e7d0cd5c6b1122c35d7ffdbbba30327ca3fb5a8.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-c01337f381828818b2b23a7fcc3d165108e64cc8cf1a2a5604cb180f6d8ac4fe.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n protocol_version AS \"protocol_version!\",\n protocol_version_patch AS \"protocol_version_patch!\",\n COUNT(*) FILTER (\n WHERE\n status = 'queued'\n ) AS queued,\n COUNT(*) FILTER (\n WHERE\n status = 'in_progress'\n ) AS in_progress\n FROM\n prover_jobs_fri\n WHERE\n status IN ('queued', 'in_progress')\n AND protocol_version IS NOT NULL\n GROUP BY\n protocol_version,\n protocol_version_patch\n ", + "query": "\n SELECT\n protocol_version AS \"protocol_version!\",\n protocol_version_patch AS \"protocol_version_patch!\",\n COUNT(*) FILTER (\n WHERE\n status = 'queued'\n ) AS queued,\n COUNT(*) FILTER (\n WHERE\n status = 'in_progress'\n ) AS in_progress\n FROM\n prover_jobs_fri\n WHERE\n status IN ('queued', 'in_progress')\n AND protocol_version IS NOT NULL\n GROUP BY\n protocol_version,\n protocol_version_patch\n ", "describe": { "columns": [ { @@ -34,5 +34,5 @@ null ] }, - "hash": "29f7a564a8373f7e44840e8e9e7d0cd5c6b1122c35d7ffdbbba30327ca3fb5a8" + "hash": "c01337f381828818b2b23a7fcc3d165108e64cc8cf1a2a5604cb180f6d8ac4fe" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-7effbacbdcc4bd762386351755f4f32042dfead8a37401558f5fd3b03480f2dd.json b/prover/crates/lib/prover_dal/.sqlx/query-c5569d55d77296b8c7180c95682423bb83b9fb0422b396cbd201f02ebce7b921.json similarity index 93% rename from prover/crates/lib/prover_dal/.sqlx/query-7effbacbdcc4bd762386351755f4f32042dfead8a37401558f5fd3b03480f2dd.json rename to prover/crates/lib/prover_dal/.sqlx/query-c5569d55d77296b8c7180c95682423bb83b9fb0422b396cbd201f02ebce7b921.json index 3064489830d9..f25ad78910d9 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-7effbacbdcc4bd762386351755f4f32042dfead8a37401558f5fd3b03480f2dd.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-c5569d55d77296b8c7180c95682423bb83b9fb0422b396cbd201f02ebce7b921.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n node_aggregation_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n depth ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n node_aggregation_witness_jobs_fri.*\n ", + "query": "\n UPDATE node_aggregation_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n id = (\n SELECT\n id\n FROM\n node_aggregation_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $2\n ORDER BY\n l1_batch_number ASC,\n depth ASC,\n id ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n node_aggregation_witness_jobs_fri.*\n ", "describe": { "columns": [ { @@ -110,5 +110,5 @@ false ] }, - "hash": "7effbacbdcc4bd762386351755f4f32042dfead8a37401558f5fd3b03480f2dd" + "hash": "c5569d55d77296b8c7180c95682423bb83b9fb0422b396cbd201f02ebce7b921" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-081e2b928f0816c41d6645c1dedbb3402044d201e85e114ff4582394c32bd2bf.json b/prover/crates/lib/prover_dal/.sqlx/query-c6d02dc9cb9908a57c79729c759b9314a2ce0180c20126ad22ddaa20c7c32c2c.json similarity index 66% rename from prover/crates/lib/prover_dal/.sqlx/query-081e2b928f0816c41d6645c1dedbb3402044d201e85e114ff4582394c32bd2bf.json rename to prover/crates/lib/prover_dal/.sqlx/query-c6d02dc9cb9908a57c79729c759b9314a2ce0180c20126ad22ddaa20c7c32c2c.json index 918fb2817d26..8462680ad82d 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-081e2b928f0816c41d6645c1dedbb3402044d201e85e114ff4582394c32bd2bf.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-c6d02dc9cb9908a57c79729c759b9314a2ce0180c20126ad22ddaa20c7c32c2c.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n comp.l1_batch_number,\n (comp.updated_at - wit.created_at) AS time_taken,\n wit.created_at\n FROM\n proof_compression_jobs_fri AS comp\n JOIN witness_inputs_fri AS wit ON comp.l1_batch_number = wit.l1_batch_number\n WHERE\n wit.created_at > $1\n ORDER BY\n time_taken DESC;\n ", + "query": "\n SELECT\n comp.l1_batch_number,\n (comp.updated_at - wit.created_at) AS time_taken,\n wit.created_at\n FROM\n proof_compression_jobs_fri AS comp\n JOIN witness_inputs_fri AS wit ON comp.l1_batch_number = wit.l1_batch_number\n WHERE\n wit.created_at > $1\n ORDER BY\n time_taken DESC;\n ", "describe": { "columns": [ { @@ -30,5 +30,5 @@ false ] }, - "hash": "081e2b928f0816c41d6645c1dedbb3402044d201e85e114ff4582394c32bd2bf" + "hash": "c6d02dc9cb9908a57c79729c759b9314a2ce0180c20126ad22ddaa20c7c32c2c" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-c8daa62b3835c15fafb3f83deabb5a4672ad50a9de92c84d939ac4c69842e355.json b/prover/crates/lib/prover_dal/.sqlx/query-c8daa62b3835c15fafb3f83deabb5a4672ad50a9de92c84d939ac4c69842e355.json deleted file mode 100644 index cadc931fa1ca..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-c8daa62b3835c15fafb3f83deabb5a4672ad50a9de92c84d939ac4c69842e355.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n node_aggregation_witness_jobs_fri (l1_batch_number, circuit_id, status, created_at, updated_at)\n VALUES\n ($1, $2, 'waiting_for_proofs', NOW(), NOW())\n ON CONFLICT (l1_batch_number, circuit_id, depth) DO\n UPDATE\n SET\n status = $3\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Text" - ] - }, - "nullable": [] - }, - "hash": "c8daa62b3835c15fafb3f83deabb5a4672ad50a9de92c84d939ac4c69842e355" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-caff620ae66d7fbe3caff7505173b6da86d1e693be03936730c340121167341f.json b/prover/crates/lib/prover_dal/.sqlx/query-caff620ae66d7fbe3caff7505173b6da86d1e693be03936730c340121167341f.json deleted file mode 100644 index 403e34bb91cd..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-caff620ae66d7fbe3caff7505173b6da86d1e693be03936730c340121167341f.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n scheduler_witness_jobs_fri (\n l1_batch_number,\n scheduler_partial_input_blob_url,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, 'waiting_for_proofs', NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "caff620ae66d7fbe3caff7505173b6da86d1e693be03936730c340121167341f" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-cb453f0677b92539747e175e796599bf65cbf2fd7c27a2dcad43e41a0f43cba0.json b/prover/crates/lib/prover_dal/.sqlx/query-cb453f0677b92539747e175e796599bf65cbf2fd7c27a2dcad43e41a0f43cba0.json new file mode 100644 index 000000000000..5c5a9e288b2c --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-cb453f0677b92539747e175e796599bf65cbf2fd7c27a2dcad43e41a0f43cba0.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id\n FROM\n prover_jobs_fri\n JOIN leaf_aggregation_witness_jobs_fri lawj\n ON\n prover_jobs_fri.l1_batch_number = lawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = lawj.circuit_id\n WHERE\n lawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 0\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n lawj.number_of_basic_circuits\n HAVING\n COUNT(*) = lawj.number_of_basic_circuits\n )\n RETURNING\n l1_batch_number,\n circuit_id;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "circuit_id", + "type_info": "Int2" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "cb453f0677b92539747e175e796599bf65cbf2fd7c27a2dcad43e41a0f43cba0" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-cebbd80998bf2be10c735f6c414d023d9cce8cd66ad684475ece209832babd5e.json b/prover/crates/lib/prover_dal/.sqlx/query-cebbd80998bf2be10c735f6c414d023d9cce8cd66ad684475ece209832babd5e.json new file mode 100644 index 000000000000..d56c7f3de74b --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-cebbd80998bf2be10c735f6c414d023d9cce8cd66ad684475ece209832babd5e.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n node_aggregation_witness_jobs_fri (\n l1_batch_number, circuit_id, status, created_at, updated_at\n )\n VALUES\n ($1, $2, 'waiting_for_proofs', NOW(), NOW())\n ON CONFLICT (l1_batch_number, circuit_id, depth) DO\n UPDATE\n SET\n status = $3\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Text" + ] + }, + "nullable": [] + }, + "hash": "cebbd80998bf2be10c735f6c414d023d9cce8cd66ad684475ece209832babd5e" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e2aceb9b86e74a3d119d383dcc729d1227a213b6cacb4c30a1f94c56f56cb4af.json b/prover/crates/lib/prover_dal/.sqlx/query-e2aceb9b86e74a3d119d383dcc729d1227a213b6cacb4c30a1f94c56f56cb4af.json new file mode 100644 index 000000000000..0fc0f557b127 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-e2aceb9b86e74a3d119d383dcc729d1227a213b6cacb4c30a1f94c56f56cb4af.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n scheduler_witness_jobs_fri (\n l1_batch_number,\n scheduler_partial_input_blob_url,\n status,\n created_at,\n updated_at\n )\n VALUES\n ($1, '', 'waiting_for_proofs', NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text" + ] + }, + "nullable": [] + }, + "hash": "e2aceb9b86e74a3d119d383dcc729d1227a213b6cacb4c30a1f94c56f56cb4af" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e65d9d8389b60f48468561984f0fb9c8674344921b98b8b26e4d85994b3d72af.json b/prover/crates/lib/prover_dal/.sqlx/query-e65d9d8389b60f48468561984f0fb9c8674344921b98b8b26e4d85994b3d72af.json new file mode 100644 index 000000000000..65a473ddeee5 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-e65d9d8389b60f48468561984f0fb9c8674344921b98b8b26e4d85994b3d72af.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n l1_batch_number IN (\n SELECT\n prover_jobs_fri.l1_batch_number\n FROM\n prover_jobs_fri\n JOIN\n recursion_tip_witness_jobs_fri rtwj\n ON prover_jobs_fri.l1_batch_number = rtwj.l1_batch_number\n WHERE\n rtwj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = $1\n AND prover_jobs_fri.is_node_final_proof = TRUE\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n rtwj.number_of_final_node_jobs\n HAVING\n COUNT(*) = rtwj.number_of_final_node_jobs\n )\n RETURNING\n l1_batch_number;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int2" + ] + }, + "nullable": [ + false + ] + }, + "hash": "e65d9d8389b60f48468561984f0fb9c8674344921b98b8b26e4d85994b3d72af" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-3727d5614d2fe2a4d96f880eb72cd48c95ca5b4520dde415a2b5ff32ece47c86.json b/prover/crates/lib/prover_dal/.sqlx/query-e6ddecc79d55bf5bd3e348a735b02757fe394fa096f09c62faa26f728a69d1ae.json similarity index 79% rename from prover/crates/lib/prover_dal/.sqlx/query-3727d5614d2fe2a4d96f880eb72cd48c95ca5b4520dde415a2b5ff32ece47c86.json rename to prover/crates/lib/prover_dal/.sqlx/query-e6ddecc79d55bf5bd3e348a735b02757fe394fa096f09c62faa26f728a69d1ae.json index d7eb6a32b421..a3da3036ab67 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-3727d5614d2fe2a4d96f880eb72cd48c95ca5b4520dde415a2b5ff32ece47c86.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-e6ddecc79d55bf5bd3e348a735b02757fe394fa096f09c62faa26f728a69d1ae.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE witness_inputs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n l1_batch_number = $1\n AND attempts >= $2\n AND (\n status = 'in_progress'\n OR status = 'failed'\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "3727d5614d2fe2a4d96f880eb72cd48c95ca5b4520dde415a2b5ff32ece47c86" + "hash": "e6ddecc79d55bf5bd3e348a735b02757fe394fa096f09c62faa26f728a69d1ae" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e743af4c18ec91eb46db5a19556fba74ec2cfc3c89c7e4e2ea475c3ce4092849.json b/prover/crates/lib/prover_dal/.sqlx/query-e743af4c18ec91eb46db5a19556fba74ec2cfc3c89c7e4e2ea475c3ce4092849.json deleted file mode 100644 index af6210ae91e4..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-e743af4c18ec91eb46db5a19556fba74ec2cfc3c89c7e4e2ea475c3ce4092849.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET\n status = 'queued'\n WHERE\n (l1_batch_number, circuit_id) IN (\n SELECT\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id\n FROM\n prover_jobs_fri\n JOIN leaf_aggregation_witness_jobs_fri lawj ON prover_jobs_fri.l1_batch_number = lawj.l1_batch_number\n AND prover_jobs_fri.circuit_id = lawj.circuit_id\n WHERE\n lawj.status = 'waiting_for_proofs'\n AND prover_jobs_fri.status = 'successful'\n AND prover_jobs_fri.aggregation_round = 0\n GROUP BY\n prover_jobs_fri.l1_batch_number,\n prover_jobs_fri.circuit_id,\n lawj.number_of_basic_circuits\n HAVING\n COUNT(*) = lawj.number_of_basic_circuits\n )\n RETURNING\n l1_batch_number,\n circuit_id;\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "l1_batch_number", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "circuit_id", - "type_info": "Int2" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false - ] - }, - "hash": "e743af4c18ec91eb46db5a19556fba74ec2cfc3c89c7e4e2ea475c3ce4092849" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-e875dcbbdaed6998dbea45d4eab5d005d8760c4809b7aef902155196873da66e.json b/prover/crates/lib/prover_dal/.sqlx/query-e875dcbbdaed6998dbea45d4eab5d005d8760c4809b7aef902155196873da66e.json deleted file mode 100644 index 4ee9278fe42a..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-e875dcbbdaed6998dbea45d4eab5d005d8760c4809b7aef902155196873da66e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n scheduler_witness_jobs_fri (\n l1_batch_number,\n scheduler_partial_input_blob_url,\n status,\n created_at,\n updated_at\n )\n VALUES\n ($1, '', 'waiting_for_proofs', NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Text" - ] - }, - "nullable": [] - }, - "hash": "e875dcbbdaed6998dbea45d4eab5d005d8760c4809b7aef902155196873da66e" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-eec29cbff034818f4fb5ec1e6ad38e1010d7389457b3c97e9b238a3a0291a54e.json b/prover/crates/lib/prover_dal/.sqlx/query-eec29cbff034818f4fb5ec1e6ad38e1010d7389457b3c97e9b238a3a0291a54e.json deleted file mode 100644 index f8e92b1ad666..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-eec29cbff034818f4fb5ec1e6ad38e1010d7389457b3c97e9b238a3a0291a54e.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n leaf_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n status,\n number_of_basic_circuits,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, 'waiting_for_proofs', 2, NOW(), NOW())\n ON CONFLICT (l1_batch_number, circuit_id) DO\n UPDATE\n SET\n status = $3\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Text" - ] - }, - "nullable": [] - }, - "hash": "eec29cbff034818f4fb5ec1e6ad38e1010d7389457b3c97e9b238a3a0291a54e" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-eef1b56e87eff63fcf6ffb98791583a7526ae38ceb4bf80543cfd3fb60492fb9.json b/prover/crates/lib/prover_dal/.sqlx/query-eef1b56e87eff63fcf6ffb98791583a7526ae38ceb4bf80543cfd3fb60492fb9.json deleted file mode 100644 index fe481b4e54db..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-eef1b56e87eff63fcf6ffb98791583a7526ae38ceb4bf80543cfd3fb60492fb9.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n recursion_tip_witness_jobs_fri (\n l1_batch_number,\n status,\n number_of_final_node_jobs,\n protocol_version,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, 'waiting_for_proofs', $2, $3, NOW(), NOW(), $4)\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "eef1b56e87eff63fcf6ffb98791583a7526ae38ceb4bf80543cfd3fb60492fb9" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-f05ea1f0ee0be1ac50c35f5dbf4bcaf4e7f673e9d9827427aa4bbedb3cae8b8f.json b/prover/crates/lib/prover_dal/.sqlx/query-f05ea1f0ee0be1ac50c35f5dbf4bcaf4e7f673e9d9827427aa4bbedb3cae8b8f.json new file mode 100644 index 000000000000..d47714f95752 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-f05ea1f0ee0be1ac50c35f5dbf4bcaf4e7f673e9d9827427aa4bbedb3cae8b8f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n recursion_tip_witness_jobs_fri (\n l1_batch_number, status, number_of_final_node_jobs, created_at, updated_at\n )\n VALUES\n ($1, 'waiting_for_proofs', 1, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n status = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Text" + ] + }, + "nullable": [] + }, + "hash": "f05ea1f0ee0be1ac50c35f5dbf4bcaf4e7f673e9d9827427aa4bbedb3cae8b8f" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-f294a1c32ffb957c901dcdfa942ea8e04c2c28771aa50a9e3ebb95c5e428be0e.json b/prover/crates/lib/prover_dal/.sqlx/query-f294a1c32ffb957c901dcdfa942ea8e04c2c28771aa50a9e3ebb95c5e428be0e.json new file mode 100644 index 000000000000..76008be6c339 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-f294a1c32ffb957c901dcdfa942ea8e04c2c28771aa50a9e3ebb95c5e428be0e.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n leaf_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n closed_form_inputs_blob_url,\n number_of_basic_circuits,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, 'waiting_for_proofs', NOW(), NOW(), $6)\n ON CONFLICT (l1_batch_number, circuit_id) DO\n UPDATE\n SET\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Text", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "f294a1c32ffb957c901dcdfa942ea8e04c2c28771aa50a9e3ebb95c5e428be0e" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-8357972a21b39644e4cbe4bedc3b6d9065bf4494daf8f7632ab2bfe055773f7b.json b/prover/crates/lib/prover_dal/.sqlx/query-f2ed1acf57927528cf978ad759ac92d6496147f6425c2485fc8a8f2739e65f80.json similarity index 81% rename from prover/crates/lib/prover_dal/.sqlx/query-8357972a21b39644e4cbe4bedc3b6d9065bf4494daf8f7632ab2bfe055773f7b.json rename to prover/crates/lib/prover_dal/.sqlx/query-f2ed1acf57927528cf978ad759ac92d6496147f6425c2485fc8a8f2739e65f80.json index 54fba3bbeac0..a261f190acfb 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-8357972a21b39644e4cbe4bedc3b6d9065bf4494daf8f7632ab2bfe055773f7b.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-f2ed1acf57927528cf978ad759ac92d6496147f6425c2485fc8a8f2739e65f80.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", + "query": "\n UPDATE recursion_tip_witness_jobs_fri\n SET\n status = 'queued',\n updated_at = NOW(),\n processing_started_at = NOW()\n WHERE\n (\n status = 'in_progress'\n AND processing_started_at <= NOW() - $1::INTERVAL\n AND attempts < $2\n )\n OR (\n status = 'failed'\n AND attempts < $2\n )\n RETURNING\n l1_batch_number,\n status,\n attempts,\n error,\n picked_by\n ", "describe": { "columns": [ { @@ -43,5 +43,5 @@ true ] }, - "hash": "8357972a21b39644e4cbe4bedc3b6d9065bf4494daf8f7632ab2bfe055773f7b" + "hash": "f2ed1acf57927528cf978ad759ac92d6496147f6425c2485fc8a8f2739e65f80" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-f3280a144a9aea48dae9b2914f0bf0344b237bf1914657d36f44b9d21ae966a6.json b/prover/crates/lib/prover_dal/.sqlx/query-f3280a144a9aea48dae9b2914f0bf0344b237bf1914657d36f44b9d21ae966a6.json new file mode 100644 index 000000000000..1a5c178a9007 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-f3280a144a9aea48dae9b2914f0bf0344b237bf1914657d36f44b9d21ae966a6.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n leaf_aggregation_witness_jobs_fri (\n l1_batch_number,\n circuit_id,\n status,\n number_of_basic_circuits,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, 'waiting_for_proofs', 2, NOW(), NOW())\n ON CONFLICT (l1_batch_number, circuit_id) DO\n UPDATE\n SET\n status = $3\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Text" + ] + }, + "nullable": [] + }, + "hash": "f3280a144a9aea48dae9b2914f0bf0344b237bf1914657d36f44b9d21ae966a6" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-f68afde603675b0853547c61a74cbb33d511e07d80a5acd79bc559abdbda49bc.json b/prover/crates/lib/prover_dal/.sqlx/query-f68afde603675b0853547c61a74cbb33d511e07d80a5acd79bc559abdbda49bc.json new file mode 100644 index 000000000000..3820754145db --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-f68afde603675b0853547c61a74cbb33d511e07d80a5acd79bc559abdbda49bc.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n prover_fri_protocol_versions (\n id, snark_wrapper_vk_hash, created_at, protocol_version_patch\n )\n VALUES\n ($1, $2, NOW(), $3)\n ON CONFLICT (id, protocol_version_patch) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "f68afde603675b0853547c61a74cbb33d511e07d80a5acd79bc559abdbda49bc" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-0b70c98c2edd8370ad09ac553c18dbc21cccb9a95e3db1c93da239845a5e9036.json b/prover/crates/lib/prover_dal/.sqlx/query-f70306e92c2a2d69e0e75eb0cf614f3cc4f9c96c2a51a157b83fff9b411beeb9.json similarity index 80% rename from prover/crates/lib/prover_dal/.sqlx/query-0b70c98c2edd8370ad09ac553c18dbc21cccb9a95e3db1c93da239845a5e9036.json rename to prover/crates/lib/prover_dal/.sqlx/query-f70306e92c2a2d69e0e75eb0cf614f3cc4f9c96c2a51a157b83fff9b411beeb9.json index 8b49fa11e63b..344068b04e91 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-0b70c98c2edd8370ad09ac553c18dbc21cccb9a95e3db1c93da239845a5e9036.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-f70306e92c2a2d69e0e75eb0cf614f3cc4f9c96c2a51a157b83fff9b411beeb9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = $1,\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n proof_compression_jobs_fri\n WHERE\n status = $2\n AND protocol_version = $4\n AND protocol_version_patch = $5\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n proof_compression_jobs_fri.l1_batch_number\n ", + "query": "\n UPDATE proof_compression_jobs_fri\n SET\n status = $1,\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $3\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n proof_compression_jobs_fri\n WHERE\n status = $2\n AND protocol_version = $4\n AND protocol_version_patch = $5\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n proof_compression_jobs_fri.l1_batch_number\n ", "describe": { "columns": [ { @@ -22,5 +22,5 @@ false ] }, - "hash": "0b70c98c2edd8370ad09ac553c18dbc21cccb9a95e3db1c93da239845a5e9036" + "hash": "f70306e92c2a2d69e0e75eb0cf614f3cc4f9c96c2a51a157b83fff9b411beeb9" } diff --git a/prover/crates/lib/prover_dal/.sqlx/query-f99c34313e2717ec74b4f274e33dae905acac53b46eeaeb059d23e48a71df3b4.json b/prover/crates/lib/prover_dal/.sqlx/query-f99c34313e2717ec74b4f274e33dae905acac53b46eeaeb059d23e48a71df3b4.json deleted file mode 100644 index c0c2637fe5ae..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-f99c34313e2717ec74b4f274e33dae905acac53b46eeaeb059d23e48a71df3b4.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n prover_jobs_fri (\n l1_batch_number,\n circuit_id,\n circuit_blob_url,\n aggregation_round,\n sequence_number,\n depth,\n is_node_final_proof,\n protocol_version,\n status,\n created_at,\n updated_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, 'queued', NOW(), NOW(), $9)\n ON CONFLICT (l1_batch_number, aggregation_round, circuit_id, depth, sequence_number) DO\n UPDATE\n SET\n updated_at = NOW()\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Text", - "Int2", - "Int4", - "Int4", - "Bool", - "Int4", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "f99c34313e2717ec74b4f274e33dae905acac53b46eeaeb059d23e48a71df3b4" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-28f03acf565c4b50fe86f606c18a8b699386b3c5b4e02d5ce046f0f2e0ddc388.json b/prover/crates/lib/prover_dal/.sqlx/query-fd29394931eed5b99d2fb4fac907218d106d5852fa6f65aca22e12b3a4b7f9c2.json similarity index 92% rename from prover/crates/lib/prover_dal/.sqlx/query-28f03acf565c4b50fe86f606c18a8b699386b3c5b4e02d5ce046f0f2e0ddc388.json rename to prover/crates/lib/prover_dal/.sqlx/query-fd29394931eed5b99d2fb4fac907218d106d5852fa6f65aca22e12b3a4b7f9c2.json index 89e159989ae6..b3e3d945b327 100644 --- a/prover/crates/lib/prover_dal/.sqlx/query-28f03acf565c4b50fe86f606c18a8b699386b3c5b4e02d5ce046f0f2e0ddc388.json +++ b/prover/crates/lib/prover_dal/.sqlx/query-fd29394931eed5b99d2fb4fac907218d106d5852fa6f65aca22e12b3a4b7f9c2.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $2\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n scheduler_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $3\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n scheduler_witness_jobs_fri.*\n ", + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET\n status = 'in_progress',\n attempts = attempts + 1,\n updated_at = NOW(),\n processing_started_at = NOW(),\n picked_by = $2\n WHERE\n l1_batch_number = (\n SELECT\n l1_batch_number\n FROM\n scheduler_witness_jobs_fri\n WHERE\n status = 'queued'\n AND protocol_version = $1\n AND protocol_version_patch = $3\n ORDER BY\n l1_batch_number ASC\n LIMIT\n 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING\n scheduler_witness_jobs_fri.*\n ", "describe": { "columns": [ { @@ -86,5 +86,5 @@ false ] }, - "hash": "28f03acf565c4b50fe86f606c18a8b699386b3c5b4e02d5ce046f0f2e0ddc388" + "hash": "fd29394931eed5b99d2fb4fac907218d106d5852fa6f65aca22e12b3a4b7f9c2" } diff --git a/prover/crates/lib/prover_dal/src/cli_test_dal.rs b/prover/crates/lib/prover_dal/src/cli_test_dal.rs index d08418203378..850e92b41366 100644 --- a/prover/crates/lib/prover_dal/src/cli_test_dal.rs +++ b/prover/crates/lib/prover_dal/src/cli_test_dal.rs @@ -51,20 +51,20 @@ impl CliTestDal<'_, '_> { sqlx::query!( r#" INSERT INTO - leaf_aggregation_witness_jobs_fri ( - l1_batch_number, - circuit_id, - status, - number_of_basic_circuits, - created_at, - updated_at - ) + leaf_aggregation_witness_jobs_fri ( + l1_batch_number, + circuit_id, + status, + number_of_basic_circuits, + created_at, + updated_at + ) VALUES - ($1, $2, 'waiting_for_proofs', 2, NOW(), NOW()) + ($1, $2, 'waiting_for_proofs', 2, NOW(), NOW()) ON CONFLICT (l1_batch_number, circuit_id) DO UPDATE SET - status = $3 + status = $3 "#, batch_number.0 as i64, circuit_id as i16, @@ -84,13 +84,15 @@ impl CliTestDal<'_, '_> { sqlx::query!( r#" INSERT INTO - node_aggregation_witness_jobs_fri (l1_batch_number, circuit_id, status, created_at, updated_at) + node_aggregation_witness_jobs_fri ( + l1_batch_number, circuit_id, status, created_at, updated_at + ) VALUES - ($1, $2, 'waiting_for_proofs', NOW(), NOW()) + ($1, $2, 'waiting_for_proofs', NOW(), NOW()) ON CONFLICT (l1_batch_number, circuit_id, depth) DO UPDATE SET - status = $3 + status = $3 "#, batch_number.0 as i64, circuit_id as i16, @@ -105,13 +107,15 @@ impl CliTestDal<'_, '_> { sqlx::query!( r#" INSERT INTO - recursion_tip_witness_jobs_fri (l1_batch_number, status, number_of_final_node_jobs, created_at, updated_at) + recursion_tip_witness_jobs_fri ( + l1_batch_number, status, number_of_final_node_jobs, created_at, updated_at + ) VALUES - ($1, 'waiting_for_proofs', 1, NOW(), NOW()) + ($1, 'waiting_for_proofs', 1, NOW(), NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - status = $2 + status = $2 "#, batch_number.0 as i64, status.to_string(), @@ -129,19 +133,19 @@ impl CliTestDal<'_, '_> { sqlx::query!( r#" INSERT INTO - scheduler_witness_jobs_fri ( - l1_batch_number, - scheduler_partial_input_blob_url, - status, - created_at, - updated_at - ) + scheduler_witness_jobs_fri ( + l1_batch_number, + scheduler_partial_input_blob_url, + status, + created_at, + updated_at + ) VALUES - ($1, '', 'waiting_for_proofs', NOW(), NOW()) + ($1, '', 'waiting_for_proofs', NOW(), NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - status = $2 + status = $2 "#, batch_number.0 as i64, status.to_string(), @@ -159,13 +163,13 @@ impl CliTestDal<'_, '_> { sqlx::query!( r#" INSERT INTO - proof_compression_jobs_fri (l1_batch_number, status, created_at, updated_at) + proof_compression_jobs_fri (l1_batch_number, status, created_at, updated_at) VALUES - ($1, $2, NOW(), NOW()) + ($1, $2, NOW(), NOW()) ON CONFLICT (l1_batch_number) DO UPDATE SET - status = $2 + status = $2 "#, batch_number.0 as i64, status.to_string(), diff --git a/prover/crates/lib/prover_dal/src/fri_gpu_prover_queue_dal.rs b/prover/crates/lib/prover_dal/src/fri_gpu_prover_queue_dal.rs index aa4810ad2f6f..63ae446d472c 100644 --- a/prover/crates/lib/prover_dal/src/fri_gpu_prover_queue_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_gpu_prover_queue_dal.rs @@ -52,10 +52,10 @@ impl FriGpuProverQueueDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - gpu_prover_queue_fri.* + gpu_prover_queue_fri.* "#, &processing_timeout, i16::from(specialized_prover_group_id), @@ -84,28 +84,28 @@ impl FriGpuProverQueueDal<'_, '_> { sqlx::query!( r#" INSERT INTO - gpu_prover_queue_fri ( - instance_host, - instance_port, - instance_status, - specialized_prover_group_id, - zone, - created_at, - updated_at, - protocol_version, - protocol_version_patch - ) + gpu_prover_queue_fri ( + instance_host, + instance_port, + instance_status, + specialized_prover_group_id, + zone, + created_at, + updated_at, + protocol_version, + protocol_version_patch + ) VALUES - (CAST($1::TEXT AS inet), $2, 'available', $3, $4, NOW(), NOW(), $5, $6) + (CAST($1::TEXT AS INET), $2, 'available', $3, $4, NOW(), NOW(), $5, $6) ON CONFLICT (instance_host, instance_port, zone) DO UPDATE SET - instance_status = 'available', - specialized_prover_group_id = $3, - zone = $4, - updated_at = NOW(), - protocol_version = $5, - protocol_version_patch = $6 + instance_status = 'available', + specialized_prover_group_id = $3, + zone = $4, + updated_at = NOW(), + protocol_version = $5, + protocol_version_patch = $6 "#, address.host.to_string(), i32::from(address.port), @@ -132,7 +132,7 @@ impl FriGpuProverQueueDal<'_, '_> { instance_status = $1, updated_at = NOW() WHERE - instance_host = $2::TEXT::inet + instance_host = $2::TEXT::INET AND instance_port = $3 AND zone = $4 "#, @@ -158,7 +158,7 @@ impl FriGpuProverQueueDal<'_, '_> { instance_status = 'available', updated_at = NOW() WHERE - instance_host = $1::TEXT::inet + instance_host = $1::TEXT::INET AND instance_port = $2 AND instance_status = 'full' AND zone = $3 @@ -184,7 +184,7 @@ impl FriGpuProverQueueDal<'_, '_> { FROM gpu_prover_queue_fri WHERE - instance_host = $1::TEXT::inet + instance_host = $1::TEXT::INET AND instance_port = $2 AND zone = $3 "#, diff --git a/prover/crates/lib/prover_dal/src/fri_proof_compressor_dal.rs b/prover/crates/lib/prover_dal/src/fri_proof_compressor_dal.rs index 31b121e51e42..205dbc784c41 100644 --- a/prover/crates/lib/prover_dal/src/fri_proof_compressor_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_proof_compressor_dal.rs @@ -27,17 +27,17 @@ impl FriProofCompressorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - proof_compression_jobs_fri ( - l1_batch_number, - fri_proof_blob_url, - status, - created_at, - updated_at, - protocol_version, - protocol_version_patch - ) + proof_compression_jobs_fri ( + l1_batch_number, + fri_proof_blob_url, + status, + created_at, + updated_at, + protocol_version, + protocol_version_patch + ) VALUES - ($1, $2, $3, NOW(), NOW(), $4, $5) + ($1, $2, $3, NOW(), NOW(), $4, $5) ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::from(block_number.0), @@ -80,10 +80,10 @@ impl FriProofCompressorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - proof_compression_jobs_fri.l1_batch_number + proof_compression_jobs_fri.l1_batch_number "#, ProofCompressionJobStatus::InProgress.to_string(), ProofCompressionJobStatus::Queued.to_string(), @@ -246,11 +246,11 @@ impl FriProofCompressorDal<'_, '_> { protocol_version_patch, COUNT(*) FILTER ( WHERE - status = 'queued' + status = 'queued' ) AS queued, COUNT(*) FILTER ( WHERE - status = 'in_progress' + status = 'in_progress' ) AS in_progress FROM proof_compression_jobs_fri @@ -328,11 +328,11 @@ impl FriProofCompressorDal<'_, '_> { AND attempts < $2 ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -435,10 +435,10 @@ impl FriProofCompressorDal<'_, '_> { OR status = 'failed' ) RETURNING - status, - attempts, - error, - picked_by + status, + attempts, + error, + picked_by "#, i64::from(block_number.0), max_attempts as i32, diff --git a/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs b/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs index 50df1046e67d..7128344e5b34 100644 --- a/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs @@ -20,15 +20,15 @@ impl FriProtocolVersionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - prover_fri_protocol_versions (id, snark_wrapper_vk_hash, created_at, protocol_version_patch) + prover_fri_protocol_versions ( + id, snark_wrapper_vk_hash, created_at, protocol_version_patch + ) VALUES - ($1, $2, NOW(), $3) + ($1, $2, NOW(), $3) ON CONFLICT (id, protocol_version_patch) DO NOTHING "#, id.minor as i32, - l1_verifier_config - .snark_wrapper_vk_hash - .as_bytes(), + l1_verifier_config.snark_wrapper_vk_hash.as_bytes(), id.patch.0 as i32 ) .execute(self.storage.conn()) diff --git a/prover/crates/lib/prover_dal/src/fri_prover_dal.rs b/prover/crates/lib/prover_dal/src/fri_prover_dal.rs index 71d0c11728b1..a0420b056125 100644 --- a/prover/crates/lib/prover_dal/src/fri_prover_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_prover_dal.rs @@ -93,16 +93,16 @@ impl FriProverDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - prover_jobs_fri.id, - prover_jobs_fri.l1_batch_number, - prover_jobs_fri.circuit_id, - prover_jobs_fri.aggregation_round, - prover_jobs_fri.sequence_number, - prover_jobs_fri.depth, - prover_jobs_fri.is_node_final_proof + prover_jobs_fri.id, + prover_jobs_fri.l1_batch_number, + prover_jobs_fri.circuit_id, + prover_jobs_fri.aggregation_round, + prover_jobs_fri.sequence_number, + prover_jobs_fri.depth, + prover_jobs_fri.is_node_final_proof "#, protocol_version.minor as i32, protocol_version.patch.0 as i32, @@ -154,16 +154,16 @@ impl FriProverDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - prover_jobs_fri.id, - prover_jobs_fri.l1_batch_number, - prover_jobs_fri.circuit_id, - prover_jobs_fri.aggregation_round, - prover_jobs_fri.sequence_number, - prover_jobs_fri.depth, - prover_jobs_fri.is_node_final_proof + prover_jobs_fri.id, + prover_jobs_fri.l1_batch_number, + prover_jobs_fri.circuit_id, + prover_jobs_fri.aggregation_round, + prover_jobs_fri.sequence_number, + prover_jobs_fri.depth, + prover_jobs_fri.is_node_final_proof "#, protocol_version.minor as i32, protocol_version.patch.0 as i32, @@ -216,25 +216,25 @@ impl FriProverDal<'_, '_> { SELECT * FROM - UNNEST($1::SMALLINT[], $2::SMALLINT[]) - ) AS tuple (circuit_id, ROUND) - JOIN LATERAL ( - SELECT - * - FROM - prover_jobs_fri AS pj - WHERE - pj.status = 'queued' - AND pj.protocol_version = $3 - AND pj.protocol_version_patch = $4 - AND pj.circuit_id = tuple.circuit_id - AND pj.aggregation_round = tuple.round - ORDER BY - pj.l1_batch_number ASC, - pj.id ASC - LIMIT - 1 - ) AS pj ON TRUE + UNNEST($1::SMALLINT [], $2::SMALLINT []) + ) AS tuple (circuit_id, round) + JOIN LATERAL ( + SELECT + * + FROM + prover_jobs_fri AS pj + WHERE + pj.status = 'queued' + AND pj.protocol_version = $3 + AND pj.protocol_version_patch = $4 + AND pj.circuit_id = tuple.circuit_id + AND pj.aggregation_round = tuple.round + ORDER BY + pj.l1_batch_number ASC, + pj.id ASC + LIMIT + 1 + ) AS pj ON TRUE ORDER BY pj.l1_batch_number ASC, pj.aggregation_round DESC, @@ -242,16 +242,16 @@ impl FriProverDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - prover_jobs_fri.id, - prover_jobs_fri.l1_batch_number, - prover_jobs_fri.circuit_id, - prover_jobs_fri.aggregation_round, - prover_jobs_fri.sequence_number, - prover_jobs_fri.depth, - prover_jobs_fri.is_node_final_proof + prover_jobs_fri.id, + prover_jobs_fri.l1_batch_number, + prover_jobs_fri.circuit_id, + prover_jobs_fri.aggregation_round, + prover_jobs_fri.sequence_number, + prover_jobs_fri.depth, + prover_jobs_fri.is_node_final_proof "#, &circuit_ids[..], &aggregation_rounds[..], @@ -332,13 +332,13 @@ impl FriProverDal<'_, '_> { WHERE id = $3 RETURNING - prover_jobs_fri.id, - prover_jobs_fri.l1_batch_number, - prover_jobs_fri.circuit_id, - prover_jobs_fri.aggregation_round, - prover_jobs_fri.sequence_number, - prover_jobs_fri.depth, - prover_jobs_fri.is_node_final_proof + prover_jobs_fri.id, + prover_jobs_fri.l1_batch_number, + prover_jobs_fri.circuit_id, + prover_jobs_fri.aggregation_round, + prover_jobs_fri.sequence_number, + prover_jobs_fri.depth, + prover_jobs_fri.is_node_final_proof "#, duration_to_naive_time(time_taken), blob_url, @@ -394,15 +394,15 @@ impl FriProverDal<'_, '_> { AND attempts < $2 ) FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - id, - status, - attempts, - circuit_id, - error, - picked_by + id, + status, + attempts, + circuit_id, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -438,26 +438,28 @@ impl FriProverDal<'_, '_> { sqlx::query!( r#" INSERT INTO - prover_jobs_fri ( - l1_batch_number, - circuit_id, - circuit_blob_url, - aggregation_round, - sequence_number, - depth, - is_node_final_proof, - protocol_version, - status, - created_at, - updated_at, - protocol_version_patch - ) + prover_jobs_fri ( + l1_batch_number, + circuit_id, + circuit_blob_url, + aggregation_round, + sequence_number, + depth, + is_node_final_proof, + protocol_version, + status, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, 'queued', NOW(), NOW(), $9) - ON CONFLICT (l1_batch_number, aggregation_round, circuit_id, depth, sequence_number) DO + ($1, $2, $3, $4, $5, $6, $7, $8, 'queued', NOW(), NOW(), $9) + ON CONFLICT ( + l1_batch_number, aggregation_round, circuit_id, depth, sequence_number + ) DO UPDATE SET - updated_at = NOW() + updated_at = NOW() "#, i64::from(l1_batch_number.0), i16::from(circuit_id), @@ -530,11 +532,11 @@ impl FriProverDal<'_, '_> { protocol_version_patch AS "protocol_version_patch!", COUNT(*) FILTER ( WHERE - status = 'queued' + status = 'queued' ) AS queued, COUNT(*) FILTER ( WHERE - status = 'in_progress' + status = 'in_progress' ) AS in_progress FROM prover_jobs_fri @@ -828,12 +830,12 @@ impl FriProverDal<'_, '_> { OR status = 'failed' ) RETURNING - id, - status, - attempts, - circuit_id, - error, - picked_by + id, + status, + attempts, + circuit_id, + error, + picked_by "#, i64::from(block_number.0), max_attempts as i32, diff --git a/prover/crates/lib/prover_dal/src/fri_witness_generator_dal.rs b/prover/crates/lib/prover_dal/src/fri_witness_generator_dal.rs index 2040b444044e..cd96edc21b09 100644 --- a/prover/crates/lib/prover_dal/src/fri_witness_generator_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_witness_generator_dal.rs @@ -49,17 +49,17 @@ impl FriWitnessGeneratorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - witness_inputs_fri ( - l1_batch_number, - witness_inputs_blob_url, - protocol_version, - status, - created_at, - updated_at, - protocol_version_patch - ) + witness_inputs_fri ( + l1_batch_number, + witness_inputs_blob_url, + protocol_version, + status, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, $2, $3, 'queued', NOW(), NOW(), $4) + ($1, $2, $3, 'queued', NOW(), NOW(), $4) ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::from(block_number.0), @@ -103,10 +103,10 @@ impl FriWitnessGeneratorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - witness_inputs_fri.l1_batch_number + witness_inputs_fri.l1_batch_number "#, protocol_version.minor as i32, picked_by, @@ -207,11 +207,11 @@ impl FriWitnessGeneratorDal<'_, '_> { AND attempts < $2 ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -256,23 +256,23 @@ impl FriWitnessGeneratorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - leaf_aggregation_witness_jobs_fri ( - l1_batch_number, - circuit_id, - closed_form_inputs_blob_url, - number_of_basic_circuits, - protocol_version, - status, - created_at, - updated_at, - protocol_version_patch - ) + leaf_aggregation_witness_jobs_fri ( + l1_batch_number, + circuit_id, + closed_form_inputs_blob_url, + number_of_basic_circuits, + protocol_version, + status, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, $2, $3, $4, $5, 'waiting_for_proofs', NOW(), NOW(), $6) + ($1, $2, $3, $4, $5, 'waiting_for_proofs', NOW(), NOW(), $6) ON CONFLICT (l1_batch_number, circuit_id) DO UPDATE SET - updated_at = NOW() + updated_at = NOW() "#, i64::from(block_number.0), i16::from(*circuit_id), @@ -299,21 +299,21 @@ impl FriWitnessGeneratorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - recursion_tip_witness_jobs_fri ( - l1_batch_number, - status, - number_of_final_node_jobs, - protocol_version, - created_at, - updated_at, - protocol_version_patch - ) + recursion_tip_witness_jobs_fri ( + l1_batch_number, + status, + number_of_final_node_jobs, + protocol_version, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, 'waiting_for_proofs', $2, $3, NOW(), NOW(), $4) + ($1, 'waiting_for_proofs', $2, $3, NOW(), NOW(), $4) ON CONFLICT (l1_batch_number) DO UPDATE SET - updated_at = NOW() + updated_at = NOW() "#, block_number.0 as i64, closed_form_inputs_and_urls.len() as i32, @@ -327,21 +327,21 @@ impl FriWitnessGeneratorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - scheduler_witness_jobs_fri ( - l1_batch_number, - scheduler_partial_input_blob_url, - protocol_version, - status, - created_at, - updated_at, - protocol_version_patch - ) + scheduler_witness_jobs_fri ( + l1_batch_number, + scheduler_partial_input_blob_url, + protocol_version, + status, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, $2, $3, 'waiting_for_proofs', NOW(), NOW(), $4) + ($1, $2, $3, 'waiting_for_proofs', NOW(), NOW(), $4) ON CONFLICT (l1_batch_number) DO UPDATE SET - updated_at = NOW() + updated_at = NOW() "#, i64::from(block_number.0), scheduler_partial_input_blob_url, @@ -386,10 +386,10 @@ impl FriWitnessGeneratorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - leaf_aggregation_witness_jobs_fri.* + leaf_aggregation_witness_jobs_fri.* "#, protocol_version.minor as i32, protocol_version.patch.0 as i32, @@ -464,8 +464,10 @@ impl FriWitnessGeneratorDal<'_, '_> { prover_jobs_fri.circuit_id FROM prover_jobs_fri - JOIN leaf_aggregation_witness_jobs_fri lawj ON prover_jobs_fri.l1_batch_number = lawj.l1_batch_number - AND prover_jobs_fri.circuit_id = lawj.circuit_id + JOIN leaf_aggregation_witness_jobs_fri lawj + ON + prover_jobs_fri.l1_batch_number = lawj.l1_batch_number + AND prover_jobs_fri.circuit_id = lawj.circuit_id WHERE lawj.status = 'waiting_for_proofs' AND prover_jobs_fri.status = 'successful' @@ -478,8 +480,8 @@ impl FriWitnessGeneratorDal<'_, '_> { COUNT(*) = lawj.number_of_basic_circuits ) RETURNING - l1_batch_number, - circuit_id; + l1_batch_number, + circuit_id; "#, ) .fetch_all(self.storage.conn()) @@ -552,10 +554,10 @@ impl FriWitnessGeneratorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - node_aggregation_witness_jobs_fri.* + node_aggregation_witness_jobs_fri.* "#, protocol_version.minor as i32, protocol_version.patch.0 as i32, @@ -617,24 +619,24 @@ impl FriWitnessGeneratorDal<'_, '_> { sqlx::query!( r#" INSERT INTO - node_aggregation_witness_jobs_fri ( - l1_batch_number, - circuit_id, - depth, - aggregations_url, - number_of_dependent_jobs, - protocol_version, - status, - created_at, - updated_at, - protocol_version_patch - ) + node_aggregation_witness_jobs_fri ( + l1_batch_number, + circuit_id, + depth, + aggregations_url, + number_of_dependent_jobs, + protocol_version, + status, + created_at, + updated_at, + protocol_version_patch + ) VALUES - ($1, $2, $3, $4, $5, $6, 'waiting_for_proofs', NOW(), NOW(), $7) + ($1, $2, $3, $4, $5, $6, 'waiting_for_proofs', NOW(), NOW(), $7) ON CONFLICT (l1_batch_number, circuit_id, depth) DO UPDATE SET - updated_at = NOW() + updated_at = NOW() "#, i64::from(block_number.0), i16::from(circuit_id), @@ -663,9 +665,11 @@ impl FriWitnessGeneratorDal<'_, '_> { prover_jobs_fri.depth FROM prover_jobs_fri - JOIN node_aggregation_witness_jobs_fri nawj ON prover_jobs_fri.l1_batch_number = nawj.l1_batch_number - AND prover_jobs_fri.circuit_id = nawj.circuit_id - AND prover_jobs_fri.depth = nawj.depth + JOIN node_aggregation_witness_jobs_fri nawj + ON + prover_jobs_fri.l1_batch_number = nawj.l1_batch_number + AND prover_jobs_fri.circuit_id = nawj.circuit_id + AND prover_jobs_fri.depth = nawj.depth WHERE nawj.status = 'waiting_for_proofs' AND prover_jobs_fri.status = 'successful' @@ -680,9 +684,9 @@ impl FriWitnessGeneratorDal<'_, '_> { COUNT(*) = nawj.number_of_dependent_jobs ) RETURNING - l1_batch_number, - circuit_id, - depth; + l1_batch_number, + circuit_id, + depth; "#, ) .fetch_all(self.storage.conn()) @@ -707,9 +711,11 @@ impl FriWitnessGeneratorDal<'_, '_> { prover_jobs_fri.depth FROM prover_jobs_fri - JOIN node_aggregation_witness_jobs_fri nawj ON prover_jobs_fri.l1_batch_number = nawj.l1_batch_number - AND prover_jobs_fri.circuit_id = nawj.circuit_id - AND prover_jobs_fri.depth = nawj.depth + JOIN node_aggregation_witness_jobs_fri nawj + ON + prover_jobs_fri.l1_batch_number = nawj.l1_batch_number + AND prover_jobs_fri.circuit_id = nawj.circuit_id + AND prover_jobs_fri.depth = nawj.depth WHERE nawj.status = 'waiting_for_proofs' AND prover_jobs_fri.status = 'successful' @@ -723,9 +729,9 @@ impl FriWitnessGeneratorDal<'_, '_> { COUNT(*) = nawj.number_of_dependent_jobs ) RETURNING - l1_batch_number, - circuit_id, - depth; + l1_batch_number, + circuit_id, + depth; "#, ) .fetch_all(self.storage.conn()) @@ -748,7 +754,9 @@ impl FriWitnessGeneratorDal<'_, '_> { prover_jobs_fri.l1_batch_number FROM prover_jobs_fri - JOIN recursion_tip_witness_jobs_fri rtwj ON prover_jobs_fri.l1_batch_number = rtwj.l1_batch_number + JOIN + recursion_tip_witness_jobs_fri rtwj + ON prover_jobs_fri.l1_batch_number = rtwj.l1_batch_number WHERE rtwj.status = 'waiting_for_proofs' AND prover_jobs_fri.status = 'successful' @@ -761,7 +769,7 @@ impl FriWitnessGeneratorDal<'_, '_> { COUNT(*) = rtwj.number_of_final_node_jobs ) RETURNING - l1_batch_number; + l1_batch_number; "#, AggregationRound::NodeAggregation as i64, ) @@ -785,14 +793,16 @@ impl FriWitnessGeneratorDal<'_, '_> { prover_jobs_fri.l1_batch_number FROM prover_jobs_fri - JOIN scheduler_witness_jobs_fri swj ON prover_jobs_fri.l1_batch_number = swj.l1_batch_number + JOIN + scheduler_witness_jobs_fri swj + ON prover_jobs_fri.l1_batch_number = swj.l1_batch_number WHERE swj.status = 'waiting_for_proofs' AND prover_jobs_fri.status = 'successful' AND prover_jobs_fri.aggregation_round = $1 ) RETURNING - l1_batch_number; + l1_batch_number; "#, AggregationRound::RecursionTip as i64, ) @@ -828,12 +838,12 @@ impl FriWitnessGeneratorDal<'_, '_> { AND attempts < $2 ) RETURNING - id, - status, - attempts, - circuit_id, - error, - picked_by + id, + status, + attempts, + circuit_id, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -877,12 +887,12 @@ impl FriWitnessGeneratorDal<'_, '_> { AND attempts < $2 ) RETURNING - id, - status, - attempts, - circuit_id, - error, - picked_by + id, + status, + attempts, + circuit_id, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -926,11 +936,11 @@ impl FriWitnessGeneratorDal<'_, '_> { AND attempts < $2 ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -979,11 +989,11 @@ impl FriWitnessGeneratorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - recursion_tip_witness_jobs_fri.l1_batch_number, - recursion_tip_witness_jobs_fri.number_of_final_node_jobs + recursion_tip_witness_jobs_fri.l1_batch_number, + recursion_tip_witness_jobs_fri.number_of_final_node_jobs "#, protocol_version.minor as i32, protocol_version.patch.0 as i32, @@ -1042,11 +1052,11 @@ impl FriWitnessGeneratorDal<'_, '_> { AND attempts < $2 ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, &processing_timeout, max_attempts as i32, @@ -1095,10 +1105,10 @@ impl FriWitnessGeneratorDal<'_, '_> { LIMIT 1 FOR UPDATE - SKIP LOCKED + SKIP LOCKED ) RETURNING - scheduler_witness_jobs_fri.* + scheduler_witness_jobs_fri.* "#, protocol_version.minor as i32, picked_by, @@ -1586,11 +1596,11 @@ impl FriWitnessGeneratorDal<'_, '_> { OR status = 'failed' ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, i64::from(block_number.0), max_attempts as i64 @@ -1656,11 +1666,11 @@ impl FriWitnessGeneratorDal<'_, '_> { OR status = 'failed' ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, i64::from(block_number.0), max_attempts as i64 @@ -1700,11 +1710,11 @@ impl FriWitnessGeneratorDal<'_, '_> { OR status = 'failed' ) RETURNING - l1_batch_number, - status, - attempts, - error, - picked_by + l1_batch_number, + status, + attempts, + error, + picked_by "#, i64::from(block_number.0), max_attempts as i64 @@ -1793,7 +1803,7 @@ impl FriWitnessGeneratorDal<'_, '_> { wit.created_at FROM proof_compression_jobs_fri AS comp - JOIN witness_inputs_fri AS wit ON comp.l1_batch_number = wit.l1_batch_number + JOIN witness_inputs_fri AS wit ON comp.l1_batch_number = wit.l1_batch_number WHERE wit.created_at > $1 ORDER BY diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 18f190974d55..297ef404698f 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -45,7 +45,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "const-random", + "getrandom", "once_cell", + "serde", "version_check", "zerocopy", ] @@ -135,6 +138,12 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +[[package]] +name = "append-only-vec" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb8633986ce6db557d8a568b0b874d840db9946e589a3de4cf84fb02130745f" + [[package]] name = "arrayvec" version = "0.7.6" @@ -169,7 +178,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -180,7 +189,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -217,20 +226,20 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", "axum-core", @@ -255,9 +264,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -421,6 +430,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "cfg_aliases", +] + [[package]] name = "bs58" version = "0.5.1" @@ -513,9 +531,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" dependencies = [ "jobserver", "libc", @@ -528,6 +546,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -594,7 +618,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -699,6 +723,12 @@ dependencies = [ "xshell", ] +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "compile-fmt" version = "0.1.0" @@ -737,6 +767,12 @@ dependencies = [ "zksync_protobuf_config", ] +[[package]] +name = "configparser" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" + [[package]] name = "console" version = "0.15.8" @@ -752,9 +788,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" dependencies = [ "cfg-if", "cpufeatures", @@ -769,6 +805,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -905,7 +961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -941,7 +997,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1033,7 +1089,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1053,7 +1109,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "unicode-xid", ] @@ -1063,6 +1119,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.10.7" @@ -1135,6 +1197,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecdsa" version = "0.14.8" @@ -1285,6 +1353,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "envy" version = "0.4.2" @@ -1457,7 +1537,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.77", + "syn 2.0.79", "toml", "walkdir", ] @@ -1475,7 +1555,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1501,7 +1581,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.77", + "syn 2.0.79", "tempfile", "thiserror", "tiny-keccak", @@ -1636,7 +1716,7 @@ dependencies = [ "tokio", "tracing", "walkdir", - "yansi", + "yansi 0.5.1", ] [[package]] @@ -1660,6 +1740,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fancy-regex" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +dependencies = [ + "bit-set", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", +] + [[package]] name = "fastrand" version = "2.1.1" @@ -1866,7 +1957,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1936,8 +2027,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -2610,7 +2703,7 @@ dependencies = [ "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "string_cache", "term", "tiny-keccak", @@ -2624,7 +2717,30 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.7", + "regex-automata 0.4.8", +] + +[[package]] +name = "lazy-regex" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.79", ] [[package]] @@ -2711,7 +2827,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2780,7 +2896,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2854,6 +2970,12 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + [[package]] name = "nom" version = "7.1.3" @@ -3011,7 +3133,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3023,7 +3145,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3043,9 +3165,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "open-fastrlp" @@ -3095,7 +3220,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3420,7 +3545,8 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", + "unicase", ] [[package]] @@ -3439,6 +3565,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", + "unicase", ] [[package]] @@ -3458,7 +3585,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3512,9 +3639,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -3537,6 +3664,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi 1.0.1", +] + [[package]] name = "prettyplease" version = "0.2.22" @@ -3544,7 +3681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3609,7 +3746,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3624,7 +3761,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "unarray", ] @@ -3665,7 +3802,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.77", + "syn 2.0.79", "tempfile", ] @@ -3679,7 +3816,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3692,7 +3829,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3832,9 +3969,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -3852,14 +3989,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -3873,13 +4010,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -3890,9 +4027,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -4090,6 +4227,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -4164,9 +4307,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -4514,7 +4657,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4720,6 +4863,12 @@ dependencies = [ "nanoid", ] +[[package]] +name = "slyce" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046d1c67b37db818d93f1d04a924ddbd7396c96cf9cfaa593d038259ae484729" + [[package]] name = "smallvec" version = "1.13.2" @@ -4735,6 +4884,16 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" +[[package]] +name = "smol_str" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66eaf762c5af19db3108300515c8aa7a50efc90ff745f4c62288052ebf9fdd25" +dependencies = [ + "borsh", + "serde", +] + [[package]] name = "socket2" version = "0.5.7" @@ -4794,6 +4953,12 @@ dependencies = [ "der 0.7.9", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "sqlformat" version = "0.2.6" @@ -4866,7 +5031,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4889,7 +5054,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.77", + "syn 2.0.79", "tempfile", "tokio", "url", @@ -4998,6 +5163,72 @@ dependencies = [ "url", ] +[[package]] +name = "sqruff-lib" +version = "0.18.2" +source = "git+https://github.com/quarylabs/sqruff#1ccf18a620b93438c0c6b4f9fc88f402f45a1b29" +dependencies = [ + "ahash", + "anstyle", + "append-only-vec", + "common-path", + "configparser", + "dyn-clone", + "enum_dispatch", + "fancy-regex", + "getrandom", + "indexmap 2.5.0", + "itertools 0.13.0", + "lazy-regex", + "nohash-hasher", + "phf", + "pretty_assertions", + "rayon", + "regex", + "rustc-hash", + "smol_str", + "sqruff-lib-core", + "sqruff-lib-dialects", + "strum", + "strum_macros", + "tikv-jemallocator", + "tracing", + "unicase", + "walkdir", +] + +[[package]] +name = "sqruff-lib-core" +version = "0.18.2" +source = "git+https://github.com/quarylabs/sqruff#1ccf18a620b93438c0c6b4f9fc88f402f45a1b29" +dependencies = [ + "ahash", + "enum_dispatch", + "fancy-regex", + "indexmap 2.5.0", + "itertools 0.13.0", + "nohash-hasher", + "pretty_assertions", + "rustc-hash", + "slyce", + "smol_str", + "sptr", + "strum", + "strum_macros", +] + +[[package]] +name = "sqruff-lib-dialects" +version = "0.18.2" +source = "git+https://github.com/quarylabs/sqruff#1ccf18a620b93438c0c6b4f9fc88f402f45a1b29" +dependencies = [ + "ahash", + "itertools 0.13.0", + "serde_yaml", + "sqruff-lib-core", + "strum", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -5065,7 +5296,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5107,9 +5338,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -5181,9 +5412,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -5241,7 +5472,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5263,6 +5494,26 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.36" @@ -5344,7 +5595,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5558,7 +5809,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5713,6 +5964,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -5892,7 +6152,7 @@ checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5948,7 +6208,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -5982,7 +6242,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6324,6 +6584,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + [[package]] name = "zerocopy" version = "0.7.35" @@ -6342,7 +6608,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -6362,7 +6628,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -6462,6 +6728,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", + "sqruff-lib", "strum", "tokio", "types", @@ -6667,7 +6934,7 @@ dependencies = [ "prost-reflect", "protox", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] diff --git a/zk_toolbox/crates/common/src/db.rs b/zk_toolbox/crates/common/src/db.rs index eda5471170dd..bceeb000982d 100644 --- a/zk_toolbox/crates/common/src/db.rs +++ b/zk_toolbox/crates/common/src/db.rs @@ -126,7 +126,7 @@ pub async fn migrate_db( let text = if skip { "Skipped" } else { "Applied" }; if global_config().verbose { - logger::step(&format!( + logger::step(format!( " {} {}/{} {} ({elapsed:?})", text, migration.version, diff --git a/zk_toolbox/crates/zk_inception/src/utils/ports.rs b/zk_toolbox/crates/zk_inception/src/utils/ports.rs index 0462c0ea40fb..5102b4fd9c6d 100644 --- a/zk_toolbox/crates/zk_inception/src/utils/ports.rs +++ b/zk_toolbox/crates/zk_inception/src/utils/ports.rs @@ -1,9 +1,4 @@ -use std::{ - collections::{HashMap, HashSet}, - fmt, - ops::Range, - path::Path, -}; +use std::{collections::HashMap, fmt, ops::Range, path::Path}; use anyhow::{bail, Context, Result}; use config::{ @@ -21,10 +16,6 @@ pub struct EcosystemPorts { } impl EcosystemPorts { - pub fn get_assigned_ports(&self) -> HashSet { - self.ports.keys().cloned().collect() - } - pub fn is_port_assigned(&self, port: u16) -> bool { self.ports.contains_key(&port) } diff --git a/zk_toolbox/crates/zk_supervisor/Cargo.toml b/zk_toolbox/crates/zk_supervisor/Cargo.toml index 4c450a736393..158abe4e2ec6 100644 --- a/zk_toolbox/crates/zk_supervisor/Cargo.toml +++ b/zk_toolbox/crates/zk_supervisor/Cargo.toml @@ -29,3 +29,4 @@ futures.workspace = true types.workspace = true serde_yaml.workspace = true zksync_basic_types.workspace = true +sqruff-lib = { git = "https://github.com/quarylabs/sqruff", version = "0.18.2" } diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs b/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs index fc55ed2c1f6f..3aefc15aba79 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs @@ -5,6 +5,7 @@ use common::{cmd::Cmd, logger, spinner::Spinner}; use config::EcosystemConfig; use xshell::{cmd, Shell}; +use super::sql_fmt::format_sql; use crate::{ commands::lint_utils::{get_unignored_files, Target}, messages::{ @@ -15,7 +16,7 @@ use crate::{ async fn prettier(shell: Shell, target: Target, check: bool) -> anyhow::Result<()> { let spinner = Spinner::new(&msg_running_fmt_for_extension_spinner(target)); - let files = get_unignored_files(&shell, &target)?; + let files = get_unignored_files(&shell, &target, None)?; if files.is_empty() { logger::info(format!("No files for {target} found")); @@ -59,6 +60,7 @@ async fn run_all_rust_formatters( check: bool, link_to_code: PathBuf, ) -> anyhow::Result<()> { + format_sql(shell.clone(), check).await?; rustfmt(shell.clone(), check, link_to_code).await?; Ok(()) } @@ -92,7 +94,7 @@ pub async fn run(shell: Shell, args: FmtArgs) -> anyhow::Result<()> { for ext in extensions { tasks.push(tokio::spawn(prettier(shell.clone(), ext, args.check))); } - tasks.push(tokio::spawn(rustfmt( + tasks.push(tokio::spawn(run_all_rust_formatters( shell.clone(), args.check, ecosystem.link_to_code, diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs b/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs index 1861d164ce44..45a7a46ebbe0 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/lint.rs @@ -92,7 +92,7 @@ fn lint( ) -> anyhow::Result<()> { let spinner = Spinner::new(&msg_running_linter_for_extension_spinner(target)); let _dir_guard = shell.push_dir(&ecosystem.link_to_code); - let files = get_unignored_files(shell, target)?; + let files = get_unignored_files(shell, target, None)?; let cmd = cmd!(shell, "yarn"); let config_path = ecosystem.link_to_code.join(CONFIG_PATH); let config_path = config_path.join(format!("{}.js", target)); diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs b/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs index a7236dc04fb3..9095e445384b 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs @@ -17,14 +17,28 @@ pub enum Target { } #[derive(Deserialize, Serialize, Debug)] -struct IgnoredData { - files: Vec, - dirs: Vec, +pub struct IgnoredData { + pub files: Vec, + pub dirs: Vec, } -pub fn get_unignored_files(shell: &Shell, target: &Target) -> anyhow::Result> { +impl IgnoredData { + pub fn merge(&mut self, other: &IgnoredData) { + self.files.extend(other.files.clone()); + self.dirs.extend(other.dirs.clone()); + } +} + +pub fn get_unignored_files( + shell: &Shell, + target: &Target, + ignored_data: Option, +) -> anyhow::Result> { let mut files = Vec::new(); - let ignored_files: IgnoredData = serde_yaml::from_str(&shell.read_file(IGNORE_FILE)?)?; + let mut ignored_files: IgnoredData = serde_yaml::from_str(&shell.read_file(IGNORE_FILE)?)?; + if let Some(ignored_data) = ignored_data { + ignored_files.merge(&ignored_data); + } let output = cmd!(shell, "git ls-files --recurse-submodules").read()?; for line in output.lines() { diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs index d3cb99f1e342..38ec586e7451 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs @@ -8,4 +8,5 @@ pub(crate) mod lint_utils; pub mod prover; pub mod send_transactions; pub mod snapshot; +pub(crate) mod sql_fmt; pub mod test; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs b/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs new file mode 100644 index 000000000000..ede2500e6ab6 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/sql_fmt.rs @@ -0,0 +1,149 @@ +use std::mem::take; + +use anyhow::{bail, Result}; +use common::spinner::Spinner; +use sqruff_lib::{api::simple::get_simple_config, core::linter::core::Linter}; +use xshell::Shell; + +use super::lint_utils::{get_unignored_files, IgnoredData, Target}; +use crate::messages::{msg_file_is_not_formatted, MSG_RUNNING_SQL_FMT_SPINNER}; + +fn format_query(query: &str) -> anyhow::Result { + let exclude_rules = vec!["LT12".to_string()]; // avoid adding newline before `$` character + let cfg = get_simple_config(Some("postgres".into()), None, Some(exclude_rules), None).unwrap(); + let mut linter = Linter::new(cfg, None, None); + let mut result = linter.lint_string_wrapped(query, None, true); + let formatted_query = take(&mut result.paths[0].files[0]).fix_string(); + // Remove first empty line + let formatted_query = formatted_query + .lines() + .skip(1) + .collect::>() + .join("\n"); + + Ok(formatted_query) +} + +fn extract_query_from_rust_string(query: &str, is_raw: bool) -> String { + let mut query = query.trim().to_string(); + if query.ends_with(',') { + query.pop(); + } + // Removing quotes + if !is_raw { + query = query[1..query.len() - 1].to_string(); + } else { + query = query[3..query.len() - 2].to_string(); + } + + // Remove all escape characters + if !is_raw { + query = query.replace(r#"\""#, "\""); + } + + query +} + +fn embed_text_inside_rust_string(query: &str) -> String { + format!("r#\"\n{}\n\"#", query) +} + +fn add_indent(query: &str, indent: usize) -> String { + query + .lines() + .map(|line| format!("{:indent$}{}", "", line)) + .collect::>() + .join("\n") +} + +fn format_rust_string_query(query: &str, is_raw: bool) -> anyhow::Result { + let base_indent = query.find(|c: char| !c.is_whitespace()).unwrap_or(0); + let raw_query = extract_query_from_rust_string(query, is_raw); + let formatted_query = format_query(&raw_query)?; + let reconstructed_rust_string = embed_text_inside_rust_string(&formatted_query); + Ok(add_indent(&reconstructed_rust_string, base_indent)) +} + +fn fmt_file(shell: &Shell, file_path: &str, check: bool) -> Result<()> { + let content = shell.read_file(file_path)?; + let mut modified_file = String::new(); + + let mut lines_to_query: Option = None; + let mut is_inside_query = false; + let mut is_raw_string = false; + let mut built_query = String::new(); + + for line in content.lines() { + if line.ends_with("sqlx::query!(") { + lines_to_query = Some(1); + is_raw_string = false; + built_query.clear(); + } else if line.ends_with("sqlx::query_as!(") { + lines_to_query = Some(2); + is_raw_string = false; + built_query.clear(); + } + + if let Some(ref mut count) = lines_to_query { + if *count == 0 { + is_inside_query = true; + lines_to_query = None; + if line.contains("r#\"") { + is_raw_string = true; + } + } else { + *count -= 1; + } + } + + if is_inside_query { + let query_not_empty = !built_query.is_empty() || line.trim().len() > 1; + let raw_string_query_ended = line.ends_with("\"#,") || line.ends_with("\"#"); + let regular_string_query_ended = + (line.ends_with("\",") || line.ends_with('"')) && query_not_empty; + built_query.push_str(line); + built_query.push('\n'); + + let line_end_is_not_escape = !line.ends_with("\\\"") && !line.ends_with("\\\","); + if (is_raw_string && raw_string_query_ended) + || (!is_raw_string && regular_string_query_ended && line_end_is_not_escape) + { + is_inside_query = false; + let ended_with_comma = built_query.trim_end().ends_with(','); + modified_file + .push_str(format_rust_string_query(&built_query, is_raw_string)?.trim_end()); + if ended_with_comma { + modified_file.push(','); + } + modified_file.push('\n'); + } + } else { + modified_file.push_str(line); + modified_file.push('\n'); + } + } + + if content != modified_file { + if check { + bail!(msg_file_is_not_formatted(file_path)); + } else { + shell.write_file(file_path, &modified_file)?; + } + } + + Ok(()) +} + +pub async fn format_sql(shell: Shell, check: bool) -> anyhow::Result<()> { + let spinner = Spinner::new(MSG_RUNNING_SQL_FMT_SPINNER); + let ignored_data = Some(IgnoredData { + files: vec![], + dirs: vec!["zk_toolbox".to_string()], + }); + let rust_files = get_unignored_files(&shell, &Target::Rs, ignored_data)?; + for file in rust_files { + fmt_file(&shell, &file, check)?; + } + spinner.finish(); + Ok(()) +} diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs index 5f68630f7562..6f6deb22edbf 100644 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ b/zk_toolbox/crates/zk_supervisor/src/messages.rs @@ -197,6 +197,12 @@ pub(super) const MSG_LINT_CONFIG_PATH_ERR: &str = "Lint config path error"; pub(super) const MSG_RUNNING_CONTRACTS_LINTER_SPINNER: &str = "Running contracts linter.."; pub(super) const MSG_RUNNING_CONTRACTS_FMT_SPINNER: &str = "Running prettier for contracts.."; +pub(super) const MSG_RUNNING_SQL_FMT_SPINNER: &str = "Running SQL formatter.."; + +pub(super) fn msg_file_is_not_formatted(file: &str) -> String { + format!("File {} is not formatted", file) +} + // Test wallets related messages pub(super) const MSG_TEST_WALLETS_INFO: &str = "Print test wallets information"; pub(super) const MSG_DESERIALIZE_TEST_WALLETS_ERR: &str = "Impossible to deserialize test wallets"; diff --git a/zk_toolbox/rust-toolchain b/zk_toolbox/rust-toolchain index aaceec04e040..dbd41264aa9f 100644 --- a/zk_toolbox/rust-toolchain +++ b/zk_toolbox/rust-toolchain @@ -1 +1 @@ -1.80.0 +1.81.0