From 2d7c93c5a227cb600edadde0dd127ef83da48f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cperekopskiy=E2=80=9D?= Date: Mon, 16 Oct 2023 11:50:19 +0300 Subject: [PATCH 1/6] New commitments --- Cargo.lock | 331 +- ...13085524_boojum-block-commitments.down.sql | 6 + ...1013085524_boojum-block-commitments.up.sql | 9 + core/lib/dal/sqlx-data.json | 3363 +++++++++-------- core/lib/dal/src/blocks_dal.rs | 75 +- core/lib/dal/src/models/storage_block.rs | 7 + core/lib/dal/src/storage_logs_dal.rs | 2 +- core/lib/dal/src/tests/mod.rs | 10 +- core/lib/mempool/src/tests.rs | 2 +- core/lib/merkle_tree/src/hasher/nodes.rs | 4 +- core/lib/merkle_tree/src/storage/patch.rs | 2 +- core/lib/merkle_tree/src/storage/tests.rs | 10 +- core/lib/state/src/test_utils.rs | 2 +- core/lib/types/src/commitment.rs | 6 + .../lib/types/src/priority_op_onchain_data.rs | 2 +- core/lib/zksync_core/Cargo.toml | 2 + core/lib/zksync_core/src/eth_sender/tests.rs | 32 +- core/lib/zksync_core/src/eth_watch/tests.rs | 4 +- core/lib/zksync_core/src/genesis.rs | 4 +- .../src/metadata_calculator/helpers.rs | 5 +- .../src/metadata_calculator/metrics.rs | 10 +- .../src/metadata_calculator/mod.rs | 5 + .../src/metadata_calculator/tests.rs | 6 +- .../src/metadata_calculator/updater.rs | 54 +- .../src/state_keeper/io/seal_logic.rs | 2 + .../src/state_keeper/io/tests/tester.rs | 2 +- .../zksync_core/src/state_keeper/tests/mod.rs | 2 + .../zksync_core/src/witness_generator/mod.rs | 2 +- .../src/witness_generator/utils.rs | 3 +- .../vm_1_3_2/src/oracles/tracer/call.rs | 1 - .../vm_m6/src/oracles/tracer/call.rs | 1 - .../src/checker.rs | 5 +- docker/contract-verifier/Dockerfile | 16 +- .../cross-external-nodes-checker/Dockerfile | 15 +- docker/external-node/Dockerfile | 14 +- docker/server-v2/Dockerfile | 16 +- rust-toolchain | 2 +- 37 files changed, 2320 insertions(+), 1714 deletions(-) create mode 100644 core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql create mode 100644 core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql diff --git a/Cargo.lock b/Cargo.lock index 6fa750f187e..35db5976e8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -677,7 +677,7 @@ source = "git+https://github.com/matter-labs/bellman?branch=dev#5520aa2274afe73d dependencies = [ "arrayvec 0.7.3", "bit-vec", - "blake2s_const", + "blake2s_const 0.6.0 (git+https://github.com/matter-labs/bellman?branch=dev)", "blake2s_simd", "byteorder", "cfg-if 1.0.0", @@ -686,7 +686,30 @@ dependencies = [ "hex", "lazy_static", "num_cpus", - "pairing_ce", + "pairing_ce 0.28.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "bellman_ce" +version = "0.3.2" +source = "git+https://github.com/matter-labs/bellman?branch=snark-wrapper#e01e5fa08a97a113e76ec8a69d06fe6cc2c82d17" +dependencies = [ + "arrayvec 0.7.3", + "bit-vec", + "blake2s_const 0.6.0 (git+https://github.com/matter-labs/bellman?branch=snark-wrapper)", + "blake2s_simd", + "byteorder", + "cfg-if 1.0.0", + "crossbeam 0.7.3", + "futures 0.3.28", + "hex", + "lazy_static", + "num_cpus", + "pairing_ce 0.28.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6", "serde", "smallvec", @@ -821,6 +844,16 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_const" +version = "0.6.0" +source = "git+https://github.com/matter-labs/bellman?branch=snark-wrapper#e01e5fa08a97a113e76ec8a69d06fe6cc2c82d17" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + [[package]] name = "blake2s_simd" version = "0.5.11" @@ -903,6 +936,37 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "boojum" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-boojum.git?branch=main#2771569baab9a59690d88cee6ba9b295c8a1e4c4" +dependencies = [ + "arrayvec 0.7.3", + "bincode", + "blake2 0.10.6", + "const_format", + "convert_case 0.4.0", + "crossbeam 0.7.3", + "crypto-bigint 0.5.3", + "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "derivative", + "ethereum-types 0.14.1", + "firestorm", + "itertools", + "lazy_static", + "num-modular", + "num_cpus", + "packed_simd", + "pairing_ce 0.28.5 (git+https://github.com/matter-labs/pairing.git)", + "rand 0.8.5", + "rayon", + "serde", + "sha2 0.10.6", + "sha3 0.10.6", + "smallvec", + "unroll", +] + [[package]] name = "brotli" version = "3.3.4" @@ -1118,12 +1182,27 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "circuit_definitions" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=v1.4.0#1934433af48520ac70dc3080b0d1feba877a07c5" +dependencies = [ + "crossbeam 0.8.2", + "derivative", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper)", + "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", + "serde", + "snark_wrapper", + "zk_evm 1.4.0", + "zkevm_circuits", +] + [[package]] name = "circuit_testing" version = "0.1.0" source = "git+https://github.com/matter-labs/era-circuit_testing.git?branch=main#164c0adac85be39ee44bd9456b2b91cdede5af80" dependencies = [ - "bellman_ce", + "bellman_ce 0.3.2 (git+https://github.com/matter-labs/bellman?branch=dev)", ] [[package]] @@ -1230,11 +1309,11 @@ version = "0.1.0" source = "git+https://github.com/matter-labs/solidity_plonk_verifier.git?branch=dev#82f96b7156551087f1c9bfe4f0ea68845b6debfc" dependencies = [ "ethereum-types 0.14.1", - "franklin-crypto", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", "handlebars", "hex", "paste", - "rescue_poseidon", + "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon)", "serde", "serde_derive", "serde_json", @@ -1289,6 +1368,26 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +[[package]] +name = "const_format" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +dependencies = [ + "proc-macro2 1.0.66", + "quote 1.0.33", + "unicode-xid 0.2.4", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -1591,6 +1690,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1621,6 +1730,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "cs_derive" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-boojum.git?branch=main#2771569baab9a59690d88cee6ba9b295c8a1e4c4" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "cs_derive" version = "0.1.0" @@ -2084,6 +2204,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "firestorm" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" + [[package]] name = "fixed-hash" version = "0.7.0" @@ -2154,12 +2280,44 @@ version = "0.0.5" source = "git+https://github.com/matter-labs/franklin-crypto?branch=dev#5695d07c7bc604c2c39a27712ffac171d39ee1ed" dependencies = [ "arr_macro", - "bellman_ce", + "bellman_ce 0.3.2 (git+https://github.com/matter-labs/bellman?branch=dev)", + "bit-vec", + "blake2 0.9.2", + "blake2-rfc_bellman_edition", + "blake2s_simd", + "byteorder", + "digest 0.9.0", + "hex", + "indexmap", + "itertools", + "lazy_static", + "num-bigint 0.4.3", + "num-derive 0.2.5", + "num-integer", + "num-traits", + "rand 0.4.6", + "serde", + "sha2 0.9.9", + "sha3 0.9.1", + "smallvec", + "splitmut", + "tiny-keccak 1.5.0", +] + +[[package]] +name = "franklin-crypto" +version = "0.0.5" +source = "git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper#900332b8c2fe528b5008bb4e6bf2d3f206a9ae56" +dependencies = [ + "arr_macro", + "bellman_ce 0.3.2 (git+https://github.com/matter-labs/bellman?branch=snark-wrapper)", "bit-vec", "blake2 0.9.2", "blake2-rfc_bellman_edition", "blake2s_simd", + "boojum", "byteorder", + "derivative", "digest 0.9.0", "hex", "indexmap", @@ -4044,6 +4202,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-modular" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.3.2" @@ -4210,6 +4378,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "packed_simd" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d" +dependencies = [ + "cfg-if 1.0.0", + "num-traits", +] + [[package]] name = "pairing_ce" version = "0.28.5" @@ -4223,6 +4401,18 @@ dependencies = [ "serde", ] +[[package]] +name = "pairing_ce" +version = "0.28.5" +source = "git+https://github.com/matter-labs/pairing.git#d06c2a112913b0abfb75996cc29a6b6075717e99" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "ff_ce", + "rand 0.4.6", + "serde", +] + [[package]] name = "parity-crypto" version = "0.9.0" @@ -4678,7 +4868,7 @@ version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" dependencies = [ - "unicode-xid", + "unicode-xid 0.1.0", ] [[package]] @@ -5154,6 +5344,29 @@ dependencies = [ "winreg", ] +[[package]] +name = "rescue_poseidon" +version = "0.4.1" +source = "git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2#09b96e7e82dadac151d8d681f017cb6a16961801" +dependencies = [ + "addchain", + "arrayvec 0.7.3", + "blake2 0.10.6", + "boojum", + "byteorder", + "derivative", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper)", + "log", + "num-bigint 0.3.3", + "num-integer", + "num-iter", + "num-traits", + "rand 0.4.6", + "serde", + "sha3 0.9.1", + "smallvec", +] + [[package]] name = "rescue_poseidon" version = "0.4.1" @@ -5163,7 +5376,7 @@ dependencies = [ "arrayvec 0.7.3", "blake2 0.10.6", "byteorder", - "franklin-crypto", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", "num-bigint 0.3.3", "num-integer", "num-iter", @@ -5881,6 +6094,21 @@ name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +dependencies = [ + "serde", +] + +[[package]] +name = "snark_wrapper" +version = "0.1.0" +source = "git+https://github.com/matter-labs/snark-wrapper.git?branch=main#450ea6c9f3ede11e149b86ad3a072e673f9846e7" +dependencies = [ + "boojum", + "derivative", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper)", + "rand 0.4.6", + "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", +] [[package]] name = "socket2" @@ -6152,7 +6380,7 @@ checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", - "unicode-xid", + "unicode-xid 0.1.0", ] [[package]] @@ -6183,9 +6411,9 @@ version = "1.3.3" source = "git+https://github.com/matter-labs/era-sync_vm.git?branch=v1.3.3#3a21c8dee43c77604350fdf33c1615e25bf1dacd" dependencies = [ "arrayvec 0.7.3", - "cs_derive", + "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-sync_vm.git?branch=v1.3.3)", "derivative", - "franklin-crypto", + "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", "hex", "itertools", "num-bigint 0.4.3", @@ -6194,7 +6422,7 @@ dependencies = [ "num-traits", "once_cell", "rand 0.4.6", - "rescue_poseidon", + "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon)", "serde", "sha2 0.10.6", "sha3 0.10.6", @@ -6775,12 +7003,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "unicode_categories" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" +[[package]] +name = "unroll" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -7540,6 +7784,21 @@ dependencies = [ "zkevm_opcode_defs 1.3.2", ] +[[package]] +name = "zk_evm" +version = "1.4.0" +source = "git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.4.0#e33a5ded1b53e35d261fdb46e6d16f2c900b217f" +dependencies = [ + "anyhow", + "lazy_static", + "num 0.4.0", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions", + "zkevm_opcode_defs 1.3.2", +] + [[package]] name = "zk_evm_abstractions" version = "0.1.0" @@ -7589,6 +7848,26 @@ dependencies = [ "zkevm_opcode_defs 1.3.2", ] +[[package]] +name = "zkevm_circuits" +version = "1.4.0" +source = "git+https://github.com/matter-labs/era-zkevm_circuits.git?branch=main#4fba537ccecc238e2da9c80844dc8c185e42466f" +dependencies = [ + "arrayvec 0.7.3", + "bincode", + "boojum", + "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "derivative", + "hex", + "itertools", + "rand 0.4.6", + "rand 0.8.5", + "serde", + "serde_json", + "smallvec", + "zkevm_opcode_defs 1.3.2", +] + [[package]] name = "zkevm_opcode_defs" version = "1.3.1" @@ -7641,6 +7920,31 @@ dependencies = [ "zkevm-assembly 1.3.2", ] +[[package]] +name = "zkevm_test_harness" +version = "1.4.0" +source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=v1.4.0#1934433af48520ac70dc3080b0d1feba877a07c5" +dependencies = [ + "bincode", + "circuit_definitions", + "codegen 0.2.0", + "crossbeam 0.8.2", + "derivative", + "env_logger", + "hex", + "rand 0.4.6", + "rayon", + "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", + "serde", + "serde_json", + "smallvec", + "snark_wrapper", + "structopt", + "test-log", + "tracing", + "zkevm-assembly 1.3.2", +] + [[package]] name = "zksync" version = "0.4.0" @@ -7795,6 +8099,7 @@ dependencies = [ "tracing", "vlog", "vm", + "zkevm_test_harness 1.4.0", "zksync_circuit_breaker", "zksync_config", "zksync_contracts", @@ -8115,7 +8420,7 @@ dependencies = [ "thiserror", "tokio", "zk_evm 1.3.3", - "zkevm_test_harness", + "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_config", "zksync_contracts", diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql new file mode 100644 index 00000000000..7dd14f5f797 --- /dev/null +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql @@ -0,0 +1,6 @@ +ALTER TABLE l1_batches + DROP COLUMN IF EXISTS events_queue_commitment; +ALTER TABLE l1_batches + DROP COLUMN IF EXISTS bootloader_initial_content_commitment; + +DROP TABLE IF EXISTS events_queue; diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql new file mode 100644 index 00000000000..f349794d18e --- /dev/null +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql @@ -0,0 +1,9 @@ +ALTER TABLE l1_batches + ADD COLUMN IF NOT EXISTS events_queue_commitment BYTEA; +ALTER TABLE l1_batches + ADD COLUMN IF NOT EXISTS bootloader_initial_content_commitment BYTEA; + +CREATE TABLE IF NOT EXISTS events_queue ( + l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches (number), + serialized_events_queue JSONB NOT NULL +); diff --git a/core/lib/dal/sqlx-data.json b/core/lib/dal/sqlx-data.json index 3815fe50088..217c5b63dcb 100644 --- a/core/lib/dal/sqlx-data.json +++ b/core/lib/dal/sqlx-data.json @@ -272,6 +272,243 @@ }, "query": "UPDATE eth_txs\n SET confirmed_eth_tx_history_id = $1\n WHERE id = $2" }, + "0bb61f02c7961c783b7cfacdf9817e8808caa2e0a93aa0782e6e7b932d664e62": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 2, + "type_info": "Bool" + }, + { + "name": "l1_tx_count", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bloom", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "hash", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "parent_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "commitment", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + } + }, + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM (SELECT l1_batches.*, row_number() OVER (ORDER BY number ASC) AS row_number FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND l1_batches.skip_proof = TRUE AND l1_batches.number > $1 ORDER BY number LIMIT $2) inn WHERE number - row_number = $1" + }, "0c212f47b9a0e719f947a419be8284837b1b01aa23994ba6401b420790b802b8": { "describe": { "columns": [], @@ -345,6 +582,33 @@ }, "query": "SELECT MAX(number) as \"number\" FROM l1_batches WHERE is_finished = TRUE" }, + "0dc16c4de6dfdc12f12635d3090c98a6326228d40dc40d42486fd9d076f22730": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bool", + "Bytea", + "Int8", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Int8" + ] + } + }, + "query": "UPDATE l1_batches SET hash = $1, merkle_root_hash = $2, commitment = $3, compressed_repeated_writes = $4, compressed_initial_writes = $5, l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, events_queue_commitment = $14, bootloader_initial_content_commitment = $15,\n updated_at = now() WHERE number = $16 AND hash IS NULL" + }, "0e001ef507253b4fd3a87e379c8f2e63fa41250b1a396d81697de2b7ea71215e": { "describe": { "columns": [ @@ -734,6 +998,26 @@ }, "query": "DELETE FROM storage_logs WHERE miniblock_number > $1" }, + "191fb8c0549267b515aaa7acc199675be1ea113e9137195468bb8ce64a099ae8": { + "describe": { + "columns": [ + { + "name": "serialized_events_queue", + "ordinal": 0, + "type_info": "Jsonb" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "SELECT serialized_events_queue FROM events_queue WHERE l1_batch_number = $1" + }, "1948ab14bafbb3ba0098563f22d958c9383877788980fe51bd217987898b1c92": { "describe": { "columns": [ @@ -2537,10 +2821,246 @@ null ], "parameters": { - "Left": [] + "Left": [] + } + }, + "query": "SELECT MAX(number) as \"number\" FROM miniblocks" + }, + "345bff6a5a418cc2cc3bed6960a89ebeccdbc715c6189d29331f4e7740ea3ab5": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 2, + "type_info": "Bool" + }, + { + "name": "l1_tx_count", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bloom", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "hash", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "parent_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "commitment", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int8" + ] } }, - "query": "SELECT MAX(number) as \"number\" FROM miniblocks" + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND eth_prove_tx_id IS NULL ORDER BY number LIMIT $1" }, "357347157ed8ff19d223c54533c3a85bd7e64a37514d657f8d49bd6eb5be1806": { "describe": { @@ -3035,256 +3555,32 @@ "ordinal": 1, "type_info": "Bytea" } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Int4", - "Int8" - ] - } - }, - "query": "SELECT number, hash FROM miniblocks WHERE protocol_version = $1 ORDER BY number DESC LIMIT $2" - }, - "40a86f39a74ab22bdcd8b40446ea063c68bfb3e930e3150212474a657e82b38f": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Text" - ] - } - }, - "query": "\n UPDATE scheduler_witness_jobs\n SET final_node_aggregations_blob_url = $2,\n status = 'waiting_for_proofs',\n updated_at = now()\n WHERE l1_batch_number = $1 AND status != 'queued'\n " - }, - "419344dd86dfa0fbc73bdedd8408971ecb1b97382cf3eb4c57ed6d9ffb87ce58": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, + ], + "nullable": [ false, - true, - true, - true, - true + false ], "parameters": { "Left": [ + "Int4", "Int8" ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL ORDER BY number LIMIT $1" + "query": "SELECT number, hash FROM miniblocks WHERE protocol_version = $1 ORDER BY number DESC LIMIT $2" + }, + "40a86f39a74ab22bdcd8b40446ea063c68bfb3e930e3150212474a657e82b38f": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Text" + ] + } + }, + "query": "\n UPDATE scheduler_witness_jobs\n SET final_node_aggregations_blob_url = $2,\n status = 'waiting_for_proofs',\n updated_at = now()\n WHERE l1_batch_number = $1 AND status != 'queued'\n " }, "433d5da4d72150cf2c1e1007ee3ff51edfa51924f4b662b8cf382f06e60fd228": { "describe": { @@ -4470,6 +4766,19 @@ }, "query": "SELECT timestamp FROM l1_batches WHERE eth_commit_tx_id IS NULL AND number > 0 ORDER BY number LIMIT 1" }, + "601487490349c5eee83d6de19137b1a1079235e46c4a3f07e1eaa9db7760f586": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Jsonb" + ] + } + }, + "query": "INSERT INTO events_queue (l1_batch_number, serialized_events_queue) VALUES ($1, $2)" + }, "62e8b4afd4df9e30bfa08cb30c74ba4566fa2e9f4934b7a2777f9e90b49e8fce": { "describe": { "columns": [], @@ -4883,97 +5192,7 @@ }, "query": "INSERT INTO factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at) SELECT u.bytecode_hash, u.bytecode, $3, now(), now() FROM UNNEST($1::bytea[], $2::bytea[]) AS u(bytecode_hash, bytecode) ON CONFLICT (bytecode_hash) DO NOTHING" }, - "721367902328f9e2e5f8a99820b11d230c60553db366fc76f97c5680470bece8": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "basic_circuits_blob_url", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "basic_circuits_inputs_blob_url", - "ordinal": 2, - "type_info": "Text" - } - ], - "nullable": [ - false, - true, - true - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "\n SELECT l1_batch_number, basic_circuits_blob_url, basic_circuits_inputs_blob_url FROM leaf_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND basic_circuits_blob_url is NOT NULL\n AND basic_circuits_inputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " - }, - "73f0e672ff1a5e144b3034beb18271f1164e95029998d6750c6a8953f7344db5": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int4", - "Int8", - "Bool", - "Bytea", - "ByteaArray", - "ByteaArray", - "Bytea", - "ByteaArray", - "Int8", - "Int8", - "Int8", - "Jsonb", - "Jsonb", - "Numeric", - "Int8", - "Int8", - "Bytea", - "Bytea", - "Int4" - ] - } - }, - "query": "INSERT INTO l1_batches (number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, 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, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version, 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, $21, now(), now())" - }, - "741b13b0a4769a30186c650a4a1b24855806a27ccd8d5a50594741842dde44ec": { - "describe": { - "columns": [ - { - "name": "min?", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "max?", - "ordinal": 1, - "type_info": "Int8" - } - ], - "nullable": [ - null, - null - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "SELECT MIN(miniblocks.number) as \"min?\", MAX(miniblocks.number) as \"max?\" FROM miniblocks WHERE l1_batch_number = $1" - }, - "74637e3c2a52bc7c00521c38f476497792e29046fbb4bb6caa4715f017f5d828": { + "71ffc55f1e7efdcc81401b8a318a82192604f0f094e40ba94a3a97b190e4f6b1": { "describe": { "columns": [ { @@ -5142,52 +5361,157 @@ "type_info": "Bytea" }, { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Int4", + "Int8" + ] + } + }, + "query": "SELECT number, l1_batches.timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, l1_batches.bootloader_code_hash, l1_batches.default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version WHERE eth_commit_tx_id IS NULL AND number != 0 AND protocol_versions.bootloader_code_hash = $1 AND protocol_versions.default_account_code_hash = $2 AND commitment IS NOT NULL AND (protocol_versions.id = $3 OR protocol_versions.upgrade_tx_hash IS NULL) ORDER BY number LIMIT $4" + }, + "721367902328f9e2e5f8a99820b11d230c60553db366fc76f97c5680470bece8": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "basic_circuits_blob_url", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "basic_circuits_inputs_blob_url", + "ordinal": 2, + "type_info": "Text" + } + ], + "nullable": [ + false, + true, + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT l1_batch_number, basic_circuits_blob_url, basic_circuits_inputs_blob_url FROM leaf_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND basic_circuits_blob_url is NOT NULL\n AND basic_circuits_inputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " + }, + "73f0e672ff1a5e144b3034beb18271f1164e95029998d6750c6a8953f7344db5": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Int4", + "Int8", + "Bool", + "Bytea", + "ByteaArray", + "ByteaArray", + "Bytea", + "ByteaArray", + "Int8", + "Int8", + "Int8", + "Jsonb", + "Jsonb", + "Numeric", + "Int8", + "Int8", + "Bytea", + "Bytea", + "Int4" + ] + } + }, + "query": "INSERT INTO l1_batches (number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, 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, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version, 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, $21, now(), now())" + }, + "741b13b0a4769a30186c650a4a1b24855806a27ccd8d5a50594741842dde44ec": { + "describe": { + "columns": [ + { + "name": "min?", + "ordinal": 0, + "type_info": "Int8" }, { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" + "name": "max?", + "ordinal": 1, + "type_info": "Int8" } ], "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true + null, + null ], "parameters": { "Left": [ @@ -5195,7 +5519,7 @@ ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND eth_prove_tx_id IS NULL ORDER BY number LIMIT $1" + "query": "SELECT MIN(miniblocks.number) as \"min?\", MAX(miniblocks.number) as \"max?\" FROM miniblocks WHERE l1_batch_number = $1" }, "751c8e5ed1fc211dbb4c7419a316c5f4e49a7f0b4f3a5c74c2abd8daebc457dd": { "describe": { @@ -5621,28 +5945,240 @@ "type_info": "Bool" }, { - "name": "tx_index_in_miniblock", - "ordinal": 8, - "type_info": "Int4" + "name": "tx_index_in_miniblock", + "ordinal": 8, + "type_info": "Int4" + }, + { + "name": "tx_index_in_l1_batch", + "ordinal": 9, + "type_info": "Int4" + }, + { + "name": "sender", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "key", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "value", + "ordinal": 12, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + null, + null, + false, + false, + false, + false, + false, + false, + false + ], + "parameters": { + "Left": [ + "Bytea" + ] + } + }, + "query": "SELECT miniblock_number, log_index_in_miniblock, log_index_in_tx, tx_hash, Null::bytea as \"block_hash\", Null::bigint as \"l1_batch_number?\", shard_id, is_service, tx_index_in_miniblock, tx_index_in_l1_batch, sender, key, value FROM l2_to_l1_logs WHERE tx_hash = $1 ORDER BY log_index_in_tx ASC" + }, + "81385d97d64772a457d7ddf58375ab11270ac2ae407c5726a939575b30603c85": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 2, + "type_info": "Bool" + }, + { + "name": "l1_tx_count", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bloom", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "hash", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "parent_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "commitment", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" }, { - "name": "tx_index_in_l1_batch", - "ordinal": 9, - "type_info": "Int4" + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" }, { - "name": "sender", - "ordinal": 10, + "name": "meta_parameters_hash", + "ordinal": 33, "type_info": "Bytea" }, { - "name": "key", - "ordinal": 11, + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, "type_info": "Bytea" }, { - "name": "value", - "ordinal": 12, + "name": "bootloader_initial_content_commitment", + "ordinal": 36, "type_info": "Bytea" } ], @@ -5651,23 +6187,47 @@ false, false, false, - null, - null, false, false, false, false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, false, false, - false + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true ], "parameters": { "Left": [ - "Bytea" + "Int8" ] } }, - "query": "SELECT miniblock_number, log_index_in_miniblock, log_index_in_tx, tx_hash, Null::bytea as \"block_hash\", Null::bigint as \"l1_batch_number?\", shard_id, is_service, tx_index_in_miniblock, tx_index_in_l1_batch, sender, key, value FROM l2_to_l1_logs WHERE tx_hash = $1 ORDER BY log_index_in_tx ASC" + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number = $1" }, "84703029e09ab1362aa4b4177b38be594d2daf17e69508cae869647028055efb": { "describe": { @@ -5859,13 +6419,249 @@ "type_info": "Int8" }, { - "name": "circuit_input_blob_url", - "ordinal": 1, - "type_info": "Text" + "name": "circuit_input_blob_url", + "ordinal": 1, + "type_info": "Text" + } + ], + "nullable": [ + false, + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT id, circuit_input_blob_url FROM prover_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND circuit_input_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " + }, + "88e8f08f068d15e386dde062e10b4b951c0feab5a9ff6b554c7ac28fd57609b0": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 2, + "type_info": "Bool" + }, + { + "name": "l1_tx_count", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bloom", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "hash", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "parent_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "commitment", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" } ], "nullable": [ false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, true ], "parameters": { @@ -5874,7 +6670,7 @@ ] } }, - "query": "\n SELECT id, circuit_input_blob_url FROM prover_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND circuit_input_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL ORDER BY number LIMIT $1" }, "8996a1794585dfe0f9c16a11e113831a63d5d944bc8061d7caa25ea33f12b19d": { "describe": { @@ -6688,31 +7484,6 @@ }, "query": "\n SELECT\n (SELECT l1_batch_number\n FROM prover_jobs\n WHERE status NOT IN ('successful', 'skipped')\n ORDER BY l1_batch_number\n LIMIT 1) as \"successful_limit!\",\n \n (SELECT l1_batch_number\n FROM prover_jobs\n WHERE status <> 'queued'\n ORDER BY l1_batch_number DESC\n LIMIT 1) as \"queued_limit!\",\n\n (SELECT MAX(l1_batch_number) as \"max!\" FROM prover_jobs) as \"max_block!\"\n " }, - "9c77342759fc71b12f05c2395ac36aabadab1fa64ff585d6349b8053300cf76c": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bool", - "Bytea", - "Int8", - "Bytea", - "Bytea", - "Bytea", - "Int8" - ] - } - }, - "query": "UPDATE l1_batches SET hash = $1, merkle_root_hash = $2, commitment = $3, compressed_repeated_writes = $4, compressed_initial_writes = $5, l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, updated_at = now() WHERE number = $14 AND hash IS NULL" - }, "9d28c1be3bda0c4fb37567d4a56730e801f48fbb2abad42ea894ebd8ee40412d": { "describe": { "columns": [], @@ -7110,247 +7881,20 @@ "columns": [ { "name": "max?", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "SELECT MAX(operation_number) as \"max?\" FROM storage_logs WHERE miniblock_number = $1" - }, - "a8878258bac2876686f1218213457edd70652e8145743b6b44a846220829bbe2": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, + "ordinal": 0, "type_info": "Int4" } ], "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true + null ], "parameters": { "Left": [ - "Bytea", - "Bytea", - "Int4", "Int8" ] } }, - "query": "SELECT number, l1_batches.timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, l1_batches.bootloader_code_hash, l1_batches.default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version WHERE eth_commit_tx_id IS NULL AND number != 0 AND protocol_versions.bootloader_code_hash = $1 AND protocol_versions.default_account_code_hash = $2 AND commitment IS NOT NULL AND (protocol_versions.id = $3 OR protocol_versions.upgrade_tx_hash IS NULL) ORDER BY number LIMIT $4" + "query": "SELECT MAX(operation_number) as \"max?\" FROM storage_logs WHERE miniblock_number = $1" }, "a9b1a31def214f8b1441dc3ab720bd270f3991c9f1c7528256276e176d532163": { "describe": { @@ -8143,18 +8687,256 @@ "nullable": [ false, false, - false + false + ], + "parameters": { + "Left": [ + "Interval", + "Int2" + ] + } + }, + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " + }, + "b7d3b30bff2ed9aabcdaed89ebfd1f0303b70c6d5483ff9183475bb232a04f21": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "status", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "attempts", + "ordinal": 2, + "type_info": "Int2" + } + ], + "nullable": [ + false, + false, + false + ], + "parameters": { + "Left": [ + "Interval", + "Int2" + ] + } + }, + "query": "\n UPDATE witness_inputs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'in_gpu_proof' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " + }, + "b944df7af612ec911170a43be846eb2f6e27163b0d3983672de2b8d5d60af640": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Interval" + ] + } + }, + "query": "UPDATE proof_generation_details SET status = 'picked_by_prover', updated_at = now(), prover_taken_at = now() WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_generation_details WHERE status = 'ready_to_be_proven' OR (status = 'picked_by_prover' AND prover_taken_at < now() - $1::interval) ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_generation_details.l1_batch_number" + }, + "bc4433cdfa499830fe6a6a95759c9fbe343ac25b371c7fa980bfd1b0afc86629": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text" + ] + } + }, + "query": "UPDATE proof_compression_jobs_fri SET status = $1, attempts = attempts + 1, updated_at = now(), processing_started_at = now(), picked_by = $3 WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_compression_jobs_fri WHERE status = $2 ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_compression_jobs_fri.l1_batch_number" + }, + "be824de76050461afe29dfd229e524bdf113eab3ca24208782c200531db1c940": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Int2", + "Int4" + ] + } + }, + "query": "\n SELECT id from prover_jobs_fri\n WHERE l1_batch_number = $1\n AND circuit_id = $2\n AND aggregation_round = $3\n AND depth = $4\n AND status = 'successful'\n ORDER BY sequence_number ASC;\n " + }, + "bef58e581dd0b658350dcdc15ebf7cf350cf088b60c916a15889e31ee7534907": { + "describe": { + "columns": [ + { + "name": "bytecode", + "ordinal": 0, + "type_info": "Bytea" + }, + { + "name": "bytecode_hash", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "ByteaArray" + ] + } + }, + "query": "SELECT bytecode, bytecode_hash FROM factory_deps WHERE bytecode_hash = ANY($1)" + }, + "c178e1574d2a16cb90bcc5d5333a4f8dd2a69e0c12b4e7e108a8dcc6000669a5": { + "describe": { + "columns": [ + { + "name": "protocol_version", + "ordinal": 0, + "type_info": "Int4" + } + ], + "nullable": [ + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "SELECT protocol_version FROM miniblocks WHERE number = $1" + }, + "c1e5f85be88ef0b6ab81daf8dec2011797086a7ec5aeaffe5665ebf9584bf84a": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "scheduler_partial_input_blob_url", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "status", + "ordinal": 2, + "type_info": "Text" + }, + { + "name": "processing_started_at", + "ordinal": 3, + "type_info": "Timestamp" + }, + { + "name": "time_taken", + "ordinal": 4, + "type_info": "Time" + }, + { + "name": "error", + "ordinal": 5, + "type_info": "Text" + }, + { + "name": "created_at", + "ordinal": 6, + "type_info": "Timestamp" + }, + { + "name": "updated_at", + "ordinal": 7, + "type_info": "Timestamp" + }, + { + "name": "attempts", + "ordinal": 8, + "type_info": "Int2" + }, + { + "name": "protocol_version", + "ordinal": 9, + "type_info": "Int4" + }, + { + "name": "picked_by", + "ordinal": 10, + "type_info": "Text" + } + ], + "nullable": [ + false, + false, + false, + true, + true, + true, + false, + false, + false, + true, + true ], "parameters": { "Left": [ - "Interval", - "Int2" + "Int4Array", + "Text" ] } }, - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now(),\n picked_by = $2\n WHERE l1_batch_number = (\n SELECT l1_batch_number\n FROM scheduler_witness_jobs_fri\n WHERE status = 'queued'\n AND protocol_version = ANY($1)\n ORDER BY l1_batch_number ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING scheduler_witness_jobs_fri.*\n " + }, + "c2cf96a9eb6893c5ba7d9e5418d9f24084ccd87980cb6ee05de1b3bde5c654bd": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray" + ] + } + }, + "query": "\n INSERT INTO call_traces (tx_hash, call_trace)\n SELECT u.tx_hash, u.call_trace\n FROM UNNEST($1::bytea[], $2::bytea[])\n AS u(tx_hash, call_trace)\n " }, - "b7c3d8606c77f78897763bc8c77b7bc85ce1daf8d079402eb20dfc0a3f164834": { + "c2f391ed1397da01d04955c511a924747ea167f68da7647888f9e14ab8974610": { "describe": { "columns": [ { @@ -8331,6 +9113,16 @@ "name": "protocol_version", "ordinal": 34, "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" } ], "nullable": [ @@ -8368,253 +9160,15 @@ true, true, true, - true - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches WHERE number = $1" - }, - "b7d3b30bff2ed9aabcdaed89ebfd1f0303b70c6d5483ff9183475bb232a04f21": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "attempts", - "ordinal": 2, - "type_info": "Int2" - } - ], - "nullable": [ - false, - false, - false - ], - "parameters": { - "Left": [ - "Interval", - "Int2" - ] - } - }, - "query": "\n UPDATE witness_inputs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'in_gpu_proof' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " - }, - "b944df7af612ec911170a43be846eb2f6e27163b0d3983672de2b8d5d60af640": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Interval" - ] - } - }, - "query": "UPDATE proof_generation_details SET status = 'picked_by_prover', updated_at = now(), prover_taken_at = now() WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_generation_details WHERE status = 'ready_to_be_proven' OR (status = 'picked_by_prover' AND prover_taken_at < now() - $1::interval) ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_generation_details.l1_batch_number" - }, - "bc4433cdfa499830fe6a6a95759c9fbe343ac25b371c7fa980bfd1b0afc86629": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text" - ] - } - }, - "query": "UPDATE proof_compression_jobs_fri SET status = $1, attempts = attempts + 1, updated_at = now(), processing_started_at = now(), picked_by = $3 WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_compression_jobs_fri WHERE status = $2 ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_compression_jobs_fri.l1_batch_number" - }, - "be824de76050461afe29dfd229e524bdf113eab3ca24208782c200531db1c940": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Int2", - "Int4" - ] - } - }, - "query": "\n SELECT id from prover_jobs_fri\n WHERE l1_batch_number = $1\n AND circuit_id = $2\n AND aggregation_round = $3\n AND depth = $4\n AND status = 'successful'\n ORDER BY sequence_number ASC;\n " - }, - "bef58e581dd0b658350dcdc15ebf7cf350cf088b60c916a15889e31ee7534907": { - "describe": { - "columns": [ - { - "name": "bytecode", - "ordinal": 0, - "type_info": "Bytea" - }, - { - "name": "bytecode_hash", - "ordinal": 1, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "ByteaArray" - ] - } - }, - "query": "SELECT bytecode, bytecode_hash FROM factory_deps WHERE bytecode_hash = ANY($1)" - }, - "c178e1574d2a16cb90bcc5d5333a4f8dd2a69e0c12b4e7e108a8dcc6000669a5": { - "describe": { - "columns": [ - { - "name": "protocol_version", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - true - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "SELECT protocol_version FROM miniblocks WHERE number = $1" - }, - "c1e5f85be88ef0b6ab81daf8dec2011797086a7ec5aeaffe5665ebf9584bf84a": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "scheduler_partial_input_blob_url", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "status", - "ordinal": 2, - "type_info": "Text" - }, - { - "name": "processing_started_at", - "ordinal": 3, - "type_info": "Timestamp" - }, - { - "name": "time_taken", - "ordinal": 4, - "type_info": "Time" - }, - { - "name": "error", - "ordinal": 5, - "type_info": "Text" - }, - { - "name": "created_at", - "ordinal": 6, - "type_info": "Timestamp" - }, - { - "name": "updated_at", - "ordinal": 7, - "type_info": "Timestamp" - }, - { - "name": "attempts", - "ordinal": 8, - "type_info": "Int2" - }, - { - "name": "protocol_version", - "ordinal": 9, - "type_info": "Int4" - }, - { - "name": "picked_by", - "ordinal": 10, - "type_info": "Text" - } - ], - "nullable": [ - false, - false, - false, - true, - true, true, - false, - false, - false, true, true ], "parameters": { - "Left": [ - "Int4Array", - "Text" - ] - } - }, - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now(),\n picked_by = $2\n WHERE l1_batch_number = (\n SELECT l1_batch_number\n FROM scheduler_witness_jobs_fri\n WHERE status = 'queued'\n AND protocol_version = ANY($1)\n ORDER BY l1_batch_number ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING scheduler_witness_jobs_fri.*\n " - }, - "c2cf96a9eb6893c5ba7d9e5418d9f24084ccd87980cb6ee05de1b3bde5c654bd": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray" - ] + "Left": [] } }, - "query": "\n INSERT INTO call_traces (tx_hash, call_trace)\n SELECT u.tx_hash, u.call_trace\n FROM UNNEST($1::bytea[], $2::bytea[])\n AS u(tx_hash, call_trace)\n " + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL ORDER BY number DESC LIMIT 1" }, "c49a6925e9462cc85a6e1cc850f2e147e0a5d990efed56f27792698e6cf9ff0c": { "describe": { @@ -9053,261 +9607,32 @@ { "name": "l1_batch_number", "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "circuit_id", - "ordinal": 2, - "type_info": "Int2" - }, - { - "name": "aggregation_round", - "ordinal": 3, - "type_info": "Int2" - }, - { - "name": "sequence_number", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "depth", - "ordinal": 5, - "type_info": "Int4" - }, - { - "name": "is_node_final_proof", - "ordinal": 6, - "type_info": "Bool" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false - ], - "parameters": { - "Left": [ - "Int4Array", - "Text" - ] - } - }, - "query": "\n UPDATE prover_jobs_fri\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now(),\n picked_by = $2\n WHERE id = (\n SELECT id\n FROM prover_jobs_fri\n WHERE status = 'queued'\n AND protocol_version = ANY($1)\n ORDER BY aggregation_round DESC, l1_batch_number ASC, id ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING prover_jobs_fri.id, prover_jobs_fri.l1_batch_number, prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round, prover_jobs_fri.sequence_number, prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n " - }, - "d1c82bd0b3c010569937ad7600760fa0c3aca7c9585bbf9598a5c0515b431b26": { - "describe": { - "columns": [ - { - "name": "hashed_key", - "ordinal": 0, - "type_info": "Bytea" - }, - { - "name": "l1_batch_number", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "index", - "ordinal": 2, - "type_info": "Int8" - } - ], - "nullable": [ - false, - false, - false - ], - "parameters": { - "Left": [ - "ByteaArray" - ] - } - }, - "query": "SELECT hashed_key, l1_batch_number, index FROM initial_writes WHERE hashed_key = ANY($1::bytea[])" - }, - "d5dea31f2a325bb44e8ef2cbbabbeb73fd6996a3e6cb99d62c6b97a4aa49c1ca": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" + "type_info": "Int8" }, { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" + "name": "circuit_id", + "ordinal": 2, + "type_info": "Int2" }, { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" + "name": "aggregation_round", + "ordinal": 3, + "type_info": "Int2" }, { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" + "name": "sequence_number", + "ordinal": 4, + "type_info": "Int4" }, { - "name": "protocol_version", - "ordinal": 34, + "name": "depth", + "ordinal": 5, "type_info": "Int4" + }, + { + "name": "is_node_final_proof", + "ordinal": 6, + "type_info": "Bool" } ], "nullable": [ @@ -9317,44 +9642,48 @@ false, false, false, + false + ], + "parameters": { + "Left": [ + "Int4Array", + "Text" + ] + } + }, + "query": "\n UPDATE prover_jobs_fri\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now(),\n picked_by = $2\n WHERE id = (\n SELECT id\n FROM prover_jobs_fri\n WHERE status = 'queued'\n AND protocol_version = ANY($1)\n ORDER BY aggregation_round DESC, l1_batch_number ASC, id ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING prover_jobs_fri.id, prover_jobs_fri.l1_batch_number, prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round, prover_jobs_fri.sequence_number, prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n " + }, + "d1c82bd0b3c010569937ad7600760fa0c3aca7c9585bbf9598a5c0515b431b26": { + "describe": { + "columns": [ + { + "name": "hashed_key", + "ordinal": 0, + "type_info": "Bytea" + }, + { + "name": "l1_batch_number", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "index", + "ordinal": 2, + "type_info": "Int8" + } + ], + "nullable": [ false, false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true + false ], "parameters": { "Left": [ - "Int8", - "Int8" + "ByteaArray" ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM (SELECT l1_batches.*, row_number() OVER (ORDER BY number ASC) AS row_number FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND l1_batches.skip_proof = TRUE AND l1_batches.number > $1 ORDER BY number LIMIT $2) inn WHERE number - row_number = $1" + "query": "SELECT hashed_key, l1_batch_number, index FROM initial_writes WHERE hashed_key = ANY($1::bytea[])" }, "d6709f3ce8f08f988e10a0e0fb5c06db9488834a85066babaf3d56cf212b4ea0": { "describe": { @@ -9720,223 +10049,96 @@ ] } }, - "query": "SELECT timestamp, virtual_blocks FROM miniblocks WHERE number BETWEEN $1 AND $2 ORDER BY number" - }, - "e1ad7a51afef6bd7a95df3294f64b7b1bdc4c4fc7ae5c4195802177986f3e876": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "attempts", - "ordinal": 2, - "type_info": "Int2" - } - ], - "nullable": [ - false, - false, - false - ], - "parameters": { - "Left": [ - "Interval", - "Int2" - ] - } - }, - "query": "\n UPDATE prover_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " - }, - "e29d263f33257a37f391907b7ff588f416a0350b606f16f4779fa1d3bf4be08b": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "eth_tx_id", - "ordinal": 1, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "UPDATE eth_txs_history\n SET updated_at = now(), confirmed_at = now()\n WHERE tx_hash = $1\n RETURNING id, eth_tx_id" - }, - "e409b39a5e62a3a4ec5d3b6aae4935c13b93129a22ffe6a0b68b5ade1f6082c8": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "hash", - "ordinal": 1, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int8" - ] - } - }, - "query": "SELECT number, hash FROM miniblocks WHERE number >= $1 and protocol_version = $2 ORDER BY number LIMIT $3" - }, - "e626aa2efb6ba875a12f2b4e37b0ba8052810e73fa5e2d3280f747f7b89b956f": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Int8" - ] - } - }, - "query": "UPDATE proof_generation_details SET status='generated', proof_blob_url = $1, updated_at = now() WHERE l1_batch_number = $2" - }, - "e6fc424c622576166999df4487068cc1447b09464c48f379f882c45172f34a78": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "l1_tx_count", - "ordinal": 1, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 2, - "type_info": "Int4" - }, - { - "name": "timestamp", - "ordinal": 3, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 4, - "type_info": "Bool" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 6, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "bloom", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 9, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 10, - "type_info": "Jsonb" - }, - { - "name": "base_fee_per_gas", - "ordinal": 11, - "type_info": "Numeric" - }, + "query": "SELECT timestamp, virtual_blocks FROM miniblocks WHERE number BETWEEN $1 AND $2 ORDER BY number" + }, + "e1ad7a51afef6bd7a95df3294f64b7b1bdc4c4fc7ae5c4195802177986f3e876": { + "describe": { + "columns": [ { - "name": "l1_gas_price", - "ordinal": 12, + "name": "id", + "ordinal": 0, "type_info": "Int8" }, { - "name": "l2_fair_gas_price", - "ordinal": 13, - "type_info": "Int8" + "name": "status", + "ordinal": 1, + "type_info": "Text" }, { - "name": "bootloader_code_hash", - "ordinal": 14, - "type_info": "Bytea" - }, + "name": "attempts", + "ordinal": 2, + "type_info": "Int2" + } + ], + "nullable": [ + false, + false, + false + ], + "parameters": { + "Left": [ + "Interval", + "Int2" + ] + } + }, + "query": "\n UPDATE prover_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " + }, + "e29d263f33257a37f391907b7ff588f416a0350b606f16f4779fa1d3bf4be08b": { + "describe": { + "columns": [ { - "name": "default_aa_code_hash", - "ordinal": 15, - "type_info": "Bytea" + "name": "id", + "ordinal": 0, + "type_info": "Int4" }, { - "name": "protocol_version", - "ordinal": 16, + "name": "eth_tx_id", + "ordinal": 1, "type_info": "Int4" } ], "nullable": [ false, + false + ], + "parameters": { + "Left": [ + "Text" + ] + } + }, + "query": "UPDATE eth_txs_history\n SET updated_at = now(), confirmed_at = now()\n WHERE tx_hash = $1\n RETURNING id, eth_tx_id" + }, + "e409b39a5e62a3a4ec5d3b6aae4935c13b93129a22ffe6a0b68b5ade1f6082c8": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "hash", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true + false ], "parameters": { - "Left": [] + "Left": [ + "Int8", + "Int4", + "Int8" + ] } }, - "query": "SELECT number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, l2_to_l1_messages, bloom, priority_ops_onchain_data, used_contract_hashes, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version FROM l1_batches ORDER BY number DESC LIMIT 1" + "query": "SELECT number, hash FROM miniblocks WHERE number >= $1 and protocol_version = $2 ORDER BY number LIMIT $3" }, - "e72e3eb79c4d306775cdae718db78f8f1f7c4a97b0abfcceac15efe1c3543fff": { + "e47ea1f8caf3c0a1a7d669ffdfa8482881365bdaffd8a5077cb0953d7973c3d6": { "describe": { "columns": [ { @@ -10100,18 +10302,179 @@ "type_info": "Bytea" }, { - "name": "pass_through_data_hash", - "ordinal": 32, + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int8", + "Int8", + "Int8" + ] + } + }, + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number BETWEEN $1 AND $2 ORDER BY number LIMIT $3" + }, + "e626aa2efb6ba875a12f2b4e37b0ba8052810e73fa5e2d3280f747f7b89b956f": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Text", + "Int8" + ] + } + }, + "query": "UPDATE proof_generation_details SET status='generated', proof_blob_url = $1, updated_at = now() WHERE l1_batch_number = $2" + }, + "e6fc424c622576166999df4487068cc1447b09464c48f379f882c45172f34a78": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "l1_tx_count", + "ordinal": 1, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 2, + "type_info": "Int4" + }, + { + "name": "timestamp", + "ordinal": 3, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 4, + "type_info": "Bool" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 6, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "bloom", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 9, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 10, + "type_info": "Jsonb" + }, + { + "name": "base_fee_per_gas", + "ordinal": 11, + "type_info": "Numeric" + }, + { + "name": "l1_gas_price", + "ordinal": 12, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 13, + "type_info": "Int8" + }, + { + "name": "bootloader_code_hash", + "ordinal": 14, "type_info": "Bytea" }, { - "name": "meta_parameters_hash", - "ordinal": 33, + "name": "default_aa_code_hash", + "ordinal": 15, "type_info": "Bytea" }, { "name": "protocol_version", - "ordinal": 34, + "ordinal": 16, "type_info": "Int4" } ], @@ -10124,43 +10487,21 @@ false, false, false, - true, - true, - true, - true, - true, - true, - true, - true, - true, false, false, false, - true, - true, - true, - true, false, false, - true, - true, - true, - true, false, true, true, - true, true ], "parameters": { - "Left": [ - "Int8", - "Int8", - "Int8" - ] + "Left": [] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches WHERE number BETWEEN $1 AND $2 ORDER BY number LIMIT $3" + "query": "SELECT number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, l2_to_l1_messages, bloom, priority_ops_onchain_data, used_contract_hashes, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version FROM l1_batches ORDER BY number DESC LIMIT 1" }, "e900682a160af90d532da47a1222fc1d7c9962ee8996dbd9b9bb63f13820cf2b": { "describe": { @@ -10486,228 +10827,6 @@ }, "query": "\n UPDATE leaf_aggregation_witness_jobs\n SET is_blob_cleaned=TRUE\n WHERE l1_batch_number = ANY($1);\n " }, - "ee20215e53d1467e96d3db3a95dbb9a8cbb1c9407d0c914b4168637604d91c29": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version FROM l1_batches WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL ORDER BY number DESC LIMIT 1" - }, "ee5727dc06a7385969e834556b96bbfdf12a5049a1a1c270f203ef3fa0e8cb94": { "describe": { "columns": [], diff --git a/core/lib/dal/src/blocks_dal.rs b/core/lib/dal/src/blocks_dal.rs index 69913a2dc14..0929c781776 100644 --- a/core/lib/dal/src/blocks_dal.rs +++ b/core/lib/dal/src/blocks_dal.rs @@ -12,7 +12,8 @@ use zksync_types::{ aggregated_operations::AggregatedActionType, block::{BlockGasCount, L1BatchHeader, MiniblockHeader}, commitment::{L1BatchMetadata, L1BatchWithMetadata}, - L1BatchNumber, MiniblockNumber, ProtocolVersionId, H256, MAX_GAS_PER_PUBDATA_BYTE, U256, + L1BatchNumber, LogQuery, MiniblockNumber, ProtocolVersionId, H256, MAX_GAS_PER_PUBDATA_BYTE, + U256, }; use crate::{ @@ -182,7 +183,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ WHERE number = $1", number.0 as i64 @@ -238,6 +240,28 @@ impl BlocksDal<'_, '_> { Ok(Some(heap)) } + pub async fn get_events_queue( + &mut self, + number: L1BatchNumber, + ) -> anyhow::Result>> { + let Some(row) = sqlx::query!( + "SELECT serialized_events_queue FROM events_queue WHERE l1_batch_number = $1", + number.0 as i64 + ) + .instrument("get_events_queue") + .report_latency() + .with_arg("number", &number) + .fetch_optional(self.storage.conn()) + .await? + else { + return Ok(None); + }; + + let events = serde_json::from_value(row.serialized_events_queue) + .context("invalid value for serialized_events_queue in the DB")?; + Ok(Some(events)) + } + pub async fn set_eth_tx_id( &mut self, number_range: ops::RangeInclusive, @@ -290,6 +314,7 @@ impl BlocksDal<'_, '_> { header: &L1BatchHeader, initial_bootloader_contents: &[(usize, U256)], predicted_block_gas: BlockGasCount, + events_queue: &[LogQuery], ) -> anyhow::Result<()> { let priority_onchain_data: Vec> = header .priority_ops_onchain_data @@ -305,12 +330,15 @@ impl BlocksDal<'_, '_> { // Serialization should always succeed. let initial_bootloader_contents = serde_json::to_value(initial_bootloader_contents) .expect("failed to serialize initial_bootloader_contents to JSON value"); + let events_queue = serde_json::to_value(events_queue) + .expect("failed to serialize events_queue to JSON value"); // Serialization should always succeed. let used_contract_hashes = serde_json::to_value(&header.used_contract_hashes) .expect("failed to serialize used_contract_hashes to JSON value"); let base_fee_per_gas = BigDecimal::from_u64(header.base_fee_per_gas) .context("block.base_fee_per_gas should fit in u64")?; + let mut transaction = self.storage.start_transaction().await?; sqlx::query!( "INSERT INTO l1_batches (\ number, l1_tx_count, l2_tx_count, \ @@ -349,8 +377,18 @@ impl BlocksDal<'_, '_> { .as_bytes(), header.protocol_version.map(|v| v as i32), ) - .execute(self.storage.conn()) + .execute(transaction.conn()) .await?; + + sqlx::query!( + "INSERT INTO events_queue (l1_batch_number, serialized_events_queue) VALUES ($1, $2)", + header.number.0 as i64, + events_queue + ) + .execute(transaction.conn()) + .await?; + transaction.commit().await?; + Ok(()) } @@ -515,8 +553,9 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, \ zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, \ aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, \ + events_queue_commitment = $14, bootloader_initial_content_commitment = $15, updated_at = now() \ - WHERE number = $14 AND hash IS NULL", + WHERE number = $16 AND hash IS NULL", metadata.root_hash.as_bytes(), metadata.merkle_root_hash.as_bytes(), metadata.commitment.as_bytes(), @@ -530,6 +569,10 @@ impl BlocksDal<'_, '_> { metadata.aux_data_hash.as_bytes(), metadata.pass_through_data_hash.as_bytes(), metadata.meta_parameters_hash.as_bytes(), + metadata.events_queue_commitment.map(|h| h.0.to_vec()), + metadata + .bootloader_initial_content_commitment + .map(|h| h.0.to_vec()), number.0 as i64, ) .instrument("save_blocks_metadata") @@ -594,7 +637,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL \ ORDER BY number DESC \ @@ -689,7 +733,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ WHERE eth_commit_tx_id IS NOT NULL AND eth_prove_tx_id IS NULL \ ORDER BY number LIMIT $1", @@ -755,7 +800,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM \ (SELECT l1_batches.*, row_number() OVER (ORDER BY number ASC) AS row_number \ FROM l1_batches \ @@ -794,7 +840,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL \ ORDER BY number LIMIT $1", @@ -871,7 +918,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, \ default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ WHERE number BETWEEN $1 AND $2 \ ORDER BY number LIMIT $3", @@ -906,7 +954,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, \ rollup_last_leaf_index, zkporter_is_available, l1_batches.bootloader_code_hash, \ l1_batches.default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, \ - meta_parameters_hash, protocol_version \ + meta_parameters_hash, protocol_version, \ + events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version \ WHERE eth_commit_tx_id IS NULL \ @@ -1401,7 +1450,7 @@ mod tests { header.l2_to_l1_messages.push(vec![33; 33]); conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default()) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[]) .await .unwrap(); @@ -1449,7 +1498,7 @@ mod tests { execute: 10, }; conn.blocks_dal() - .insert_l1_batch(&header, &[], predicted_gas) + .insert_l1_batch(&header, &[], predicted_gas, &[]) .await .unwrap(); @@ -1457,7 +1506,7 @@ mod tests { header.timestamp += 100; predicted_gas += predicted_gas; conn.blocks_dal() - .insert_l1_batch(&header, &[], predicted_gas) + .insert_l1_batch(&header, &[], predicted_gas, &[]) .await .unwrap(); diff --git a/core/lib/dal/src/models/storage_block.rs b/core/lib/dal/src/models/storage_block.rs index d0077a2f7a1..d16dc541467 100644 --- a/core/lib/dal/src/models/storage_block.rs +++ b/core/lib/dal/src/models/storage_block.rs @@ -152,6 +152,9 @@ pub struct StorageL1Batch { pub l2_fair_gas_price: i64, pub protocol_version: Option, + + pub events_queue_commitment: Option>, + pub bootloader_initial_content_commitment: Option>, } impl From for L1BatchHeader { @@ -257,6 +260,10 @@ impl TryInto for StorageL1Batch { .ok_or(StorageL1BatchConvertError::Incomplete)?, ), }, + events_queue_commitment: self.events_queue_commitment.map(|v| H256::from_slice(&v)), + bootloader_initial_content_commitment: self + .bootloader_initial_content_commitment + .map(|v| H256::from_slice(&v)), }) } } diff --git a/core/lib/dal/src/storage_logs_dal.rs b/core/lib/dal/src/storage_logs_dal.rs index b0424c534fe..c41ad2b668d 100644 --- a/core/lib/dal/src/storage_logs_dal.rs +++ b/core/lib/dal/src/storage_logs_dal.rs @@ -548,7 +548,7 @@ mod tests { ); header.is_finished = true; conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default()) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[]) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/dal/src/tests/mod.rs b/core/lib/dal/src/tests/mod.rs index fecd33f4761..78d1f934b80 100644 --- a/core/lib/dal/src/tests/mod.rs +++ b/core/lib/dal/src/tests/mod.rs @@ -290,7 +290,7 @@ async fn test_duplicate_insert_prover_jobs(connection_pool: ConnectionPool) { ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); @@ -352,7 +352,7 @@ async fn test_requeue_prover_jobs(connection_pool: ConnectionPool) { ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); @@ -415,7 +415,7 @@ async fn test_move_leaf_aggregation_jobs_from_waiting_to_queued(connection_pool: ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); @@ -495,7 +495,7 @@ async fn test_move_node_aggregation_jobs_from_waiting_to_queued(connection_pool: ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); @@ -582,7 +582,7 @@ async fn test_move_scheduler_jobs_from_waiting_to_queued(connection_pool: Connec ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); diff --git a/core/lib/mempool/src/tests.rs b/core/lib/mempool/src/tests.rs index 6de94c766d3..cb149752e2d 100644 --- a/core/lib/mempool/src/tests.rs +++ b/core/lib/mempool/src/tests.rs @@ -206,7 +206,7 @@ fn two_ready_txs() { view(mempool.next_transaction(&L2TxFilter::default())), view(mempool.next_transaction(&L2TxFilter::default())) ]), - HashSet::<(_, _)>::from_iter(vec![(account0, 0), (account1, 0)].into_iter()), + HashSet::<(_, _)>::from_iter(vec![(account0, 0), (account1, 0)]), ); } diff --git a/core/lib/merkle_tree/src/hasher/nodes.rs b/core/lib/merkle_tree/src/hasher/nodes.rs index 715e0c958fa..e4432b86b69 100644 --- a/core/lib/merkle_tree/src/hasher/nodes.rs +++ b/core/lib/merkle_tree/src/hasher/nodes.rs @@ -37,7 +37,7 @@ impl MerklePath { } } - pub(crate) fn push(&mut self, hasher: &mut HasherWithStats<'_>, maybe_hash: Option) { + pub(crate) fn push(&mut self, hasher: &HasherWithStats<'_>, maybe_hash: Option) { if let Some(hash) = maybe_hash { self.hashes.push(hash); } else if !self.hashes.is_empty() { @@ -126,7 +126,7 @@ impl InternalNodeCache { fn extend_merkle_path( &self, - hasher: &mut HasherWithStats<'_>, + hasher: &HasherWithStats<'_>, merkle_path: &mut MerklePath, nibble: u8, ) { diff --git a/core/lib/merkle_tree/src/storage/patch.rs b/core/lib/merkle_tree/src/storage/patch.rs index 5f98f3a2a66..1ba52fab538 100644 --- a/core/lib/merkle_tree/src/storage/patch.rs +++ b/core/lib/merkle_tree/src/storage/patch.rs @@ -269,7 +269,7 @@ impl WorkingPatchSet { /// Splits this patch set by the first nibble of the contained keys. pub fn split(self) -> [Self; SUBTREE_COUNT] { - let mut parts = [(); SUBTREE_COUNT].map(|_| Self { + let mut parts = [(); SUBTREE_COUNT].map(|()| Self { version: self.version, changes_by_nibble_count: vec![HashMap::new(); self.changes_by_nibble_count.len()], }); diff --git a/core/lib/merkle_tree/src/storage/tests.rs b/core/lib/merkle_tree/src/storage/tests.rs index 19006689174..64241c05b93 100644 --- a/core/lib/merkle_tree/src/storage/tests.rs +++ b/core/lib/merkle_tree/src/storage/tests.rs @@ -256,23 +256,23 @@ fn proving_keys_existence_and_absence() { let mut hasher = (&() as &dyn HashTree).into(); let (op, merkle_path) = updater.prove(&mut hasher, FIRST_KEY, &Nibbles::EMPTY); assert_matches!(op, TreeLogEntry::Read { .. }); - let merkle_path = finalize_merkle_path(merkle_path, &mut hasher); + let merkle_path = finalize_merkle_path(merkle_path, &hasher); assert!(merkle_path.is_empty()); // all adjacent hashes correspond to empty subtrees let (op, merkle_path) = updater.prove(&mut hasher, SECOND_KEY, &Nibbles::EMPTY); assert_matches!(op, TreeLogEntry::ReadMissingKey); - let merkle_path = finalize_merkle_path(merkle_path, &mut hasher); + let merkle_path = finalize_merkle_path(merkle_path, &hasher); assert_eq!(merkle_path.len(), 40); updater.insert(THIRD_KEY, H256([3; 32]), &Nibbles::EMPTY, || 2); let (op, merkle_path) = updater.prove(&mut hasher, FIRST_KEY, &Nibbles::EMPTY); assert_matches!(op, TreeLogEntry::Read { .. }); - let merkle_path = finalize_merkle_path(merkle_path, &mut hasher); + let merkle_path = finalize_merkle_path(merkle_path, &hasher); assert_eq!(merkle_path.len(), 18); // keys diverge at 18th bit let (op, merkle_path) = updater.prove(&mut hasher, SECOND_KEY, &Nibbles::EMPTY); assert_matches!(op, TreeLogEntry::ReadMissingKey); - let merkle_path = finalize_merkle_path(merkle_path, &mut hasher); + let merkle_path = finalize_merkle_path(merkle_path, &hasher); assert_eq!(merkle_path.len(), 40); assert_eq!(updater.metrics.key_reads, 2); @@ -280,7 +280,7 @@ fn proving_keys_existence_and_absence() { } // Emulate Merkle path finalization. -fn finalize_merkle_path(mut path: MerklePath, hasher: &mut HasherWithStats<'_>) -> Vec { +fn finalize_merkle_path(mut path: MerklePath, hasher: &HasherWithStats<'_>) -> Vec { for _ in 0..4 { path.push(hasher, None); } diff --git a/core/lib/state/src/test_utils.rs b/core/lib/state/src/test_utils.rs index 6ec1e9f3e9b..2e4a2281a86 100644 --- a/core/lib/state/src/test_utils.rs +++ b/core/lib/state/src/test_utils.rs @@ -106,7 +106,7 @@ pub(crate) async fn create_l1_batch( ); header.is_finished = true; conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default()) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[]) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/types/src/commitment.rs b/core/lib/types/src/commitment.rs index abc0946fa34..a5f930058ba 100644 --- a/core/lib/types/src/commitment.rs +++ b/core/lib/types/src/commitment.rs @@ -61,6 +61,12 @@ pub struct L1BatchMetadata { pub aux_data_hash: H256, pub meta_parameters_hash: H256, pub pass_through_data_hash: H256, + /// The commitment to the final events queue state after the batch is committed. + /// Practically, it is a commitment to all events that happened on L2 during the batch execution. + pub events_queue_commitment: Option, + /// The commitment to the initial heap content of the bootloader. Practically it serves as a + /// commitment to the transactions in the batch. + pub bootloader_initial_content_commitment: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/core/lib/types/src/priority_op_onchain_data.rs b/core/lib/types/src/priority_op_onchain_data.rs index 84ff177bbc9..a729aa27bf4 100644 --- a/core/lib/types/src/priority_op_onchain_data.rs +++ b/core/lib/types/src/priority_op_onchain_data.rs @@ -35,7 +35,7 @@ impl Eq for PriorityOpOnchainData {} impl PartialOrd for PriorityOpOnchainData { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.layer_2_tip_fee.cmp(&other.layer_2_tip_fee)) + Some(self.cmp(other)) } } diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index ec03e83ba6c..5b96d42f572 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -81,6 +81,8 @@ actix-web = "4.0.0-beta.8" tracing = "0.1.26" +zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0" } + [dev-dependencies] db_test_macro = { path = "../db_test_macro" } diff --git a/core/lib/zksync_core/src/eth_sender/tests.rs b/core/lib/zksync_core/src/eth_sender/tests.rs index 9cce70b8248..815450dd596 100644 --- a/core/lib/zksync_core/src/eth_sender/tests.rs +++ b/core/lib/zksync_core/src/eth_sender/tests.rs @@ -465,6 +465,8 @@ fn default_l1_batch_metadata() -> L1BatchMetadata { aux_data_hash: Default::default(), meta_parameters_hash: Default::default(), pass_through_data_hash: Default::default(), + events_queue_commitment: Some(H256::zero()), + bootloader_initial_content_commitment: Some(H256::zero()), } } @@ -480,9 +482,9 @@ fn l1_batch_with_metadata(header: L1BatchHeader) -> L1BatchWithMetadata { async fn correct_order_for_confirmations(connection_pool: ConnectionPool) -> anyhow::Result<()> { let mut tester = EthSenderTester::new(connection_pool, vec![100; 100], true).await; insert_genesis_protocol_version(&tester).await; - let genesis_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(0)).await; - let first_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(1)).await; - let second_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(2)).await; + let genesis_l1_batch = insert_l1_batch(&tester, L1BatchNumber(0)).await; + let first_l1_batch = insert_l1_batch(&tester, L1BatchNumber(1)).await; + let second_l1_batch = insert_l1_batch(&tester, L1BatchNumber(2)).await; commit_l1_batch( &mut tester, @@ -540,9 +542,9 @@ async fn correct_order_for_confirmations(connection_pool: ConnectionPool) -> any async fn skipped_l1_batch_at_the_start(connection_pool: ConnectionPool) -> anyhow::Result<()> { let mut tester = EthSenderTester::new(connection_pool, vec![100; 100], true).await; insert_genesis_protocol_version(&tester).await; - let genesis_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(0)).await; - let first_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(1)).await; - let second_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(2)).await; + let genesis_l1_batch = insert_l1_batch(&tester, L1BatchNumber(0)).await; + let first_l1_batch = insert_l1_batch(&tester, L1BatchNumber(1)).await; + let second_l1_batch = insert_l1_batch(&tester, L1BatchNumber(2)).await; commit_l1_batch( &mut tester, @@ -575,8 +577,8 @@ async fn skipped_l1_batch_at_the_start(connection_pool: ConnectionPool) -> anyho .await; execute_l1_batches(&mut tester, vec![second_l1_batch.clone()], true).await; - let third_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(3)).await; - let fourth_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(4)).await; + let third_l1_batch = insert_l1_batch(&tester, L1BatchNumber(3)).await; + let fourth_l1_batch = insert_l1_batch(&tester, L1BatchNumber(4)).await; // DO NOT CONFIRM THIRD BLOCK let third_l1_batch_commit_tx_hash = commit_l1_batch( &mut tester, @@ -632,9 +634,9 @@ async fn skipped_l1_batch_at_the_start(connection_pool: ConnectionPool) -> anyho async fn skipped_l1_batch_in_the_middle(connection_pool: ConnectionPool) -> anyhow::Result<()> { let mut tester = EthSenderTester::new(connection_pool, vec![100; 100], true).await; insert_genesis_protocol_version(&tester).await; - let genesis_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(0)).await; - let first_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(1)).await; - let second_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(2)).await; + let genesis_l1_batch = insert_l1_batch(&tester, L1BatchNumber(0)).await; + let first_l1_batch = insert_l1_batch(&tester, L1BatchNumber(1)).await; + let second_l1_batch = insert_l1_batch(&tester, L1BatchNumber(2)).await; commit_l1_batch( &mut tester, genesis_l1_batch.clone(), @@ -659,8 +661,8 @@ async fn skipped_l1_batch_in_the_middle(connection_pool: ConnectionPool) -> anyh ) .await; - let third_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(3)).await; - let fourth_l1_batch = insert_l1_batch(&mut tester, L1BatchNumber(4)).await; + let third_l1_batch = insert_l1_batch(&tester, L1BatchNumber(3)).await; + let fourth_l1_batch = insert_l1_batch(&tester, L1BatchNumber(4)).await; // DO NOT CONFIRM THIRD BLOCK let third_l1_batch_commit_tx_hash = commit_l1_batch( &mut tester, @@ -809,7 +811,7 @@ async fn insert_genesis_protocol_version(tester: &EthSenderTester) { .await; } -async fn insert_l1_batch(tester: &mut EthSenderTester, number: L1BatchNumber) -> L1BatchHeader { +async fn insert_l1_batch(tester: &EthSenderTester, number: L1BatchNumber) -> L1BatchHeader { let mut header = L1BatchHeader::new( number, 0, @@ -824,7 +826,7 @@ async fn insert_l1_batch(tester: &mut EthSenderTester, number: L1BatchNumber) -> .storage() .await .blocks_dal() - .insert_l1_batch(&header, &[], Default::default()) + .insert_l1_batch(&header, &[], Default::default(), &[]) .await .unwrap(); tester diff --git a/core/lib/zksync_core/src/eth_watch/tests.rs b/core/lib/zksync_core/src/eth_watch/tests.rs index 32d3837fecc..d9448efbfab 100644 --- a/core/lib/zksync_core/src/eth_watch/tests.rs +++ b/core/lib/zksync_core/src/eth_watch/tests.rs @@ -40,7 +40,7 @@ impl FakeEthClientData { let eth_block = transaction.eth_block(); self.transactions .entry(eth_block.0 as u64) - .or_insert_with(Vec::new) + .or_default() .push(tx_into_log(transaction.clone())); } } @@ -49,7 +49,7 @@ impl FakeEthClientData { for (upgrade, eth_block) in upgrades { self.upgrades .entry(*eth_block) - .or_insert_with(Vec::new) + .or_default() .push(upgrade_into_log(upgrade.clone(), *eth_block)); } } diff --git a/core/lib/zksync_core/src/genesis.rs b/core/lib/zksync_core/src/genesis.rs index ccc9e949d2d..4fe31352e4b 100644 --- a/core/lib/zksync_core/src/genesis.rs +++ b/core/lib/zksync_core/src/genesis.rs @@ -292,7 +292,7 @@ pub(crate) async fn create_genesis_l1_batch( .await; transaction .blocks_dal() - .insert_l1_batch(&genesis_l1_batch_header, &[], BlockGasCount::default()) + .insert_l1_batch(&genesis_l1_batch_header, &[], BlockGasCount::default(), &[]) .await .unwrap(); transaction @@ -360,6 +360,8 @@ pub(crate) async fn save_genesis_l1_batch_metadata( aux_data_hash: commitment_hash.aux_output, meta_parameters_hash: commitment_hash.meta_parameters, pass_through_data_hash: commitment_hash.pass_through_data, + events_queue_commitment: None, + bootloader_initial_content_commitment: None, }; storage .blocks_dal() diff --git a/core/lib/zksync_core/src/metadata_calculator/helpers.rs b/core/lib/zksync_core/src/metadata_calculator/helpers.rs index 26707c73117..29e4e840c40 100644 --- a/core/lib/zksync_core/src/metadata_calculator/helpers.rs +++ b/core/lib/zksync_core/src/metadata_calculator/helpers.rs @@ -230,11 +230,12 @@ impl L1BatchWithLogs { // since no new leaf indices are allocated in the tree for them, such writes are no-op on the tree side as well. let hashed_keys_for_zero_values: Vec<_> = touched_slots .iter() - .filter_map(|(key, value)| { + .filter(|(_, value)| { // Only zero values are worth checking for initial writes; non-zero values are always // written per deduplication rules. - value.is_zero().then(|| key.hashed_key()) + value.is_zero() }) + .map(|(key, _value)| key.hashed_key()) .collect(); metrics::histogram!( "server.metadata_calculator.load_changes.zero_values", diff --git a/core/lib/zksync_core/src/metadata_calculator/metrics.rs b/core/lib/zksync_core/src/metadata_calculator/metrics.rs index 8b7477472f5..970d3868252 100644 --- a/core/lib/zksync_core/src/metadata_calculator/metrics.rs +++ b/core/lib/zksync_core/src/metadata_calculator/metrics.rs @@ -29,7 +29,10 @@ pub(super) trait ReportStage: Copy { pub(super) enum TreeUpdateStage { LoadChanges, Compute, - PrepareResults, + CheckConsistency, + EventsCommitment, + BootloaderCommitment, + BuildMetadata, ReestimateGasCost, SavePostgres, SaveRocksDB, @@ -44,7 +47,10 @@ impl ReportStage for TreeUpdateStage { match self { Self::LoadChanges => "load_changes", Self::Compute => "compute", - Self::PrepareResults => "prepare_results", + Self::CheckConsistency => "check_consistency", + Self::EventsCommitment => "events_commitment", + Self::BootloaderCommitment => "bootloader_commitment", + Self::BuildMetadata => "build_metadata", Self::ReestimateGasCost => "reestimate_block_commit_gas_cost", Self::SavePostgres => "save_postgres", Self::SaveRocksDB => "save_rocksdb", diff --git a/core/lib/zksync_core/src/metadata_calculator/mod.rs b/core/lib/zksync_core/src/metadata_calculator/mod.rs index 02a0ba1082b..436384d6ebc 100644 --- a/core/lib/zksync_core/src/metadata_calculator/mod.rs +++ b/core/lib/zksync_core/src/metadata_calculator/mod.rs @@ -16,6 +16,7 @@ use zksync_object_store::ObjectStoreFactory; use zksync_types::{ block::L1BatchHeader, commitment::{L1BatchCommitment, L1BatchMetadata}, + H256, }; mod helpers; @@ -167,6 +168,8 @@ impl MetadataCalculator { fn build_l1_batch_metadata( tree_metadata: TreeMetadata, header: &L1BatchHeader, + events_queue_commitment: Option, + bootloader_initial_content_commitment: Option, ) -> L1BatchMetadata { let merkle_root_hash = tree_metadata.root_hash; @@ -195,6 +198,8 @@ impl MetadataCalculator { aux_data_hash: commitment_hash.aux_output, meta_parameters_hash: commitment_hash.meta_parameters, pass_through_data_hash: commitment_hash.pass_through_data, + events_queue_commitment, + bootloader_initial_content_commitment, }; tracing::trace!("L1 batch metadata: {metadata:?}"); diff --git a/core/lib/zksync_core/src/metadata_calculator/tests.rs b/core/lib/zksync_core/src/metadata_calculator/tests.rs index 269b48f2820..fa8df01d909 100644 --- a/core/lib/zksync_core/src/metadata_calculator/tests.rs +++ b/core/lib/zksync_core/src/metadata_calculator/tests.rs @@ -282,7 +282,7 @@ async fn test_postgres_backup_recovery( // Re-insert the last batch without metadata immediately. storage .blocks_dal() - .insert_l1_batch(batch_without_metadata, &[], BlockGasCount::default()) + .insert_l1_batch(batch_without_metadata, &[], BlockGasCount::default(), &[]) .await .unwrap(); insert_initial_writes_for_batch(&mut storage, batch_without_metadata.number).await; @@ -307,7 +307,7 @@ async fn test_postgres_backup_recovery( for batch_header in &removed_batches { storage .blocks_dal() - .insert_l1_batch(batch_header, &[], BlockGasCount::default()) + .insert_l1_batch(batch_header, &[], BlockGasCount::default(), &[]) .await .unwrap(); insert_initial_writes_for_batch(&mut storage, batch_header.number).await; @@ -520,7 +520,7 @@ pub(super) async fn extend_db_state( storage .blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default()) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[]) .await .unwrap(); storage diff --git a/core/lib/zksync_core/src/metadata_calculator/updater.rs b/core/lib/zksync_core/src/metadata_calculator/updater.rs index 07f7d195de7..7588ca14027 100644 --- a/core/lib/zksync_core/src/metadata_calculator/updater.rs +++ b/core/lib/zksync_core/src/metadata_calculator/updater.rs @@ -5,18 +5,22 @@ use tokio::sync::watch; use std::{ops, time::Instant}; +use zkevm_test_harness::witness::utils::{ + events_queue_commitment_fixed, initial_heap_content_commitment_fixed, +}; use zksync_config::configs::database::MerkleTreeMode; use zksync_dal::{ConnectionPool, StorageProcessor}; use zksync_health_check::HealthUpdater; use zksync_merkle_tree::domain::TreeMetadata; use zksync_object_store::ObjectStore; -use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, U256}; +use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, H256, U256}; use super::{ helpers::{AsyncTree, Delayer, L1BatchWithLogs, TreeHealthCheckDetails}, metrics::{ReportStage, TreeUpdateStage}, MetadataCalculator, MetadataCalculatorConfig, }; +use crate::witness_generator::utils::expand_bootloader_contents; #[derive(Debug)] pub(super) struct TreeUpdater { @@ -133,15 +137,57 @@ impl TreeUpdater { let ((header, metadata, object_key), next_l1_batch_data) = future::join(process_l1_batch_task, load_next_l1_batch_task).await; - let prepare_results_latency = TreeUpdateStage::PrepareResults.start(); + let check_consistency_latency = TreeUpdateStage::CheckConsistency.start(); Self::check_initial_writes_consistency( storage, header.number, &metadata.initial_writes, ) .await; - let metadata = MetadataCalculator::build_l1_batch_metadata(metadata, &header); - prepare_results_latency.report(); + check_consistency_latency.report(); + + let (events_queue_commitment, bootloader_initial_content_commitment) = if self.mode + == MerkleTreeMode::Full + { + let events_queue_commitment_latency = TreeUpdateStage::EventsCommitment.start(); + let events_queue = storage + .blocks_dal() + .get_events_queue(header.number) + .await + .unwrap() + .unwrap(); + let events_queue_commitment = events_queue_commitment_fixed(&events_queue); + events_queue_commitment_latency.report(); + + let bootloader_commitment_latency = TreeUpdateStage::BootloaderCommitment.start(); + let initial_bootloader_contents = storage + .blocks_dal() + .get_initial_bootloader_heap(header.number) + .await + .unwrap() + .unwrap(); + let full_bootloader_memory = + expand_bootloader_contents(&initial_bootloader_contents); + let bootloader_initial_content_commitment = + initial_heap_content_commitment_fixed(&full_bootloader_memory); + bootloader_commitment_latency.report(); + + ( + Some(H256(events_queue_commitment)), + Some(H256(bootloader_initial_content_commitment)), + ) + } else { + (None, None) + }; + + let build_metadata_latency = TreeUpdateStage::BuildMetadata.start(); + let metadata = MetadataCalculator::build_l1_batch_metadata( + metadata, + &header, + events_queue_commitment, + bootloader_initial_content_commitment, + ); + build_metadata_latency.report(); MetadataCalculator::reestimate_l1_batch_commit_gas(storage, &header, &metadata).await; diff --git a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs index f3802960493..8a3cdacce84 100644 --- a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs +++ b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs @@ -210,12 +210,14 @@ impl UpdatesManager { let initial_bootloader_contents = finished_batch.final_bootloader_memory.unwrap_or_default(); + let events_queue = Vec::new(); // TODO: put actual value when new VM is merged. transaction .blocks_dal() .insert_l1_batch( &l1_batch, &initial_bootloader_contents, self.l1_batch.l1_gas_count, + &events_queue, ) .await .unwrap(); diff --git a/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs b/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs index fb9ec33c54b..92b54950e5b 100644 --- a/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs +++ b/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs @@ -160,7 +160,7 @@ impl Tester { let mut storage = pool.access_storage_tagged("state_keeper").await.unwrap(); storage .blocks_dal() - .insert_l1_batch(&batch_header, &[], Default::default()) + .insert_l1_batch(&batch_header, &[], Default::default(), &[]) .await .unwrap(); storage diff --git a/core/lib/zksync_core/src/state_keeper/tests/mod.rs b/core/lib/zksync_core/src/state_keeper/tests/mod.rs index d269b1fea67..f29c3874d72 100644 --- a/core/lib/zksync_core/src/state_keeper/tests/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/tests/mod.rs @@ -102,6 +102,8 @@ pub(super) fn create_l1_batch_metadata(number: u32) -> L1BatchMetadata { aux_data_hash: H256::zero(), meta_parameters_hash: H256::zero(), pass_through_data_hash: H256::zero(), + events_queue_commitment: Some(H256::zero()), + bootloader_initial_content_commitment: Some(H256::zero()), } } diff --git a/core/lib/zksync_core/src/witness_generator/mod.rs b/core/lib/zksync_core/src/witness_generator/mod.rs index 4700318d5b3..f2de579691b 100644 --- a/core/lib/zksync_core/src/witness_generator/mod.rs +++ b/core/lib/zksync_core/src/witness_generator/mod.rs @@ -5,7 +5,7 @@ use zksync_types::proofs::AggregationRound; // use crate::witness_generator::basic_circuits; mod precalculated_merkle_paths_provider; -mod utils; +pub(crate) mod utils; pub mod basic_circuits; pub mod leaf_aggregation; diff --git a/core/lib/zksync_core/src/witness_generator/utils.rs b/core/lib/zksync_core/src/witness_generator/utils.rs index c457e3c4483..f0083f39468 100644 --- a/core/lib/zksync_core/src/witness_generator/utils.rs +++ b/core/lib/zksync_core/src/witness_generator/utils.rs @@ -6,8 +6,7 @@ use zksync_types::{proofs::AggregationRound, L1BatchNumber}; use zksync_types::{U256, USED_BOOTLOADER_MEMORY_BYTES}; pub fn expand_bootloader_contents(packed: &[(usize, U256)]) -> Vec { - let mut result: Vec = Vec::new(); - result.resize(USED_BOOTLOADER_MEMORY_BYTES, 0); + let mut result: Vec = vec![0; USED_BOOTLOADER_MEMORY_BYTES]; for (offset, value) in packed { value.to_big_endian(&mut result[(offset * 32)..(offset + 1) * 32]); diff --git a/core/multivm_deps/vm_1_3_2/src/oracles/tracer/call.rs b/core/multivm_deps/vm_1_3_2/src/oracles/tracer/call.rs index 24c61bc50b4..5e0e1bbd22d 100644 --- a/core/multivm_deps/vm_1_3_2/src/oracles/tracer/call.rs +++ b/core/multivm_deps/vm_1_3_2/src/oracles/tracer/call.rs @@ -302,7 +302,6 @@ mod tests { assert_eq!(filtered_call.len(), 1); assert_eq!(filtered_call[0].calls.len(), 2); - let mut near_call = near_call; near_call.calls = vec![Call::default(), Call::default(), near_call.clone()]; call.calls = vec![Call::default(), Call::default(), near_call]; let filtered_call = filter_near_call(call); diff --git a/core/multivm_deps/vm_m6/src/oracles/tracer/call.rs b/core/multivm_deps/vm_m6/src/oracles/tracer/call.rs index fc345a64e48..8ca67145072 100644 --- a/core/multivm_deps/vm_m6/src/oracles/tracer/call.rs +++ b/core/multivm_deps/vm_m6/src/oracles/tracer/call.rs @@ -306,7 +306,6 @@ mod tests { assert_eq!(filtered_call.len(), 1); assert_eq!(filtered_call[0].calls.len(), 2); - let mut near_call = near_call; near_call.calls = vec![Call::default(), Call::default(), near_call.clone()]; call.calls = vec![Call::default(), Call::default(), near_call]; let filtered_call = filter_near_call(call); diff --git a/core/tests/cross_external_nodes_checker/src/checker.rs b/core/tests/cross_external_nodes_checker/src/checker.rs index 049553612bc..61421816c60 100644 --- a/core/tests/cross_external_nodes_checker/src/checker.rs +++ b/core/tests/cross_external_nodes_checker/src/checker.rs @@ -472,10 +472,7 @@ impl Checker { match self.mode { RpcMode::Triggered => { // Add a divergence to the list of divergences for the given EN instance. - let divergences = self - .divergences - .entry(url.to_string()) - .or_insert_with(Vec::new); + let divergences = self.divergences.entry(url.to_string()).or_default(); divergences.push(divergence.clone()); tracing::error!("{}", divergence); } diff --git a/docker/contract-verifier/Dockerfile b/docker/contract-verifier/Dockerfile index 69e3a0a7df0..86753869895 100644 --- a/docker/contract-verifier/Dockerfile +++ b/docker/contract-verifier/Dockerfile @@ -1,8 +1,18 @@ -# Will work locally only after building contracts first +# syntax=docker/dockerfile:experimental +FROM debian:bookworm-slim as builder -FROM rust:1.72-bookworm as builder +RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \ + pkg-config build-essential libclang-dev && \ + rm -rf /var/lib/apt/lists/* + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ + rustup install nightly-2023-07-21 && \ + rustup default nightly-2023-07-21 -RUN apt-get update && apt-get install -y clang && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/zksync COPY . . diff --git a/docker/cross-external-nodes-checker/Dockerfile b/docker/cross-external-nodes-checker/Dockerfile index 301f67e8b0a..40837169402 100644 --- a/docker/cross-external-nodes-checker/Dockerfile +++ b/docker/cross-external-nodes-checker/Dockerfile @@ -1,6 +1,17 @@ -FROM rust:1.72-bookworm as builder +# syntax=docker/dockerfile:experimental +FROM debian:bookworm-slim as builder -RUN apt-get update && apt-get install -y clang && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \ + pkg-config build-essential libclang-dev && \ + rm -rf /var/lib/apt/lists/* + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ + rustup install nightly-2023-07-21 && \ + rustup default nightly-2023-07-21 WORKDIR /usr/src/zksync COPY . . diff --git a/docker/external-node/Dockerfile b/docker/external-node/Dockerfile index 60375216ba0..c3152b0ddf8 100644 --- a/docker/external-node/Dockerfile +++ b/docker/external-node/Dockerfile @@ -1,8 +1,18 @@ # Will work locally only after prior contracts build +# syntax=docker/dockerfile:experimental +FROM debian:bookworm-slim as builder -FROM rust:1.72-bookworm as builder +RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \ + pkg-config build-essential libclang-dev && \ + rm -rf /var/lib/apt/lists/* -RUN apt-get update && apt-get install -y clang && rm -rf /var/lib/apt/lists/* +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ + rustup install nightly-2023-07-21 && \ + rustup default nightly-2023-07-21 WORKDIR /usr/src/zksync COPY . . diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index 074e2e306ec..23402dc0833 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -1,10 +1,22 @@ # Will work locally only after prior contracts build +# syntax=docker/dockerfile:experimental +FROM debian:bookworm-slim as builder -FROM rust:1.72-bookworm as builder +WORKDIR /usr/src/zksync +COPY . . -RUN apt-get update && apt-get install -y linux-libc-dev liburing-dev clang && \ +RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \ + pkg-config build-essential libclang-dev linux-libc-dev liburing-dev && \ rm -rf /var/lib/apt/lists/* +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ + rustup install nightly-2023-07-21 && \ + rustup default nightly-2023-07-21 + WORKDIR /usr/src/zksync COPY . . diff --git a/rust-toolchain b/rust-toolchain index 22d6771a47d..9a87fb21ccf 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.72.1 +nightly-2023-08-21 From 50a64066fe06accf4738aa63d97c9f410ec4434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cperekopskiy=E2=80=9D?= Date: Mon, 16 Oct 2023 12:34:27 +0300 Subject: [PATCH 2/6] Remove FK --- .../migrations/20231013085524_boojum-block-commitments.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql index f349794d18e..392e6760643 100644 --- a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql @@ -4,6 +4,6 @@ ALTER TABLE l1_batches ADD COLUMN IF NOT EXISTS bootloader_initial_content_commitment BYTEA; CREATE TABLE IF NOT EXISTS events_queue ( - l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches (number), + l1_batch_number BIGINT PRIMARY KEY, serialized_events_queue JSONB NOT NULL ); From d43204c319a395fd865193e1b24294260689e9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cperekopskiy=E2=80=9D?= Date: Mon, 16 Oct 2023 13:18:01 +0300 Subject: [PATCH 3/6] Delete events cascade --- .../migrations/20231013085524_boojum-block-commitments.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql index 392e6760643..1dd44f184dc 100644 --- a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql @@ -4,6 +4,6 @@ ALTER TABLE l1_batches ADD COLUMN IF NOT EXISTS bootloader_initial_content_commitment BYTEA; CREATE TABLE IF NOT EXISTS events_queue ( - l1_batch_number BIGINT PRIMARY KEY, + l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches(number) ON DELETE CASCADE, serialized_events_queue JSONB NOT NULL ); From 6949fd309e3e36bd85d33147fe58fce98c523fb6 Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:41:08 +0300 Subject: [PATCH 4/6] Update core/lib/zksync_core/src/metadata_calculator/helpers.rs Co-authored-by: Stanislav Bezkorovainyi --- core/lib/zksync_core/src/metadata_calculator/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/zksync_core/src/metadata_calculator/helpers.rs b/core/lib/zksync_core/src/metadata_calculator/helpers.rs index 71449f29fa2..3d7246d78c5 100644 --- a/core/lib/zksync_core/src/metadata_calculator/helpers.rs +++ b/core/lib/zksync_core/src/metadata_calculator/helpers.rs @@ -236,7 +236,7 @@ impl L1BatchWithLogs { // written per deduplication rules. value.is_zero() }) - .map(|(key, _value)| key.hashed_key()) + .map(|(key, _)| key.hashed_key()) .collect(); METRICS .load_changes_zero_values From 23d8ffec4eb5b6baeceea8d1fc2dc2cd264ea5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cperekopskiy=E2=80=9D?= Date: Mon, 16 Oct 2023 17:42:13 +0300 Subject: [PATCH 5/6] `commitment_utils` lib --- Cargo.lock | 11 +- Cargo.toml | 1 + core/lib/commitment_utils/Cargo.toml | 15 + core/lib/commitment_utils/src/lib.rs | 34 + ...13085524_boojum-block-commitments.down.sql | 6 +- ...1013085524_boojum-block-commitments.up.sql | 9 +- core/lib/dal/sqlx-data.json | 4364 +++++++++-------- core/lib/dal/src/blocks_dal.rs | 33 +- core/lib/dal/src/models/storage_block.rs | 2 +- core/lib/utils/src/misc.rs | 10 + core/lib/zksync_core/Cargo.toml | 3 +- .../src/metadata_calculator/updater.rs | 77 +- .../src/witness_generator/basic_circuits.rs | 10 +- .../zksync_core/src/witness_generator/mod.rs | 2 +- .../src/witness_generator/utils.rs | 11 - 15 files changed, 2337 insertions(+), 2251 deletions(-) create mode 100644 core/lib/commitment_utils/Cargo.toml create mode 100644 core/lib/commitment_utils/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 111c573f248..c478fb95bcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7996,6 +7996,15 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_commitment_utils" +version = "0.1.0" +dependencies = [ + "zkevm_test_harness 1.4.0", + "zksync_types", + "zksync_utils", +] + [[package]] name = "zksync_config" version = "0.1.0" @@ -8101,8 +8110,8 @@ dependencies = [ "vise", "vlog", "vm", - "zkevm_test_harness 1.4.0", "zksync_circuit_breaker", + "zksync_commitment_utils", "zksync_config", "zksync_contracts", "zksync_dal", diff --git a/Cargo.toml b/Cargo.toml index 9211084819d..49039476132 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ members = [ "core/lib/contracts", "core/lib/crypto", "core/lib/circuit_breaker", + "core/lib/commitment_utils", "core/lib/dal", "core/lib/db_test_macro", "core/lib/eth_client", diff --git a/core/lib/commitment_utils/Cargo.toml b/core/lib/commitment_utils/Cargo.toml new file mode 100644 index 00000000000..801f90ea0f2 --- /dev/null +++ b/core/lib/commitment_utils/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "zksync_commitment_utils" +version = "0.1.0" +edition = "2018" +authors = ["The Matter Labs Team "] +homepage = "https://zksync.io/" +repository = "https://github.com/matter-labs/zksync-era" +license = "MIT OR Apache-2.0" +keywords = ["blockchain", "zksync"] +categories = ["cryptography"] + +[dependencies] +zksync_types = { path = "../../lib/types" } +zksync_utils = { path = "../../lib/utils" } +zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0" } diff --git a/core/lib/commitment_utils/src/lib.rs b/core/lib/commitment_utils/src/lib.rs new file mode 100644 index 00000000000..c99332009d2 --- /dev/null +++ b/core/lib/commitment_utils/src/lib.rs @@ -0,0 +1,34 @@ +//! Utils for commitment calculation. +use zkevm_test_harness::witness::utils::{ + events_queue_commitment_fixed, initial_heap_content_commitment_fixed, +}; +use zksync_types::{LogQuery, ProtocolVersionId, H256, U256, USED_BOOTLOADER_MEMORY_BYTES}; +use zksync_utils::expand_memory_contents; + +pub fn events_queue_commitment( + events_queue: &Vec, + protocol_version: ProtocolVersionId, +) -> Option { + match protocol_version { + id if id < ProtocolVersionId::Version17 => None, + ProtocolVersionId::Version17 => Some(H256(events_queue_commitment_fixed(events_queue))), + id => unimplemented!("events_queue_commitment is not implemented for {id:?}"), + } +} + +pub fn bootloader_initial_content_commitment( + initial_bootloader_contents: &[(usize, U256)], + protocol_version: ProtocolVersionId, +) -> Option { + match protocol_version { + id if id < ProtocolVersionId::Version17 => None, + ProtocolVersionId::Version17 => { + let full_bootloader_memory = + expand_memory_contents(initial_bootloader_contents, USED_BOOTLOADER_MEMORY_BYTES); + Some(H256(initial_heap_content_commitment_fixed( + &full_bootloader_memory, + ))) + } + id => unimplemented!("events_queue_commitment is not implemented for {id:?}"), + } +} diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql index 7dd14f5f797..7d7b59063f6 100644 --- a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.down.sql @@ -1,6 +1,2 @@ -ALTER TABLE l1_batches - DROP COLUMN IF EXISTS events_queue_commitment; -ALTER TABLE l1_batches - DROP COLUMN IF EXISTS bootloader_initial_content_commitment; - +DROP TABLE IF EXISTS commitments; DROP TABLE IF EXISTS events_queue; diff --git a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql index 1dd44f184dc..f704bd3eee3 100644 --- a/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql +++ b/core/lib/dal/migrations/20231013085524_boojum-block-commitments.up.sql @@ -1,7 +1,8 @@ -ALTER TABLE l1_batches - ADD COLUMN IF NOT EXISTS events_queue_commitment BYTEA; -ALTER TABLE l1_batches - ADD COLUMN IF NOT EXISTS bootloader_initial_content_commitment BYTEA; +CREATE TABLE IF NOT EXISTS commitments ( + l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches(number) ON DELETE CASCADE, + events_queue_commitment BYTEA, + bootloader_initial_content_commitment BYTEA +); CREATE TABLE IF NOT EXISTS events_queue ( l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches(number) ON DELETE CASCADE, diff --git a/core/lib/dal/sqlx-data.json b/core/lib/dal/sqlx-data.json index 217c5b63dcb..9e67a374002 100644 --- a/core/lib/dal/sqlx-data.json +++ b/core/lib/dal/sqlx-data.json @@ -272,243 +272,6 @@ }, "query": "UPDATE eth_txs\n SET confirmed_eth_tx_history_id = $1\n WHERE id = $2" }, - "0bb61f02c7961c783b7cfacdf9817e8808caa2e0a93aa0782e6e7b932d664e62": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" - }, - { - "name": "events_queue_commitment", - "ordinal": 35, - "type_info": "Bytea" - }, - { - "name": "bootloader_initial_content_commitment", - "ordinal": 36, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true, - true, - true - ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - } - }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM (SELECT l1_batches.*, row_number() OVER (ORDER BY number ASC) AS row_number FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND l1_batches.skip_proof = TRUE AND l1_batches.number > $1 ORDER BY number LIMIT $2) inn WHERE number - row_number = $1" - }, "0c212f47b9a0e719f947a419be8284837b1b01aa23994ba6401b420790b802b8": { "describe": { "columns": [], @@ -582,48 +345,21 @@ }, "query": "SELECT MAX(number) as \"number\" FROM l1_batches WHERE is_finished = TRUE" }, - "0dc16c4de6dfdc12f12635d3090c98a6326228d40dc40d42486fd9d076f22730": { + "0e001ef507253b4fd3a87e379c8f2e63fa41250b1a396d81697de2b7ea71215e": { "describe": { - "columns": [], - "nullable": [], + "columns": [ + { + "name": "count!", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + null + ], "parameters": { "Left": [ - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bool", - "Bytea", - "Int8", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Int8" - ] - } - }, - "query": "UPDATE l1_batches SET hash = $1, merkle_root_hash = $2, commitment = $3, compressed_repeated_writes = $4, compressed_initial_writes = $5, l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, events_queue_commitment = $14, bootloader_initial_content_commitment = $15,\n updated_at = now() WHERE number = $16 AND hash IS NULL" - }, - "0e001ef507253b4fd3a87e379c8f2e63fa41250b1a396d81697de2b7ea71215e": { - "describe": { - "columns": [ - { - "name": "count!", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Int8", + "Int8", "Bytea", "Bytea", "Bytea", @@ -2826,13 +2562,13 @@ }, "query": "SELECT MAX(number) as \"number\" FROM miniblocks" }, - "345bff6a5a418cc2cc3bed6960a89ebeccdbc715c6189d29331f4e7740ea3ab5": { + "357347157ed8ff19d223c54533c3a85bd7e64a37514d657f8d49bd6eb5be1806": { "describe": { "columns": [ { - "name": "number", + "name": "id", "ordinal": 0, - "type_info": "Int8" + "type_info": "Int4" }, { "name": "timestamp", @@ -2840,179 +2576,49 @@ "type_info": "Int8" }, { - "name": "is_finished", + "name": "recursion_scheduler_level_vk_hash", "ordinal": 2, - "type_info": "Bool" + "type_info": "Bytea" }, { - "name": "l1_tx_count", + "name": "recursion_node_level_vk_hash", "ordinal": 3, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "l2_tx_count", + "name": "recursion_leaf_level_vk_hash", "ordinal": 4, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "fee_account_address", + "name": "recursion_circuits_set_vks_hash", "ordinal": 5, "type_info": "Bytea" }, { - "name": "bloom", + "name": "bootloader_code_hash", "ordinal": 6, "type_info": "Bytea" }, { - "name": "priority_ops_onchain_data", + "name": "default_account_code_hash", "ordinal": 7, - "type_info": "ByteaArray" + "type_info": "Bytea" }, { - "name": "hash", + "name": "verifier_address", "ordinal": 8, "type_info": "Bytea" }, { - "name": "parent_hash", + "name": "upgrade_tx_hash", "ordinal": 9, "type_info": "Bytea" }, { - "name": "commitment", + "name": "created_at", "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" - }, - { - "name": "events_queue_commitment", - "ordinal": 35, - "type_info": "Bytea" - }, - { - "name": "bootloader_initial_content_commitment", - "ordinal": 36, - "type_info": "Bytea" + "type_info": "Timestamp" } ], "nullable": [ @@ -3024,34 +2630,38 @@ false, false, false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, false, true, - true, - true, - true, + false + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT * FROM protocol_versions ORDER BY id DESC LIMIT 1" + }, + "36c483775b604324eacd7e5aac591b927cc32abb89fe1b0c5cf4b0383e9bd443": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "leaf_layer_subqueues_blob_url", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "aggregation_outputs_blob_url", + "ordinal": 2, + "type_info": "Text" + } + ], + "nullable": [ false, true, - true, - true, - true, - true, true ], "parameters": { @@ -3060,123 +2670,13 @@ ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND eth_prove_tx_id IS NULL ORDER BY number LIMIT $1" + "query": "\n SELECT l1_batch_number, leaf_layer_subqueues_blob_url, aggregation_outputs_blob_url FROM node_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND leaf_layer_subqueues_blob_url is NOT NULL\n AND aggregation_outputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " }, - "357347157ed8ff19d223c54533c3a85bd7e64a37514d657f8d49bd6eb5be1806": { + "37e4a0eea7b72bd3b75c26e003f3fa62039d9b614f0f2fa3d61e8c5e95f002fd": { "describe": { "columns": [ { - "name": "id", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "recursion_scheduler_level_vk_hash", - "ordinal": 2, - "type_info": "Bytea" - }, - { - "name": "recursion_node_level_vk_hash", - "ordinal": 3, - "type_info": "Bytea" - }, - { - "name": "recursion_leaf_level_vk_hash", - "ordinal": 4, - "type_info": "Bytea" - }, - { - "name": "recursion_circuits_set_vks_hash", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bootloader_code_hash", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "default_account_code_hash", - "ordinal": 7, - "type_info": "Bytea" - }, - { - "name": "verifier_address", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "upgrade_tx_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "created_at", - "ordinal": 10, - "type_info": "Timestamp" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - false - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT * FROM protocol_versions ORDER BY id DESC LIMIT 1" - }, - "36c483775b604324eacd7e5aac591b927cc32abb89fe1b0c5cf4b0383e9bd443": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "leaf_layer_subqueues_blob_url", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "aggregation_outputs_blob_url", - "ordinal": 2, - "type_info": "Text" - } - ], - "nullable": [ - false, - true, - true - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "\n SELECT l1_batch_number, leaf_layer_subqueues_blob_url, aggregation_outputs_blob_url FROM node_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND leaf_layer_subqueues_blob_url is NOT NULL\n AND aggregation_outputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " - }, - "37e4a0eea7b72bd3b75c26e003f3fa62039d9b614f0f2fa3d61e8c5e95f002fd": { - "describe": { - "columns": [ - { - "name": "max?", + "name": "max?", "ordinal": 0, "type_info": "Int8" } @@ -3582,150 +3082,13 @@ }, "query": "\n UPDATE scheduler_witness_jobs\n SET final_node_aggregations_blob_url = $2,\n status = 'waiting_for_proofs',\n updated_at = now()\n WHERE l1_batch_number = $1 AND status != 'queued'\n " }, - "433d5da4d72150cf2c1e1007ee3ff51edfa51924f4b662b8cf382f06e60fd228": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int4", - "Int8", - "Text", - "Text" - ] - } - }, - "query": "\n UPDATE node_aggregation_witness_jobs\n SET number_of_leaf_circuits = $1,\n leaf_layer_subqueues_blob_url = $3,\n aggregation_outputs_blob_url = $4,\n status = 'waiting_for_proofs',\n updated_at = now()\n WHERE l1_batch_number = $2 AND status != 'queued'\n " - }, - "43b5082ff7673ee3a8e8f3fafa64667fac4f7f5c8bd26a21ead6b4ba0f8fd17b": { - "describe": { - "columns": [ - { - "name": "hash", - "ordinal": 0, - "type_info": "Bytea" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "SELECT hash FROM miniblocks WHERE number = $1" - }, - "448d283cab6ae334de9676f69416974656d11563b58e0188d53ca9e0995dd287": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8Array" - ] - } - }, - "query": "\n UPDATE scheduler_dependency_tracker_fri\n SET status='queued'\n WHERE l1_batch_number = ANY($1)\n " - }, - "4588d998b3454d8210190c6b16116b5885f6f3e74606aec8250e6c1e8f55d242": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [] - } - }, - "query": "VACUUM storage_logs" - }, - "4ab8a25620b5400d836e1b847320d4e176629a27e1a6cb0666ab02bb55371769": { - "describe": { - "columns": [ - { - "name": "hash", - "ordinal": 0, - "type_info": "Bytea" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Interval" - ] - } - }, - "query": "DELETE FROM transactions WHERE miniblock_number IS NULL AND received_at < now() - $1::interval AND is_priority=false AND error IS NULL RETURNING hash" - }, - "4ac212a08324b9d4c3febc585109f19105b4d20aa3e290352e3c63d7ec58c5b2": { - "describe": { - "columns": [ - { - "name": "l2_address", - "ordinal": 0, - "type_info": "Bytea" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT l2_address FROM tokens" - }, - "4ac92a8436108097a32e94e53f7fe99261c7c3a40dbc433c20ccea3a7d06650c": { - "describe": { - "columns": [ - { - "name": "hashed_key", - "ordinal": 0, - "type_info": "Bytea" - }, - { - "name": "value!", - "ordinal": 1, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "ByteaArray" - ] - } - }, - "query": "SELECT hashed_key, value as \"value!\" FROM storage WHERE hashed_key = ANY($1)" - }, - "4aef34fb19a07dbfe2be09024d6c7fc2033a8e1570cc7f002a5c78317ff8ff3f": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Int2", - "Text", - "Int4", - "Int4" - ] - } - }, - "query": "\n INSERT INTO leaf_aggregation_witness_jobs_fri\n (l1_batch_number, circuit_id, closed_form_inputs_blob_url, number_of_basic_circuits, protocol_version, status, created_at, updated_at)\n VALUES ($1, $2, $3, $4, $5, 'waiting_for_proofs', now(), now())\n ON CONFLICT(l1_batch_number, circuit_id)\n DO UPDATE SET updated_at=now()\n " - }, - "4b8597a47c0724155ad9592dc32134523bcbca11c9d82763d1bebbe17479c7b4": { + "430ffa460ea553cb46c25ebaf1442229cc94f10fd642366e0f827b94f5c0b9f7": { "describe": { "columns": [ { - "name": "id", + "name": "number", "ordinal": 0, - "type_info": "Int4" + "type_info": "Int8" }, { "name": "timestamp", @@ -3733,49 +3096,179 @@ "type_info": "Int8" }, { - "name": "recursion_scheduler_level_vk_hash", + "name": "is_finished", "ordinal": 2, - "type_info": "Bytea" + "type_info": "Bool" }, { - "name": "recursion_node_level_vk_hash", + "name": "l1_tx_count", "ordinal": 3, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "recursion_leaf_level_vk_hash", + "name": "l2_tx_count", "ordinal": 4, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "recursion_circuits_set_vks_hash", + "name": "fee_account_address", "ordinal": 5, "type_info": "Bytea" }, { - "name": "bootloader_code_hash", + "name": "bloom", "ordinal": 6, "type_info": "Bytea" }, { - "name": "default_account_code_hash", + "name": "priority_ops_onchain_data", "ordinal": 7, - "type_info": "Bytea" + "type_info": "ByteaArray" }, { - "name": "verifier_address", + "name": "hash", "ordinal": 8, "type_info": "Bytea" }, { - "name": "upgrade_tx_hash", + "name": "parent_hash", "ordinal": 9, "type_info": "Bytea" }, { - "name": "created_at", + "name": "commitment", "ordinal": 10, - "type_info": "Timestamp" + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" } ], "nullable": [ @@ -3787,97 +3280,126 @@ false, false, false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, false, true, - false + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL ORDER BY number DESC LIMIT 1" + }, + "433d5da4d72150cf2c1e1007ee3ff51edfa51924f4b662b8cf382f06e60fd228": { + "describe": { + "columns": [], + "nullable": [], "parameters": { "Left": [ - "Int4" + "Int4", + "Int8", + "Text", + "Text" ] } }, - "query": "SELECT * FROM protocol_versions\n WHERE id = $1\n " + "query": "\n UPDATE node_aggregation_witness_jobs\n SET number_of_leaf_circuits = $1,\n leaf_layer_subqueues_blob_url = $3,\n aggregation_outputs_blob_url = $4,\n status = 'waiting_for_proofs',\n updated_at = now()\n WHERE l1_batch_number = $2 AND status != 'queued'\n " }, - "4bab972cbbd8b53237a840ba9307079705bd4b5270428d2b41f05ee3d2aa42af": { + "43b5082ff7673ee3a8e8f3fafa64667fac4f7f5c8bd26a21ead6b4ba0f8fd17b": { "describe": { "columns": [ { - "name": "l1_batch_number!", + "name": "hash", "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "circuit_type", - "ordinal": 1, - "type_info": "Text" + "type_info": "Bytea" } ], "nullable": [ - null, false ], "parameters": { - "Left": [] + "Left": [ + "Int8" + ] } }, - "query": "\n SELECT MIN(l1_batch_number) as \"l1_batch_number!\", circuit_type\n FROM prover_jobs\n WHERE aggregation_round = 0 AND (status = 'queued' OR status = 'in_progress'\n OR status = 'in_gpu_proof'\n OR status = 'failed')\n GROUP BY circuit_type\n " + "query": "SELECT hash FROM miniblocks WHERE number = $1" }, - "4c0d2aa6e08f3b4748b88cad5cf7b3a9eb9c051e8e8e747a3c38c1b37ce3a6b7": { + "448d283cab6ae334de9676f69416974656d11563b58e0188d53ca9e0995dd287": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ - "Int8" + "Int8Array" ] } }, - "query": "DELETE FROM l2_to_l1_logs WHERE miniblock_number > $1" + "query": "\n UPDATE scheduler_dependency_tracker_fri\n SET status='queued'\n WHERE l1_batch_number = ANY($1)\n " }, - "4c83881635e957872a435737392bfed829de58780887c9a0fa7921ea648296fb": { + "4588d998b3454d8210190c6b16116b5885f6f3e74606aec8250e6c1e8f55d242": { "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], + "columns": [], + "nullable": [], "parameters": { "Left": [] } }, - "query": "SELECT number FROM l1_batches WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL ORDER BY number LIMIT 1" + "query": "VACUUM storage_logs" }, - "4d2e106c809a48ace74952df2b883a5e747aaa1bc6bee28e986dccee7fa130b6": { + "4ab8a25620b5400d836e1b847320d4e176629a27e1a6cb0666ab02bb55371769": { "describe": { "columns": [ { - "name": "nonce", + "name": "hash", "ordinal": 0, - "type_info": "Int8" + "type_info": "Bytea" } ], "nullable": [ false ], "parameters": { - "Left": [] + "Left": [ + "Interval" + ] } }, - "query": "SELECT nonce FROM eth_txs ORDER BY id DESC LIMIT 1" + "query": "DELETE FROM transactions WHERE miniblock_number IS NULL AND received_at < now() - $1::interval AND is_priority=false AND error IS NULL RETURNING hash" }, - "4d36aff2bdeb0b659b8c4cd031f7c3fc204d92bb500a4efe8b6beb9255a232f6": { + "4ac212a08324b9d4c3febc585109f19105b4d20aa3e290352e3c63d7ec58c5b2": { "describe": { "columns": [ { - "name": "timestamp", + "name": "l2_address", "ordinal": 0, - "type_info": "Int8" + "type_info": "Bytea" } ], "nullable": [ @@ -3887,15 +3409,227 @@ "Left": [] } }, - "query": "SELECT timestamp FROM l1_batches WHERE eth_execute_tx_id IS NULL AND number > 0 ORDER BY number LIMIT 1" + "query": "SELECT l2_address FROM tokens" }, - "4e2b733fea9ca7cef542602fcd80acf1a9d2e0f1e22566f1076c4837e3ac7e61": { + "4ac92a8436108097a32e94e53f7fe99261c7c3a40dbc433c20ccea3a7d06650c": { "describe": { "columns": [ { - "name": "id", + "name": "hashed_key", "ordinal": 0, - "type_info": "Int8" + "type_info": "Bytea" + }, + { + "name": "value!", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "ByteaArray" + ] + } + }, + "query": "SELECT hashed_key, value as \"value!\" FROM storage WHERE hashed_key = ANY($1)" + }, + "4aef34fb19a07dbfe2be09024d6c7fc2033a8e1570cc7f002a5c78317ff8ff3f": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int2", + "Text", + "Int4", + "Int4" + ] + } + }, + "query": "\n INSERT INTO leaf_aggregation_witness_jobs_fri\n (l1_batch_number, circuit_id, closed_form_inputs_blob_url, number_of_basic_circuits, protocol_version, status, created_at, updated_at)\n VALUES ($1, $2, $3, $4, $5, 'waiting_for_proofs', now(), now())\n ON CONFLICT(l1_batch_number, circuit_id)\n DO UPDATE SET updated_at=now()\n " + }, + "4b8597a47c0724155ad9592dc32134523bcbca11c9d82763d1bebbe17479c7b4": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "recursion_scheduler_level_vk_hash", + "ordinal": 2, + "type_info": "Bytea" + }, + { + "name": "recursion_node_level_vk_hash", + "ordinal": 3, + "type_info": "Bytea" + }, + { + "name": "recursion_leaf_level_vk_hash", + "ordinal": 4, + "type_info": "Bytea" + }, + { + "name": "recursion_circuits_set_vks_hash", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bootloader_code_hash", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "default_account_code_hash", + "ordinal": 7, + "type_info": "Bytea" + }, + { + "name": "verifier_address", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "upgrade_tx_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "created_at", + "ordinal": 10, + "type_info": "Timestamp" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false + ], + "parameters": { + "Left": [ + "Int4" + ] + } + }, + "query": "SELECT * FROM protocol_versions\n WHERE id = $1\n " + }, + "4bab972cbbd8b53237a840ba9307079705bd4b5270428d2b41f05ee3d2aa42af": { + "describe": { + "columns": [ + { + "name": "l1_batch_number!", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "circuit_type", + "ordinal": 1, + "type_info": "Text" + } + ], + "nullable": [ + null, + false + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT MIN(l1_batch_number) as \"l1_batch_number!\", circuit_type\n FROM prover_jobs\n WHERE aggregation_round = 0 AND (status = 'queued' OR status = 'in_progress'\n OR status = 'in_gpu_proof'\n OR status = 'failed')\n GROUP BY circuit_type\n " + }, + "4c0d2aa6e08f3b4748b88cad5cf7b3a9eb9c051e8e8e747a3c38c1b37ce3a6b7": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "DELETE FROM l2_to_l1_logs WHERE miniblock_number > $1" + }, + "4c83881635e957872a435737392bfed829de58780887c9a0fa7921ea648296fb": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT number FROM l1_batches WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL ORDER BY number LIMIT 1" + }, + "4d2e106c809a48ace74952df2b883a5e747aaa1bc6bee28e986dccee7fa130b6": { + "describe": { + "columns": [ + { + "name": "nonce", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT nonce FROM eth_txs ORDER BY id DESC LIMIT 1" + }, + "4d36aff2bdeb0b659b8c4cd031f7c3fc204d92bb500a4efe8b6beb9255a232f6": { + "describe": { + "columns": [ + { + "name": "timestamp", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT timestamp FROM l1_batches WHERE eth_execute_tx_id IS NULL AND number > 0 ORDER BY number LIMIT 1" + }, + "4e2b733fea9ca7cef542602fcd80acf1a9d2e0f1e22566f1076c4837e3ac7e61": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" }, { "name": "instance_host", @@ -4981,252 +4715,41 @@ }, "query": "\n UPDATE leaf_aggregation_witness_jobs\n SET status='queued'\n WHERE l1_batch_number IN\n (SELECT prover_jobs.l1_batch_number\n FROM prover_jobs\n JOIN leaf_aggregation_witness_jobs lawj ON prover_jobs.l1_batch_number = lawj.l1_batch_number\n WHERE lawj.status = 'waiting_for_proofs'\n AND prover_jobs.status = 'successful'\n AND prover_jobs.aggregation_round = 0\n GROUP BY prover_jobs.l1_batch_number, lawj.number_of_basic_circuits\n HAVING COUNT(*) = lawj.number_of_basic_circuits)\n RETURNING l1_batch_number;\n " }, - "697835cdd5be1b99a0f332c4c8f3245e317b0282b46e55f15e728a7642382b25": { + "68130d145d314f1076ef6becb5fae8ec9401ac211a5bb98c9791fac93521a0c2": { "describe": { "columns": [ { - "name": "id", + "name": "number", "ordinal": 0, "type_info": "Int8" }, { - "name": "l1_batch_number", + "name": "timestamp", "ordinal": 1, "type_info": "Int8" }, { - "name": "circuit_id", + "name": "is_finished", "ordinal": 2, - "type_info": "Int2" + "type_info": "Bool" }, { - "name": "aggregation_round", + "name": "l1_tx_count", "ordinal": 3, - "type_info": "Int2" + "type_info": "Int4" }, { - "name": "sequence_number", + "name": "l2_tx_count", "ordinal": 4, "type_info": "Int4" }, { - "name": "depth", + "name": "fee_account_address", "ordinal": 5, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "is_node_final_proof", - "ordinal": 6, - "type_info": "Bool" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false - ], - "parameters": { - "Left": [ - "Time", - "Text", - "Int8" - ] - } - }, - "query": "\n UPDATE prover_jobs_fri\n SET status = 'successful', updated_at = now(), time_taken = $1, proof_blob_url=$2\n WHERE id = $3\n RETURNING prover_jobs_fri.id, prover_jobs_fri.l1_batch_number, prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round, prover_jobs_fri.sequence_number, prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n " - }, - "6a282084b02cddd8646e984a729b689bdb758e07096fc8cf60f68c6ec5bd6a9c": { - "describe": { - "columns": [ - { - "name": "max?", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT MAX(id) as \"max?\" FROM protocol_versions" - }, - "6a3af113a71bffa445d4a729e24fbc2be90bfffbdd072c74f9ca58669b7e5f80": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Bytea", - "Bytea", - "Bytea", - "Bytea" - ] - } - }, - "query": "SELECT id FROM prover_fri_protocol_versions WHERE recursion_circuits_set_vks_hash = $1 AND recursion_leaf_level_vk_hash = $2 AND recursion_node_level_vk_hash = $3 AND recursion_scheduler_level_vk_hash = $4 " - }, - "6ac39e83e446e70a2875624db78a05e56eb35f46e11d0f2fbb2165cda56fbacd": { - "describe": { - "columns": [ - { - "name": "bytecode", - "ordinal": 0, - "type_info": "Bytea" - }, - { - "name": "data?", - "ordinal": 1, - "type_info": "Jsonb" - }, - { - "name": "contract_address?", - "ordinal": 2, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false, - true - ], - "parameters": { - "Left": [ - "Bytea", - "Bytea" - ] - } - }, - "query": "\n SELECT factory_deps.bytecode, transactions.data as \"data?\", transactions.contract_address as \"contract_address?\"\n FROM (\n SELECT * FROM storage_logs\n WHERE storage_logs.hashed_key = $1\n ORDER BY miniblock_number DESC, operation_number DESC\n LIMIT 1\n ) storage_logs\n JOIN factory_deps ON factory_deps.bytecode_hash = storage_logs.value\n LEFT JOIN transactions ON transactions.hash = storage_logs.tx_hash\n WHERE storage_logs.value != $2\n " - }, - "6b53e5cb619c9649d28ae33df6a43e6984e2d9320f894f3d04156a2d1235bb60": { - "describe": { - "columns": [ - { - "name": "hash", - "ordinal": 0, - "type_info": "Bytea" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Int8", - "Int8" - ] - } - }, - "query": "SELECT hash FROM miniblocks WHERE number BETWEEN $1 AND $2 ORDER BY number" - }, - "6c0915ed87e6d0fdf83cb24a51cc277e366bea0ba8821c048092d2a0aadb2771": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Int8", - "Bytea", - "Int4", - "Int4", - "Numeric", - "Int8", - "Int8", - "Int8", - "Bytea", - "Bytea", - "Int4", - "Int8" - ] - } - }, - "query": "INSERT INTO miniblocks ( number, timestamp, hash, l1_tx_count, l2_tx_count, 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, created_at, updated_at ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, now(), now())" - }, - "6ffd22b0590341c38ce3957dccdb5a4edf47fb558bc64e4df08897a0c72dbf23": { - "describe": { - "columns": [ - { - "name": "protocol_version", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - true - ], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "\n SELECT protocol_version\n FROM witness_inputs\n WHERE l1_batch_number = $1\n " - }, - "715aba794d60ce2faf937eacd9498b203dbb8e620d6d8850b9071cd72902ffbf": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "ByteaArray", - "ByteaArray", - "Int8" - ] - } - }, - "query": "INSERT INTO factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at) SELECT u.bytecode_hash, u.bytecode, $3, now(), now() FROM UNNEST($1::bytea[], $2::bytea[]) AS u(bytecode_hash, bytecode) ON CONFLICT (bytecode_hash) DO NOTHING" - }, - "71ffc55f1e7efdcc81401b8a318a82192604f0f094e40ba94a3a97b190e4f6b1": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", + "name": "bloom", "ordinal": 6, "type_info": "Bytea" }, @@ -5422,261 +4945,213 @@ ], "parameters": { "Left": [ - "Bytea", - "Bytea", - "Int4", "Int8" ] } }, - "query": "SELECT number, l1_batches.timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, l1_batches.bootloader_code_hash, l1_batches.default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches JOIN protocol_versions ON protocol_versions.id = l1_batches.protocol_version WHERE eth_commit_tx_id IS NULL AND number != 0 AND protocol_versions.bootloader_code_hash = $1 AND protocol_versions.default_account_code_hash = $2 AND commitment IS NOT NULL AND (protocol_versions.id = $3 OR protocol_versions.upgrade_tx_hash IS NULL) ORDER BY number LIMIT $4" + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number = $1" }, - "721367902328f9e2e5f8a99820b11d230c60553db366fc76f97c5680470bece8": { + "68a9ba78f60674bc047e4af6eb2a379725da047f2e6c06bce96a33852565cc95": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Bytea", + "Bytea" + ] + } + }, + "query": "INSERT INTO commitments (l1_batch_number, events_queue_commitment, bootloader_initial_content_commitment) VALUES ($1, $2, $3) ON CONFLICT (l1_batch_number) DO UPDATE SET events_queue_commitment = $2, bootloader_initial_content_commitment = $3" + }, + "697835cdd5be1b99a0f332c4c8f3245e317b0282b46e55f15e728a7642382b25": { "describe": { "columns": [ { - "name": "l1_batch_number", + "name": "id", "ordinal": 0, "type_info": "Int8" }, { - "name": "basic_circuits_blob_url", + "name": "l1_batch_number", "ordinal": 1, - "type_info": "Text" + "type_info": "Int8" }, { - "name": "basic_circuits_inputs_blob_url", + "name": "circuit_id", "ordinal": 2, - "type_info": "Text" + "type_info": "Int2" + }, + { + "name": "aggregation_round", + "ordinal": 3, + "type_info": "Int2" + }, + { + "name": "sequence_number", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "depth", + "ordinal": 5, + "type_info": "Int4" + }, + { + "name": "is_node_final_proof", + "ordinal": 6, + "type_info": "Bool" } ], "nullable": [ false, - true, - true + false, + false, + false, + false, + false, + false ], "parameters": { "Left": [ + "Time", + "Text", "Int8" ] } }, - "query": "\n SELECT l1_batch_number, basic_circuits_blob_url, basic_circuits_inputs_blob_url FROM leaf_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND basic_circuits_blob_url is NOT NULL\n AND basic_circuits_inputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " + "query": "\n UPDATE prover_jobs_fri\n SET status = 'successful', updated_at = now(), time_taken = $1, proof_blob_url=$2\n WHERE id = $3\n RETURNING prover_jobs_fri.id, prover_jobs_fri.l1_batch_number, prover_jobs_fri.circuit_id,\n prover_jobs_fri.aggregation_round, prover_jobs_fri.sequence_number, prover_jobs_fri.depth,\n prover_jobs_fri.is_node_final_proof\n " }, - "73f0e672ff1a5e144b3034beb18271f1164e95029998d6750c6a8953f7344db5": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int4", - "Int8", - "Bool", - "Bytea", - "ByteaArray", - "ByteaArray", - "Bytea", - "ByteaArray", - "Int8", - "Int8", - "Int8", - "Jsonb", - "Jsonb", - "Numeric", - "Int8", - "Int8", - "Bytea", - "Bytea", - "Int4" - ] - } - }, - "query": "INSERT INTO l1_batches (number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, 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, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version, 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, $21, now(), now())" - }, - "741b13b0a4769a30186c650a4a1b24855806a27ccd8d5a50594741842dde44ec": { + "6a282084b02cddd8646e984a729b689bdb758e07096fc8cf60f68c6ec5bd6a9c": { "describe": { "columns": [ - { - "name": "min?", - "ordinal": 0, - "type_info": "Int8" - }, { "name": "max?", - "ordinal": 1, - "type_info": "Int8" + "ordinal": 0, + "type_info": "Int4" } ], "nullable": [ - null, null ], "parameters": { - "Left": [ - "Int8" - ] + "Left": [] } }, - "query": "SELECT MIN(miniblocks.number) as \"min?\", MAX(miniblocks.number) as \"max?\" FROM miniblocks WHERE l1_batch_number = $1" + "query": "SELECT MAX(id) as \"max?\" FROM protocol_versions" }, - "751c8e5ed1fc211dbb4c7419a316c5f4e49a7f0b4f3a5c74c2abd8daebc457dd": { + "6a3af113a71bffa445d4a729e24fbc2be90bfffbdd072c74f9ca58669b7e5f80": { "describe": { "columns": [ { - "name": "l1_batch_number", + "name": "id", "ordinal": 0, - "type_info": "Int8" + "type_info": "Int4" } ], "nullable": [ - true + false ], "parameters": { "Left": [ - "Int8" + "Bytea", + "Bytea", + "Bytea", + "Bytea" ] } }, - "query": "SELECT l1_batch_number FROM miniblocks WHERE number = $1" + "query": "SELECT id FROM prover_fri_protocol_versions WHERE recursion_circuits_set_vks_hash = $1 AND recursion_leaf_level_vk_hash = $2 AND recursion_node_level_vk_hash = $3 AND recursion_scheduler_level_vk_hash = $4 " }, - "769c021b51b9aaafdf27b4019834729047702b17b0684f7271eecd6ffdf96e7c": { + "6ac39e83e446e70a2875624db78a05e56eb35f46e11d0f2fbb2165cda56fbacd": { "describe": { "columns": [ { - "name": "l1_batch_number", + "name": "bytecode", "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [] - } - }, - "query": "\n UPDATE scheduler_witness_jobs\n SET status='queued'\n WHERE l1_batch_number IN\n (SELECT prover_jobs.l1_batch_number\n FROM prover_jobs\n JOIN scheduler_witness_jobs swj ON prover_jobs.l1_batch_number = swj.l1_batch_number\n WHERE swj.status = 'waiting_for_proofs'\n AND prover_jobs.status = 'successful'\n AND prover_jobs.aggregation_round = 2\n GROUP BY prover_jobs.l1_batch_number\n HAVING COUNT(*) = 1)\n RETURNING l1_batch_number;\n " - }, - "7717652bb4933f87cbeb7baa2e70e8e0b439663c6b15493bd2e406bed2486b42": { - "describe": { - "columns": [ + "type_info": "Bytea" + }, { - "name": "max", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Numeric" - ] - } - }, - "query": "SELECT 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) 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 FROM commit_tx.confirmed_at) < $1" - }, - "780b30e56a3ecfb3daa5310168ac6cd9e94bd5f1d871e1eaf36fbfd463a5e7e0": { - "describe": { - "columns": [ + "name": "data?", + "ordinal": 1, + "type_info": "Jsonb" + }, { - "name": "address_and_key?", - "ordinal": 0, - "type_info": "ByteaArray" + "name": "contract_address?", + "ordinal": 2, + "type_info": "Bytea" } ], "nullable": [ - null + false, + false, + true ], "parameters": { "Left": [ - "ByteaArray" + "Bytea", + "Bytea" ] } }, - "query": "SELECT (SELECT ARRAY[address,key] FROM storage_logs WHERE hashed_key = u.hashed_key ORDER BY miniblock_number, operation_number LIMIT 1) as \"address_and_key?\" FROM UNNEST($1::bytea[]) AS u(hashed_key)" - }, - "7889294ffe999d3c8b3b093d3add7f9b826e8259451068aeaeca0da0772648e8": { - "describe": { - "columns": [ - { - "name": "count!", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [] - } - }, - "query": "\n SELECT COUNT(*) as \"count!\"\n FROM contract_verification_requests\n WHERE status = 'queued'\n " + "query": "\n SELECT factory_deps.bytecode, transactions.data as \"data?\", transactions.contract_address as \"contract_address?\"\n FROM (\n SELECT * FROM storage_logs\n WHERE storage_logs.hashed_key = $1\n ORDER BY miniblock_number DESC, operation_number DESC\n LIMIT 1\n ) storage_logs\n JOIN factory_deps ON factory_deps.bytecode_hash = storage_logs.value\n LEFT JOIN transactions ON transactions.hash = storage_logs.tx_hash\n WHERE storage_logs.value != $2\n " }, - "79420f7676acb3f17aeb538271cdb4067a342fd554adcf7bd0550b6682b4c82b": { + "6b53e5cb619c9649d28ae33df6a43e6984e2d9320f894f3d04156a2d1235bb60": { "describe": { "columns": [ { - "name": "tx_hash", + "name": "hash", "ordinal": 0, "type_info": "Bytea" - }, - { - "name": "call_trace", - "ordinal": 1, - "type_info": "Bytea" } ], "nullable": [ - false, false ], "parameters": { "Left": [ + "Int8", "Int8" ] } }, - "query": "SELECT * FROM call_traces WHERE tx_hash IN (SELECT hash FROM transactions WHERE miniblock_number = $1)" + "query": "SELECT hash FROM miniblocks WHERE number BETWEEN $1 AND $2 ORDER BY number" }, - "7a5aba2130fec60318266c8059d3757cd78eb6099d50486b4996fb4090c99622": { + "6c0915ed87e6d0fdf83cb24a51cc277e366bea0ba8821c048092d2a0aadb2771": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ + "Int8", + "Int8", + "Bytea", + "Int4", + "Int4", + "Numeric", + "Int8", + "Int8", "Int8", "Bytea", "Bytea", - "Text", - "Text", "Int4", - "Int4" + "Int8" ] } }, - "query": "\n INSERT INTO leaf_aggregation_witness_jobs\n (l1_batch_number, basic_circuits, basic_circuits_inputs, basic_circuits_blob_url, basic_circuits_inputs_blob_url, number_of_basic_circuits, protocol_version, status, created_at, updated_at)\n VALUES ($1, $2, $3, $4, $5, $6, $7, 'waiting_for_proofs', now(), now())\n " + "query": "INSERT INTO miniblocks ( number, timestamp, hash, l1_tx_count, l2_tx_count, 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, created_at, updated_at ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, now(), now())" }, - "7acba1f016450b084a5fd97199a757a471f8b8a880a800c29737f1bceae3ff46": { + "6ffd22b0590341c38ce3957dccdb5a4edf47fb558bc64e4df08897a0c72dbf23": { "describe": { "columns": [ { - "name": "l1_batch_number", + "name": "protocol_version", "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "merkel_tree_paths_blob_url", - "ordinal": 1, - "type_info": "Text" + "type_info": "Int4" } ], "nullable": [ - false, true ], "parameters": { @@ -5685,117 +5160,201 @@ ] } }, - "query": "SELECT l1_batch_number, merkel_tree_paths_blob_url FROM witness_inputs WHERE status = 'successful' AND is_blob_cleaned = FALSE AND merkel_tree_paths_blob_url is NOT NULL AND updated_at < NOW() - INTERVAL '30 days' LIMIT $1" - }, - "7b8043a59029a19a3ba2433a438e8a4fe560aba7eda57b7a63b580de2e19aacb": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Text", - "Int4" - ] - } - }, - "query": "INSERT INTO witness_inputs_fri(l1_batch_number, merkle_tree_paths_blob_url, protocol_version, status, created_at, updated_at) VALUES ($1, $2, $3, 'queued', now(), now()) ON CONFLICT (l1_batch_number) DO NOTHING" + "query": "\n SELECT protocol_version\n FROM witness_inputs\n WHERE l1_batch_number = $1\n " }, - "7c3e55a10c8cf90e60001bca401113fd5335ec6c4b1ffdb6d6ff063d244d23e2": { + "7091a5c10a913f053129a76299d2e6fe7081473456888d30fb41b23a01d28690": { "describe": { "columns": [ { - "name": "id", + "name": "number", "ordinal": 0, "type_info": "Int8" }, { - "name": "l1_batch_number", + "name": "timestamp", "ordinal": 1, "type_info": "Int8" }, { - "name": "circuit_type", + "name": "is_finished", "ordinal": 2, - "type_info": "Text" + "type_info": "Bool" }, { - "name": "prover_input", + "name": "l1_tx_count", "ordinal": 3, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "status", + "name": "l2_tx_count", "ordinal": 4, - "type_info": "Text" + "type_info": "Int4" }, { - "name": "error", + "name": "fee_account_address", "ordinal": 5, - "type_info": "Text" + "type_info": "Bytea" }, { - "name": "processing_started_at", + "name": "bloom", "ordinal": 6, - "type_info": "Timestamp" + "type_info": "Bytea" }, { - "name": "created_at", + "name": "priority_ops_onchain_data", "ordinal": 7, - "type_info": "Timestamp" + "type_info": "ByteaArray" }, { - "name": "updated_at", + "name": "hash", "ordinal": 8, - "type_info": "Timestamp" + "type_info": "Bytea" }, { - "name": "time_taken", + "name": "parent_hash", "ordinal": 9, - "type_info": "Time" + "type_info": "Bytea" }, { - "name": "aggregation_round", + "name": "commitment", "ordinal": 10, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "result", + "name": "compressed_write_logs", "ordinal": 11, "type_info": "Bytea" }, { - "name": "sequence_number", + "name": "compressed_contracts", "ordinal": 12, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "attempts", + "name": "eth_prove_tx_id", "ordinal": 13, "type_info": "Int4" }, { - "name": "circuit_input_blob_url", + "name": "eth_commit_tx_id", "ordinal": 14, - "type_info": "Text" + "type_info": "Int4" }, { - "name": "proccesed_by", + "name": "eth_execute_tx_id", "ordinal": 15, - "type_info": "Text" + "type_info": "Int4" }, { - "name": "is_blob_cleaned", + "name": "merkle_root_hash", "ordinal": 16, - "type_info": "Bool" + "type_info": "Bytea" }, { - "name": "protocol_version", + "name": "l2_to_l1_logs", "ordinal": 17, - "type_info": "Int4" - } - ], - "nullable": [ + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, false, false, false, @@ -5803,38 +5362,81 @@ false, true, true, + true, + true, + true, + true, + true, + true, + true, false, false, false, - false, + true, + true, + true, true, false, false, true, true, + true, + true, false, + true, + true, + true, + true, + true, true ], "parameters": { "Left": [ - "TextArray", - "Int4Array" + "Int8", + "Int8", + "Int8" ] } }, - "query": "\n UPDATE prover_jobs\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now()\n WHERE id = (\n SELECT id\n FROM prover_jobs\n WHERE circuit_type = ANY($1)\n AND status = 'queued'\n AND protocol_version = ANY($2)\n ORDER BY aggregation_round DESC, l1_batch_number ASC, id ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING prover_jobs.*\n " + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number WHERE number BETWEEN $1 AND $2 ORDER BY number LIMIT $3" }, - "7ca78be8b18638857111cdbc6117ed2c204e3eb22682d5e4553ac4f47efab6e2": { + "715aba794d60ce2faf937eacd9498b203dbb8e620d6d8850b9071cd72902ffbf": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "ByteaArray", + "ByteaArray", + "Int8" + ] + } + }, + "query": "INSERT INTO factory_deps (bytecode_hash, bytecode, miniblock_number, created_at, updated_at) SELECT u.bytecode_hash, u.bytecode, $3, now(), now() FROM UNNEST($1::bytea[], $2::bytea[]) AS u(bytecode_hash, bytecode) ON CONFLICT (bytecode_hash) DO NOTHING" + }, + "721367902328f9e2e5f8a99820b11d230c60553db366fc76f97c5680470bece8": { "describe": { "columns": [ { - "name": "hash", + "name": "l1_batch_number", "ordinal": 0, - "type_info": "Bytea" + "type_info": "Int8" + }, + { + "name": "basic_circuits_blob_url", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "basic_circuits_inputs_blob_url", + "ordinal": 2, + "type_info": "Text" } ], "nullable": [ - false + false, + true, + true ], "parameters": { "Left": [ @@ -5842,158 +5444,233 @@ ] } }, - "query": "UPDATE transactions\n SET l1_batch_number = NULL, miniblock_number = NULL, error = NULL, index_in_block = NULL, execution_info = '{}'\n WHERE miniblock_number > $1\n RETURNING hash\n " + "query": "\n SELECT l1_batch_number, basic_circuits_blob_url, basic_circuits_inputs_blob_url FROM leaf_aggregation_witness_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND basic_circuits_blob_url is NOT NULL\n AND basic_circuits_inputs_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " }, - "7cf855c4869db43b765b92762402596f6b97b3717735b6d87a16a5776f2eca71": { + "73f0e672ff1a5e144b3034beb18271f1164e95029998d6750c6a8953f7344db5": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ + "Int8", + "Int4", + "Int4", + "Int8", + "Bool", + "Bytea", + "ByteaArray", + "ByteaArray", "Bytea", + "ByteaArray", + "Int8", + "Int8", + "Int8", + "Jsonb", + "Jsonb", "Numeric", - "Timestamp" + "Int8", + "Int8", + "Bytea", + "Bytea", + "Int4" ] } }, - "query": "UPDATE tokens SET usd_price = $2, usd_price_updated_at = $3, updated_at = now() WHERE l1_address = $1" + "query": "INSERT INTO l1_batches (number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, 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, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version, 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, $21, now(), now())" }, - "7d3a57126f111ebe51d678b91f64c34b8394df3e7b1d59ca80b6eca01c606da4": { + "741b13b0a4769a30186c650a4a1b24855806a27ccd8d5a50594741842dde44ec": { "describe": { - "columns": [], - "nullable": [], + "columns": [ + { + "name": "min?", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "max?", + "ordinal": 1, + "type_info": "Int8" + } + ], + "nullable": [ + null, + null + ], "parameters": { "Left": [ - "Bytea", - "Jsonb" + "Int8" ] } }, - "query": "\n INSERT INTO contracts_verification_info\n (address, verification_info)\n VALUES ($1, $2)\n ON CONFLICT (address)\n DO UPDATE SET verification_info = $2\n " + "query": "SELECT MIN(miniblocks.number) as \"min?\", MAX(miniblocks.number) as \"max?\" FROM miniblocks WHERE l1_batch_number = $1" }, - "7d4210089c5abb84befec962fc769b396ff7ad7da212d079bd4460f9ea4d60dc": { + "751c8e5ed1fc211dbb4c7419a316c5f4e49a7f0b4f3a5c74c2abd8daebc457dd": { "describe": { "columns": [ { - "name": "l1_batch_number?", + "name": "l1_batch_number", "ordinal": 0, "type_info": "Int8" } ], "nullable": [ - null + true ], "parameters": { - "Left": [] + "Left": [ + "Int8" + ] } }, - "query": "\n SELECT MIN(l1_batch_number) as \"l1_batch_number?\" FROM (\n SELECT MIN(l1_batch_number) as \"l1_batch_number\"\n FROM prover_jobs\n WHERE status = 'successful' OR aggregation_round < 3\n GROUP BY l1_batch_number\n HAVING MAX(aggregation_round) < 3\n ) as inn\n " + "query": "SELECT l1_batch_number FROM miniblocks WHERE number = $1" }, - "7df997e5a203e8df350b1346863fddf26d32123159213c02e8794c39240e48dc": { + "769c021b51b9aaafdf27b4019834729047702b17b0684f7271eecd6ffdf96e7c": { "describe": { - "columns": [], - "nullable": [], + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], "parameters": { - "Left": [ - "Int8" - ] + "Left": [] } }, - "query": "UPDATE miniblocks SET l1_batch_number = $1 WHERE l1_batch_number IS NULL" + "query": "\n UPDATE scheduler_witness_jobs\n SET status='queued'\n WHERE l1_batch_number IN\n (SELECT prover_jobs.l1_batch_number\n FROM prover_jobs\n JOIN scheduler_witness_jobs swj ON prover_jobs.l1_batch_number = swj.l1_batch_number\n WHERE swj.status = 'waiting_for_proofs'\n AND prover_jobs.status = 'successful'\n AND prover_jobs.aggregation_round = 2\n GROUP BY prover_jobs.l1_batch_number\n HAVING COUNT(*) = 1)\n RETURNING l1_batch_number;\n " }, - "8045a697a6a1070857b6fdc656f60ee6bab4b3a875ab98099beee227c199f818": { + "7717652bb4933f87cbeb7baa2e70e8e0b439663c6b15493bd2e406bed2486b42": { "describe": { "columns": [ { - "name": "miniblock_number", + "name": "max", "ordinal": 0, "type_info": "Int8" - }, - { - "name": "log_index_in_miniblock", - "ordinal": 1, - "type_info": "Int4" - }, - { - "name": "log_index_in_tx", - "ordinal": 2, - "type_info": "Int4" - }, - { - "name": "tx_hash", - "ordinal": 3, - "type_info": "Bytea" - }, + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [ + "Numeric" + ] + } + }, + "query": "SELECT 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) 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 FROM commit_tx.confirmed_at) < $1" + }, + "780b30e56a3ecfb3daa5310168ac6cd9e94bd5f1d871e1eaf36fbfd463a5e7e0": { + "describe": { + "columns": [ { - "name": "block_hash", - "ordinal": 4, - "type_info": "Bytea" - }, + "name": "address_and_key?", + "ordinal": 0, + "type_info": "ByteaArray" + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [ + "ByteaArray" + ] + } + }, + "query": "SELECT (SELECT ARRAY[address,key] FROM storage_logs WHERE hashed_key = u.hashed_key ORDER BY miniblock_number, operation_number LIMIT 1) as \"address_and_key?\" FROM UNNEST($1::bytea[]) AS u(hashed_key)" + }, + "7889294ffe999d3c8b3b093d3add7f9b826e8259451068aeaeca0da0772648e8": { + "describe": { + "columns": [ { - "name": "l1_batch_number?", - "ordinal": 5, + "name": "count!", + "ordinal": 0, "type_info": "Int8" - }, - { - "name": "shard_id", - "ordinal": 6, - "type_info": "Int4" - }, - { - "name": "is_service", - "ordinal": 7, - "type_info": "Bool" - }, - { - "name": "tx_index_in_miniblock", - "ordinal": 8, - "type_info": "Int4" - }, - { - "name": "tx_index_in_l1_batch", - "ordinal": 9, - "type_info": "Int4" - }, + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT COUNT(*) as \"count!\"\n FROM contract_verification_requests\n WHERE status = 'queued'\n " + }, + "79420f7676acb3f17aeb538271cdb4067a342fd554adcf7bd0550b6682b4c82b": { + "describe": { + "columns": [ { - "name": "sender", - "ordinal": 10, + "name": "tx_hash", + "ordinal": 0, "type_info": "Bytea" }, { - "name": "key", - "ordinal": 11, + "name": "call_trace", + "ordinal": 1, "type_info": "Bytea" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "SELECT * FROM call_traces WHERE tx_hash IN (SELECT hash FROM transactions WHERE miniblock_number = $1)" + }, + "7a5aba2130fec60318266c8059d3757cd78eb6099d50486b4996fb4090c99622": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Bytea", + "Bytea", + "Text", + "Text", + "Int4", + "Int4" + ] + } + }, + "query": "\n INSERT INTO leaf_aggregation_witness_jobs\n (l1_batch_number, basic_circuits, basic_circuits_inputs, basic_circuits_blob_url, basic_circuits_inputs_blob_url, number_of_basic_circuits, protocol_version, status, created_at, updated_at)\n VALUES ($1, $2, $3, $4, $5, $6, $7, 'waiting_for_proofs', now(), now())\n " + }, + "7acba1f016450b084a5fd97199a757a471f8b8a880a800c29737f1bceae3ff46": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" }, { - "name": "value", - "ordinal": 12, - "type_info": "Bytea" + "name": "merkel_tree_paths_blob_url", + "ordinal": 1, + "type_info": "Text" } ], "nullable": [ false, - false, - false, - false, - null, - null, - false, - false, - false, - false, - false, - false, - false + true ], "parameters": { "Left": [ - "Bytea" + "Int8" ] } }, - "query": "SELECT miniblock_number, log_index_in_miniblock, log_index_in_tx, tx_hash, Null::bytea as \"block_hash\", Null::bigint as \"l1_batch_number?\", shard_id, is_service, tx_index_in_miniblock, tx_index_in_l1_batch, sender, key, value FROM l2_to_l1_logs WHERE tx_hash = $1 ORDER BY log_index_in_tx ASC" + "query": "SELECT l1_batch_number, merkel_tree_paths_blob_url FROM witness_inputs WHERE status = 'successful' AND is_blob_cleaned = FALSE AND merkel_tree_paths_blob_url is NOT NULL AND updated_at < NOW() - INTERVAL '30 days' LIMIT $1" }, - "81385d97d64772a457d7ddf58375ab11270ac2ae407c5726a939575b30603c85": { + "7b71d5390f82b405eab5373ba05448ed7189338da059817d158d3607efe3efd1": { "describe": { "columns": [ { @@ -6223,125 +5900,120 @@ ], "parameters": { "Left": [ + "Bytea", + "Bytea", + "Int4", "Int8" ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number = $1" + "query": "SELECT number, l1_batches.timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, l1_batches.bootloader_code_hash, l1_batches.default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment 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 WHERE eth_commit_tx_id IS NULL AND number != 0 AND protocol_versions.bootloader_code_hash = $1 AND protocol_versions.default_account_code_hash = $2 AND commitment IS NOT NULL AND (protocol_versions.id = $3 OR protocol_versions.upgrade_tx_hash IS NULL) ORDER BY number LIMIT $4" }, - "84703029e09ab1362aa4b4177b38be594d2daf17e69508cae869647028055efb": { + "7b8043a59029a19a3ba2433a438e8a4fe560aba7eda57b7a63b580de2e19aacb": { "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - } - ], - "nullable": [ - false, - false - ], + "columns": [], + "nullable": [], "parameters": { "Left": [ + "Int8", "Text", - "Text" + "Int4" ] } }, - "query": "SELECT l1_batch_number, status FROM proof_compression_jobs_fri\n WHERE l1_batch_number = ( SELECT MIN(l1_batch_number) FROM proof_compression_jobs_fri WHERE status = $1 OR status = $2\n )" + "query": "INSERT INTO witness_inputs_fri(l1_batch_number, merkle_tree_paths_blob_url, protocol_version, status, created_at, updated_at) VALUES ($1, $2, $3, 'queued', now(), now()) ON CONFLICT (l1_batch_number) DO NOTHING" }, - "852b8d72a8dcbf620e528e983b836b2b05596eb0b7c5d7d1791080bef6a6b821": { + "7c3e55a10c8cf90e60001bca401113fd5335ec6c4b1ffdb6d6ff063d244d23e2": { "describe": { "columns": [ { - "name": "number", + "name": "id", "ordinal": 0, "type_info": "Int8" }, { - "name": "l1_tx_count", + "name": "l1_batch_number", "ordinal": 1, - "type_info": "Int4" + "type_info": "Int8" }, { - "name": "l2_tx_count", + "name": "circuit_type", "ordinal": 2, - "type_info": "Int4" + "type_info": "Text" }, { - "name": "timestamp", + "name": "prover_input", "ordinal": 3, - "type_info": "Int8" + "type_info": "Bytea" }, { - "name": "is_finished", + "name": "status", "ordinal": 4, - "type_info": "Bool" + "type_info": "Text" }, { - "name": "fee_account_address", + "name": "error", "ordinal": 5, - "type_info": "Bytea" + "type_info": "Text" }, { - "name": "l2_to_l1_logs", + "name": "processing_started_at", "ordinal": 6, - "type_info": "ByteaArray" + "type_info": "Timestamp" }, { - "name": "l2_to_l1_messages", + "name": "created_at", "ordinal": 7, - "type_info": "ByteaArray" + "type_info": "Timestamp" }, { - "name": "bloom", + "name": "updated_at", "ordinal": 8, - "type_info": "Bytea" + "type_info": "Timestamp" }, { - "name": "priority_ops_onchain_data", + "name": "time_taken", "ordinal": 9, - "type_info": "ByteaArray" + "type_info": "Time" }, { - "name": "used_contract_hashes", + "name": "aggregation_round", "ordinal": 10, - "type_info": "Jsonb" + "type_info": "Int4" }, { - "name": "base_fee_per_gas", + "name": "result", "ordinal": 11, - "type_info": "Numeric" + "type_info": "Bytea" }, { - "name": "l1_gas_price", + "name": "sequence_number", "ordinal": 12, - "type_info": "Int8" + "type_info": "Int4" }, { - "name": "l2_fair_gas_price", + "name": "attempts", "ordinal": 13, - "type_info": "Int8" + "type_info": "Int4" }, { - "name": "bootloader_code_hash", + "name": "circuit_input_blob_url", "ordinal": 14, - "type_info": "Bytea" + "type_info": "Text" }, { - "name": "default_aa_code_hash", + "name": "proccesed_by", "ordinal": 15, - "type_info": "Bytea" + "type_info": "Text" }, { - "name": "protocol_version", + "name": "is_blob_cleaned", "ordinal": 16, + "type_info": "Bool" + }, + { + "name": "protocol_version", + "ordinal": 17, "type_info": "Int4" } ], @@ -6351,44 +6023,40 @@ false, false, false, + true, + true, false, false, false, false, - false, - false, - false, + true, false, false, true, true, + false, true ], "parameters": { "Left": [ - "Int8" + "TextArray", + "Int4Array" ] } }, - "query": "SELECT number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, l2_to_l1_messages, bloom, priority_ops_onchain_data, used_contract_hashes, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version FROM l1_batches WHERE number = $1" + "query": "\n UPDATE prover_jobs\n SET status = 'in_progress', attempts = attempts + 1,\n updated_at = now(), processing_started_at = now()\n WHERE id = (\n SELECT id\n FROM prover_jobs\n WHERE circuit_type = ANY($1)\n AND status = 'queued'\n AND protocol_version = ANY($2)\n ORDER BY aggregation_round DESC, l1_batch_number ASC, id ASC\n LIMIT 1\n FOR UPDATE\n SKIP LOCKED\n )\n RETURNING prover_jobs.*\n " }, - "85c52cb09c73499507144e3a684c3230c2c71eb4f8ddef43e67fbd33de2747c8": { + "7ca78be8b18638857111cdbc6117ed2c204e3eb22682d5e4553ac4f47efab6e2": { "describe": { "columns": [ - { - "name": "timestamp", - "ordinal": 0, - "type_info": "Int8" - }, { "name": "hash", - "ordinal": 1, + "ordinal": 0, "type_info": "Bytea" } ], "nullable": [ - false, - true + false ], "parameters": { "Left": [ @@ -6396,233 +6064,271 @@ ] } }, - "query": "SELECT timestamp, hash FROM l1_batches WHERE number = $1" + "query": "UPDATE transactions\n SET l1_batch_number = NULL, miniblock_number = NULL, error = NULL, index_in_block = NULL, execution_info = '{}'\n WHERE miniblock_number > $1\n RETURNING hash\n " }, - "87e1ae393bf250f834704c940482884c9ed729a24f41d1ec07319fa0cbcc21a7": { + "7cf855c4869db43b765b92762402596f6b97b3717735b6d87a16a5776f2eca71": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ - "Int8" + "Bytea", + "Numeric", + "Timestamp" ] } }, - "query": "DELETE FROM l1_batches WHERE number > $1" + "query": "UPDATE tokens SET usd_price = $2, usd_price_updated_at = $3, updated_at = now() WHERE l1_address = $1" }, - "88c49ebeb45f7208d223de59ec08a332beac765644e4f29ed855808b8f9cef91": { + "7d3a57126f111ebe51d678b91f64c34b8394df3e7b1d59ca80b6eca01c606da4": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Bytea", + "Jsonb" + ] + } + }, + "query": "\n INSERT INTO contracts_verification_info\n (address, verification_info)\n VALUES ($1, $2)\n ON CONFLICT (address)\n DO UPDATE SET verification_info = $2\n " + }, + "7d4210089c5abb84befec962fc769b396ff7ad7da212d079bd4460f9ea4d60dc": { "describe": { "columns": [ { - "name": "id", + "name": "l1_batch_number?", "ordinal": 0, "type_info": "Int8" - }, - { - "name": "circuit_input_blob_url", - "ordinal": 1, - "type_info": "Text" } ], "nullable": [ - false, - true + null ], + "parameters": { + "Left": [] + } + }, + "query": "\n SELECT MIN(l1_batch_number) as \"l1_batch_number?\" FROM (\n SELECT MIN(l1_batch_number) as \"l1_batch_number\"\n FROM prover_jobs\n WHERE status = 'successful' OR aggregation_round < 3\n GROUP BY l1_batch_number\n HAVING MAX(aggregation_round) < 3\n ) as inn\n " + }, + "7df997e5a203e8df350b1346863fddf26d32123159213c02e8794c39240e48dc": { + "describe": { + "columns": [], + "nullable": [], "parameters": { "Left": [ "Int8" ] } }, - "query": "\n SELECT id, circuit_input_blob_url FROM prover_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND circuit_input_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " + "query": "UPDATE miniblocks SET l1_batch_number = $1 WHERE l1_batch_number IS NULL" }, - "88e8f08f068d15e386dde062e10b4b951c0feab5a9ff6b554c7ac28fd57609b0": { + "8045a697a6a1070857b6fdc656f60ee6bab4b3a875ab98099beee227c199f818": { "describe": { "columns": [ { - "name": "number", + "name": "miniblock_number", "ordinal": 0, "type_info": "Int8" }, { - "name": "timestamp", + "name": "log_index_in_miniblock", "ordinal": 1, - "type_info": "Int8" + "type_info": "Int4" }, { - "name": "is_finished", + "name": "log_index_in_tx", "ordinal": 2, - "type_info": "Bool" + "type_info": "Int4" }, { - "name": "l1_tx_count", + "name": "tx_hash", "ordinal": 3, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "l2_tx_count", + "name": "block_hash", "ordinal": 4, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "fee_account_address", + "name": "l1_batch_number?", "ordinal": 5, - "type_info": "Bytea" + "type_info": "Int8" }, { - "name": "bloom", + "name": "shard_id", "ordinal": 6, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "priority_ops_onchain_data", + "name": "is_service", "ordinal": 7, - "type_info": "ByteaArray" + "type_info": "Bool" }, { - "name": "hash", + "name": "tx_index_in_miniblock", "ordinal": 8, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "parent_hash", + "name": "tx_index_in_l1_batch", "ordinal": 9, - "type_info": "Bytea" + "type_info": "Int4" }, { - "name": "commitment", + "name": "sender", "ordinal": 10, "type_info": "Bytea" }, { - "name": "compressed_write_logs", + "name": "key", "ordinal": 11, "type_info": "Bytea" }, { - "name": "compressed_contracts", + "name": "value", "ordinal": 12, "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + null, + null, + false, + false, + false, + false, + false, + false, + false + ], + "parameters": { + "Left": [ + "Bytea" + ] + } + }, + "query": "SELECT miniblock_number, log_index_in_miniblock, log_index_in_tx, tx_hash, Null::bytea as \"block_hash\", Null::bigint as \"l1_batch_number?\", shard_id, is_service, tx_index_in_miniblock, tx_index_in_l1_batch, sender, key, value FROM l2_to_l1_logs WHERE tx_hash = $1 ORDER BY log_index_in_tx ASC" + }, + "84703029e09ab1362aa4b4177b38be594d2daf17e69508cae869647028055efb": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" }, { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" + "name": "status", + "ordinal": 1, + "type_info": "Text" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + } + }, + "query": "SELECT l1_batch_number, status FROM proof_compression_jobs_fri\n WHERE l1_batch_number = ( SELECT MIN(l1_batch_number) FROM proof_compression_jobs_fri WHERE status = $1 OR status = $2\n )" + }, + "852b8d72a8dcbf620e528e983b836b2b05596eb0b7c5d7d1791080bef6a6b821": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" }, { - "name": "eth_commit_tx_id", - "ordinal": 14, + "name": "l1_tx_count", + "ordinal": 1, "type_info": "Int4" }, { - "name": "eth_execute_tx_id", - "ordinal": 15, + "name": "l2_tx_count", + "ordinal": 2, "type_info": "Int4" }, { - "name": "merkle_root_hash", - "ordinal": 16, + "name": "timestamp", + "ordinal": 3, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 4, + "type_info": "Bool" + }, + { + "name": "fee_account_address", + "ordinal": 5, "type_info": "Bytea" }, { "name": "l2_to_l1_logs", - "ordinal": 17, + "ordinal": 6, "type_info": "ByteaArray" }, { "name": "l2_to_l1_messages", - "ordinal": 18, + "ordinal": 7, "type_info": "ByteaArray" }, { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, + "name": "bloom", + "ordinal": 8, "type_info": "Bytea" }, { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" + "name": "priority_ops_onchain_data", + "ordinal": 9, + "type_info": "ByteaArray" }, { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" + "name": "used_contract_hashes", + "ordinal": 10, + "type_info": "Jsonb" }, { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" + "name": "base_fee_per_gas", + "ordinal": 11, + "type_info": "Numeric" }, { "name": "l1_gas_price", - "ordinal": 24, + "ordinal": 12, "type_info": "Int8" }, { "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, + "ordinal": 13, "type_info": "Int8" }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, { "name": "bootloader_code_hash", - "ordinal": 28, + "ordinal": 14, "type_info": "Bytea" }, { "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, + "ordinal": 15, "type_info": "Bytea" }, { "name": "protocol_version", - "ordinal": 34, + "ordinal": 16, "type_info": "Int4" - }, - { - "name": "events_queue_commitment", - "ordinal": 35, - "type_info": "Bytea" - }, - { - "name": "bootloader_initial_content_commitment", - "ordinal": 36, - "type_info": "Bytea" } ], "nullable": [ @@ -6634,34 +6340,14 @@ false, false, false, - true, - true, - true, - true, - true, - true, - true, - true, - true, false, false, false, - true, - true, - true, - true, false, false, - true, - true, - true, - true, false, true, true, - true, - true, - true, true ], "parameters": { @@ -6670,7 +6356,71 @@ ] } }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE eth_prove_tx_id IS NOT NULL AND eth_execute_tx_id IS NULL ORDER BY number LIMIT $1" + "query": "SELECT number, l1_tx_count, l2_tx_count, timestamp, is_finished, fee_account_address, l2_to_l1_logs, l2_to_l1_messages, bloom, priority_ops_onchain_data, used_contract_hashes, base_fee_per_gas, l1_gas_price, l2_fair_gas_price, bootloader_code_hash, default_aa_code_hash, protocol_version FROM l1_batches WHERE number = $1" + }, + "85c52cb09c73499507144e3a684c3230c2c71eb4f8ddef43e67fbd33de2747c8": { + "describe": { + "columns": [ + { + "name": "timestamp", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "hash", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "SELECT timestamp, hash FROM l1_batches WHERE number = $1" + }, + "87e1ae393bf250f834704c940482884c9ed729a24f41d1ec07319fa0cbcc21a7": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "DELETE FROM l1_batches WHERE number > $1" + }, + "88c49ebeb45f7208d223de59ec08a332beac765644e4f29ed855808b8f9cef91": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "circuit_input_blob_url", + "ordinal": 1, + "type_info": "Text" + } + ], + "nullable": [ + false, + true + ], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "\n SELECT id, circuit_input_blob_url FROM prover_jobs\n WHERE status='successful' AND is_blob_cleaned=FALSE\n AND circuit_input_blob_url is NOT NULL\n AND updated_at < NOW() - INTERVAL '30 days'\n LIMIT $1;\n " }, "8996a1794585dfe0f9c16a11e113831a63d5d944bc8061d7caa25ea33f12b19d": { "describe": { @@ -7484,6 +7234,31 @@ }, "query": "\n SELECT\n (SELECT l1_batch_number\n FROM prover_jobs\n WHERE status NOT IN ('successful', 'skipped')\n ORDER BY l1_batch_number\n LIMIT 1) as \"successful_limit!\",\n \n (SELECT l1_batch_number\n FROM prover_jobs\n WHERE status <> 'queued'\n ORDER BY l1_batch_number DESC\n LIMIT 1) as \"queued_limit!\",\n\n (SELECT MAX(l1_batch_number) as \"max!\" FROM prover_jobs) as \"max_block!\"\n " }, + "9c77342759fc71b12f05c2395ac36aabadab1fa64ff585d6349b8053300cf76c": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bytea", + "Bool", + "Bytea", + "Int8", + "Bytea", + "Bytea", + "Bytea", + "Int8" + ] + } + }, + "query": "UPDATE l1_batches SET hash = $1, merkle_root_hash = $2, commitment = $3, compressed_repeated_writes = $4, compressed_initial_writes = $5, l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, updated_at = now() WHERE number = $14 AND hash IS NULL" + }, "9d28c1be3bda0c4fb37567d4a56730e801f48fbb2abad42ea894ebd8ee40412d": { "describe": { "columns": [], @@ -8097,27 +7872,638 @@ "nullable": [ false ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT number FROM l1_batches 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 number DESC LIMIT 1" - }, - "ac35fb205c83d82d78983f4c9b47f56d3c91fbb2c95046555c7d60a9a2ebb446": { - "describe": { - "columns": [], - "nullable": [], + "parameters": { + "Left": [] + } + }, + "query": "SELECT number FROM l1_batches 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 number DESC LIMIT 1" + }, + "ac35fb205c83d82d78983f4c9b47f56d3c91fbb2c95046555c7d60a9a2ebb446": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "ByteaArray", + "Int8Array", + "Int8" + ] + } + }, + "query": "INSERT INTO initial_writes (hashed_key, index, l1_batch_number, created_at, updated_at) SELECT u.hashed_key, u.index, $3, now(), now() FROM UNNEST($1::bytea[], $2::bigint[]) AS u(hashed_key, index)" + }, + "ad11ec3e628ae6c64ac160d8dd689b2f64033f620e17a31469788b3ce4968ad3": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "eth_tx_id", + "ordinal": 1, + "type_info": "Int4" + }, + { + "name": "tx_hash", + "ordinal": 2, + "type_info": "Text" + }, + { + "name": "created_at", + "ordinal": 3, + "type_info": "Timestamp" + }, + { + "name": "updated_at", + "ordinal": 4, + "type_info": "Timestamp" + }, + { + "name": "base_fee_per_gas", + "ordinal": 5, + "type_info": "Int8" + }, + { + "name": "priority_fee_per_gas", + "ordinal": 6, + "type_info": "Int8" + }, + { + "name": "confirmed_at", + "ordinal": 7, + "type_info": "Timestamp" + }, + { + "name": "signed_raw_tx", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "sent_at_block", + "ordinal": 9, + "type_info": "Int4" + }, + { + "name": "sent_at", + "ordinal": 10, + "type_info": "Timestamp" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int4" + ] + } + }, + "query": "SELECT * FROM eth_txs_history WHERE eth_tx_id = $1 ORDER BY created_at DESC LIMIT 1" + }, + "ad4f74aa6f131df0243f4fa500ade1b98aa335bd71ed417b02361e2c697e60f8": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Bytea", + "Int8" + ] + } + }, + "query": "\n UPDATE scheduler_witness_jobs\n SET aggregation_result_coords = $1,\n updated_at = now()\n WHERE l1_batch_number = $2\n " + }, + "adc9ad2c944f9dacc28b5bd133aa37d9e8ea99eca1c5dfbeef37cda4b793f434": { + "describe": { + "columns": [ + { + "name": "market_volume", + "ordinal": 0, + "type_info": "Numeric" + }, + { + "name": "market_volume_updated_at", + "ordinal": 1, + "type_info": "Timestamp" + } + ], + "nullable": [ + true, + true + ], + "parameters": { + "Left": [ + "Bytea" + ] + } + }, + "query": "SELECT market_volume, market_volume_updated_at FROM tokens WHERE l2_address = $1" + }, + "ae072f51b65d0b5212264be9a34027922e5aedef7e4741517ad8104bf5aa79e9": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8" + ] + } + }, + "query": "DELETE FROM factory_deps WHERE miniblock_number > $1" + }, + "aea4e8d1b018836973d252df943a2c1988dd5f3ffc629064b87d25af8cdb8638": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "l1_batch_tx_index", + "ordinal": 1, + "type_info": "Int4" + } + ], + "nullable": [ + true, + true + ], + "parameters": { + "Left": [ + "Bytea" + ] + } + }, + "query": "SELECT l1_batch_number, l1_batch_tx_index FROM transactions WHERE hash = $1" + }, + "af22ad34bde12b8d25eb85da9939d12b7bed6407d732b868eeaf2916568c8646": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Time", + "Int8" + ] + } + }, + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'successful', updated_at = now(), time_taken = $1\n WHERE l1_batch_number = $2\n " + }, + "af75db6b7e42b73ce62b28a7281e1bfa181ee0c80a85d7d8078831db5dcdb699": { + "describe": { + "columns": [ + { + "name": "l1_block_number", + "ordinal": 0, + "type_info": "Int4" + } + ], + "nullable": [ + true + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT l1_block_number FROM transactions\n WHERE priority_op_id IS NOT NULL\n ORDER BY priority_op_id DESC\n LIMIT 1" + }, + "b1478907214ad20dddd4f3846fba4b0ddf1fff63ddb3b95c8999635e77c8b863": { + "describe": { + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int4" + }, + { + "name": "eth_tx_id", + "ordinal": 1, + "type_info": "Int4" + }, + { + "name": "tx_hash", + "ordinal": 2, + "type_info": "Text" + }, + { + "name": "created_at", + "ordinal": 3, + "type_info": "Timestamp" + }, + { + "name": "updated_at", + "ordinal": 4, + "type_info": "Timestamp" + }, + { + "name": "base_fee_per_gas", + "ordinal": 5, + "type_info": "Int8" + }, + { + "name": "priority_fee_per_gas", + "ordinal": 6, + "type_info": "Int8" + }, + { + "name": "confirmed_at", + "ordinal": 7, + "type_info": "Timestamp" + }, + { + "name": "signed_raw_tx", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "sent_at_block", + "ordinal": 9, + "type_info": "Int4" + }, + { + "name": "sent_at", + "ordinal": 10, + "type_info": "Timestamp" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + "parameters": { + "Left": [ + "Int4" + ] + } + }, + "query": "SELECT * FROM eth_txs_history WHERE eth_tx_id = $1 ORDER BY created_at DESC" + }, + "b14997f84d11d7eea89168383195c5579eed1c57bb2b416a749e2863ae6594a5": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Text", + "Int8" + ] + } + }, + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status ='failed', error= $1, updated_at = now()\n WHERE id = $2\n " + }, + "b14d9a82e6b0a4174dde61642d3abc001cd8cb80d988eb81a685255e3ce920de": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8Array", + "ByteaArray" + ] + } + }, + "query": "UPDATE miniblocks SET hash = u.hash FROM UNNEST($1::bigint[], $2::bytea[]) AS u(number, hash) WHERE miniblocks.number = u.number\n " + }, + "b479b7d3334f8d4566c294a44e2adb282fbc66a87be5c248c65211c2a8a07db0": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "hash", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + } + }, + "query": "SELECT number, hash FROM miniblocks WHERE number > $1 ORDER BY number ASC LIMIT $2" + }, + "b4c576db7c762103dc6700ded458e996d2e9ef670d7b58b181dbfab02fa426ce": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Numeric", + "Numeric", + "Numeric", + "Jsonb", + "Int8", + "Numeric", + "Numeric", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Bytea", + "Int4", + "Numeric", + "Bytea", + "Timestamp" + ] + } + }, + "query": "\n INSERT INTO transactions\n (\n hash,\n is_priority,\n initiator_address,\n\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n\n paymaster,\n paymaster_input,\n tx_format,\n\n l1_tx_mint,\n l1_tx_refund_recipient,\n\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1, TRUE, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,\n $13, $14, $15, $16, $17, $18, now(), now()\n )\n ON CONFLICT (hash) DO NOTHING\n " + }, + "b4da918ee3b36b56d95c8834edebe65eb48ebb8270fa1e6ccf73ad354fd71134": { + "describe": { + "columns": [ + { + "name": "l1_address", + "ordinal": 0, + "type_info": "Bytea" + }, + { + "name": "l2_address", + "ordinal": 1, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT l1_address, l2_address FROM tokens WHERE well_known = true" + }, + "b4f7d9b915b1feb92d0ff1982e256fbde8377e9c305aa2c919aba1cd55641d83": { + "describe": { + "columns": [ + { + "name": "number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "timestamp", + "ordinal": 1, + "type_info": "Int8" + }, + { + "name": "is_finished", + "ordinal": 2, + "type_info": "Bool" + }, + { + "name": "l1_tx_count", + "ordinal": 3, + "type_info": "Int4" + }, + { + "name": "l2_tx_count", + "ordinal": 4, + "type_info": "Int4" + }, + { + "name": "fee_account_address", + "ordinal": 5, + "type_info": "Bytea" + }, + { + "name": "bloom", + "ordinal": 6, + "type_info": "Bytea" + }, + { + "name": "priority_ops_onchain_data", + "ordinal": 7, + "type_info": "ByteaArray" + }, + { + "name": "hash", + "ordinal": 8, + "type_info": "Bytea" + }, + { + "name": "parent_hash", + "ordinal": 9, + "type_info": "Bytea" + }, + { + "name": "commitment", + "ordinal": 10, + "type_info": "Bytea" + }, + { + "name": "compressed_write_logs", + "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, + "type_info": "Int8" + }, + { + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, + "type_info": "Int8" + }, + { + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, + "type_info": "Bytea" + }, + { + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" + }, + { + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" + }, + { + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" + }, + { + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" + }, + { + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" + }, + { + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" + }, + { + "name": "events_queue_commitment", + "ordinal": 35, + "type_info": "Bytea" + }, + { + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" + } + ], + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true + ], "parameters": { "Left": [ - "ByteaArray", - "Int8Array", + "Int8", "Int8" ] } }, - "query": "INSERT INTO initial_writes (hashed_key, index, l1_batch_number, created_at, updated_at) SELECT u.hashed_key, u.index, $3, now(), now() FROM UNNEST($1::bytea[], $2::bigint[]) AS u(hashed_key, index)" + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM (SELECT l1_batches.*, row_number() OVER (ORDER BY number ASC) AS row_number FROM l1_batches WHERE eth_commit_tx_id IS NOT NULL AND l1_batches.skip_proof = TRUE AND l1_batches.number > $1 ORDER BY number LIMIT $2) inn LEFT JOIN commitments ON commitments.l1_batch_number = inn.number WHERE number - row_number = $1" }, - "ad11ec3e628ae6c64ac160d8dd689b2f64033f620e17a31469788b3ce4968ad3": { + "b6c8e0827b2389a14433c031332962495311562ae9652ae7e9409a4bf48dc55b": { "describe": { "columns": [ { @@ -8126,44 +8512,44 @@ "type_info": "Int4" }, { - "name": "eth_tx_id", + "name": "nonce", "ordinal": 1, - "type_info": "Int4" + "type_info": "Int8" }, { - "name": "tx_hash", + "name": "raw_tx", "ordinal": 2, - "type_info": "Text" + "type_info": "Bytea" }, { - "name": "created_at", + "name": "contract_address", "ordinal": 3, - "type_info": "Timestamp" + "type_info": "Text" }, { - "name": "updated_at", + "name": "tx_type", "ordinal": 4, - "type_info": "Timestamp" + "type_info": "Text" }, { - "name": "base_fee_per_gas", + "name": "gas_used", "ordinal": 5, "type_info": "Int8" }, { - "name": "priority_fee_per_gas", + "name": "created_at", "ordinal": 6, - "type_info": "Int8" + "type_info": "Timestamp" }, { - "name": "confirmed_at", + "name": "updated_at", "ordinal": 7, "type_info": "Timestamp" }, { - "name": "signed_raw_tx", + "name": "has_failed", "ordinal": 8, - "type_info": "Bytea" + "type_info": "Bool" }, { "name": "sent_at_block", @@ -8171,9 +8557,14 @@ "type_info": "Int4" }, { - "name": "sent_at", + "name": "confirmed_eth_tx_history_id", "ordinal": 10, - "type_info": "Timestamp" + "type_info": "Int4" + }, + { + "name": "predicted_gas_cost", + "ordinal": 11, + "type_info": "Int8" } ], "nullable": [ @@ -8182,186 +8573,90 @@ false, false, false, + true, + false, false, false, true, true, - true, - true + false ], "parameters": { - "Left": [ - "Int4" - ] + "Left": [] } }, - "query": "SELECT * FROM eth_txs_history WHERE eth_tx_id = $1 ORDER BY created_at DESC LIMIT 1" + "query": "SELECT * FROM eth_txs WHERE confirmed_eth_tx_history_id IS NULL \n AND id <= (SELECT COALESCE(MAX(eth_tx_id), 0) FROM eth_txs_history WHERE sent_at_block IS NOT NULL)\n ORDER BY id" }, - "ad4f74aa6f131df0243f4fa500ade1b98aa335bd71ed417b02361e2c697e60f8": { + "b6f9874059c57e5e59f3021936437e9ff71a68065dfc19c295d806d7a9aafc93": { "describe": { "columns": [], "nullable": [], "parameters": { "Left": [ + "Int4", + "Int8", + "Bytea", + "Bytea", + "Bytea", "Bytea", - "Int8" - ] - } - }, - "query": "\n UPDATE scheduler_witness_jobs\n SET aggregation_result_coords = $1,\n updated_at = now()\n WHERE l1_batch_number = $2\n " - }, - "adc9ad2c944f9dacc28b5bd133aa37d9e8ea99eca1c5dfbeef37cda4b793f434": { - "describe": { - "columns": [ - { - "name": "market_volume", - "ordinal": 0, - "type_info": "Numeric" - }, - { - "name": "market_volume_updated_at", - "ordinal": 1, - "type_info": "Timestamp" - } - ], - "nullable": [ - true, - true - ], - "parameters": { - "Left": [ - "Bytea" - ] - } - }, - "query": "SELECT market_volume, market_volume_updated_at FROM tokens WHERE l2_address = $1" - }, - "ae072f51b65d0b5212264be9a34027922e5aedef7e4741517ad8104bf5aa79e9": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8" - ] - } - }, - "query": "DELETE FROM factory_deps WHERE miniblock_number > $1" - }, - "aea4e8d1b018836973d252df943a2c1988dd5f3ffc629064b87d25af8cdb8638": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "l1_batch_tx_index", - "ordinal": 1, - "type_info": "Int4" - } - ], - "nullable": [ - true, - true - ], - "parameters": { - "Left": [ "Bytea" ] } }, - "query": "SELECT l1_batch_number, l1_batch_tx_index FROM transactions WHERE hash = $1" - }, - "af22ad34bde12b8d25eb85da9939d12b7bed6407d732b868eeaf2916568c8646": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Time", - "Int8" - ] - } - }, - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'successful', updated_at = now(), time_taken = $1\n WHERE l1_batch_number = $2\n " - }, - "af75db6b7e42b73ce62b28a7281e1bfa181ee0c80a85d7d8078831db5dcdb699": { - "describe": { - "columns": [ - { - "name": "l1_block_number", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - true - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT l1_block_number FROM transactions\n WHERE priority_op_id IS NOT NULL\n ORDER BY priority_op_id DESC\n LIMIT 1" + "query": "INSERT INTO prover_protocol_versions\n (id, timestamp, recursion_scheduler_level_vk_hash, recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash, recursion_circuits_set_vks_hash, verifier_address, created_at)\n VALUES ($1, $2, $3, $4, $5, $6, $7, now())\n " }, - "b1478907214ad20dddd4f3846fba4b0ddf1fff63ddb3b95c8999635e77c8b863": { + "b79f02c8663c6b99d0aa46b430de32103afa0333e8293cf8661cfc1c3f9fc12e": { "describe": { "columns": [ { "name": "id", "ordinal": 0, - "type_info": "Int4" + "type_info": "Int8" }, { - "name": "eth_tx_id", + "name": "contract_address", "ordinal": 1, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "tx_hash", + "name": "source_code", "ordinal": 2, "type_info": "Text" }, { - "name": "created_at", + "name": "contract_name", "ordinal": 3, - "type_info": "Timestamp" + "type_info": "Text" }, { - "name": "updated_at", + "name": "zk_compiler_version", "ordinal": 4, - "type_info": "Timestamp" + "type_info": "Text" }, { - "name": "base_fee_per_gas", + "name": "compiler_version", "ordinal": 5, - "type_info": "Int8" + "type_info": "Text" }, { - "name": "priority_fee_per_gas", + "name": "optimization_used", "ordinal": 6, - "type_info": "Int8" + "type_info": "Bool" }, { - "name": "confirmed_at", + "name": "optimizer_mode", "ordinal": 7, - "type_info": "Timestamp" + "type_info": "Text" }, { - "name": "signed_raw_tx", + "name": "constructor_arguments", "ordinal": 8, "type_info": "Bytea" }, { - "name": "sent_at_block", + "name": "is_system", "ordinal": 9, - "type_info": "Int4" - }, - { - "name": "sent_at", - "ordinal": 10, - "type_info": "Timestamp" + "type_info": "Bool" } ], "nullable": [ @@ -8373,278 +8668,310 @@ false, false, true, - true, - true, - true + false, + false ], "parameters": { - "Left": [ - "Int4" - ] - } - }, - "query": "SELECT * FROM eth_txs_history WHERE eth_tx_id = $1 ORDER BY created_at DESC" - }, - "b14997f84d11d7eea89168383195c5579eed1c57bb2b416a749e2863ae6594a5": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Int8" - ] + "Left": [] } }, - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status ='failed', error= $1, updated_at = now()\n WHERE id = $2\n " + "query": "SELECT id, contract_address, source_code, contract_name, zk_compiler_version, compiler_version, optimization_used,\n optimizer_mode, constructor_arguments, is_system\n FROM contract_verification_requests\n WHERE status = 'successful'\n ORDER BY id" }, - "b14d9a82e6b0a4174dde61642d3abc001cd8cb80d988eb81a685255e3ce920de": { + "b7ab3aeee71e87c7469428ec411b410d81282ff6fed63fe5cda0e81a330d2ac5": { "describe": { - "columns": [], - "nullable": [], + "columns": [ + { + "name": "id", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "status", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "attempts", + "ordinal": 2, + "type_info": "Int2" + } + ], + "nullable": [ + false, + false, + false + ], "parameters": { "Left": [ - "Int8Array", - "ByteaArray" + "Interval", + "Int2" ] } }, - "query": "UPDATE miniblocks SET hash = u.hash FROM UNNEST($1::bigint[], $2::bytea[]) AS u(number, hash) WHERE miniblocks.number = u.number\n " + "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " }, - "b479b7d3334f8d4566c294a44e2adb282fbc66a87be5c248c65211c2a8a07db0": { + "b7d3b30bff2ed9aabcdaed89ebfd1f0303b70c6d5483ff9183475bb232a04f21": { "describe": { "columns": [ { - "name": "number", + "name": "l1_batch_number", "ordinal": 0, "type_info": "Int8" }, { - "name": "hash", + "name": "status", "ordinal": 1, - "type_info": "Bytea" + "type_info": "Text" + }, + { + "name": "attempts", + "ordinal": 2, + "type_info": "Int2" } ], "nullable": [ + false, false, false ], "parameters": { "Left": [ - "Int8", - "Int8" + "Interval", + "Int2" ] } }, - "query": "SELECT number, hash FROM miniblocks WHERE number > $1 ORDER BY number ASC LIMIT $2" + "query": "\n UPDATE witness_inputs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'in_gpu_proof' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " }, - "b4c576db7c762103dc6700ded458e996d2e9ef670d7b58b181dbfab02fa426ce": { + "b944df7af612ec911170a43be846eb2f6e27163b0d3983672de2b8d5d60af640": { "describe": { - "columns": [], - "nullable": [], + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + false + ], "parameters": { "Left": [ - "Bytea", - "Bytea", - "Numeric", - "Numeric", - "Numeric", - "Jsonb", - "Int8", - "Numeric", - "Numeric", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Bytea", - "Int4", - "Numeric", - "Bytea", - "Timestamp" + "Interval" ] } }, - "query": "\n INSERT INTO transactions\n (\n hash,\n is_priority,\n initiator_address,\n\n gas_limit,\n max_fee_per_gas,\n gas_per_pubdata_limit,\n\n data,\n priority_op_id,\n full_fee,\n layer_2_tip_fee,\n contract_address,\n l1_block_number,\n value,\n\n paymaster,\n paymaster_input,\n tx_format,\n\n l1_tx_mint,\n l1_tx_refund_recipient,\n\n received_at,\n created_at,\n updated_at\n )\n VALUES\n (\n $1, TRUE, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,\n $13, $14, $15, $16, $17, $18, now(), now()\n )\n ON CONFLICT (hash) DO NOTHING\n " + "query": "UPDATE proof_generation_details SET status = 'picked_by_prover', updated_at = now(), prover_taken_at = now() WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_generation_details WHERE status = 'ready_to_be_proven' OR (status = 'picked_by_prover' AND prover_taken_at < now() - $1::interval) ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_generation_details.l1_batch_number" }, - "b4da918ee3b36b56d95c8834edebe65eb48ebb8270fa1e6ccf73ad354fd71134": { + "bc4433cdfa499830fe6a6a95759c9fbe343ac25b371c7fa980bfd1b0afc86629": { "describe": { "columns": [ { - "name": "l1_address", + "name": "l1_batch_number", "ordinal": 0, - "type_info": "Bytea" - }, - { - "name": "l2_address", - "ordinal": 1, - "type_info": "Bytea" + "type_info": "Int8" } ], "nullable": [ - false, false ], "parameters": { - "Left": [] + "Left": [ + "Text", + "Text", + "Text" + ] } }, - "query": "SELECT l1_address, l2_address FROM tokens WHERE well_known = true" + "query": "UPDATE proof_compression_jobs_fri SET status = $1, attempts = attempts + 1, updated_at = now(), processing_started_at = now(), picked_by = $3 WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_compression_jobs_fri WHERE status = $2 ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_compression_jobs_fri.l1_batch_number" }, - "b6c8e0827b2389a14433c031332962495311562ae9652ae7e9409a4bf48dc55b": { + "bdf6109aa2625b809f9ffac5351d3693e2fbd081a0e7f25e55f74571770122d1": { "describe": { "columns": [ { - "name": "id", + "name": "number", "ordinal": 0, - "type_info": "Int4" + "type_info": "Int8" }, { - "name": "nonce", + "name": "timestamp", "ordinal": 1, "type_info": "Int8" }, { - "name": "raw_tx", + "name": "is_finished", "ordinal": 2, - "type_info": "Bytea" + "type_info": "Bool" }, { - "name": "contract_address", + "name": "l1_tx_count", "ordinal": 3, - "type_info": "Text" + "type_info": "Int4" }, { - "name": "tx_type", + "name": "l2_tx_count", "ordinal": 4, - "type_info": "Text" + "type_info": "Int4" }, { - "name": "gas_used", + "name": "fee_account_address", "ordinal": 5, - "type_info": "Int8" + "type_info": "Bytea" }, { - "name": "created_at", + "name": "bloom", "ordinal": 6, - "type_info": "Timestamp" + "type_info": "Bytea" }, { - "name": "updated_at", + "name": "priority_ops_onchain_data", "ordinal": 7, - "type_info": "Timestamp" + "type_info": "ByteaArray" }, { - "name": "has_failed", + "name": "hash", "ordinal": 8, - "type_info": "Bool" + "type_info": "Bytea" }, { - "name": "sent_at_block", + "name": "parent_hash", "ordinal": 9, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "confirmed_eth_tx_history_id", + "name": "commitment", "ordinal": 10, - "type_info": "Int4" + "type_info": "Bytea" }, { - "name": "predicted_gas_cost", + "name": "compressed_write_logs", "ordinal": 11, + "type_info": "Bytea" + }, + { + "name": "compressed_contracts", + "ordinal": 12, + "type_info": "Bytea" + }, + { + "name": "eth_prove_tx_id", + "ordinal": 13, + "type_info": "Int4" + }, + { + "name": "eth_commit_tx_id", + "ordinal": 14, + "type_info": "Int4" + }, + { + "name": "eth_execute_tx_id", + "ordinal": 15, + "type_info": "Int4" + }, + { + "name": "merkle_root_hash", + "ordinal": 16, + "type_info": "Bytea" + }, + { + "name": "l2_to_l1_logs", + "ordinal": 17, + "type_info": "ByteaArray" + }, + { + "name": "l2_to_l1_messages", + "ordinal": 18, + "type_info": "ByteaArray" + }, + { + "name": "used_contract_hashes", + "ordinal": 19, + "type_info": "Jsonb" + }, + { + "name": "compressed_initial_writes", + "ordinal": 20, + "type_info": "Bytea" + }, + { + "name": "compressed_repeated_writes", + "ordinal": 21, + "type_info": "Bytea" + }, + { + "name": "l2_l1_compressed_messages", + "ordinal": 22, + "type_info": "Bytea" + }, + { + "name": "l2_l1_merkle_root", + "ordinal": 23, + "type_info": "Bytea" + }, + { + "name": "l1_gas_price", + "ordinal": 24, "type_info": "Int8" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - true, - false, - false, - false, - true, - true, - false - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT * FROM eth_txs WHERE confirmed_eth_tx_history_id IS NULL \n AND id <= (SELECT COALESCE(MAX(eth_tx_id), 0) FROM eth_txs_history WHERE sent_at_block IS NOT NULL)\n ORDER BY id" - }, - "b6f9874059c57e5e59f3021936437e9ff71a68065dfc19c295d806d7a9aafc93": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int4", - "Int8", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Bytea" - ] - } - }, - "query": "INSERT INTO prover_protocol_versions\n (id, timestamp, recursion_scheduler_level_vk_hash, recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash, recursion_circuits_set_vks_hash, verifier_address, created_at)\n VALUES ($1, $2, $3, $4, $5, $6, $7, now())\n " - }, - "b79f02c8663c6b99d0aa46b430de32103afa0333e8293cf8661cfc1c3f9fc12e": { - "describe": { - "columns": [ + }, { - "name": "id", - "ordinal": 0, + "name": "l2_fair_gas_price", + "ordinal": 25, + "type_info": "Int8" + }, + { + "name": "rollup_last_leaf_index", + "ordinal": 26, "type_info": "Int8" }, { - "name": "contract_address", - "ordinal": 1, + "name": "zkporter_is_available", + "ordinal": 27, + "type_info": "Bool" + }, + { + "name": "bootloader_code_hash", + "ordinal": 28, "type_info": "Bytea" }, { - "name": "source_code", - "ordinal": 2, - "type_info": "Text" + "name": "default_aa_code_hash", + "ordinal": 29, + "type_info": "Bytea" }, { - "name": "contract_name", - "ordinal": 3, - "type_info": "Text" + "name": "base_fee_per_gas", + "ordinal": 30, + "type_info": "Numeric" }, { - "name": "zk_compiler_version", - "ordinal": 4, - "type_info": "Text" + "name": "aux_data_hash", + "ordinal": 31, + "type_info": "Bytea" }, { - "name": "compiler_version", - "ordinal": 5, - "type_info": "Text" + "name": "pass_through_data_hash", + "ordinal": 32, + "type_info": "Bytea" }, { - "name": "optimization_used", - "ordinal": 6, - "type_info": "Bool" + "name": "meta_parameters_hash", + "ordinal": 33, + "type_info": "Bytea" }, { - "name": "optimizer_mode", - "ordinal": 7, - "type_info": "Text" + "name": "protocol_version", + "ordinal": 34, + "type_info": "Int4" }, { - "name": "constructor_arguments", - "ordinal": 8, + "name": "events_queue_commitment", + "ordinal": 35, "type_info": "Bytea" }, { - "name": "is_system", - "ordinal": 9, - "type_info": "Bool" + "name": "bootloader_initial_content_commitment", + "ordinal": 36, + "type_info": "Bytea" } ], "nullable": [ @@ -8655,123 +8982,44 @@ false, false, false, + false, + true, + true, + true, + true, + true, + true, + true, + true, true, false, - false - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT id, contract_address, source_code, contract_name, zk_compiler_version, compiler_version, optimization_used,\n optimizer_mode, constructor_arguments, is_system\n FROM contract_verification_requests\n WHERE status = 'successful'\n ORDER BY id" - }, - "b7ab3aeee71e87c7469428ec411b410d81282ff6fed63fe5cda0e81a330d2ac5": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "attempts", - "ordinal": 2, - "type_info": "Int2" - } - ], - "nullable": [ false, false, - false - ], - "parameters": { - "Left": [ - "Interval", - "Int2" - ] - } - }, - "query": "\n UPDATE leaf_aggregation_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING id, status, attempts\n " - }, - "b7d3b30bff2ed9aabcdaed89ebfd1f0303b70c6d5483ff9183475bb232a04f21": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "attempts", - "ordinal": 2, - "type_info": "Int2" - } - ], - "nullable": [ + true, + true, + true, + true, false, false, - false - ], - "parameters": { - "Left": [ - "Interval", - "Int2" - ] - } - }, - "query": "\n UPDATE witness_inputs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'in_gpu_proof' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " - }, - "b944df7af612ec911170a43be846eb2f6e27163b0d3983672de2b8d5d60af640": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Interval" - ] - } - }, - "query": "UPDATE proof_generation_details SET status = 'picked_by_prover', updated_at = now(), prover_taken_at = now() WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_generation_details WHERE status = 'ready_to_be_proven' OR (status = 'picked_by_prover' AND prover_taken_at < now() - $1::interval) ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_generation_details.l1_batch_number" - }, - "bc4433cdfa499830fe6a6a95759c9fbe343ac25b371c7fa980bfd1b0afc86629": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - } - ], - "nullable": [ - false + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true ], "parameters": { "Left": [ - "Text", - "Text", - "Text" + "Int8" ] } }, - "query": "UPDATE proof_compression_jobs_fri SET status = $1, attempts = attempts + 1, updated_at = now(), processing_started_at = now(), picked_by = $3 WHERE l1_batch_number = ( SELECT l1_batch_number FROM proof_compression_jobs_fri WHERE status = $2 ORDER BY l1_batch_number ASC LIMIT 1 FOR UPDATE SKIP LOCKED ) RETURNING proof_compression_jobs_fri.l1_batch_number" + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches 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 ORDER BY number LIMIT $1" }, "be824de76050461afe29dfd229e524bdf113eab3ca24208782c200531db1c940": { "describe": { @@ -8936,7 +9184,40 @@ }, "query": "\n INSERT INTO call_traces (tx_hash, call_trace)\n SELECT u.tx_hash, u.call_trace\n FROM UNNEST($1::bytea[], $2::bytea[])\n AS u(tx_hash, call_trace)\n " }, - "c2f391ed1397da01d04955c511a924747ea167f68da7647888f9e14ab8974610": { + "c49a6925e9462cc85a6e1cc850f2e147e0a5d990efed56f27792698e6cf9ff0c": { + "describe": { + "columns": [ + { + "name": "l1_batch_number", + "ordinal": 0, + "type_info": "Int8" + }, + { + "name": "status", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "attempts", + "ordinal": 2, + "type_info": "Int2" + } + ], + "nullable": [ + false, + false, + false + ], + "parameters": { + "Left": [ + "Interval", + "Int2" + ] + } + }, + "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " + }, + "c4f0135b4b5dd111832c909c0bf134e0cfdf6c93a8b8ad1f5a206652546aac5b": { "describe": { "columns": [ { @@ -9146,62 +9427,31 @@ false, false, false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true, - true, - true - ], - "parameters": { - "Left": [] - } - }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL ORDER BY number DESC LIMIT 1" - }, - "c49a6925e9462cc85a6e1cc850f2e147e0a5d990efed56f27792698e6cf9ff0c": { - "describe": { - "columns": [ - { - "name": "l1_batch_number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "status", - "ordinal": 1, - "type_info": "Text" - }, - { - "name": "attempts", - "ordinal": 2, - "type_info": "Int2" - } - ], - "nullable": [ + true, + true, + true, + true, false, false, - false + true, + true, + true, + true, + false, + true, + true, + true, + true, + true, + true ], "parameters": { "Left": [ - "Interval", - "Int2" + "Int8" ] } }, - "query": "\n UPDATE scheduler_witness_jobs_fri\n SET status = 'queued', attempts = attempts + 1, updated_at = now(), processing_started_at = now()\n WHERE (status = 'in_progress' AND processing_started_at <= now() - $1::interval AND attempts < $2)\n OR (status = 'failed' AND attempts < $2)\n RETURNING l1_batch_number, status, attempts\n " + "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches 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 ORDER BY number LIMIT $1" }, "c604ee1dd86ac154d67ddb339da5f65ca849887d6a1068623e874f9df00cfdd1": { "describe": { @@ -10138,244 +10388,6 @@ }, "query": "SELECT number, hash FROM miniblocks WHERE number >= $1 and protocol_version = $2 ORDER BY number LIMIT $3" }, - "e47ea1f8caf3c0a1a7d669ffdfa8482881365bdaffd8a5077cb0953d7973c3d6": { - "describe": { - "columns": [ - { - "name": "number", - "ordinal": 0, - "type_info": "Int8" - }, - { - "name": "timestamp", - "ordinal": 1, - "type_info": "Int8" - }, - { - "name": "is_finished", - "ordinal": 2, - "type_info": "Bool" - }, - { - "name": "l1_tx_count", - "ordinal": 3, - "type_info": "Int4" - }, - { - "name": "l2_tx_count", - "ordinal": 4, - "type_info": "Int4" - }, - { - "name": "fee_account_address", - "ordinal": 5, - "type_info": "Bytea" - }, - { - "name": "bloom", - "ordinal": 6, - "type_info": "Bytea" - }, - { - "name": "priority_ops_onchain_data", - "ordinal": 7, - "type_info": "ByteaArray" - }, - { - "name": "hash", - "ordinal": 8, - "type_info": "Bytea" - }, - { - "name": "parent_hash", - "ordinal": 9, - "type_info": "Bytea" - }, - { - "name": "commitment", - "ordinal": 10, - "type_info": "Bytea" - }, - { - "name": "compressed_write_logs", - "ordinal": 11, - "type_info": "Bytea" - }, - { - "name": "compressed_contracts", - "ordinal": 12, - "type_info": "Bytea" - }, - { - "name": "eth_prove_tx_id", - "ordinal": 13, - "type_info": "Int4" - }, - { - "name": "eth_commit_tx_id", - "ordinal": 14, - "type_info": "Int4" - }, - { - "name": "eth_execute_tx_id", - "ordinal": 15, - "type_info": "Int4" - }, - { - "name": "merkle_root_hash", - "ordinal": 16, - "type_info": "Bytea" - }, - { - "name": "l2_to_l1_logs", - "ordinal": 17, - "type_info": "ByteaArray" - }, - { - "name": "l2_to_l1_messages", - "ordinal": 18, - "type_info": "ByteaArray" - }, - { - "name": "used_contract_hashes", - "ordinal": 19, - "type_info": "Jsonb" - }, - { - "name": "compressed_initial_writes", - "ordinal": 20, - "type_info": "Bytea" - }, - { - "name": "compressed_repeated_writes", - "ordinal": 21, - "type_info": "Bytea" - }, - { - "name": "l2_l1_compressed_messages", - "ordinal": 22, - "type_info": "Bytea" - }, - { - "name": "l2_l1_merkle_root", - "ordinal": 23, - "type_info": "Bytea" - }, - { - "name": "l1_gas_price", - "ordinal": 24, - "type_info": "Int8" - }, - { - "name": "l2_fair_gas_price", - "ordinal": 25, - "type_info": "Int8" - }, - { - "name": "rollup_last_leaf_index", - "ordinal": 26, - "type_info": "Int8" - }, - { - "name": "zkporter_is_available", - "ordinal": 27, - "type_info": "Bool" - }, - { - "name": "bootloader_code_hash", - "ordinal": 28, - "type_info": "Bytea" - }, - { - "name": "default_aa_code_hash", - "ordinal": 29, - "type_info": "Bytea" - }, - { - "name": "base_fee_per_gas", - "ordinal": 30, - "type_info": "Numeric" - }, - { - "name": "aux_data_hash", - "ordinal": 31, - "type_info": "Bytea" - }, - { - "name": "pass_through_data_hash", - "ordinal": 32, - "type_info": "Bytea" - }, - { - "name": "meta_parameters_hash", - "ordinal": 33, - "type_info": "Bytea" - }, - { - "name": "protocol_version", - "ordinal": 34, - "type_info": "Int4" - }, - { - "name": "events_queue_commitment", - "ordinal": 35, - "type_info": "Bytea" - }, - { - "name": "bootloader_initial_content_commitment", - "ordinal": 36, - "type_info": "Bytea" - } - ], - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - true, - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - true, - true, - true, - true, - true - ], - "parameters": { - "Left": [ - "Int8", - "Int8", - "Int8" - ] - } - }, - "query": "SELECT number, timestamp, is_finished, l1_tx_count, l2_tx_count, fee_account_address, bloom, priority_ops_onchain_data, hash, parent_hash, commitment, compressed_write_logs, compressed_contracts, eth_prove_tx_id, eth_commit_tx_id, eth_execute_tx_id, merkle_root_hash, l2_to_l1_logs, l2_to_l1_messages, used_contract_hashes, compressed_initial_writes, compressed_repeated_writes, l2_l1_compressed_messages, l2_l1_merkle_root, l1_gas_price, l2_fair_gas_price, rollup_last_leaf_index, zkporter_is_available, bootloader_code_hash, default_aa_code_hash, base_fee_per_gas, aux_data_hash, pass_through_data_hash, meta_parameters_hash, protocol_version, events_queue_commitment, bootloader_initial_content_commitment FROM l1_batches WHERE number BETWEEN $1 AND $2 ORDER BY number LIMIT $3" - }, "e626aa2efb6ba875a12f2b4e37b0ba8052810e73fa5e2d3280f747f7b89b956f": { "describe": { "columns": [], diff --git a/core/lib/dal/src/blocks_dal.rs b/core/lib/dal/src/blocks_dal.rs index 0929c781776..2013eeaa4df 100644 --- a/core/lib/dal/src/blocks_dal.rs +++ b/core/lib/dal/src/blocks_dal.rs @@ -186,6 +186,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number \ WHERE number = $1", number.0 as i64 ) @@ -546,6 +547,8 @@ impl BlocksDal<'_, '_> { metadata: &L1BatchMetadata, previous_root_hash: H256, ) -> anyhow::Result<()> { + let mut transaction = self.storage.start_transaction().await?; + let update_result = sqlx::query!( "UPDATE l1_batches \ SET hash = $1, merkle_root_hash = $2, commitment = $3, \ @@ -553,9 +556,8 @@ impl BlocksDal<'_, '_> { l2_l1_compressed_messages = $6, l2_l1_merkle_root = $7, \ zkporter_is_available = $8, parent_hash = $9, rollup_last_leaf_index = $10, \ aux_data_hash = $11, pass_through_data_hash = $12, meta_parameters_hash = $13, \ - events_queue_commitment = $14, bootloader_initial_content_commitment = $15, updated_at = now() \ - WHERE number = $16 AND hash IS NULL", + WHERE number = $14 AND hash IS NULL", metadata.root_hash.as_bytes(), metadata.merkle_root_hash.as_bytes(), metadata.commitment.as_bytes(), @@ -569,16 +571,28 @@ impl BlocksDal<'_, '_> { metadata.aux_data_hash.as_bytes(), metadata.pass_through_data_hash.as_bytes(), metadata.meta_parameters_hash.as_bytes(), + number.0 as i64, + ) + .instrument("save_blocks_metadata") + .with_arg("number", &number) + .report_latency() + .execute(transaction.conn()) + .await?; + + sqlx::query!( + "INSERT INTO commitments (l1_batch_number, events_queue_commitment, bootloader_initial_content_commitment) \ + VALUES ($1, $2, $3) \ + ON CONFLICT (l1_batch_number) DO UPDATE SET events_queue_commitment = $2, bootloader_initial_content_commitment = $3", + number.0 as i64, metadata.events_queue_commitment.map(|h| h.0.to_vec()), metadata .bootloader_initial_content_commitment .map(|h| h.0.to_vec()), - number.0 as i64, ) - .instrument("save_blocks_metadata") + .instrument("save_batch_commitments") .with_arg("number", &number) .report_latency() - .execute(self.storage.conn()) + .execute(transaction.conn()) .await?; if update_result.rows_affected() == 0 { @@ -608,7 +622,7 @@ impl BlocksDal<'_, '_> { .instrument("get_matching_blocks_metadata") .with_arg("number", &number) .report_latency() - .fetch_one(self.storage.conn()) + .fetch_one(transaction.conn()) .await? .count; @@ -620,6 +634,7 @@ impl BlocksDal<'_, '_> { metadata.l2_l1_merkle_root ); } + transaction.commit().await?; Ok(()) } @@ -640,6 +655,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number \ WHERE number = 0 OR eth_commit_tx_id IS NOT NULL AND commitment IS NOT NULL \ ORDER BY number DESC \ LIMIT 1", @@ -736,6 +752,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ + 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 \ ORDER BY number LIMIT $1", limit as i32 @@ -810,6 +827,7 @@ impl BlocksDal<'_, '_> { AND l1_batches.number > $1 \ ORDER BY number LIMIT $2\ ) inn \ + LEFT JOIN commitments ON commitments.l1_batch_number = inn.number \ WHERE number - row_number = $1", last_proved_block_number.0 as i32, limit as i32 @@ -843,6 +861,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ + 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 \ ORDER BY number LIMIT $1", limit as i32, @@ -921,6 +940,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ FROM l1_batches \ + LEFT JOIN commitments ON commitments.l1_batch_number = l1_batches.number \ WHERE number BETWEEN $1 AND $2 \ ORDER BY number LIMIT $3", expected_started_point as i32, @@ -957,6 +977,7 @@ impl BlocksDal<'_, '_> { meta_parameters_hash, protocol_version, \ events_queue_commitment, bootloader_initial_content_commitment \ 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 \ WHERE eth_commit_tx_id IS NULL \ AND number != 0 \ diff --git a/core/lib/dal/src/models/storage_block.rs b/core/lib/dal/src/models/storage_block.rs index d16dc541467..80d8da65dc6 100644 --- a/core/lib/dal/src/models/storage_block.rs +++ b/core/lib/dal/src/models/storage_block.rs @@ -106,7 +106,7 @@ fn convert_base_system_contracts_hashes( } } -/// Projection of the `l1_batches` table corresponding to [`L1BatchHeader`] + [`L1BatchMetadata`]. +/// Projection of the columns corresponding to [`L1BatchHeader`] + [`L1BatchMetadata`]. // TODO(PLA-369): use `#[sqlx(flatten)]` once upgraded to newer `sqlx` #[derive(Debug, Clone, sqlx::FromRow)] pub struct StorageL1Batch { diff --git a/core/lib/utils/src/misc.rs b/core/lib/utils/src/misc.rs index 234d188400e..468e953f83b 100644 --- a/core/lib/utils/src/misc.rs +++ b/core/lib/utils/src/misc.rs @@ -20,6 +20,16 @@ pub fn concat_and_hash(hash1: H256, hash2: H256) -> H256 { H256(keccak256(&bytes)) } +pub fn expand_memory_contents(packed: &[(usize, U256)], memory_size_bytes: usize) -> Vec { + let mut result: Vec = vec![0; memory_size_bytes]; + + for (offset, value) in packed { + value.to_big_endian(&mut result[(offset * 32)..(offset + 1) * 32]); + } + + result.to_vec() +} + #[cfg(test)] mod tests { use super::*; diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index 643db6843b1..bd0b079bd5f 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -17,6 +17,7 @@ zksync_dal = { path = "../dal" } zksync_config = { path = "../config" } zksync_utils = { path = "../utils" } zksync_contracts = { path = "../contracts" } +zksync_commitment_utils = { path = "../commitment_utils" } zksync_eth_client = { path = "../eth_client" } zksync_eth_signer = { path = "../eth_signer" } zksync_mempool = { path = "../mempool" } @@ -82,8 +83,6 @@ actix-web = "4.0.0-beta.8" tracing = "0.1.26" -zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0" } - [dev-dependencies] db_test_macro = { path = "../db_test_macro" } diff --git a/core/lib/zksync_core/src/metadata_calculator/updater.rs b/core/lib/zksync_core/src/metadata_calculator/updater.rs index a82060bed56..7f41782d1dc 100644 --- a/core/lib/zksync_core/src/metadata_calculator/updater.rs +++ b/core/lib/zksync_core/src/metadata_calculator/updater.rs @@ -5,22 +5,19 @@ use tokio::sync::watch; use std::{ops, time::Instant}; -use zkevm_test_harness::witness::utils::{ - events_queue_commitment_fixed, initial_heap_content_commitment_fixed, -}; +use zksync_commitment_utils::{bootloader_initial_content_commitment, events_queue_commitment}; use zksync_config::configs::database::MerkleTreeMode; use zksync_dal::{ConnectionPool, StorageProcessor}; use zksync_health_check::HealthUpdater; use zksync_merkle_tree::domain::TreeMetadata; use zksync_object_store::ObjectStore; -use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, H256, U256}; +use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, U256}; use super::{ helpers::{AsyncTree, Delayer, L1BatchWithLogs, TreeHealthCheckDetails}, metrics::{TreeUpdateStage, METRICS}, MetadataCalculator, MetadataCalculatorConfig, }; -use crate::witness_generator::utils::expand_bootloader_contents; #[derive(Debug)] pub(super) struct TreeUpdater { @@ -146,40 +143,42 @@ impl TreeUpdater { .await; check_consistency_latency.observe(); - let (events_queue_commitment, bootloader_initial_content_commitment) = - if self.mode == MerkleTreeMode::Full { - let events_queue_commitment_latency = - METRICS.start_stage(TreeUpdateStage::EventsCommitment); - let events_queue = storage - .blocks_dal() - .get_events_queue(header.number) - .await - .unwrap() - .unwrap(); - let events_queue_commitment = events_queue_commitment_fixed(&events_queue); - events_queue_commitment_latency.observe(); - - let bootloader_commitment_latency = - METRICS.start_stage(TreeUpdateStage::BootloaderCommitment); - let initial_bootloader_contents = storage - .blocks_dal() - .get_initial_bootloader_heap(header.number) - .await - .unwrap() - .unwrap(); - let full_bootloader_memory = - expand_bootloader_contents(&initial_bootloader_contents); - let bootloader_initial_content_commitment = - initial_heap_content_commitment_fixed(&full_bootloader_memory); - bootloader_commitment_latency.observe(); - - ( - Some(H256(events_queue_commitment)), - Some(H256(bootloader_initial_content_commitment)), - ) - } else { - (None, None) - }; + let (events_queue_commitment, bootloader_initial_content_commitment) = if self.mode + == MerkleTreeMode::Full + { + let events_queue_commitment_latency = + METRICS.start_stage(TreeUpdateStage::EventsCommitment); + let events_queue = storage + .blocks_dal() + .get_events_queue(header.number) + .await + .unwrap() + .unwrap(); + let events_queue_commitment = + events_queue_commitment(&events_queue, header.protocol_version.unwrap()); + events_queue_commitment_latency.observe(); + + let bootloader_commitment_latency = + METRICS.start_stage(TreeUpdateStage::BootloaderCommitment); + let initial_bootloader_contents = storage + .blocks_dal() + .get_initial_bootloader_heap(header.number) + .await + .unwrap() + .unwrap(); + let bootloader_initial_content_commitment = bootloader_initial_content_commitment( + &initial_bootloader_contents, + header.protocol_version.unwrap(), + ); + bootloader_commitment_latency.observe(); + + ( + events_queue_commitment, + bootloader_initial_content_commitment, + ) + } else { + (None, None) + }; let build_metadata_latency = METRICS.start_stage(TreeUpdateStage::BuildMetadata); let metadata = MetadataCalculator::build_l1_batch_metadata( diff --git a/core/lib/zksync_core/src/witness_generator/basic_circuits.rs b/core/lib/zksync_core/src/witness_generator/basic_circuits.rs index 676f3c41c38..1a4b33e3e6b 100644 --- a/core/lib/zksync_core/src/witness_generator/basic_circuits.rs +++ b/core/lib/zksync_core/src/witness_generator/basic_circuits.rs @@ -29,14 +29,13 @@ use zksync_types::{ witness::oracle::VmWitnessOracle, SchedulerCircuitInstanceWitness, }, - Address, L1BatchNumber, ProtocolVersionId, H256, U256, + Address, L1BatchNumber, ProtocolVersionId, H256, U256, USED_BOOTLOADER_MEMORY_BYTES, }; -use zksync_utils::{bytes_to_chunks, h256_to_u256, u256_to_h256}; +use zksync_utils::{bytes_to_chunks, expand_memory_contents, h256_to_u256, u256_to_h256}; use super::{ precalculated_merkle_paths_provider::PrecalculatedMerklePathsProvider, - utils::{expand_bootloader_contents, save_prover_input_artifacts}, - METRICS, + utils::save_prover_input_artifacts, METRICS, }; pub struct BasicCircuitArtifacts { @@ -431,7 +430,8 @@ pub async fn generate_witness( .await .expect("Default aa bytecode should exist"); let account_bytecode = bytes_to_chunks(&account_bytecode_bytes); - let bootloader_contents = expand_bootloader_contents(&input.initial_heap_content); + let bootloader_contents = + expand_memory_contents(&input.initial_heap_content, USED_BOOTLOADER_MEMORY_BYTES); let account_code_hash = h256_to_u256(header.base_system_contracts_hashes.default_aa); let hashes: HashSet = input diff --git a/core/lib/zksync_core/src/witness_generator/mod.rs b/core/lib/zksync_core/src/witness_generator/mod.rs index e061da4d911..268e6073db5 100644 --- a/core/lib/zksync_core/src/witness_generator/mod.rs +++ b/core/lib/zksync_core/src/witness_generator/mod.rs @@ -51,7 +51,7 @@ mod precalculated_merkle_paths_provider; pub mod scheduler; #[cfg(test)] mod tests; -pub(crate) mod utils; +mod utils; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelSet, EncodeLabelValue)] #[metrics(label = "stage", format = "wit_gen_{}")] diff --git a/core/lib/zksync_core/src/witness_generator/utils.rs b/core/lib/zksync_core/src/witness_generator/utils.rs index f0083f39468..2135eddb3cc 100644 --- a/core/lib/zksync_core/src/witness_generator/utils.rs +++ b/core/lib/zksync_core/src/witness_generator/utils.rs @@ -3,17 +3,6 @@ use zksync_types::zkevm_test_harness::abstract_zksync_circuit::concrete_circuits use zksync_types::zkevm_test_harness::bellman::bn256::Bn256; use zksync_types::zkevm_test_harness::witness::oracle::VmWitnessOracle; use zksync_types::{proofs::AggregationRound, L1BatchNumber}; -use zksync_types::{U256, USED_BOOTLOADER_MEMORY_BYTES}; - -pub fn expand_bootloader_contents(packed: &[(usize, U256)]) -> Vec { - let mut result: Vec = vec![0; USED_BOOTLOADER_MEMORY_BYTES]; - - for (offset, value) in packed { - value.to_big_endian(&mut result[(offset * 32)..(offset + 1) * 32]); - } - - result.to_vec() -} pub async fn save_prover_input_artifacts( block_number: L1BatchNumber, From a9620d95c76d46c0037f4494387f159bd0a17638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cperekopskiy=E2=80=9D?= Date: Mon, 16 Oct 2023 20:41:58 +0300 Subject: [PATCH 6/6] Extract commitment calc in a separate function --- .../src/metadata_calculator/updater.rs | 81 ++++++++++--------- docker/server-v2/Dockerfile | 3 - 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/core/lib/zksync_core/src/metadata_calculator/updater.rs b/core/lib/zksync_core/src/metadata_calculator/updater.rs index 7f41782d1dc..c2d8b007659 100644 --- a/core/lib/zksync_core/src/metadata_calculator/updater.rs +++ b/core/lib/zksync_core/src/metadata_calculator/updater.rs @@ -11,7 +11,7 @@ use zksync_dal::{ConnectionPool, StorageProcessor}; use zksync_health_check::HealthUpdater; use zksync_merkle_tree::domain::TreeMetadata; use zksync_object_store::ObjectStore; -use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, U256}; +use zksync_types::{block::L1BatchHeader, writes::InitialStorageWrite, L1BatchNumber, H256, U256}; use super::{ helpers::{AsyncTree, Delayer, L1BatchWithLogs, TreeHealthCheckDetails}, @@ -143,42 +143,8 @@ impl TreeUpdater { .await; check_consistency_latency.observe(); - let (events_queue_commitment, bootloader_initial_content_commitment) = if self.mode - == MerkleTreeMode::Full - { - let events_queue_commitment_latency = - METRICS.start_stage(TreeUpdateStage::EventsCommitment); - let events_queue = storage - .blocks_dal() - .get_events_queue(header.number) - .await - .unwrap() - .unwrap(); - let events_queue_commitment = - events_queue_commitment(&events_queue, header.protocol_version.unwrap()); - events_queue_commitment_latency.observe(); - - let bootloader_commitment_latency = - METRICS.start_stage(TreeUpdateStage::BootloaderCommitment); - let initial_bootloader_contents = storage - .blocks_dal() - .get_initial_bootloader_heap(header.number) - .await - .unwrap() - .unwrap(); - let bootloader_initial_content_commitment = bootloader_initial_content_commitment( - &initial_bootloader_contents, - header.protocol_version.unwrap(), - ); - bootloader_commitment_latency.observe(); - - ( - events_queue_commitment, - bootloader_initial_content_commitment, - ) - } else { - (None, None) - }; + let (events_queue_commitment, bootloader_initial_content_commitment) = + self.calculate_commitments(storage, &header).await; let build_metadata_latency = METRICS.start_stage(TreeUpdateStage::BuildMetadata); let metadata = MetadataCalculator::build_l1_batch_metadata( @@ -253,6 +219,47 @@ impl TreeUpdater { last_l1_batch_number + 1 } + async fn calculate_commitments( + &self, + conn: &mut StorageProcessor<'_>, + header: &L1BatchHeader, + ) -> (Option, Option) { + if self.mode == MerkleTreeMode::Full { + let events_queue_commitment_latency = + METRICS.start_stage(TreeUpdateStage::EventsCommitment); + let events_queue = conn + .blocks_dal() + .get_events_queue(header.number) + .await + .unwrap() + .unwrap(); + let events_queue_commitment = + events_queue_commitment(&events_queue, header.protocol_version.unwrap()); + events_queue_commitment_latency.observe(); + + let bootloader_commitment_latency = + METRICS.start_stage(TreeUpdateStage::BootloaderCommitment); + let initial_bootloader_contents = conn + .blocks_dal() + .get_initial_bootloader_heap(header.number) + .await + .unwrap() + .unwrap(); + let bootloader_initial_content_commitment = bootloader_initial_content_commitment( + &initial_bootloader_contents, + header.protocol_version.unwrap(), + ); + bootloader_commitment_latency.observe(); + + ( + events_queue_commitment, + bootloader_initial_content_commitment, + ) + } else { + (None, None) + } + } + async fn step( &mut self, mut storage: StorageProcessor<'_>, diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index 23402dc0833..ff441ab4170 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -17,9 +17,6 @@ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ rustup install nightly-2023-07-21 && \ rustup default nightly-2023-07-21 -WORKDIR /usr/src/zksync -COPY . . - RUN cargo build --release --features=rocksdb/io-uring FROM debian:bookworm-slim