diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json
index 7e3c7e01ae74..c3898055f848 100644
--- a/.github/release-please/manifest.json
+++ b/.github/release-please/manifest.json
@@ -1,5 +1,5 @@
{
"core": "25.2.0",
- "prover": "17.1.0",
+ "prover": "17.1.1",
"zkstack_cli": "0.1.2"
}
diff --git a/.github/workflows/zk-environment-publish.yml b/.github/workflows/zk-environment-publish.yml
index b9321c8f5d6c..e9dfac1c6bb2 100644
--- a/.github/workflows/zk-environment-publish.yml
+++ b/.github/workflows/zk-environment-publish.yml
@@ -128,8 +128,7 @@ jobs:
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') }}
zk_environment_multiarch_manifest:
- # 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'
+ if: ${{ (needs.changed_files.outputs.zk_environment == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch') }}
# Needed to push to Gihub Package Registry
permissions:
packages: write
diff --git a/.gitignore b/.gitignore
index adf3b7799618..471a601cc34b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,3 +120,6 @@ 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 0994c0133e70..abec4a863bc9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12135,6 +12135,16 @@ 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"
@@ -12208,9 +12218,9 @@ dependencies = [
[[package]]
name = "zksync_concurrency"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "035269d811b3770debca372141ab64cad067dce8e58cb39a48cb7617d30c626b"
+checksum = "4c24c9a056499823227503dd9e5fb3037d93bcc3ae9b06c1ac0a47334c6283af"
dependencies = [
"anyhow",
"once_cell",
@@ -12244,9 +12254,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_bft"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8001633dee671134cf572175a6c4f817904ce5f8d92e9b51f49891c5184a831"
+checksum = "e9e7ae72c257d6a4956ecb1b9d77eb082b0b31e9f47a7860d107509fb55c474d"
dependencies = [
"anyhow",
"async-trait",
@@ -12266,9 +12276,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_crypto"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49e38d1b5ed28c66e785caff53ea4863375555d818aafa03290397192dd3e665"
+checksum = "5da303b01f24283e93f80f361bf62c3df4a761d061c8b38b4faebeebf26362fc"
dependencies = [
"anyhow",
"blst",
@@ -12287,9 +12297,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_executor"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "061546668dd779ecb08302d2c84a6419e0093ad42aaa279bf20a8fa2ffda1be4"
+checksum = "a33cfae30ebaaa817394718fe0858dfa7c0abfa2ed800ea283c407560aac2465"
dependencies = [
"anyhow",
"async-trait",
@@ -12309,9 +12319,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_network"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e9789b5be26d20511bd7930bd9916d91122ff6cb09a28898563152a52f9f5eb"
+checksum = "e0129eab96f940ce24f975a27ef9408592d64da7cff51153755dedefbcf58a73"
dependencies = [
"anyhow",
"async-trait",
@@ -12346,9 +12356,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_roles"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e49fbd4e69b276058f3dfc06cf6ada0e8caa6ed826e81289e4d596da95a0f17a"
+checksum = "50f07db2a8ec2d2cda5cb4c5ac408101e81c8fa5d95c9f3302829dafae78d11c"
dependencies = [
"anyhow",
"bit-vec",
@@ -12368,9 +12378,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_storage"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b2aab4ed18b13cd584f4edcc2546c8da82f89ac62e525063e12935ff28c9be"
+checksum = "57a42f57cc5afcee634cbd336e9e6ea891d0171352d7c0bc7d6e17f6c8faa554"
dependencies = [
"anyhow",
"async-trait",
@@ -12388,9 +12398,9 @@ dependencies = [
[[package]]
name = "zksync_consensus_utils"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10bac8f471b182d4fa3d40cf158aac3624fe636a1ff0b4cf3fe26a0e20c68a42"
+checksum = "3222410c67617a86edb192e0c4bb48afc254a17052200a0a839c90e8b0378842"
dependencies = [
"anyhow",
"rand 0.8.5",
@@ -12724,6 +12734,7 @@ dependencies = [
"async-trait",
"chrono",
"once_cell",
+ "serde",
"test-casing",
"test-log",
"thiserror",
@@ -12734,6 +12745,7 @@ dependencies = [
"zksync_contracts",
"zksync_dal",
"zksync_eth_client",
+ "zksync_health_check",
"zksync_l1_contract_interface",
"zksync_node_fee_model",
"zksync_node_test_utils",
@@ -12761,6 +12773,9 @@ dependencies = [
"anyhow",
"async-recursion",
"async-trait",
+ "bincode",
+ "hex",
+ "itertools 0.10.5",
"test-log",
"thiserror",
"tokio",
@@ -12770,9 +12785,11 @@ dependencies = [
"zksync_contracts",
"zksync_dal",
"zksync_eth_client",
+ "zksync_mini_merkle_tree",
"zksync_shared_metrics",
"zksync_system_constants",
"zksync_types",
+ "zksync_web3_decl",
]
[[package]]
@@ -12910,6 +12927,7 @@ dependencies = [
"tokio",
"tracing",
"vise",
+ "zksync_bin_metadata",
]
[[package]]
@@ -13125,6 +13143,7 @@ dependencies = [
"zksync_config",
"zksync_consensus_roles",
"zksync_contracts",
+ "zksync_crypto_primitives",
"zksync_dal",
"zksync_health_check",
"zksync_metadata_calculator",
@@ -13239,11 +13258,13 @@ 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",
@@ -13277,6 +13298,7 @@ dependencies = [
"zksync_proof_data_handler",
"zksync_queued_job_processor",
"zksync_reorg_detector",
+ "zksync_shared_metrics",
"zksync_state",
"zksync_state_keeper",
"zksync_storage",
@@ -13450,9 +13472,9 @@ dependencies = [
[[package]]
name = "zksync_protobuf"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abd55c64f54cb10967a435422f66ff5880ae14a232b245517c7ce38da32e0cab"
+checksum = "f05755c38b134b409736008bfdfd0fdb42bfa061947be93be4c78069aa10c9b3"
dependencies = [
"anyhow",
"bit-vec",
@@ -13471,9 +13493,9 @@ dependencies = [
[[package]]
name = "zksync_protobuf_build"
-version = "0.5.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4121952bcaf711005dd554612fc6e2de9b30cb58088508df87f1d38046ce8ac8"
+checksum = "64c3930a73ca667780be6dcd94e469d40a93fa52f4654c9ab732991b62238cb5"
dependencies = [
"anyhow",
"heck 0.5.0",
@@ -13589,9 +13611,10 @@ dependencies = [
name = "zksync_shared_metrics"
version = "0.1.0"
dependencies = [
- "rustc_version 0.4.1",
+ "serde",
"tracing",
"vise",
+ "zksync_bin_metadata",
"zksync_dal",
"zksync_types",
]
@@ -13672,6 +13695,7 @@ dependencies = [
"itertools 0.10.5",
"once_cell",
"rand 0.8.5",
+ "serde",
"tempfile",
"test-casing",
"thiserror",
@@ -13683,6 +13707,7 @@ 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 5d3ea3b8dbe0..8ece4b334112 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -80,6 +80,7 @@ members = [
"core/tests/loadnext",
"core/tests/vm-benchmark",
"get_all_blobs",
+ "core/lib/bin_metadata",
]
resolver = "2"
@@ -250,16 +251,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.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"
+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"
# "Local" dependencies
zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" }
@@ -282,6 +283,7 @@ 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 81604f83008a..49f37116de75 100644
--- a/core/bin/external_node/src/config/mod.rs
+++ b/core/bin/external_node/src/config/mod.rs
@@ -102,11 +102,15 @@ 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 {
- 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,
+ #[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,
// 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.
@@ -144,7 +148,7 @@ impl RemoteENConfig {
.rpc_context("ecosystem_contracts")
.await
.ok();
- let diamond_proxy_addr = client
+ let l1_diamond_proxy_addr = client
.get_main_contract()
.rpc_context("get_main_contract")
.await?;
@@ -180,14 +184,14 @@ impl RemoteENConfig {
}
Ok(Self {
- bridgehub_proxy_addr: ecosystem_contracts.as_ref().map(|a| a.bridgehub_proxy_addr),
- state_transition_proxy_addr: ecosystem_contracts
+ l1_bridgehub_proxy_addr: ecosystem_contracts.as_ref().map(|a| a.bridgehub_proxy_addr),
+ l1_state_transition_proxy_addr: ecosystem_contracts
.as_ref()
.map(|a| a.state_transition_proxy_addr),
- transparent_proxy_admin_addr: ecosystem_contracts
+ l1_transparent_proxy_admin_addr: ecosystem_contracts
.as_ref()
.map(|a| a.transparent_proxy_admin_addr),
- diamond_proxy_addr,
+ l1_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,
@@ -212,10 +216,10 @@ impl RemoteENConfig {
#[cfg(test)]
fn mock() -> Self {
Self {
- bridgehub_proxy_addr: None,
- state_transition_proxy_addr: None,
- transparent_proxy_admin_addr: None,
- diamond_proxy_addr: Address::repeat_byte(1),
+ 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),
l1_erc20_bridge_proxy_addr: Some(Address::repeat_byte(2)),
l2_erc20_bridge_addr: Some(Address::repeat_byte(3)),
l2_weth_bridge_addr: None,
@@ -479,7 +483,6 @@ 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,
@@ -489,7 +492,11 @@ pub(crate) struct OptionalENConfig {
}
impl OptionalENConfig {
- fn from_configs(general_config: &GeneralConfig, enconfig: &ENConfig) -> anyhow::Result {
+ fn from_configs(
+ general_config: &GeneralConfig,
+ enconfig: &ENConfig,
+ secrets: &Secrets,
+ ) -> 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()?;
@@ -721,7 +728,10 @@ impl OptionalENConfig {
.unwrap_or_else(Self::default_main_node_rate_limit_rps),
api_namespaces,
contracts_diamond_proxy_addr: None,
- gateway_url: enconfig.gateway_url.clone(),
+ gateway_url: secrets
+ .l1
+ .as_ref()
+ .and_then(|l1| l1.gateway_rpc_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
@@ -1340,7 +1350,11 @@ impl ExternalNodeConfig<()> {
&external_node_config,
&secrets_config,
)?;
- let optional = OptionalENConfig::from_configs(&general_config, &external_node_config)?;
+ let optional = OptionalENConfig::from_configs(
+ &general_config,
+ &external_node_config,
+ &secrets_config,
+ )?;
let postgres = PostgresConfig {
database_url: secrets_config
.database
@@ -1383,7 +1397,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.diamond_proxy_addr;
+ let remote_diamond_proxy_addr = remote.l1_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,
@@ -1430,14 +1444,14 @@ impl ExternalNodeConfig {
}
}
- /// Returns a verified diamond proxy address.
+ /// Returns verified L1 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 diamond_proxy_address(&self) -> Address {
+ pub fn l1_diamond_proxy_address(&self) -> Address {
self.optional
.contracts_diamond_proxy_addr
- .unwrap_or(self.remote.diamond_proxy_addr)
+ .unwrap_or(self.remote.l1_diamond_proxy_addr)
}
}
@@ -1461,10 +1475,10 @@ impl From<&ExternalNodeConfig> for InternalApiConfig {
l1_weth_bridge: config.remote.l1_weth_bridge_addr,
l2_weth_bridge: config.remote.l2_weth_bridge_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,
+ 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,
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 fc9d4fe51345..228af8aa0417 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::rustc::RUST_METRICS;
+use zksync_shared_metrics::{GIT_METRICS, RUST_METRICS};
use zksync_types::{L1ChainId, L2ChainId, SLChainId};
use super::EN_METRICS;
@@ -40,6 +40,7 @@ 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 5c70fd436781..5f9445d30fe8 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_metrics::PostgresMetricsLayer,
+ postgres::PostgresLayer,
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_NATIVE_TOKEN_VAULT_ADDRESS;
+use zksync_types::L2_ASSET_ROUTER_ADDRESS;
use crate::{config::ExternalNodeConfig, metrics::framework::ExternalNodeMetricsLayer, Component};
@@ -125,8 +125,8 @@ impl ExternalNodeBuilder {
Ok(self)
}
- fn add_postgres_metrics_layer(mut self) -> anyhow::Result {
- self.node.add_layer(PostgresMetricsLayer);
+ fn add_postgres_layer(mut self) -> anyhow::Result {
+ self.node.add_layer(PostgresLayer);
Ok(self)
}
@@ -181,8 +181,7 @@ impl ExternalNodeBuilder {
let query_eth_client_layer = QueryEthClientLayer::new(
self.config.required.settlement_layer_id(),
self.config.required.eth_client_url.clone(),
- // TODO(EVM-676): add this config for external node
- Default::default(),
+ self.config.optional.gateway_url.clone(),
);
self.node.add_layer(query_eth_client_layer);
Ok(self)
@@ -200,12 +199,11 @@ 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_NATIVE_TOKEN_VAULT_ADDRESS
- {
- // System has migrated to `L2_NATIVE_TOKEN_VAULT_ADDRESS`, use legacy shared bridge address from main node.
+ 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.
self.config.remote.l2_legacy_shared_bridge_addr
} else {
- // System hasn't migrated on `L2_NATIVE_TOKEN_VAULT_ADDRESS`, we can safely use `l2_shared_bridge_addr`.
+ // System hasn't migrated on `L2_ASSET_ROUTER_ADDRESS`, we can safely use `l2_shared_bridge_addr`.
Some(l2_shared_bridge_addr)
};
@@ -278,7 +276,7 @@ impl ExternalNodeBuilder {
fn add_l1_batch_commitment_mode_validation_layer(mut self) -> anyhow::Result {
let layer = L1BatchCommitmentModeValidationLayer::new(
- self.config.diamond_proxy_address(),
+ self.config.l1_diamond_proxy_address(),
self.config.optional.l1_batch_commit_data_generator_mode,
);
self.node.add_layer(layer);
@@ -297,9 +295,10 @@ 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.diamond_proxy_address(),
+ self.config.l1_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)
@@ -324,7 +323,10 @@ impl ExternalNodeBuilder {
}
fn add_tree_data_fetcher_layer(mut self) -> anyhow::Result {
- let layer = TreeDataFetcherLayer::new(self.config.diamond_proxy_address());
+ let layer = TreeDataFetcherLayer::new(
+ self.config.l1_diamond_proxy_address(),
+ self.config.required.l2_chain_id,
+ );
self.node.add_layer(layer);
Ok(self)
}
@@ -582,7 +584,7 @@ impl ExternalNodeBuilder {
// so until we have a dedicated component for "auxiliary" tasks,
// it's responsible for things like metrics.
self = self
- .add_postgres_metrics_layer()?
+ .add_postgres_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 59aceea819f1..fd616a467ee8 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.diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.l1_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.diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.l1_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.diamond_proxy_address());
+ let eth_client = utils::mock_eth_client(env.config.l1_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 b26fa80d1a95..58e2a88e5fb7 100644
--- a/core/bin/external_node/src/tests/utils.rs
+++ b/core/bin/external_node/src/tests/utils.rs
@@ -23,10 +23,13 @@ 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 794c847a24d5..d74928e8fbc7 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_metrics::PostgresMetricsLayer,
+ postgres::PostgresLayer,
prometheus_exporter::PrometheusExporterLayer,
proof_data_handler::ProofDataHandlerLayer,
query_eth_client::QueryEthClientLayer,
@@ -138,8 +138,8 @@ impl MainNodeBuilder {
Ok(self)
}
- fn add_postgres_metrics_layer(mut self) -> anyhow::Result {
- self.node.add_layer(PostgresMetricsLayer);
+ fn add_postgres_layer(mut self) -> anyhow::Result {
+ self.node.add_layer(PostgresLayer);
Ok(self)
}
@@ -161,11 +161,7 @@ impl MainNodeBuilder {
let query_eth_client_layer = QueryEthClientLayer::new(
genesis.settlement_layer_id(),
eth_config.l1_rpc_url,
- self.configs
- .eth
- .as_ref()
- .and_then(|x| Some(x.gas_adjuster?.settlement_mode))
- .unwrap_or(SettlementMode::SettlesToL1),
+ eth_config.gateway_rpc_url,
);
self.node.add_layer(query_eth_client_layer);
Ok(self)
@@ -283,6 +279,7 @@ 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)
}
@@ -760,9 +757,7 @@ impl MainNodeBuilder {
self = self.add_eth_tx_manager_layer()?;
}
Component::Housekeeper => {
- self = self
- .add_house_keeper_layer()?
- .add_postgres_metrics_layer()?;
+ self = self.add_house_keeper_layer()?.add_postgres_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 d79bc57cc5e1..8b8e24af4339 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 {
- fn new(number: u64) -> Result {
+ pub 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 e6d3cab37273..98625831c991 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(Vec);
+pub struct ValueOrArray(pub Vec);
impl ValueOrArray {
pub fn flatten(self) -> Vec {
@@ -206,6 +206,12 @@ 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
new file mode 100644
index 000000000000..e529ecfb49a7
--- /dev/null
+++ b/core/lib/bin_metadata/Cargo.toml
@@ -0,0 +1,18 @@
+[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
new file mode 100644
index 000000000000..ff339ae5589c
--- /dev/null
+++ b/core/lib/bin_metadata/build.rs
@@ -0,0 +1,75 @@
+//! 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
new file mode 100644
index 000000000000..d8a5221e4775
--- /dev/null
+++ b/core/lib/bin_metadata/src/lib.rs
@@ -0,0 +1,68 @@
+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/da_client/eigen.rs b/core/lib/config/src/configs/da_client/eigen.rs
index 6e353b6b1928..b39365bced2b 100644
--- a/core/lib/config/src/configs/da_client/eigen.rs
+++ b/core/lib/config/src/configs/da_client/eigen.rs
@@ -1,5 +1,17 @@
use serde::Deserialize;
use zksync_basic_types::secrets::PrivateKey;
+
+#[derive(Clone, Debug, PartialEq, Deserialize)]
+pub enum PointsSource {
+ Path(String),
+ Link(String),
+}
+
+impl Default for PointsSource {
+ fn default() -> Self {
+ PointsSource::Path("".to_string())
+ }
+}
/// Configuration for the EigenDA remote disperser client.
#[derive(Clone, Debug, PartialEq, Deserialize, Default)]
pub struct EigenConfig {
@@ -7,13 +19,11 @@ pub struct EigenConfig {
pub disperser_rpc: String,
/// Block height needed to reach in order to consider the blob finalized
/// a value less or equal to 0 means that the disperser will not wait for finalization
- pub eth_confirmation_depth: i32,
+ pub settlement_layer_confirmation_depth: i32,
/// URL of the Ethereum RPC server
pub eigenda_eth_rpc: String,
/// Address of the service manager contract
pub eigenda_svc_manager_address: String,
- /// Maximum size permitted for a blob in bytes
- pub blob_size_limit: u32,
/// Maximun amount of time in milliseconds to wait for a status query response
pub status_query_timeout: u64,
/// Interval in milliseconds to query the status of a blob
@@ -24,8 +34,8 @@ pub struct EigenConfig {
pub authenticated: bool,
/// Verify the certificate of dispatched blobs
pub verify_cert: bool,
- /// Path to the file containing the points used for KZG
- pub path_to_points: String,
+ /// Path or link to the file containing the points used for KZG
+ pub points_source: PointsSource,
/// Chain ID of the Ethereum network
pub chain_id: u64,
}
diff --git a/core/lib/config/src/configs/en_config.rs b/core/lib/config/src/configs/en_config.rs
index 4cab47b0779e..13a0e1f2c99d 100644
--- a/core/lib/config/src/configs/en_config.rs
+++ b/core/lib/config/src/configs/en_config.rs
@@ -18,6 +18,5 @@ 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 7b67f015238d..be2f5b532a3e 100644
--- a/core/lib/config/src/configs/eth_sender.rs
+++ b/core/lib/config/src/configs/eth_sender.rs
@@ -23,7 +23,6 @@ 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,
@@ -82,7 +81,6 @@ 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 75ff067c2473..8285d81e4bd2 100644
--- a/core/lib/config/src/configs/secrets.rs
+++ b/core/lib/config/src/configs/secrets.rs
@@ -16,6 +16,7 @@ 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 3574fc8cc58d..5464d82d1ef2 100644
--- a/core/lib/config/src/testonly.rs
+++ b/core/lib/config/src/testonly.rs
@@ -399,7 +399,6 @@ 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),
@@ -852,6 +851,7 @@ 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,8 +938,6 @@ 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 4f0f362d9149..6e402c117bfe 100644
--- a/core/lib/constants/src/contracts.rs
+++ b/core/lib/constants/src/contracts.rs
@@ -135,6 +135,8 @@ 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 a8f4a034fb99..9bb8764cd667 100644
--- a/core/lib/constants/src/message_root.rs
+++ b/core/lib/constants/src/message_root.rs
@@ -1,5 +1,14 @@
-// Position of `FullTree::_height` in `MessageRoot`'s storage layout.
+/// 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.
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 74efa72793aa..e60fdb0e59f3 100644
--- a/core/lib/contracts/src/lib.rs
+++ b/core/lib/contracts/src/lib.rs
@@ -256,7 +256,9 @@ impl SystemContractsRepo {
"artifacts-zk/contracts-preprocessed/{0}{1}.sol/{1}.json",
directory, name
)))
- .expect("One of the outputs should exists")
+ .unwrap_or_else(|| {
+ panic!("One of the outputs should exists for {directory}{name}");
+ })
}
}
ContractLanguage::Yul => {
@@ -975,3 +977,461 @@ 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
deleted file mode 100644
index d59f237ed3c3..000000000000
--- a/core/lib/dal/.sqlx/query-10b8981f7aa47ce5d3507571af45f7cef0d50c4938105684971e8adc86bb6366.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "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 48fa673b2c91..df60f114f5ef 100644
--- a/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json
+++ b/core/lib/dal/.sqlx/query-2234d7728d91cefaee792c900448aafe4b1aa2250fc535bfcdff39172551d42b.json
@@ -103,7 +103,7 @@
false,
true,
true,
- false,
+ true,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
index b8d6482ea744..32a2212dfdf6 100644
--- a/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
+++ b/core/lib/dal/.sqlx/query-228aa5ec4c4eb56143823b96a8190ded732839b9f5bf16042205a730fac07c3a.json
@@ -11,7 +11,8 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions"
+ "PriorityTransactions",
+ "ChainBatchRoot"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json b/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json
new file mode 100644
index 000000000000..adbd2c0931ec
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-2d0a4e9281e53b0e410b9be0ebd53b2126b52d568196f333973a345f984ea7c4.json
@@ -0,0 +1,22 @@
+{
+ "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
new file mode 100644
index 000000000000..69dd87a6c355
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-2e3107b0c5e8466598066ceca9844469e431e35c4419fd710050d51eeefd6b8b.json
@@ -0,0 +1,22 @@
+{
+ "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
new file mode 100644
index 000000000000..123afc6060a6
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-3566423188a5d6bed7150f327d83613cd34138b59ef3b9271fd0bfdaddd086f8.json
@@ -0,0 +1,50 @@
+{
+ "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
new file mode 100644
index 000000000000..dfaccfbc99d3
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-3785c01a8eb1eaeaf7baf0a8ba7f30cbc385e6fb6c8b8ae2c2d06b871a4cae72.json
@@ -0,0 +1,27 @@
+{
+ "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 e2a808d41f89..8bab74d20f5c 100644
--- a/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json
+++ b/core/lib/dal/.sqlx/query-3ee6c2a87c65eaece7048da53c9f98ded0ad3e59e6de69c2b13d92d8ab1a07dd.json
@@ -17,7 +17,8 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions"
+ "PriorityTransactions",
+ "ChainBatchRoot"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
index 3e64cc5f5b2f..c6c189d45fcb 100644
--- a/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
+++ b/core/lib/dal/.sqlx/query-400457c97449097837d5e31d4476c32170ea4b47051a100f71a41dd6ed9bb1a9.json
@@ -108,7 +108,7 @@
false,
true,
true,
- false,
+ true,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json b/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json
deleted file mode 100644
index 98d228726d48..000000000000
--- a/core/lib/dal/.sqlx/query-6069d168d5c4b5131b50500302cdde79388b62926ff83d954b4d93dedfe2503a.json
+++ /dev/null
@@ -1,33 +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 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
deleted file mode 100644
index ab2283fa60c3..000000000000
--- a/core/lib/dal/.sqlx/query-63f5f9bff4b2c15fa4230af2c73b5b5cc7e37dd6a607e9453e822e34ba77cdc3.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "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 1a3c160cee1b..a6ac67328b14 100644
--- a/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json
+++ b/core/lib/dal/.sqlx/query-6692ff6c0fbb2fc94f5cd2837a43ce80f9b2b27758651ccfc09df61a4ae8a363.json
@@ -101,7 +101,7 @@
false,
true,
true,
- false,
+ true,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json b/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json
new file mode 100644
index 000000000000..7559630217be
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-8065f779631edb7ba30229485ff5e419ffae1fece87427c6571713047d44f015.json
@@ -0,0 +1,52 @@
+{
+ "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-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json b/core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json
similarity index 56%
rename from core/lib/dal/.sqlx/query-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json
rename to core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json
index 5f27c7549b47..9c339a604c89 100644
--- a/core/lib/dal/.sqlx/query-5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231.json
+++ b/core/lib/dal/.sqlx/query-843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "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",
+ "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",
"describe": {
"columns": [
{
@@ -11,12 +11,13 @@
],
"parameters": {
"Left": [
- "Text"
+ "Text",
+ "Int8"
]
},
"nullable": [
false
]
},
- "hash": "5503575d9377785894de6cf6139a8d4768c6a803a1a90889e5a1b8254c315231"
+ "hash": "843b299bbffbade83dd673ed4a488eefd4419e8a9eb05a9528da11163f52b2c7"
}
diff --git a/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
index c2e662ef376e..e47911f3d776 100644
--- a/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
+++ b/core/lib/dal/.sqlx/query-868bfdc5d8ee5eab395fa690891751dfd285628a75a35b152bccb3c73e9cc057.json
@@ -102,7 +102,7 @@
false,
true,
true,
- false,
+ true,
true,
true,
false,
diff --git a/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json b/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json
new file mode 100644
index 000000000000..0132af8fbe6c
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-8bab3c429fc5bbf4a91819e55cfb71ef6258e011f424c705d56c9827e8277c84.json
@@ -0,0 +1,44 @@
+{
+ "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-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json b/core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.json
similarity index 52%
rename from core/lib/dal/.sqlx/query-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json
rename to core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.json
index ed3270de573e..8de8a19da5f8 100644
--- a/core/lib/dal/.sqlx/query-d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8.json
+++ b/core/lib/dal/.sqlx/query-9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f.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 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 ",
+ "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 ",
"describe": {
"columns": [
{
@@ -45,61 +45,76 @@
},
{
"ordinal": 8,
+ "name": "commit_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 9,
"name": "prove_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 9,
+ "ordinal": 10,
"name": "proven_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 10,
+ "ordinal": 11,
+ "name": "prove_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 12,
"name": "execute_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 11,
+ "ordinal": 13,
"name": "executed_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 12,
+ "ordinal": 14,
+ "name": "execute_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 15,
"name": "l1_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 13,
+ "ordinal": 16,
"name": "l2_fair_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 14,
+ "ordinal": 17,
"name": "fair_pubdata_price",
"type_info": "Int8"
},
{
- "ordinal": 15,
+ "ordinal": 18,
"name": "bootloader_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 16,
+ "ordinal": 19,
"name": "default_aa_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 17,
+ "ordinal": 20,
"name": "evm_emulator_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 18,
+ "ordinal": 21,
"name": "protocol_version",
"type_info": "Int4"
},
{
- "ordinal": 19,
+ "ordinal": 22,
"name": "fee_account_address",
"type_info": "Bytea"
}
@@ -118,10 +133,13 @@
false,
false,
true,
+ true,
false,
true,
+ true,
false,
true,
+ true,
false,
false,
true,
@@ -132,5 +150,5 @@
false
]
},
- "hash": "d3760406b7bf5d14a3fe6cbc9fb3926df634ebf0d8286181fa04884fb747cee8"
+ "hash": "9b011c7afa158edd17fe0dc56dad5204831b7ede1a8e3b3c2d441d505c4ca58f"
}
diff --git a/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json b/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json
new file mode 100644
index 000000000000..a64bdb403aef
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-a0ad14cd53afb6c360e70c47dbd79d66dd9fbd20941aec20e2e8c3874b15a953.json
@@ -0,0 +1,30 @@
+{
+ "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-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json b/core/lib/dal/.sqlx/query-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json
new file mode 100644
index 000000000000..89f0706843bd
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-b7fa581d662640236d11143953e3a0aedbd2455b2ff728fe88cab94728925c0e.json
@@ -0,0 +1,53 @@
+{
+ "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
deleted file mode 100644
index 379c1f75d9b3..000000000000
--- a/core/lib/dal/.sqlx/query-b9f77e6c15f9e635024b73f1fc985c5196c431363802b6b988939c99853b9c97.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "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
new file mode 100644
index 000000000000..90623e77e985
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-c1f9ecf033d609457106189bc4d7928aa933616d2186c13a4e005297b0ad63a7.json
@@ -0,0 +1,15 @@
+{
+ "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
new file mode 100644
index 000000000000..751d272b0b0e
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-c2c288d268d6b266acbfc1058bc55a360f8ae12b6378f8168c000d668d6489d0.json
@@ -0,0 +1,22 @@
+{
+ "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 61832d25fd24..5e2ea45e0bc2 100644
--- a/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json
+++ b/core/lib/dal/.sqlx/query-c2c40d5aae2e0276de453c78a39ce5a6cca1524adfe99b0cb35662746479dcc1.json
@@ -11,7 +11,8 @@
"kind": {
"Enum": [
"ProtocolUpgrades",
- "PriorityTransactions"
+ "PriorityTransactions",
+ "ChainBatchRoot"
]
}
}
diff --git a/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json b/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json
deleted file mode 100644
index fb28539ccdf6..000000000000
--- a/core/lib/dal/.sqlx/query-c9a842d04e8b225e43f07f76541dc766262b5bdc58be0444e164b1bd9feed02d.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH\n soft AS (\n SELECT\n pruned_l1_batch,\n pruned_miniblock\n FROM\n pruning_log\n WHERE\n type = 'Soft'\n ORDER BY\n pruned_l1_batch DESC\n LIMIT\n 1\n ),\n \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-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json b/core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.json
similarity index 51%
rename from core/lib/dal/.sqlx/query-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json
rename to core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.json
index 28ffcc5ae468..1af3384a2d9f 100644
--- a/core/lib/dal/.sqlx/query-a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6.json
+++ b/core/lib/dal/.sqlx/query-cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f.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 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 ",
+ "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 ",
"describe": {
"columns": [
{
@@ -40,51 +40,66 @@
},
{
"ordinal": 7,
+ "name": "commit_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 8,
"name": "prove_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 8,
+ "ordinal": 9,
"name": "proven_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 9,
+ "ordinal": 10,
+ "name": "prove_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 11,
"name": "execute_tx_hash?",
"type_info": "Text"
},
{
- "ordinal": 10,
+ "ordinal": 12,
"name": "executed_at?",
"type_info": "Timestamp"
},
{
- "ordinal": 11,
+ "ordinal": 13,
+ "name": "execute_chain_id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 14,
"name": "l1_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 12,
+ "ordinal": 15,
"name": "l2_fair_gas_price",
"type_info": "Int8"
},
{
- "ordinal": 13,
+ "ordinal": 16,
"name": "fair_pubdata_price",
"type_info": "Int8"
},
{
- "ordinal": 14,
+ "ordinal": 17,
"name": "bootloader_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 15,
+ "ordinal": 18,
"name": "default_aa_code_hash",
"type_info": "Bytea"
},
{
- "ordinal": 16,
+ "ordinal": 19,
"name": "evm_emulator_code_hash",
"type_info": "Bytea"
}
@@ -102,10 +117,13 @@
true,
false,
true,
+ true,
false,
true,
+ true,
false,
true,
+ true,
false,
false,
true,
@@ -114,5 +132,5 @@
true
]
},
- "hash": "a88b113b5dc06ac990a66202b3c05e2c2f10d5cbdb03d02c3c541f7eaa1f58a6"
+ "hash": "cd6ab0aea6e1f72c58c189e098be5d1cd01521f82e2962c3feebac395caef36f"
}
diff --git a/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json b/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json
deleted file mode 100644
index 59bfa4858c02..000000000000
--- a/core/lib/dal/.sqlx/query-cf3c7b918a3f82476543841d4dc5393ec02458104c483a2023b24881ae0c6716.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "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
new file mode 100644
index 000000000000..b79441ab4d63
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-cf8aaa95e3e8c376b6083c7015753e30af54675ce58273cbb29312e6e88cbdf5.json
@@ -0,0 +1,22 @@
+{
+ "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-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json b/core/lib/dal/.sqlx/query-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json
new file mode 100644
index 000000000000..9f7de50539be
--- /dev/null
+++ b/core/lib/dal/.sqlx/query-f516657dd48332522a5580e26c509fb7e3baa5ae84bd5e010008f8972e1a7f98.json
@@ -0,0 +1,28 @@
+{
+ "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
new file mode 100644
index 000000000000..da7142b8f819
--- /dev/null
+++ b/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.down.sql
@@ -0,0 +1,2 @@
+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
new file mode 100644
index 000000000000..8b133f70904b
--- /dev/null
+++ b/core/lib/dal/migrations/20241011081834_batch_chain_merkle_path.up.sql
@@ -0,0 +1,5 @@
+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
new file mode 100644
index 000000000000..d6beeb80e8a5
--- /dev/null
+++ b/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.down.sql
@@ -0,0 +1,2 @@
+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
new file mode 100644
index 000000000000..6a990781f61c
--- /dev/null
+++ b/core/lib/dal/migrations/20241112120944_add_batch_root_hash_to_pruning_logs.up.sql
@@ -0,0 +1,3 @@
+-- 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
new file mode 100644
index 000000000000..6d0c32ea6c24
--- /dev/null
+++ b/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.down.sql
@@ -0,0 +1,2 @@
+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
new file mode 100644
index 000000000000..cbb1e3c1a3f1
--- /dev/null
+++ b/core/lib/dal/migrations/20241121142103_drop_predicted_gas_cost_not_null.up.sql
@@ -0,0 +1,2 @@
+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 93d8574187ab..3c128458c87f 100644
--- a/core/lib/dal/src/blocks_dal.rs
+++ b/core/lib/dal/src/blocks_dal.rs
@@ -6,25 +6,24 @@ use std::{
};
use anyhow::Context as _;
-use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
+use bigdecimal::{BigDecimal, FromPrimitive};
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::{
- BlockGasCount, L1BatchHeader, L1BatchStatistics, L1BatchTreeData, L2BlockHeader,
- StorageOracleInfo, UnsealedL1BatchHeader,
+ L1BatchHeader, L1BatchStatistics, L1BatchTreeData, L2BlockHeader, StorageOracleInfo,
+ UnsealedL1BatchHeader,
},
commitment::{L1BatchCommitmentArtifacts, L1BatchWithMetadata},
fee_model::BatchFeeInput,
- l2_to_l1_log::UserL2ToL1Log,
+ l2_to_l1_log::{BatchAndChainMerklePath, UserL2ToL1Log},
writes::TreeWrite,
- Address, Bloom, L1BatchNumber, L2BlockNumber, ProtocolVersionId, H256, U256,
+ Address, Bloom, L1BatchNumber, L2BlockNumber, ProtocolVersionId, SLChainId, H256, U256,
};
use zksync_vm_interface::CircuitStatistic;
@@ -689,7 +688,6 @@ 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
@@ -729,20 +727,17 @@ impl BlocksDal<'_, '_> {
l2_to_l1_messages = $4,
bloom = $5,
priority_ops_onchain_data = $6,
- 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,
+ 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,
updated_at = NOW(),
sealed_at = NOW(),
is_sealed = TRUE
@@ -755,9 +750,6 @@ 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(),
@@ -1990,6 +1982,150 @@ 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