diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json
index c3898055f848..7e3c7e01ae74 100644
--- a/.github/release-please/manifest.json
+++ b/.github/release-please/manifest.json
@@ -1,5 +1,5 @@
{
"core": "25.2.0",
- "prover": "17.1.1",
+ "prover": "17.1.0",
"zkstack_cli": "0.1.2"
}
diff --git a/.github/workflows/zk-environment-publish.yml b/.github/workflows/zk-environment-publish.yml
index e9dfac1c6bb2..b9321c8f5d6c 100644
--- a/.github/workflows/zk-environment-publish.yml
+++ b/.github/workflows/zk-environment-publish.yml
@@ -128,7 +128,8 @@ jobs:
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') }}
zk_environment_multiarch_manifest:
- if: ${{ (needs.changed_files.outputs.zk_environment == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') }}
+ # We'll update the 'latest' tag, only on environments generated from 'main'.
+ if: needs.changed_files.outputs.zk_environment == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
# Needed to push to Gihub Package Registry
permissions:
packages: write
diff --git a/.gitignore b/.gitignore
index 471a601cc34b..adf3b7799618 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,6 +120,3 @@ configs/*
era-observability/
core/tests/ts-integration/deployments-zk
transactions/
-
-# foundry-zksync
-install
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index a482c627d1a7..5b408fe71c5a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11430,16 +11430,6 @@ dependencies = [
"zksync_pairing",
]
-[[package]]
-name = "zksync_bin_metadata"
-version = "0.1.0"
-dependencies = [
- "rustc_version 0.4.1",
- "serde",
- "tracing",
- "vise",
-]
-
[[package]]
name = "zksync_block_reverter"
version = "0.1.0"
@@ -11513,9 +11503,9 @@ dependencies = [
[[package]]
name = "zksync_concurrency"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c24c9a056499823227503dd9e5fb3037d93bcc3ae9b06c1ac0a47334c6283af"
+checksum = "035269d811b3770debca372141ab64cad067dce8e58cb39a48cb7617d30c626b"
dependencies = [
"anyhow",
"once_cell",
@@ -11549,9 +11539,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_bft"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9e7ae72c257d6a4956ecb1b9d77eb082b0b31e9f47a7860d107509fb55c474d"
+checksum = "a8001633dee671134cf572175a6c4f817904ce5f8d92e9b51f49891c5184a831"
dependencies = [
"anyhow",
"async-trait",
@@ -11571,9 +11561,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_crypto"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5da303b01f24283e93f80f361bf62c3df4a761d061c8b38b4faebeebf26362fc"
+checksum = "49e38d1b5ed28c66e785caff53ea4863375555d818aafa03290397192dd3e665"
dependencies = [
"anyhow",
"blst",
@@ -11592,9 +11582,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_executor"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a33cfae30ebaaa817394718fe0858dfa7c0abfa2ed800ea283c407560aac2465"
+checksum = "061546668dd779ecb08302d2c84a6419e0093ad42aaa279bf20a8fa2ffda1be4"
dependencies = [
"anyhow",
"async-trait",
@@ -11614,9 +11604,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_network"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0129eab96f940ce24f975a27ef9408592d64da7cff51153755dedefbcf58a73"
+checksum = "4e9789b5be26d20511bd7930bd9916d91122ff6cb09a28898563152a52f9f5eb"
dependencies = [
"anyhow",
"async-trait",
@@ -11651,9 +11641,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_roles"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50f07db2a8ec2d2cda5cb4c5ac408101e81c8fa5d95c9f3302829dafae78d11c"
+checksum = "e49fbd4e69b276058f3dfc06cf6ada0e8caa6ed826e81289e4d596da95a0f17a"
dependencies = [
"anyhow",
"bit-vec",
@@ -11673,9 +11663,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_storage"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a42f57cc5afcee634cbd336e9e6ea891d0171352d7c0bc7d6e17f6c8faa554"
+checksum = "b2b2aab4ed18b13cd584f4edcc2546c8da82f89ac62e525063e12935ff28c9be"
dependencies = [
"anyhow",
"async-trait",
@@ -11693,9 +11683,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_utils"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3222410c67617a86edb192e0c4bb48afc254a17052200a0a839c90e8b0378842"
+checksum = "10bac8f471b182d4fa3d40cf158aac3624fe636a1ff0b4cf3fe26a0e20c68a42"
dependencies = [
"anyhow",
"rand 0.8.5",
@@ -12029,7 +12019,6 @@ dependencies = [
"async-trait",
"chrono",
"once_cell",
- "serde",
"test-casing",
"test-log",
"thiserror",
@@ -12040,7 +12029,6 @@ dependencies = [
"zksync_contracts",
"zksync_dal",
"zksync_eth_client",
- "zksync_health_check",
"zksync_l1_contract_interface",
"zksync_node_fee_model",
"zksync_node_test_utils",
@@ -12068,9 +12056,6 @@ dependencies = [
"anyhow",
"async-recursion",
"async-trait",
- "bincode",
- "hex",
- "itertools 0.10.5",
"test-log",
"thiserror",
"tokio",
@@ -12080,11 +12065,9 @@ dependencies = [
"zksync_contracts",
"zksync_dal",
"zksync_eth_client",
- "zksync_mini_merkle_tree",
"zksync_shared_metrics",
"zksync_system_constants",
"zksync_types",
- "zksync_web3_decl",
]
[[package]]
@@ -12222,7 +12205,6 @@ dependencies = [
"tokio",
"tracing",
"vise",
- "zksync_bin_metadata",
]
[[package]]
@@ -12438,7 +12420,6 @@ dependencies = [
"zksync_config",
"zksync_consensus_roles",
"zksync_contracts",
- "zksync_crypto_primitives",
"zksync_dal",
"zksync_health_check",
"zksync_metadata_calculator",
@@ -12553,13 +12534,11 @@ dependencies = [
"futures 0.3.31",
"pin-project-lite",
"semver 1.0.23",
- "serde",
"thiserror",
"tokio",
"tracing",
"trybuild",
"zksync_base_token_adjuster",
- "zksync_bin_metadata",
"zksync_block_reverter",
"zksync_circuit_breaker",
"zksync_commitment_generator",
@@ -12593,7 +12572,6 @@ dependencies = [
"zksync_proof_data_handler",
"zksync_queued_job_processor",
"zksync_reorg_detector",
- "zksync_shared_metrics",
"zksync_state",
"zksync_state_keeper",
"zksync_storage",
@@ -12767,9 +12745,9 @@ dependencies = [
[[package]]
name = "zksync_protobuf"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05755c38b134b409736008bfdfd0fdb42bfa061947be93be4c78069aa10c9b3"
+checksum = "abd55c64f54cb10967a435422f66ff5880ae14a232b245517c7ce38da32e0cab"
dependencies = [
"anyhow",
"bit-vec",
@@ -12788,9 +12766,9 @@ dependencies = [
[[package]]
name = "zksync_protobuf_build"
-version = "0.6.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64c3930a73ca667780be6dcd94e469d40a93fa52f4654c9ab732991b62238cb5"
+checksum = "4121952bcaf711005dd554612fc6e2de9b30cb58088508df87f1d38046ce8ac8"
dependencies = [
"anyhow",
"heck 0.5.0",
@@ -12906,10 +12884,9 @@ dependencies = [
name = "zksync_shared_metrics"
version = "0.1.0"
dependencies = [
- "serde",
+ "rustc_version 0.4.1",
"tracing",
"vise",
- "zksync_bin_metadata",
"zksync_dal",
"zksync_types",
]
@@ -12990,7 +12967,6 @@ dependencies = [
"itertools 0.10.5",
"once_cell",
"rand 0.8.5",
- "serde",
"tempfile",
"test-casing",
"thiserror",
@@ -13002,7 +12978,6 @@ dependencies = [
"zksync_contracts",
"zksync_dal",
"zksync_eth_client",
- "zksync_health_check",
"zksync_mempool",
"zksync_multivm",
"zksync_node_fee_model",
diff --git a/Cargo.toml b/Cargo.toml
index 138c0913b363..d00de197d0a6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -79,7 +79,6 @@ members = [
# Test infrastructure
"core/tests/loadnext",
"core/tests/vm-benchmark",
- "core/lib/bin_metadata",
]
resolver = "2"
@@ -250,16 +249,16 @@ zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.7" }
zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "457d8a7eea9093af9440662e33e598c13ba41633" }
# Consensus dependencies.
-zksync_concurrency = "=0.6.0"
-zksync_consensus_bft = "=0.6.0"
-zksync_consensus_crypto = "=0.6.0"
-zksync_consensus_executor = "=0.6.0"
-zksync_consensus_network = "=0.6.0"
-zksync_consensus_roles = "=0.6.0"
-zksync_consensus_storage = "=0.6.0"
-zksync_consensus_utils = "=0.6.0"
-zksync_protobuf = "=0.6.0"
-zksync_protobuf_build = "=0.6.0"
+zksync_concurrency = "=0.5.0"
+zksync_consensus_bft = "=0.5.0"
+zksync_consensus_crypto = "=0.5.0"
+zksync_consensus_executor = "=0.5.0"
+zksync_consensus_network = "=0.5.0"
+zksync_consensus_roles = "=0.5.0"
+zksync_consensus_storage = "=0.5.0"
+zksync_consensus_utils = "=0.5.0"
+zksync_protobuf = "=0.5.0"
+zksync_protobuf_build = "=0.5.0"
# "Local" dependencies
zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" }
@@ -282,7 +281,6 @@ zksync_health_check = { version = "0.1.0", path = "core/lib/health_check" }
zksync_l1_contract_interface = { version = "0.1.0", path = "core/lib/l1_contract_interface" }
zksync_mempool = { version = "0.1.0", path = "core/lib/mempool" }
zksync_merkle_tree = { version = "0.1.0", path = "core/lib/merkle_tree" }
-zksync_bin_metadata = { version = "0.1.0", path = "core/lib/bin_metadata" }
zksync_mini_merkle_tree = { version = "0.1.0", path = "core/lib/mini_merkle_tree" }
zksync_object_store = { version = "0.1.0", path = "core/lib/object_store" }
zksync_protobuf_config = { version = "0.1.0", path = "core/lib/protobuf_config" }
diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs
index 49f37116de75..81604f83008a 100644
--- a/core/bin/external_node/src/config/mod.rs
+++ b/core/bin/external_node/src/config/mod.rs
@@ -102,15 +102,11 @@ impl ConfigurationSource for Environment {
/// This part of the external node config is fetched directly from the main node.
#[derive(Debug, Deserialize)]
pub(crate) struct RemoteENConfig {
- #[serde(alias = "bridgehub_proxy_addr")]
- pub l1_bridgehub_proxy_addr: Option
,
- #[serde(alias = "state_transition_proxy_addr")]
- pub l1_state_transition_proxy_addr: Option,
- #[serde(alias = "transparent_proxy_admin_addr")]
- pub l1_transparent_proxy_admin_addr: Option,
- /// Should not be accessed directly. Use [`ExternalNodeConfig::l1_diamond_proxy_address`] instead.
- #[serde(alias = "diamond_proxy_addr")]
- l1_diamond_proxy_addr: Address,
+ pub bridgehub_proxy_addr: Option,
+ pub state_transition_proxy_addr: Option,
+ pub transparent_proxy_admin_addr: Option,
+ /// Should not be accessed directly. Use [`ExternalNodeConfig::diamond_proxy_address`] instead.
+ diamond_proxy_addr: Address,
// While on L1 shared bridge and legacy bridge are different contracts with different addresses,
// the `l2_erc20_bridge_addr` and `l2_shared_bridge_addr` are basically the same contract, but with
// a different name, with names adapted only for consistency.
@@ -148,7 +144,7 @@ impl RemoteENConfig {
.rpc_context("ecosystem_contracts")
.await
.ok();
- let l1_diamond_proxy_addr = client
+ let diamond_proxy_addr = client
.get_main_contract()
.rpc_context("get_main_contract")
.await?;
@@ -184,14 +180,14 @@ impl RemoteENConfig {
}
Ok(Self {
- l1_bridgehub_proxy_addr: ecosystem_contracts.as_ref().map(|a| a.bridgehub_proxy_addr),
- l1_state_transition_proxy_addr: ecosystem_contracts
+ bridgehub_proxy_addr: ecosystem_contracts.as_ref().map(|a| a.bridgehub_proxy_addr),
+ state_transition_proxy_addr: ecosystem_contracts
.as_ref()
.map(|a| a.state_transition_proxy_addr),
- l1_transparent_proxy_admin_addr: ecosystem_contracts
+ transparent_proxy_admin_addr: ecosystem_contracts
.as_ref()
.map(|a| a.transparent_proxy_admin_addr),
- l1_diamond_proxy_addr,
+ diamond_proxy_addr,
l2_testnet_paymaster_addr,
l1_erc20_bridge_proxy_addr: bridges.l1_erc20_default_bridge,
l2_erc20_bridge_addr: l2_erc20_default_bridge,
@@ -216,10 +212,10 @@ impl RemoteENConfig {
#[cfg(test)]
fn mock() -> Self {
Self {
- l1_bridgehub_proxy_addr: None,
- l1_state_transition_proxy_addr: None,
- l1_transparent_proxy_admin_addr: None,
- l1_diamond_proxy_addr: Address::repeat_byte(1),
+ bridgehub_proxy_addr: None,
+ state_transition_proxy_addr: None,
+ transparent_proxy_admin_addr: None,
+ diamond_proxy_addr: Address::repeat_byte(1),
l1_erc20_bridge_proxy_addr: Some(Address::repeat_byte(2)),
l2_erc20_bridge_addr: Some(Address::repeat_byte(3)),
l2_weth_bridge_addr: None,
@@ -483,6 +479,7 @@ pub(crate) struct OptionalENConfig {
#[serde(default = "OptionalENConfig::default_pruning_data_retention_sec")]
pruning_data_retention_sec: u64,
/// Gateway RPC URL, needed for operating during migration.
+ #[allow(dead_code)]
pub gateway_url: Option,
/// Interval for bridge addresses refreshing in seconds.
bridge_addresses_refresh_interval_sec: Option,
@@ -492,11 +489,7 @@ pub(crate) struct OptionalENConfig {
}
impl OptionalENConfig {
- fn from_configs(
- general_config: &GeneralConfig,
- enconfig: &ENConfig,
- secrets: &Secrets,
- ) -> anyhow::Result {
+ fn from_configs(general_config: &GeneralConfig, enconfig: &ENConfig) -> anyhow::Result {
let api_namespaces = load_config!(general_config.api_config, web3_json_rpc.api_namespaces)
.map(|a: Vec| a.iter().map(|a| a.parse()).collect::>())
.transpose()?;
@@ -728,10 +721,7 @@ impl OptionalENConfig {
.unwrap_or_else(Self::default_main_node_rate_limit_rps),
api_namespaces,
contracts_diamond_proxy_addr: None,
- gateway_url: secrets
- .l1
- .as_ref()
- .and_then(|l1| l1.gateway_rpc_url.clone()),
+ gateway_url: enconfig.gateway_url.clone(),
bridge_addresses_refresh_interval_sec: enconfig.bridge_addresses_refresh_interval_sec,
timestamp_asserter_min_time_till_end_sec: general_config
.timestamp_asserter_config
@@ -1350,11 +1340,7 @@ impl ExternalNodeConfig<()> {
&external_node_config,
&secrets_config,
)?;
- let optional = OptionalENConfig::from_configs(
- &general_config,
- &external_node_config,
- &secrets_config,
- )?;
+ let optional = OptionalENConfig::from_configs(&general_config, &external_node_config)?;
let postgres = PostgresConfig {
database_url: secrets_config
.database
@@ -1397,7 +1383,7 @@ impl ExternalNodeConfig<()> {
let remote = RemoteENConfig::fetch(main_node_client)
.await
.context("Unable to fetch required config values from the main node")?;
- let remote_diamond_proxy_addr = remote.l1_diamond_proxy_addr;
+ let remote_diamond_proxy_addr = remote.diamond_proxy_addr;
if let Some(local_diamond_proxy_addr) = self.optional.contracts_diamond_proxy_addr {
anyhow::ensure!(
local_diamond_proxy_addr == remote_diamond_proxy_addr,
@@ -1444,14 +1430,14 @@ impl ExternalNodeConfig {
}
}
- /// Returns verified L1 diamond proxy address.
+ /// Returns a verified diamond proxy address.
/// If local configuration contains the address, it will be checked against the one returned by the main node.
/// Otherwise, the remote value will be used. However, using remote value has trust implications for the main
/// node so relying on it solely is not recommended.
- pub fn l1_diamond_proxy_address(&self) -> Address {
+ pub fn diamond_proxy_address(&self) -> Address {
self.optional
.contracts_diamond_proxy_addr
- .unwrap_or(self.remote.l1_diamond_proxy_addr)
+ .unwrap_or(self.remote.diamond_proxy_addr)
}
}
@@ -1475,10 +1461,10 @@ impl From<&ExternalNodeConfig> for InternalApiConfig {
l1_weth_bridge: config.remote.l1_weth_bridge_addr,
l2_weth_bridge: config.remote.l2_weth_bridge_addr,
},
- l1_bridgehub_proxy_addr: config.remote.l1_bridgehub_proxy_addr,
- l1_state_transition_proxy_addr: config.remote.l1_state_transition_proxy_addr,
- l1_transparent_proxy_admin_addr: config.remote.l1_transparent_proxy_admin_addr,
- l1_diamond_proxy_addr: config.remote.l1_diamond_proxy_addr,
+ bridgehub_proxy_addr: config.remote.bridgehub_proxy_addr,
+ state_transition_proxy_addr: config.remote.state_transition_proxy_addr,
+ transparent_proxy_admin_addr: config.remote.transparent_proxy_admin_addr,
+ diamond_proxy_addr: config.remote.diamond_proxy_addr,
l2_testnet_paymaster_addr: config.remote.l2_testnet_paymaster_addr,
req_entities_limit: config.optional.req_entities_limit,
fee_history_limit: config.optional.fee_history_limit,
diff --git a/core/bin/external_node/src/metrics/framework.rs b/core/bin/external_node/src/metrics/framework.rs
index 228af8aa0417..fc9d4fe51345 100644
--- a/core/bin/external_node/src/metrics/framework.rs
+++ b/core/bin/external_node/src/metrics/framework.rs
@@ -5,7 +5,7 @@ use zksync_node_framework::{
implementations::resources::pools::{MasterPool, PoolResource},
FromContext, IntoContext, StopReceiver, Task, TaskId, WiringError, WiringLayer,
};
-use zksync_shared_metrics::{GIT_METRICS, RUST_METRICS};
+use zksync_shared_metrics::rustc::RUST_METRICS;
use zksync_types::{L1ChainId, L2ChainId, SLChainId};
use super::EN_METRICS;
@@ -40,7 +40,6 @@ impl WiringLayer for ExternalNodeMetricsLayer {
async fn wire(self, input: Self::Input) -> Result {
RUST_METRICS.initialize();
- GIT_METRICS.initialize();
EN_METRICS.observe_config(
self.l1_chain_id,
self.sl_chain_id,
diff --git a/core/bin/external_node/src/node_builder.rs b/core/bin/external_node/src/node_builder.rs
index 5f9445d30fe8..5c70fd436781 100644
--- a/core/bin/external_node/src/node_builder.rs
+++ b/core/bin/external_node/src/node_builder.rs
@@ -33,7 +33,7 @@ use zksync_node_framework::{
NodeStorageInitializerLayer,
},
pools_layer::PoolsLayerBuilder,
- postgres::PostgresLayer,
+ postgres_metrics::PostgresMetricsLayer,
prometheus_exporter::PrometheusExporterLayer,
pruning::PruningLayer,
query_eth_client::QueryEthClientLayer,
@@ -57,7 +57,7 @@ use zksync_node_framework::{
service::{ZkStackService, ZkStackServiceBuilder},
};
use zksync_state::RocksdbStorageOptions;
-use zksync_types::L2_ASSET_ROUTER_ADDRESS;
+use zksync_types::L2_NATIVE_TOKEN_VAULT_ADDRESS;
use crate::{config::ExternalNodeConfig, metrics::framework::ExternalNodeMetricsLayer, Component};
@@ -125,8 +125,8 @@ impl ExternalNodeBuilder {
Ok(self)
}
- fn add_postgres_layer(mut self) -> anyhow::Result {
- self.node.add_layer(PostgresLayer);
+ fn add_postgres_metrics_layer(mut self) -> anyhow::Result {
+ self.node.add_layer(PostgresMetricsLayer);
Ok(self)
}
@@ -181,7 +181,8 @@ impl ExternalNodeBuilder {
let query_eth_client_layer = QueryEthClientLayer::new(
self.config.required.settlement_layer_id(),
self.config.required.eth_client_url.clone(),
- self.config.optional.gateway_url.clone(),
+ // TODO(EVM-676): add this config for external node
+ Default::default(),
);
self.node.add_layer(query_eth_client_layer);
Ok(self)
@@ -199,11 +200,12 @@ impl ExternalNodeBuilder {
.remote
.l2_shared_bridge_addr
.context("Missing `l2_shared_bridge_addr`")?;
- let l2_legacy_shared_bridge_addr = if l2_shared_bridge_addr == L2_ASSET_ROUTER_ADDRESS {
- // System has migrated to `L2_ASSET_ROUTER_ADDRESS`, use legacy shared bridge address from main node.
+ let l2_legacy_shared_bridge_addr = if l2_shared_bridge_addr == L2_NATIVE_TOKEN_VAULT_ADDRESS
+ {
+ // System has migrated to `L2_NATIVE_TOKEN_VAULT_ADDRESS`, use legacy shared bridge address from main node.
self.config.remote.l2_legacy_shared_bridge_addr
} else {
- // System hasn't migrated on `L2_ASSET_ROUTER_ADDRESS`, we can safely use `l2_shared_bridge_addr`.
+ // System hasn't migrated on `L2_NATIVE_TOKEN_VAULT_ADDRESS`, we can safely use `l2_shared_bridge_addr`.
Some(l2_shared_bridge_addr)
};
@@ -276,7 +278,7 @@ impl ExternalNodeBuilder {
fn add_l1_batch_commitment_mode_validation_layer(mut self) -> anyhow::Result {
let layer = L1BatchCommitmentModeValidationLayer::new(
- self.config.l1_diamond_proxy_address(),
+ self.config.diamond_proxy_address(),
self.config.optional.l1_batch_commit_data_generator_mode,
);
self.node.add_layer(layer);
@@ -295,10 +297,9 @@ impl ExternalNodeBuilder {
fn add_consistency_checker_layer(mut self) -> anyhow::Result {
let max_batches_to_recheck = 10; // TODO (BFT-97): Make it a part of a proper EN config
let layer = ConsistencyCheckerLayer::new(
- self.config.l1_diamond_proxy_address(),
+ self.config.diamond_proxy_address(),
max_batches_to_recheck,
self.config.optional.l1_batch_commit_data_generator_mode,
- self.config.required.l2_chain_id,
);
self.node.add_layer(layer);
Ok(self)
@@ -323,10 +324,7 @@ impl ExternalNodeBuilder {
}
fn add_tree_data_fetcher_layer(mut self) -> anyhow::Result {
- let layer = TreeDataFetcherLayer::new(
- self.config.l1_diamond_proxy_address(),
- self.config.required.l2_chain_id,
- );
+ let layer = TreeDataFetcherLayer::new(self.config.diamond_proxy_address());
self.node.add_layer(layer);
Ok(self)
}
@@ -584,7 +582,7 @@ impl ExternalNodeBuilder {
// so until we have a dedicated component for "auxiliary" tasks,
// it's responsible for things like metrics.
self = self
- .add_postgres_layer()?
+ .add_postgres_metrics_layer()?
.add_external_node_metrics_layer()?;
// We assign the storage initialization to the core, as it's considered to be
// the "main" component.
diff --git a/core/bin/external_node/src/tests/mod.rs b/core/bin/external_node/src/tests/mod.rs
index fd616a467ee8..59aceea819f1 100644
--- a/core/bin/external_node/src/tests/mod.rs
+++ b/core/bin/external_node/src/tests/mod.rs
@@ -35,7 +35,7 @@ async fn external_node_basics(components_str: &'static str) {
}
let l2_client = utils::mock_l2_client(&env);
- let eth_client = utils::mock_eth_client(env.config.l1_diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.diamond_proxy_address());
let node_handle = tokio::task::spawn_blocking(move || {
std::thread::spawn(move || {
@@ -104,7 +104,7 @@ async fn node_reacts_to_stop_signal_during_initial_reorg_detection() {
let (env, env_handles) = utils::TestEnvironment::with_genesis_block("core").await;
let l2_client = utils::mock_l2_client_hanging();
- let eth_client = utils::mock_eth_client(env.config.l1_diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.diamond_proxy_address());
let mut node_handle = tokio::task::spawn_blocking(move || {
std::thread::spawn(move || {
@@ -140,7 +140,7 @@ async fn running_tree_without_core_is_not_allowed() {
let (env, _env_handles) = utils::TestEnvironment::with_genesis_block("tree").await;
let l2_client = utils::mock_l2_client(&env);
- let eth_client = utils::mock_eth_client(env.config.l1_diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.diamond_proxy_address());
let node_handle = tokio::task::spawn_blocking(move || {
std::thread::spawn(move || {
diff --git a/core/bin/external_node/src/tests/utils.rs b/core/bin/external_node/src/tests/utils.rs
index 58e2a88e5fb7..b26fa80d1a95 100644
--- a/core/bin/external_node/src/tests/utils.rs
+++ b/core/bin/external_node/src/tests/utils.rs
@@ -23,13 +23,10 @@ pub(super) fn block_details_base(hash: H256) -> api::BlockDetailsBase {
status: api::BlockStatus::Sealed,
commit_tx_hash: None,
committed_at: None,
- commit_chain_id: None,
prove_tx_hash: None,
proven_at: None,
- prove_chain_id: None,
execute_tx_hash: None,
executed_at: None,
- execute_chain_id: None,
l1_gas_price: 0,
l2_fair_gas_price: 0,
fair_pubdata_price: None,
diff --git a/core/bin/zksync_server/src/node_builder.rs b/core/bin/zksync_server/src/node_builder.rs
index d74928e8fbc7..794c847a24d5 100644
--- a/core/bin/zksync_server/src/node_builder.rs
+++ b/core/bin/zksync_server/src/node_builder.rs
@@ -48,7 +48,7 @@ use zksync_node_framework::{
object_store::ObjectStoreLayer,
pk_signing_eth_client::PKSigningEthClientLayer,
pools_layer::PoolsLayerBuilder,
- postgres::PostgresLayer,
+ postgres_metrics::PostgresMetricsLayer,
prometheus_exporter::PrometheusExporterLayer,
proof_data_handler::ProofDataHandlerLayer,
query_eth_client::QueryEthClientLayer,
@@ -138,8 +138,8 @@ impl MainNodeBuilder {
Ok(self)
}
- fn add_postgres_layer(mut self) -> anyhow::Result {
- self.node.add_layer(PostgresLayer);
+ fn add_postgres_metrics_layer(mut self) -> anyhow::Result {
+ self.node.add_layer(PostgresMetricsLayer);
Ok(self)
}
@@ -161,7 +161,11 @@ impl MainNodeBuilder {
let query_eth_client_layer = QueryEthClientLayer::new(
genesis.settlement_layer_id(),
eth_config.l1_rpc_url,
- eth_config.gateway_rpc_url,
+ self.configs
+ .eth
+ .as_ref()
+ .and_then(|x| Some(x.gas_adjuster?.settlement_mode))
+ .unwrap_or(SettlementMode::SettlesToL1),
);
self.node.add_layer(query_eth_client_layer);
Ok(self)
@@ -279,7 +283,6 @@ impl MainNodeBuilder {
self.node.add_layer(EthWatchLayer::new(
try_load_config!(eth_config.watcher),
self.contracts_config.clone(),
- self.genesis_config.l2_chain_id,
));
Ok(self)
}
@@ -757,7 +760,9 @@ impl MainNodeBuilder {
self = self.add_eth_tx_manager_layer()?;
}
Component::Housekeeper => {
- self = self.add_house_keeper_layer()?.add_postgres_layer()?;
+ self = self
+ .add_house_keeper_layer()?
+ .add_postgres_metrics_layer()?;
}
Component::ProofDataHandler => {
self = self.add_proof_data_handler_layer()?;
diff --git a/core/lib/basic_types/src/lib.rs b/core/lib/basic_types/src/lib.rs
index 8b8e24af4339..d79bc57cc5e1 100644
--- a/core/lib/basic_types/src/lib.rs
+++ b/core/lib/basic_types/src/lib.rs
@@ -149,7 +149,7 @@ impl<'de> Deserialize<'de> for L2ChainId {
}
impl L2ChainId {
- pub fn new(number: u64) -> Result {
+ fn new(number: u64) -> Result {
if number > L2ChainId::max().0 {
return Err(format!(
"Cannot convert given value {} into L2ChainId. It's greater than MAX: {}",
diff --git a/core/lib/basic_types/src/web3/mod.rs b/core/lib/basic_types/src/web3/mod.rs
index 98625831c991..e6d3cab37273 100644
--- a/core/lib/basic_types/src/web3/mod.rs
+++ b/core/lib/basic_types/src/web3/mod.rs
@@ -198,7 +198,7 @@ pub struct Filter {
}
#[derive(Default, Debug, PartialEq, Clone)]
-pub struct ValueOrArray(pub Vec);
+pub struct ValueOrArray(Vec);
impl ValueOrArray {
pub fn flatten(self) -> Vec {
@@ -206,12 +206,6 @@ impl ValueOrArray {
}
}
-impl From for ValueOrArray {
- fn from(value: T) -> Self {
- Self(vec![value])
- }
-}
-
impl Serialize for ValueOrArray
where
T: Serialize,
diff --git a/core/lib/bin_metadata/Cargo.toml b/core/lib/bin_metadata/Cargo.toml
deleted file mode 100644
index e529ecfb49a7..000000000000
--- a/core/lib/bin_metadata/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "zksync_bin_metadata"
-version.workspace = true
-edition.workspace = true
-authors.workspace = true
-homepage.workspace = true
-repository.workspace = true
-license.workspace = true
-keywords.workspace = true
-categories.workspace = true
-
-[dependencies]
-serde.workspace = true
-vise.workspace = true
-tracing.workspace = true
-
-[build-dependencies]
-rustc_version.workspace = true
diff --git a/core/lib/bin_metadata/build.rs b/core/lib/bin_metadata/build.rs
deleted file mode 100644
index ff339ae5589c..000000000000
--- a/core/lib/bin_metadata/build.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-//! Build script for the external node binary.
-
-use std::{
- env, fs,
- io::{self, Write},
- path::Path,
- process::Command,
-};
-
-use rustc_version::{Channel, LlvmVersion};
-
-fn print_binary_meta(out: &mut impl Write) -> io::Result<()> {
- let rustc_meta = rustc_version::version_meta().expect("Failed obtaining rustc metadata");
-
- writeln!(
- out,
- "pub const RUST_METADATA: RustMetadata = RustMetadata {{ \
- version: {semver:?}, \
- commit_hash: {commit_hash:?}, \
- commit_date: {commit_date:?}, \
- channel: {channel:?}, \
- host: {host:?}, \
- llvm: {llvm:?}, \
- }};
-
- pub const GIT_METADATA: GitMetadata = GitMetadata {{ \
- branch: {git_branch:?}, \
- revision: {git_revision:?} \
- }};",
- semver = rustc_meta.semver.to_string(),
- commit_hash = rustc_meta.commit_hash,
- commit_date = rustc_meta.commit_date,
- channel = match rustc_meta.channel {
- Channel::Dev => "dev",
- Channel::Beta => "beta",
- Channel::Nightly => "nightly",
- Channel::Stable => "stable",
- },
- host = rustc_meta.host,
- llvm = rustc_meta.llvm_version.as_ref().map(LlvmVersion::to_string),
- git_branch = git_branch(),
- git_revision = git_revision()
- )
-}
-
-/// Outputs the current git branch as a string literal.
-pub fn git_branch() -> Option {
- run_cmd_opt("git", &["rev-parse", "--abbrev-ref", "HEAD"])
-}
-
-/// Outputs the current git commit hash as a string literal.
-pub fn git_revision() -> Option {
- run_cmd_opt("git", &["rev-parse", "--short", "HEAD"])
-}
-
-fn run_cmd_opt(cmd: &str, args: &[&str]) -> Option {
- let output = Command::new(cmd).args(args).output().ok()?;
- if output.status.success() {
- String::from_utf8(output.stdout)
- .ok()
- .map(|s| s.trim().to_string())
- } else {
- None
- }
-}
-
-fn main() {
- let out_dir = env::var("OUT_DIR").expect("`OUT_DIR` env var not set for build script");
- let metadata_module_path = Path::new(&out_dir).join("metadata_values.rs");
- let metadata_module =
- fs::File::create(metadata_module_path).expect("cannot create metadata module");
- let mut metadata_module = io::BufWriter::new(metadata_module);
-
- print_binary_meta(&mut metadata_module).expect("failed printing binary metadata");
-}
diff --git a/core/lib/bin_metadata/src/lib.rs b/core/lib/bin_metadata/src/lib.rs
deleted file mode 100644
index d8a5221e4775..000000000000
--- a/core/lib/bin_metadata/src/lib.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use serde::Serialize;
-use vise::{EncodeLabelSet, Info, Metrics};
-
-use self::values::{GIT_METADATA, RUST_METADATA};
-
-pub mod values {
- use super::{GitMetadata, RustMetadata};
-
- include!(concat!(env!("OUT_DIR"), "/metadata_values.rs"));
-}
-
-pub const BIN_METADATA: BinMetadata = BinMetadata {
- rust: RUST_METADATA,
- git: GIT_METADATA,
-};
-
-/// Metadata of the compiled binary.
-#[derive(Debug, Serialize)]
-pub struct BinMetadata {
- pub rust: RustMetadata,
- pub git: GitMetadata,
-}
-
-/// Rust metadata of the compiled binary.
-#[derive(Debug, EncodeLabelSet, Serialize)]
-pub struct RustMetadata {
- pub version: &'static str,
- pub commit_hash: Option<&'static str>,
- pub commit_date: Option<&'static str>,
- pub channel: &'static str,
- pub host: &'static str,
- pub llvm: Option<&'static str>,
-}
-
-/// Git metadata of the compiled binary.
-#[derive(Debug, EncodeLabelSet, Serialize)]
-pub struct GitMetadata {
- pub branch: Option<&'static str>,
- pub revision: Option<&'static str>,
-}
-
-#[derive(Debug, Metrics)]
-#[metrics(prefix = "rust")]
-pub struct RustMetrics {
- /// General information about the compiled binary.
- info: Info,
-}
-
-impl RustMetrics {
- pub fn initialize(&self) {
- tracing::info!("Rust metadata for this binary: {RUST_METADATA:?}");
- self.info.set(RUST_METADATA).ok();
- }
-}
-
-#[derive(Debug, Metrics)]
-#[metrics(prefix = "git_info")]
-pub struct GitMetrics {
- /// General information about the compiled binary.
- info: Info,
-}
-
-impl GitMetrics {
- pub fn initialize(&self) {
- tracing::info!("Git metadata for this binary: {GIT_METADATA:?}");
- self.info.set(GIT_METADATA).ok();
- }
-}
diff --git a/core/lib/config/src/configs/en_config.rs b/core/lib/config/src/configs/en_config.rs
index 13a0e1f2c99d..4cab47b0779e 100644
--- a/core/lib/config/src/configs/en_config.rs
+++ b/core/lib/config/src/configs/en_config.rs
@@ -18,5 +18,6 @@ pub struct ENConfig {
pub main_node_url: SensitiveUrl,
pub main_node_rate_limit_rps: Option,
+ pub gateway_url: Option,
pub bridge_addresses_refresh_interval_sec: Option,
}
diff --git a/core/lib/config/src/configs/eth_sender.rs b/core/lib/config/src/configs/eth_sender.rs
index be2f5b532a3e..7b67f015238d 100644
--- a/core/lib/config/src/configs/eth_sender.rs
+++ b/core/lib/config/src/configs/eth_sender.rs
@@ -23,6 +23,7 @@ impl EthConfig {
pub fn for_tests() -> Self {
Self {
sender: Some(SenderConfig {
+ aggregated_proof_sizes: vec![1],
wait_confirmations: Some(10),
tx_poll_period: 1,
aggregate_tx_poll_period: 1,
@@ -81,6 +82,7 @@ pub enum ProofLoadingMode {
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct SenderConfig {
+ pub aggregated_proof_sizes: Vec,
/// Amount of confirmations required to consider L1 transaction committed.
/// If not specified L1 transaction will be considered finalized once its block is finalized.
pub wait_confirmations: Option,
diff --git a/core/lib/config/src/configs/secrets.rs b/core/lib/config/src/configs/secrets.rs
index 8285d81e4bd2..75ff067c2473 100644
--- a/core/lib/config/src/configs/secrets.rs
+++ b/core/lib/config/src/configs/secrets.rs
@@ -16,7 +16,6 @@ pub struct DatabaseSecrets {
#[derive(Debug, Clone, PartialEq)]
pub struct L1Secrets {
pub l1_rpc_url: SensitiveUrl,
- pub gateway_rpc_url: Option,
}
#[derive(Debug, Clone, PartialEq)]
diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs
index 1a3f63d9b278..8a9e96c96a5e 100644
--- a/core/lib/config/src/testonly.rs
+++ b/core/lib/config/src/testonly.rs
@@ -399,6 +399,7 @@ impl Distribution for EncodeDist {
impl Distribution for EncodeDist {
fn sample(&self, rng: &mut R) -> configs::eth_sender::SenderConfig {
configs::eth_sender::SenderConfig {
+ aggregated_proof_sizes: self.sample_collect(rng),
wait_confirmations: self.sample(rng),
tx_poll_period: self.sample(rng),
aggregate_tx_poll_period: self.sample(rng),
@@ -851,7 +852,6 @@ impl Distribution for EncodeDist {
use configs::secrets::L1Secrets;
L1Secrets {
l1_rpc_url: format!("localhost:{}", rng.gen::()).parse().unwrap(),
- gateway_rpc_url: Some(format!("localhost:{}", rng.gen::()).parse().unwrap()),
}
}
}
@@ -938,6 +938,8 @@ impl Distribution for EncodeDist {
_ => L1BatchCommitmentMode::Validium,
},
main_node_rate_limit_rps: self.sample_opt(|| rng.gen()),
+ gateway_url: self
+ .sample_opt(|| format!("localhost:{}", rng.gen::()).parse().unwrap()),
bridge_addresses_refresh_interval_sec: self.sample_opt(|| rng.gen()),
}
}
diff --git a/core/lib/constants/src/contracts.rs b/core/lib/constants/src/contracts.rs
index 6e402c117bfe..4f0f362d9149 100644
--- a/core/lib/constants/src/contracts.rs
+++ b/core/lib/constants/src/contracts.rs
@@ -135,8 +135,6 @@ pub const EVM_GAS_MANAGER_ADDRESS: Address = H160([
0x00, 0x00, 0x80, 0x13,
]);
-/// Note, that the `Create2Factory` and higher are explicitly deployed on a non-system-contract address
-/// as they don't require any kernel space features.
pub const CREATE2_FACTORY_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
diff --git a/core/lib/constants/src/message_root.rs b/core/lib/constants/src/message_root.rs
index 9bb8764cd667..a8f4a034fb99 100644
--- a/core/lib/constants/src/message_root.rs
+++ b/core/lib/constants/src/message_root.rs
@@ -1,14 +1,5 @@
-/// Position of `chainCount` in `MessageRoot`'s storage layout.
-pub const CHAIN_COUNT_KEY: usize = 0;
-
-/// Position of `chainIndexToId` in `MessageRoot`'s storage layout.
-pub const CHAIN_INDEX_TO_ID_KEY: usize = 2;
-
-/// Position of `FullTree::_height` in `MessageRoot`'s storage layout.
+// Position of `FullTree::_height` in `MessageRoot`'s storage layout.
pub const AGG_TREE_HEIGHT_KEY: usize = 3;
-/// Position of `FullTree::nodes` in `MessageRoot`'s storage layout.
+// Position of `FullTree::nodes` in `MessageRoot`'s storage layout.
pub const AGG_TREE_NODES_KEY: usize = 5;
-
-/// Position of `chainTree` in `MessageRoot`'s storage layout.
-pub const CHAIN_TREE_KEY: usize = 7;
diff --git a/core/lib/contracts/src/lib.rs b/core/lib/contracts/src/lib.rs
index e60fdb0e59f3..74efa72793aa 100644
--- a/core/lib/contracts/src/lib.rs
+++ b/core/lib/contracts/src/lib.rs
@@ -256,9 +256,7 @@ impl SystemContractsRepo {
"artifacts-zk/contracts-preprocessed/{0}{1}.sol/{1}.json",
directory, name
)))
- .unwrap_or_else(|| {
- panic!("One of the outputs should exists for {directory}{name}");
- })
+ .expect("One of the outputs should exists")
}
}
ContractLanguage::Yul => {
@@ -977,461 +975,3 @@ pub static DIAMOND_CUT: Lazy = Lazy::new(|| {
}"#;
serde_json::from_str(abi).unwrap()
});
-
-pub static POST_BOOJUM_COMMIT_FUNCTION: Lazy = Lazy::new(|| {
- let abi = r#"
- {
- "inputs": [
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "batchHash",
- "type": "bytes32"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "l2LogsTreeRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "timestamp",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "commitment",
- "type": "bytes32"
- }
- ],
- "internalType": "struct IExecutor.StoredBatchInfo",
- "name": "_lastCommittedBatchData",
- "type": "tuple"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "uint64",
- "name": "timestamp",
- "type": "uint64"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "newStateRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "bootloaderHeapInitialContentsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "eventsQueueStateHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes",
- "name": "systemLogs",
- "type": "bytes"
- },
- {
- "internalType": "bytes",
- "name": "pubdataCommitments",
- "type": "bytes"
- }
- ],
- "internalType": "struct IExecutor.CommitBatchInfo[]",
- "name": "_newBatchesData",
- "type": "tuple[]"
- }
- ],
- "name": "commitBatches",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }"#;
- serde_json::from_str(abi).unwrap()
-});
-
-pub static POST_SHARED_BRIDGE_COMMIT_FUNCTION: Lazy = Lazy::new(|| {
- let abi = r#"
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "_chainId",
- "type": "uint256"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "batchHash",
- "type": "bytes32"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "l2LogsTreeRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "timestamp",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "commitment",
- "type": "bytes32"
- }
- ],
- "internalType": "struct IExecutor.StoredBatchInfo",
- "name": "_lastCommittedBatchData",
- "type": "tuple"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "uint64",
- "name": "timestamp",
- "type": "uint64"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "newStateRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "bootloaderHeapInitialContentsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "eventsQueueStateHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes",
- "name": "systemLogs",
- "type": "bytes"
- },
- {
- "internalType": "bytes",
- "name": "pubdataCommitments",
- "type": "bytes"
- }
- ],
- "internalType": "struct IExecutor.CommitBatchInfo[]",
- "name": "_newBatchesData",
- "type": "tuple[]"
- }
- ],
- "name": "commitBatchesSharedBridge",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }"#;
- serde_json::from_str(abi).unwrap()
-});
-
-pub static POST_SHARED_BRIDGE_PROVE_FUNCTION: Lazy = Lazy::new(|| {
- let abi = r#"
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "_chainId",
- "type": "uint256"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "batchHash",
- "type": "bytes32"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "l2LogsTreeRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "timestamp",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "commitment",
- "type": "bytes32"
- }
- ],
- "internalType": "struct IExecutor.StoredBatchInfo",
- "name": "_prevBatch",
- "type": "tuple"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "batchHash",
- "type": "bytes32"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "l2LogsTreeRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "timestamp",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "commitment",
- "type": "bytes32"
- }
- ],
- "internalType": "struct IExecutor.StoredBatchInfo[]",
- "name": "_committedBatches",
- "type": "tuple[]"
- },
- {
- "components": [
- {
- "internalType": "uint256[]",
- "name": "recursiveAggregationInput",
- "type": "uint256[]"
- },
- {
- "internalType": "uint256[]",
- "name": "serializedProof",
- "type": "uint256[]"
- }
- ],
- "internalType": "struct IExecutor.ProofInput",
- "name": "_proof",
- "type": "tuple"
- }
- ],
- "name": "proveBatchesSharedBridge",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }"#;
- serde_json::from_str(abi).unwrap()
-});
-
-pub static POST_SHARED_BRIDGE_EXECUTE_FUNCTION: Lazy = Lazy::new(|| {
- let abi = r#"
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "_chainId",
- "type": "uint256"
- },
- {
- "components": [
- {
- "internalType": "uint64",
- "name": "batchNumber",
- "type": "uint64"
- },
- {
- "internalType": "bytes32",
- "name": "batchHash",
- "type": "bytes32"
- },
- {
- "internalType": "uint64",
- "name": "indexRepeatedStorageChanges",
- "type": "uint64"
- },
- {
- "internalType": "uint256",
- "name": "numberOfLayer1Txs",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "priorityOperationsHash",
- "type": "bytes32"
- },
- {
- "internalType": "bytes32",
- "name": "l2LogsTreeRoot",
- "type": "bytes32"
- },
- {
- "internalType": "uint256",
- "name": "timestamp",
- "type": "uint256"
- },
- {
- "internalType": "bytes32",
- "name": "commitment",
- "type": "bytes32"
- }
- ],
- "internalType": "struct IExecutor.StoredBatchInfo[]",
- "name": "_batchesData",
- "type": "tuple[]"
- }
- ],
- "name": "executeBatchesSharedBridge",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- }"#;
- serde_json::from_str(abi).unwrap()
-});
-
-// Temporary thing, should be removed when new contracts are merged.
-pub static MESSAGE_ROOT_CONTRACT: Lazy = Lazy::new(|| {
- let abi = r#"
- [{
- "inputs": [
- {
- "internalType": "uint256",
- "name": "_chainId",
- "type": "uint256"
- }
- ],
- "name": "getChainRoot",
- "outputs": [
- {
- "internalType": "bytes32",
- "name": "",
- "type": "bytes32"
- }
- ],
- "stateMutability": "view",
- "type": "function"
- }]"#;
- serde_json::from_str(abi).unwrap()
-});
diff --git a/core/lib/dal/.sqlx/query-10b8981f7aa47ce5d3507571af45f7cef0d50c4938105684971e8adc86bb6366.json b/core/lib/dal/.sqlx/query-10b8981f7aa47ce5d3507571af45f7cef0d50c4938105684971e8adc86bb6366.json
new file mode 100644
index 000000000000..d59f237ed3c3
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-10b8981f7aa47ce5d3507571af45f7cef0d50c4938105684971e8adc86bb6366.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT COALESCE(SUM(predicted_execute_gas_cost), 0) AS \"sum!\" FROM l1_batches WHERE number BETWEEN $1 AND $2",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "sum!",
+ "type_info": "Numeric"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "10b8981f7aa47ce5d3507571af45f7cef0d50c4938105684971e8adc86bb6366"
+}
diff --git a/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json b/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json
index df60f114f5ef..48fa673b2c91 100644
--- a/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json
+++ b/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json
@@ -103,7 +103,7 @@
false,
true,
true,
- true,
+ false,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
index 32a2212dfdf6..b8d6482ea744 100644
--- a/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
+++ b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
@@ -11,8 +11,7 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions",
- "ChainBatchRoot"
+ "PriorityTransactions"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json b/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json
deleted file mode 100644
index adbd2c0931ec..000000000000
--- a/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n batch_chain_merkle_path\n FROM\n l1_batches\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "batch_chain_merkle_path",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4"
-}
diff --git a/core/lib/dal/.sqlx/query-2e3107b0c5e8466598066ceca9844469e431e35c4419fd710050d51eeefd6b8b.json b/core/lib/dal/.sqlx/query-2e3107b0c5e8466598066ceca9844469e431e35c4419fd710050d51eeefd6b8b.json
deleted file mode 100644
index 69dd87a6c355..000000000000
--- a/core/lib/dal/.sqlx/query-2e3107b0c5e8466598066ceca9844469e431e35c4419fd710050d51eeefd6b8b.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n local_root\n FROM\n l1_batches\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "local_root",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "2e3107b0c5e8466598066ceca9844469e431e35c4419fd710050d51eeefd6b8b"
-}
diff --git a/core/lib/dal/.sqlx/query-3566423188a5d6bed7150f327d83613cd34138b59ef3b9271fd0bfdaddd086f8.json b/core/lib/dal/.sqlx/query-3566423188a5d6bed7150f327d83613cd34138b59ef3b9271fd0bfdaddd086f8.json
deleted file mode 100644
index 123afc6060a6..000000000000
--- a/core/lib/dal/.sqlx/query-3566423188a5d6bed7150f327d83613cd34138b59ef3b9271fd0bfdaddd086f8.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT *\n FROM _sqlx_migrations\n ORDER BY _sqlx_migrations.version DESC\n LIMIT 1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "version",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "description",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "installed_on",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "success",
- "type_info": "Bool"
- },
- {
- "ordinal": 4,
- "name": "checksum",
- "type_info": "Bytea"
- },
- {
- "ordinal": 5,
- "name": "execution_time",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "3566423188a5d6bed7150f327d83613cd34138b59ef3b9271fd0bfdaddd086f8"
-}
diff --git a/core/lib/dal/.sqlx/query-3785c01a8eb1eaeaf7baf0a8ba7f30cbc385e6fb6c8b8ae2c2d06b871a4cae72.json b/core/lib/dal/.sqlx/query-3785c01a8eb1eaeaf7baf0a8ba7f30cbc385e6fb6c8b8ae2c2d06b871a4cae72.json
deleted file mode 100644
index dfaccfbc99d3..000000000000
--- a/core/lib/dal/.sqlx/query-3785c01a8eb1eaeaf7baf0a8ba7f30cbc385e6fb6c8b8ae2c2d06b871a4cae72.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO\n pruning_log (\n pruned_l1_batch,\n pruned_miniblock,\n pruned_l1_batch_root_hash,\n type,\n created_at,\n updated_at\n )\n VALUES\n ($1, $2, $3, $4, NOW(), NOW())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Int8",
- "Bytea",
- {
- "Custom": {
- "name": "prune_type",
- "kind": {
- "Enum": [
- "Soft",
- "Hard"
- ]
- }
- }
- }
- ]
- },
- "nullable": []
- },
- "hash": "3785c01a8eb1eaeaf7baf0a8ba7f30cbc385e6fb6c8b8ae2c2d06b871a4cae72"
-}
diff --git a/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json b/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json
index 8bab74d20f5c..e2a808d41f89 100644
--- a/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json
+++ b/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json
@@ -17,8 +17,7 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions",
- "ChainBatchRoot"
+ "PriorityTransactions"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
index c6c189d45fcb..3e64cc5f5b2f 100644
--- a/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
+++ b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
@@ -108,7 +108,7 @@
false,
true,
true,
- true,
+ false,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json b/core/lib/dal/.sqlx/query-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json
similarity index 56%
rename from core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json
rename to core/lib/dal/.sqlx/query-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json
index 9c339a604c89..5f27c7549b47 100644
--- a/core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json
+++ b/core/lib/dal/.sqlx/query-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "INSERT INTO eth_txs (raw_tx, nonce, tx_type, contract_address, predicted_gas_cost, chain_id, created_at, updated_at) VALUES ('\\x00', 0, $1, '', NULL, $2, now(), now()) RETURNING id",
+ "query": "INSERT INTO eth_txs (raw_tx, nonce, tx_type, contract_address, predicted_gas_cost, created_at, updated_at) VALUES ('\\x00', 0, $1, '', 0, now(), now()) RETURNING id",
"describe": {
"columns": [
{
@@ -11,13 +11,12 @@
],
"parameters": {
"Left": [
- "Text",
- "Int8"
+ "Text"
]
},
"nullable": [
false
]
},
- "hash": "843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7"
+ "hash": "5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231"
}
diff --git a/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json b/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json
new file mode 100644
index 000000000000..98d228726d48
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json
@@ -0,0 +1,33 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE l1_batches\n SET\n l1_tx_count = $2,\n l2_tx_count = $3,\n l2_to_l1_messages = $4,\n bloom = $5,\n priority_ops_onchain_data = $6,\n predicted_commit_gas_cost = $7,\n predicted_prove_gas_cost = $8,\n predicted_execute_gas_cost = $9,\n initial_bootloader_heap_content = $10,\n used_contract_hashes = $11,\n bootloader_code_hash = $12,\n default_aa_code_hash = $13,\n evm_emulator_code_hash = $14,\n protocol_version = $15,\n system_logs = $16,\n storage_refunds = $17,\n pubdata_costs = $18,\n pubdata_input = $19,\n predicted_circuits_by_type = $20,\n updated_at = NOW(),\n sealed_at = NOW(),\n is_sealed = TRUE\n WHERE\n number = $1\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int4",
+ "Int4",
+ "ByteaArray",
+ "Bytea",
+ "ByteaArray",
+ "Int8",
+ "Int8",
+ "Int8",
+ "Jsonb",
+ "Jsonb",
+ "Bytea",
+ "Bytea",
+ "Bytea",
+ "Int4",
+ "ByteaArray",
+ "Int8Array",
+ "Int8Array",
+ "Bytea",
+ "Jsonb"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a"
+}
diff --git a/core/lib/dal/.sqlx/query-63f5f9bff4b2c15fa4230af2c73b5b5cc7e37dd6a607e9453e822e34ba77cdc3.json b/core/lib/dal/.sqlx/query-63f5f9bff4b2c15fa4230af2c73b5b5cc7e37dd6a607e9453e822e34ba77cdc3.json
new file mode 100644
index 000000000000..ab2283fa60c3
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-63f5f9bff4b2c15fa4230af2c73b5b5cc7e37dd6a607e9453e822e34ba77cdc3.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT COALESCE(SUM(predicted_prove_gas_cost), 0) AS \"sum!\" FROM l1_batches WHERE number BETWEEN $1 AND $2",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "sum!",
+ "type_info": "Numeric"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "63f5f9bff4b2c15fa4230af2c73b5b5cc7e37dd6a607e9453e822e34ba77cdc3"
+}
diff --git a/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json b/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json
index a6ac67328b14..1a3c160cee1b 100644
--- a/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json
+++ b/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json
@@ -101,7 +101,7 @@
false,
true,
true,
- true,
+ false,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json b/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json
deleted file mode 100644
index 7559630217be..000000000000
--- a/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n tp.pubkey,\n tp.signature,\n tp.proof,\n tp.updated_at,\n tp.status,\n ta.attestation\n FROM\n tee_proof_generation_details tp\n LEFT JOIN\n tee_attestations ta ON tp.pubkey = ta.pubkey\n WHERE\n tp.l1_batch_number = $1\n ORDER BY tp.l1_batch_number ASC, tp.tee_type ASC",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pubkey",
- "type_info": "Bytea"
- },
- {
- "ordinal": 1,
- "name": "signature",
- "type_info": "Bytea"
- },
- {
- "ordinal": 2,
- "name": "proof",
- "type_info": "Bytea"
- },
- {
- "ordinal": 3,
- "name": "updated_at",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 4,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "attestation",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- true,
- true,
- true,
- false,
- false,
- true
- ]
- },
- "hash": "8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015"
-}
diff --git a/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
index e47911f3d776..c2e662ef376e 100644
--- a/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
+++ b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
@@ -102,7 +102,7 @@
false,
true,
true,
- true,
+ false,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json b/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json
deleted file mode 100644
index 0132af8fbe6c..000000000000
--- a/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH\n soft AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Soft'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n ),\n \n hard AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock,\n pruned_l1_batch_root_hash\n FROM\n pruning_log\n WHERE\n type = 'Hard'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n )\n \n SELECT\n soft.pruned_l1_batch AS last_soft_pruned_l1_batch,\n soft.pruned_miniblock AS last_soft_pruned_l2_block,\n hard.pruned_l1_batch AS last_hard_pruned_l1_batch,\n hard.pruned_miniblock AS last_hard_pruned_l2_block,\n hard.pruned_l1_batch_root_hash AS last_hard_pruned_batch_root_hash\n FROM\n soft\n FULL JOIN hard ON TRUE\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "last_soft_pruned_l1_batch",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "last_soft_pruned_l2_block",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "last_hard_pruned_l1_batch",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "last_hard_pruned_l2_block",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "last_hard_pruned_batch_root_hash",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- true,
- true,
- true,
- true,
- true
- ]
- },
- "hash": "8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84"
-}
diff --git a/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json b/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json
deleted file mode 100644
index a64bdb403aef..000000000000
--- a/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE l1_batches\n SET\n l1_tx_count = $2,\n l2_tx_count = $3,\n l2_to_l1_messages = $4,\n bloom = $5,\n priority_ops_onchain_data = $6,\n initial_bootloader_heap_content = $7,\n used_contract_hashes = $8,\n bootloader_code_hash = $9,\n default_aa_code_hash = $10,\n evm_emulator_code_hash = $11,\n protocol_version = $12,\n system_logs = $13,\n storage_refunds = $14,\n pubdata_costs = $15,\n pubdata_input = $16,\n predicted_circuits_by_type = $17,\n updated_at = NOW(),\n sealed_at = NOW(),\n is_sealed = TRUE\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Int4",
- "Int4",
- "ByteaArray",
- "Bytea",
- "ByteaArray",
- "Jsonb",
- "Jsonb",
- "Bytea",
- "Bytea",
- "Bytea",
- "Int4",
- "ByteaArray",
- "Int8Array",
- "Int8Array",
- "Bytea",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953"
-}
diff --git a/core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.json b/core/lib/dal/.sqlx/query-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json
similarity index 51%
rename from core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.json
rename to core/lib/dal/.sqlx/query-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json
index 1af3384a2d9f..28ffcc5ae468 100644
--- a/core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.json
+++ b/core/lib/dal/.sqlx/query-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n WITH\n mb AS (\n SELECT\n l1_gas_price,\n l2_fair_gas_price,\n fair_pubdata_price\n FROM\n miniblocks\n WHERE\n l1_batch_number = $1\n LIMIT\n 1\n )\n \n SELECT\n l1_batches.number,\n l1_batches.timestamp,\n l1_batches.l1_tx_count,\n l1_batches.l2_tx_count,\n l1_batches.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n commit_tx_data.chain_id AS \"commit_chain_id?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n prove_tx_data.chain_id AS \"prove_chain_id?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n execute_tx_data.chain_id AS \"execute_chain_id?\",\n mb.l1_gas_price,\n mb.l2_fair_gas_price,\n mb.fair_pubdata_price,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n l1_batches.evm_emulator_code_hash\n FROM\n l1_batches\n INNER JOIN mb ON TRUE\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs AS commit_tx_data\n ON (\n l1_batches.eth_commit_tx_id = commit_tx_data.id\n AND commit_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n LEFT JOIN eth_txs AS prove_tx_data\n ON (\n l1_batches.eth_prove_tx_id = prove_tx_data.id\n AND prove_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n LEFT JOIN eth_txs AS execute_tx_data\n ON (\n l1_batches.eth_execute_tx_id = execute_tx_data.id\n AND execute_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n WHERE\n l1_batches.number = $1\n ",
+ "query": "\n WITH\n mb AS (\n SELECT\n l1_gas_price,\n l2_fair_gas_price,\n fair_pubdata_price\n FROM\n miniblocks\n WHERE\n l1_batch_number = $1\n LIMIT\n 1\n )\n \n SELECT\n l1_batches.number,\n l1_batches.timestamp,\n l1_batches.l1_tx_count,\n l1_batches.l2_tx_count,\n l1_batches.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n mb.l1_gas_price,\n mb.l2_fair_gas_price,\n mb.fair_pubdata_price,\n l1_batches.bootloader_code_hash,\n l1_batches.default_aa_code_hash,\n l1_batches.evm_emulator_code_hash\n FROM\n l1_batches\n INNER JOIN mb ON TRUE\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n l1_batches.number = $1\n ",
"describe": {
"columns": [
{
@@ -40,66 +40,51 @@
},
{
"ordinal": 7,
- "name": "commit_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 8,
"name": "prove_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 9,
+ "ordinal": 8,
"name": "proven_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 10,
- "name": "prove_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 11,
+ "ordinal": 9,
"name": "execute_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 12,
+ "ordinal": 10,
"name": "executed_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 13,
- "name": "execute_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 14,
+ "ordinal": 11,
"name": "l1_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 15,
+ "ordinal": 12,
"name": "l2_fair_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 16,
+ "ordinal": 13,
"name": "fair_pubdata_price",
"type_info": "Int8"
},
{
- "ordinal": 17,
+ "ordinal": 14,
"name": "bootloader_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 18,
+ "ordinal": 15,
"name": "default_aa_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 19,
+ "ordinal": 16,
"name": "evm_emulator_code_hash",
"type_info": "Bytea"
}
@@ -117,13 +102,10 @@
true,
false,
true,
- true,
false,
true,
- true,
false,
true,
- true,
false,
false,
true,
@@ -132,5 +114,5 @@
true
]
},
- "hash": "cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f"
+ "hash": "a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6"
}
diff --git a/core/lib/dal/.sqlx/query-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json b/core/lib/dal/.sqlx/query-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json
deleted file mode 100644
index 89f0706843bd..000000000000
--- a/core/lib/dal/.sqlx/query-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n tp.pubkey,\n tp.signature,\n tp.proof,\n tp.updated_at,\n tp.status,\n ta.attestation\n FROM\n tee_proof_generation_details tp\n LEFT JOIN\n tee_attestations ta ON tp.pubkey = ta.pubkey\n WHERE\n tp.l1_batch_number = $1\n AND tp.tee_type = $2ORDER BY tp.l1_batch_number ASC, tp.tee_type ASC",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pubkey",
- "type_info": "Bytea"
- },
- {
- "ordinal": 1,
- "name": "signature",
- "type_info": "Bytea"
- },
- {
- "ordinal": 2,
- "name": "proof",
- "type_info": "Bytea"
- },
- {
- "ordinal": 3,
- "name": "updated_at",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 4,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "attestation",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8",
- "Text"
- ]
- },
- "nullable": [
- true,
- true,
- true,
- false,
- false,
- true
- ]
- },
- "hash": "b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e"
-}
diff --git a/core/lib/dal/.sqlx/query-b9f77e6c15f9e635024b73f1fc985c5196c431363802b6b988939c99853b9c97.json b/core/lib/dal/.sqlx/query-b9f77e6c15f9e635024b73f1fc985c5196c431363802b6b988939c99853b9c97.json
new file mode 100644
index 000000000000..379c1f75d9b3
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-b9f77e6c15f9e635024b73f1fc985c5196c431363802b6b988939c99853b9c97.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT COALESCE(SUM(predicted_commit_gas_cost), 0) AS \"sum!\" FROM l1_batches WHERE number BETWEEN $1 AND $2",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "sum!",
+ "type_info": "Numeric"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "b9f77e6c15f9e635024b73f1fc985c5196c431363802b6b988939c99853b9c97"
+}
diff --git a/core/lib/dal/.sqlx/query-c1f9ecf033d609457106189bc4d7928aa933616d2186c13a4e005297b0ad63a7.json b/core/lib/dal/.sqlx/query-c1f9ecf033d609457106189bc4d7928aa933616d2186c13a4e005297b0ad63a7.json
deleted file mode 100644
index 90623e77e985..000000000000
--- a/core/lib/dal/.sqlx/query-c1f9ecf033d609457106189bc4d7928aa933616d2186c13a4e005297b0ad63a7.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE\n l1_batches\n SET\n batch_chain_merkle_path = $2\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Bytea"
- ]
- },
- "nullable": []
- },
- "hash": "c1f9ecf033d609457106189bc4d7928aa933616d2186c13a4e005297b0ad63a7"
-}
diff --git a/core/lib/dal/.sqlx/query-c2c288d268d6b266acbfc1058bc55a360f8ae12b6378f8168c000d668d6489d0.json b/core/lib/dal/.sqlx/query-c2c288d268d6b266acbfc1058bc55a360f8ae12b6378f8168c000d668d6489d0.json
deleted file mode 100644
index 751d272b0b0e..000000000000
--- a/core/lib/dal/.sqlx/query-c2c288d268d6b266acbfc1058bc55a360f8ae12b6378f8168c000d668d6489d0.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n l2_l1_merkle_root\n FROM\n l1_batches\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "l2_l1_merkle_root",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "c2c288d268d6b266acbfc1058bc55a360f8ae12b6378f8168c000d668d6489d0"
-}
diff --git a/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json b/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json
index 5e2ea45e0bc2..61832d25fd24 100644
--- a/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json
+++ b/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json
@@ -11,8 +11,7 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions",
- "ChainBatchRoot"
+ "PriorityTransactions"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json b/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json
new file mode 100644
index 000000000000..fb28539ccdf6
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json
@@ -0,0 +1,38 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n WITH\n soft AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Soft'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n ),\n \n hard AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Hard'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n )\n \n SELECT\n soft.pruned_l1_batch AS last_soft_pruned_l1_batch,\n soft.pruned_miniblock AS last_soft_pruned_miniblock,\n hard.pruned_l1_batch AS last_hard_pruned_l1_batch,\n hard.pruned_miniblock AS last_hard_pruned_miniblock\n FROM\n soft\n FULL JOIN hard ON TRUE\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "last_soft_pruned_l1_batch",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "last_soft_pruned_miniblock",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 2,
+ "name": "last_hard_pruned_l1_batch",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 3,
+ "name": "last_hard_pruned_miniblock",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": []
+ },
+ "nullable": [
+ true,
+ true,
+ true,
+ true
+ ]
+ },
+ "hash": "c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d"
+}
diff --git a/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json b/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json
new file mode 100644
index 000000000000..59bfa4858c02
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT\n COUNT(*) AS \"count!\"\n FROM\n (\n SELECT\n *\n FROM\n storage_logs\n WHERE\n hashed_key = $1\n AND miniblock_number <= COALESCE(\n (\n SELECT\n MAX(number)\n FROM\n miniblocks\n ),\n (\n SELECT\n miniblock_number\n FROM\n snapshot_recovery\n )\n )\n ORDER BY\n miniblock_number DESC,\n operation_number DESC\n LIMIT\n 1\n ) sl\n WHERE\n sl.value != $2\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "count!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Bytea",
+ "Bytea"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716"
+}
diff --git a/core/lib/dal/.sqlx/query-cf8aaa95e3e8c376b6083c7015753e30af54675ce58273cbb29312e6e88cbdf5.json b/core/lib/dal/.sqlx/query-cf8aaa95e3e8c376b6083c7015753e30af54675ce58273cbb29312e6e88cbdf5.json
deleted file mode 100644
index b79441ab4d63..000000000000
--- a/core/lib/dal/.sqlx/query-cf8aaa95e3e8c376b6083c7015753e30af54675ce58273cbb29312e6e88cbdf5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT eth_txs.chain_id\n FROM l1_batches\n JOIN eth_txs ON eth_txs.id = l1_batches.eth_commit_tx_id\n WHERE\n number = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "chain_id",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "cf8aaa95e3e8c376b6083c7015753e30af54675ce58273cbb29312e6e88cbdf5"
-}
diff --git a/core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.json b/core/lib/dal/.sqlx/query-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json
similarity index 52%
rename from core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.json
rename to core/lib/dal/.sqlx/query-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json
index 8de8a19da5f8..ed3270de573e 100644
--- a/core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.json
+++ b/core/lib/dal/.sqlx/query-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n miniblocks.number,\n COALESCE(\n miniblocks.l1_batch_number,\n (\n SELECT\n (MAX(number) + 1)\n FROM\n l1_batches\n WHERE\n is_sealed\n )\n ) AS \"l1_batch_number!\",\n miniblocks.timestamp,\n miniblocks.l1_tx_count,\n miniblocks.l2_tx_count,\n miniblocks.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n commit_tx_data.chain_id AS \"commit_chain_id?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n prove_tx_data.chain_id AS \"prove_chain_id?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n execute_tx_data.chain_id AS \"execute_chain_id?\",\n miniblocks.l1_gas_price,\n miniblocks.l2_fair_gas_price,\n miniblocks.fair_pubdata_price,\n miniblocks.bootloader_code_hash,\n miniblocks.default_aa_code_hash,\n l1_batches.evm_emulator_code_hash,\n miniblocks.protocol_version,\n miniblocks.fee_account_address\n FROM\n miniblocks\n LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs AS commit_tx_data\n ON (\n l1_batches.eth_commit_tx_id = commit_tx_data.id\n AND commit_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n LEFT JOIN eth_txs AS prove_tx_data\n ON (\n l1_batches.eth_prove_tx_id = prove_tx_data.id\n AND prove_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n LEFT JOIN eth_txs AS execute_tx_data\n ON (\n l1_batches.eth_execute_tx_id = execute_tx_data.id\n AND execute_tx_data.confirmed_eth_tx_history_id IS NOT NULL\n )\n WHERE\n miniblocks.number = $1\n ",
+ "query": "\n SELECT\n miniblocks.number,\n COALESCE(\n miniblocks.l1_batch_number,\n (\n SELECT\n (MAX(number) + 1)\n FROM\n l1_batches\n WHERE\n is_sealed\n )\n ) AS \"l1_batch_number!\",\n miniblocks.timestamp,\n miniblocks.l1_tx_count,\n miniblocks.l2_tx_count,\n miniblocks.hash AS \"root_hash?\",\n commit_tx.tx_hash AS \"commit_tx_hash?\",\n commit_tx.confirmed_at AS \"committed_at?\",\n prove_tx.tx_hash AS \"prove_tx_hash?\",\n prove_tx.confirmed_at AS \"proven_at?\",\n execute_tx.tx_hash AS \"execute_tx_hash?\",\n execute_tx.confirmed_at AS \"executed_at?\",\n miniblocks.l1_gas_price,\n miniblocks.l2_fair_gas_price,\n miniblocks.fair_pubdata_price,\n miniblocks.bootloader_code_hash,\n miniblocks.default_aa_code_hash,\n l1_batches.evm_emulator_code_hash,\n miniblocks.protocol_version,\n miniblocks.fee_account_address\n FROM\n miniblocks\n LEFT JOIN l1_batches ON miniblocks.l1_batch_number = l1_batches.number\n LEFT JOIN eth_txs_history AS commit_tx\n ON (\n l1_batches.eth_commit_tx_id = commit_tx.eth_tx_id\n AND commit_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS prove_tx\n ON (\n l1_batches.eth_prove_tx_id = prove_tx.eth_tx_id\n AND prove_tx.confirmed_at IS NOT NULL\n )\n LEFT JOIN eth_txs_history AS execute_tx\n ON (\n l1_batches.eth_execute_tx_id = execute_tx.eth_tx_id\n AND execute_tx.confirmed_at IS NOT NULL\n )\n WHERE\n miniblocks.number = $1\n ",
"describe": {
"columns": [
{
@@ -45,76 +45,61 @@
},
{
"ordinal": 8,
- "name": "commit_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 9,
"name": "prove_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 10,
+ "ordinal": 9,
"name": "proven_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 11,
- "name": "prove_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 12,
+ "ordinal": 10,
"name": "execute_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 13,
+ "ordinal": 11,
"name": "executed_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 14,
- "name": "execute_chain_id?",
- "type_info": "Int8"
- },
- {
- "ordinal": 15,
+ "ordinal": 12,
"name": "l1_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 16,
+ "ordinal": 13,
"name": "l2_fair_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 17,
+ "ordinal": 14,
"name": "fair_pubdata_price",
"type_info": "Int8"
},
{
- "ordinal": 18,
+ "ordinal": 15,
"name": "bootloader_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 19,
+ "ordinal": 16,
"name": "default_aa_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 20,
+ "ordinal": 17,
"name": "evm_emulator_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 21,
+ "ordinal": 18,
"name": "protocol_version",
"type_info": "Int4"
},
{
- "ordinal": 22,
+ "ordinal": 19,
"name": "fee_account_address",
"type_info": "Bytea"
}
@@ -133,13 +118,10 @@
false,
false,
true,
- true,
false,
true,
- true,
false,
true,
- true,
false,
false,
true,
@@ -150,5 +132,5 @@
false
]
},
- "hash": "9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f"
+ "hash": "d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8"
}
diff --git a/core/lib/dal/.sqlx/query-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json b/core/lib/dal/.sqlx/query-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json
deleted file mode 100644
index 9f7de50539be..000000000000
--- a/core/lib/dal/.sqlx/query-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n number, l2_l1_merkle_root\n FROM\n l1_batches\n JOIN eth_txs ON eth_txs.id = l1_batches.eth_execute_tx_id\n WHERE\n batch_chain_merkle_path IS NOT NULL\n AND chain_id = $1\n ORDER BY number\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "number",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "l2_l1_merkle_root",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98"
-}
diff --git a/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.down.sql b/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.down.sql
deleted file mode 100644
index da7142b8f819..000000000000
--- a/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.down.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE l1_batches
- DROP COLUMN batch_chain_merkle_path BYTEA;
diff --git a/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.up.sql b/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.up.sql
deleted file mode 100644
index 8b133f70904b..000000000000
--- a/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.up.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-ALTER TABLE l1_batches
- ADD COLUMN batch_chain_merkle_path BYTEA;
-
--- postgres doesn't allow dropping enum variant, so nothing is done in down.sql
-ALTER TYPE event_type ADD VALUE 'ChainBatchRoot';
diff --git a/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.down.sql b/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.down.sql
deleted file mode 100644
index d6beeb80e8a5..000000000000
--- a/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.down.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE pruning_log
- DROP COLUMN pruned_l1_batch_root_hash;
diff --git a/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.up.sql b/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.up.sql
deleted file mode 100644
index 6a990781f61c..000000000000
--- a/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.up.sql
+++ /dev/null
@@ -1,3 +0,0 @@
--- nullable for backward compatibility
-ALTER TABLE pruning_log
- ADD COLUMN pruned_l1_batch_root_hash BYTEA DEFAULT NULL;
diff --git a/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.down.sql b/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.down.sql
deleted file mode 100644
index 6d0c32ea6c24..000000000000
--- a/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.down.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE eth_txs
- ALTER COLUMN predicted_gas_cost SET NOT NULL;
diff --git a/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.up.sql b/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.up.sql
deleted file mode 100644
index cbb1e3c1a3f1..000000000000
--- a/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.up.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE eth_txs
- ALTER COLUMN predicted_gas_cost DROP NOT NULL;
diff --git a/core/lib/dal/src/blocks_dal.rs b/core/lib/dal/src/blocks_dal.rs
index 5002c5a8afbf..0cb607a304e2 100644
--- a/core/lib/dal/src/blocks_dal.rs
+++ b/core/lib/dal/src/blocks_dal.rs
@@ -6,24 +6,25 @@ use std::{
};
use anyhow::Context as _;
-use bigdecimal::{BigDecimal, FromPrimitive};
+use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
use sqlx::types::chrono::{DateTime, Utc};
use zksync_db_connection::{
connection::Connection,
error::{DalResult, SqlxContext},
instrument::{InstrumentExt, Instrumented},
+ interpolate_query, match_query_as,
};
use zksync_types::{
aggregated_operations::AggregatedActionType,
block::{
- L1BatchHeader, L1BatchStatistics, L1BatchTreeData, L2BlockHeader, StorageOracleInfo,
- UnsealedL1BatchHeader,
+ BlockGasCount, L1BatchHeader, L1BatchStatistics, L1BatchTreeData, L2BlockHeader,
+ StorageOracleInfo, UnsealedL1BatchHeader,
},
commitment::{L1BatchCommitmentArtifacts, L1BatchWithMetadata},
fee_model::BatchFeeInput,
- l2_to_l1_log::{BatchAndChainMerklePath, UserL2ToL1Log},
+ l2_to_l1_log::UserL2ToL1Log,
writes::TreeWrite,
- Address, Bloom, L1BatchNumber, L2BlockNumber, ProtocolVersionId, SLChainId, H256, U256,
+ Address, Bloom, L1BatchNumber, L2BlockNumber, ProtocolVersionId, H256, U256,
};
use zksync_vm_interface::CircuitStatistic;
@@ -687,6 +688,7 @@ impl BlocksDal<'_, '_> {
&mut self,
header: &L1BatchHeader,
initial_bootloader_contents: &[(usize, U256)],
+ predicted_block_gas: BlockGasCount,
storage_refunds: &[u32],
pubdata_costs: &[i32],
predicted_circuits_by_type: CircuitStatistic, // predicted number of circuits for each circuit type
@@ -726,17 +728,20 @@ impl BlocksDal<'_, '_> {
l2_to_l1_messages = $4,
bloom = $5,
priority_ops_onchain_data = $6,
- initial_bootloader_heap_content = $7,
- used_contract_hashes = $8,
- bootloader_code_hash = $9,
- default_aa_code_hash = $10,
- evm_emulator_code_hash = $11,
- protocol_version = $12,
- system_logs = $13,
- storage_refunds = $14,
- pubdata_costs = $15,
- pubdata_input = $16,
- predicted_circuits_by_type = $17,
+ predicted_commit_gas_cost = $7,
+ predicted_prove_gas_cost = $8,
+ predicted_execute_gas_cost = $9,
+ initial_bootloader_heap_content = $10,
+ used_contract_hashes = $11,
+ bootloader_code_hash = $12,
+ default_aa_code_hash = $13,
+ evm_emulator_code_hash = $14,
+ protocol_version = $15,
+ system_logs = $16,
+ storage_refunds = $17,
+ pubdata_costs = $18,
+ pubdata_input = $19,
+ predicted_circuits_by_type = $20,
updated_at = NOW(),
sealed_at = NOW(),
is_sealed = TRUE
@@ -749,6 +754,9 @@ impl BlocksDal<'_, '_> {
&header.l2_to_l1_messages,
header.bloom.as_bytes(),
&priority_onchain_data,
+ i64::from(predicted_block_gas.commit),
+ i64::from(predicted_block_gas.prove),
+ i64::from(predicted_block_gas.execute),
initial_bootloader_contents,
used_contract_hashes,
header.base_system_contracts_hashes.bootloader.as_bytes(),
@@ -1974,150 +1982,6 @@ impl BlocksDal<'_, '_> {
Ok(Some((H256::from_slice(&hash), row.timestamp as u64)))
}
- pub async fn get_l1_batch_local_root(
- &mut self,
- number: L1BatchNumber,
- ) -> DalResult