diff --git a/crates/bridges/evm/erigon-bridge/src/generated/custom.rs b/crates/bridges/evm/erigon-bridge/src/generated/custom.rs index 0624d2e..0f4bbe4 100644 --- a/crates/bridges/evm/erigon-bridge/src/generated/custom.rs +++ b/crates/bridges/evm/erigon-bridge/src/generated/custom.rs @@ -120,10 +120,10 @@ pub mod trie_backend_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; /// TrieBackend service provides access to Merkle Patricia Trie data from CommitmentDomain #[derive(Debug, Clone)] pub struct TrieBackendClient { @@ -168,9 +168,8 @@ pub mod trie_backend_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { TrieBackendClient::new(InterceptedService::new(inner, interceptor)) } @@ -209,22 +208,12 @@ pub mod trie_backend_client { pub async fn get_state_root( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.TrieBackend/GetStateRoot", - ); + let path = http::uri::PathAndQuery::from_static("/custom.TrieBackend/GetStateRoot"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("custom.TrieBackend", "GetStateRoot")); @@ -238,43 +227,30 @@ pub mod trie_backend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.TrieBackend/StreamCommitmentNodes", - ); + let path = + http::uri::PathAndQuery::from_static("/custom.TrieBackend/StreamCommitmentNodes"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("custom.TrieBackend", "StreamCommitmentNodes")); + req.extensions_mut().insert(GrpcMethod::new( + "custom.TrieBackend", + "StreamCommitmentNodes", + )); self.inner.server_streaming(req, path, codec).await } /// Get specific nodes by hash (for filling gaps) pub async fn get_nodes_by_hash( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.TrieBackend/GetNodesByHash", - ); + let path = http::uri::PathAndQuery::from_static("/custom.TrieBackend/GetNodesByHash"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("custom.TrieBackend", "GetNodesByHash")); @@ -404,10 +380,10 @@ pub mod block_data_backend_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; /// BlockDataBackend service provides blockchain data as RLP-encoded bytes /// This service streams data from both snapshots (frozen blocks) and live database #[derive(Debug, Clone)] @@ -453,9 +429,8 @@ pub mod block_data_backend_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { BlockDataBackendClient::new(InterceptedService::new(inner, interceptor)) } @@ -498,18 +473,12 @@ pub mod block_data_backend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.BlockDataBackend/StreamBlocks", - ); + let path = + http::uri::PathAndQuery::from_static("/custom.BlockDataBackend/StreamBlocks"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("custom.BlockDataBackend", "StreamBlocks")); @@ -523,23 +492,17 @@ pub mod block_data_backend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.BlockDataBackend/StreamTransactions", - ); + let path = + http::uri::PathAndQuery::from_static("/custom.BlockDataBackend/StreamTransactions"); let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("custom.BlockDataBackend", "StreamTransactions"), - ); + req.extensions_mut().insert(GrpcMethod::new( + "custom.BlockDataBackend", + "StreamTransactions", + )); self.inner.server_streaming(req, path, codec).await } /// Execute blocks in range and stream RLP receipts (slow: executes blocks, generates receipts) @@ -551,18 +514,12 @@ pub mod block_data_backend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/custom.BlockDataBackend/ExecuteBlocks", - ); + let path = + http::uri::PathAndQuery::from_static("/custom.BlockDataBackend/ExecuteBlocks"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("custom.BlockDataBackend", "ExecuteBlocks")); diff --git a/crates/bridges/evm/erigon-bridge/src/generated/remote.rs b/crates/bridges/evm/erigon-bridge/src/generated/remote.rs index 5b2aa91..5797cc5 100644 --- a/crates/bridges/evm/erigon-bridge/src/generated/remote.rs +++ b/crates/bridges/evm/erigon-bridge/src/generated/remote.rs @@ -55,10 +55,10 @@ pub mod bridge_backend_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct BridgeBackendClient { inner: tonic::client::Grpc, @@ -102,9 +102,8 @@ pub mod bridge_backend_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { BridgeBackendClient::new(InterceptedService::new(inner, interceptor)) } @@ -143,22 +142,13 @@ pub mod bridge_backend_client { pub async fn version( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.BridgeBackend/Version", - ); + let path = http::uri::PathAndQuery::from_static("/remote.BridgeBackend/Version"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.BridgeBackend", "Version")); @@ -167,22 +157,12 @@ pub mod bridge_backend_client { pub async fn bor_txn_lookup( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.BridgeBackend/BorTxnLookup", - ); + let path = http::uri::PathAndQuery::from_static("/remote.BridgeBackend/BorTxnLookup"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.BridgeBackend", "BorTxnLookup")); @@ -192,18 +172,11 @@ pub mod bridge_backend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.BridgeBackend/BorEvents", - ); + let path = http::uri::PathAndQuery::from_static("/remote.BridgeBackend/BorEvents"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.BridgeBackend", "BorEvents")); @@ -218,10 +191,10 @@ pub mod heimdall_backend_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct HeimdallBackendClient { inner: tonic::client::Grpc, @@ -265,9 +238,8 @@ pub mod heimdall_backend_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { HeimdallBackendClient::new(InterceptedService::new(inner, interceptor)) } @@ -306,22 +278,13 @@ pub mod heimdall_backend_client { pub async fn version( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.HeimdallBackend/Version", - ); + let path = http::uri::PathAndQuery::from_static("/remote.HeimdallBackend/Version"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.HeimdallBackend", "Version")); @@ -330,22 +293,13 @@ pub mod heimdall_backend_client { pub async fn producers( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.HeimdallBackend/Producers", - ); + let path = http::uri::PathAndQuery::from_static("/remote.HeimdallBackend/Producers"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.HeimdallBackend", "Producers")); @@ -633,10 +587,10 @@ pub mod ethbackend_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] pub struct EthbackendClient { inner: tonic::client::Grpc, @@ -680,9 +634,8 @@ pub mod ethbackend_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { EthbackendClient::new(InterceptedService::new(inner, interceptor)) } @@ -721,18 +674,11 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/Etherbase", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Etherbase"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "Etherbase")); @@ -741,22 +687,12 @@ pub mod ethbackend_client { pub async fn net_version( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/NetVersion", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/NetVersion"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "NetVersion")); @@ -765,22 +701,12 @@ pub mod ethbackend_client { pub async fn net_peer_count( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/NetPeerCount", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/NetPeerCount"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "NetPeerCount")); @@ -790,24 +716,16 @@ pub mod ethbackend_client { pub async fn version( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/Version", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Version"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.ETHBACKEND", "Version")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.ETHBACKEND", "Version")); self.inner.unary(req, path, codec).await } /// Syncing returns a data object detailing the status of the sync process @@ -815,42 +733,27 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/Syncing", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Syncing"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.ETHBACKEND", "Syncing")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.ETHBACKEND", "Syncing")); self.inner.unary(req, path, codec).await } /// ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66). pub async fn protocol_version( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/ProtocolVersion", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/ProtocolVersion"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "ProtocolVersion")); @@ -860,22 +763,13 @@ pub mod ethbackend_client { pub async fn client_version( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/ClientVersion", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/ClientVersion"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "ClientVersion")); @@ -888,18 +782,11 @@ pub mod ethbackend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/Subscribe", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Subscribe"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "Subscribe")); @@ -913,18 +800,11 @@ pub mod ethbackend_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/SubscribeLogs", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/SubscribeLogs"); let mut req = request.into_streaming_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "SubscribeLogs")); @@ -937,65 +817,46 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Block"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.ETHBACKEND", "Block")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.ETHBACKEND", "Block")); self.inner.unary(req, path, codec).await } /// High-level method - can read block body (only storage metadata) from db, snapshots or apply any other logic pub async fn canonical_body_for_storage( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/CanonicalBodyForStorage", - ); + let path = + http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/CanonicalBodyForStorage"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("remote.ETHBACKEND", "CanonicalBodyForStorage")); + req.extensions_mut().insert(GrpcMethod::new( + "remote.ETHBACKEND", + "CanonicalBodyForStorage", + )); self.inner.unary(req, path, codec).await } /// High-level method - can find block hash by block number pub async fn canonical_hash( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/CanonicalHash", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/CanonicalHash"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "CanonicalHash")); @@ -1005,22 +866,12 @@ pub mod ethbackend_client { pub async fn header_number( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/HeaderNumber", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/HeaderNumber"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "HeaderNumber")); @@ -1032,18 +883,11 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/TxnLookup", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/TxnLookup"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "TxnLookup")); @@ -1054,18 +898,11 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/NodeInfo", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/NodeInfo"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "NodeInfo")); @@ -1076,59 +913,39 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/Peers"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.ETHBACKEND", "Peers")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.ETHBACKEND", "Peers")); self.inner.unary(req, path, codec).await } pub async fn add_peer( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/AddPeer", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/AddPeer"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.ETHBACKEND", "AddPeer")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.ETHBACKEND", "AddPeer")); self.inner.unary(req, path, codec).await } pub async fn remove_peer( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/RemovePeer", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/RemovePeer"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "RemovePeer")); @@ -1138,22 +955,12 @@ pub mod ethbackend_client { pub async fn pending_block( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/PendingBlock", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/PendingBlock"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "PendingBlock")); @@ -1162,22 +969,12 @@ pub mod ethbackend_client { pub async fn bor_txn_lookup( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/BorTxnLookup", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/BorTxnLookup"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "BorTxnLookup")); @@ -1187,18 +984,11 @@ pub mod ethbackend_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/BorEvents", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/BorEvents"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "BorEvents")); @@ -1207,22 +997,12 @@ pub mod ethbackend_client { pub async fn aa_validation( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/AAValidation", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/AAValidation"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "AAValidation")); @@ -1231,22 +1011,13 @@ pub mod ethbackend_client { pub async fn block_for_tx_num( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/BlockForTxNum", - ); + let path = http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/BlockForTxNum"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.ETHBACKEND", "BlockForTxNum")); @@ -1255,25 +1026,19 @@ pub mod ethbackend_client { pub async fn minimum_block_available( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.ETHBACKEND/MinimumBlockAvailable", - ); + let path = + http::uri::PathAndQuery::from_static("/remote.ETHBACKEND/MinimumBlockAvailable"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("remote.ETHBACKEND", "MinimumBlockAvailable")); + req.extensions_mut().insert(GrpcMethod::new( + "remote.ETHBACKEND", + "MinimumBlockAvailable", + )); self.inner.unary(req, path, codec).await } } @@ -1792,10 +1557,10 @@ pub mod kv_client { dead_code, missing_docs, clippy::wildcard_imports, - clippy::let_unit_value, + clippy::let_unit_value )] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; /// Provides methods to access key-value data #[derive(Debug, Clone)] pub struct KvClient { @@ -1827,10 +1592,7 @@ pub mod kv_client { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> KvClient> + pub fn with_interceptor(inner: T, interceptor: F) -> KvClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1840,9 +1602,8 @@ pub mod kv_client { >::ResponseBody, >, >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + std::marker::Send + std::marker::Sync, { KvClient::new(InterceptedService::new(inner, interceptor)) } @@ -1881,22 +1642,16 @@ pub mod kv_client { pub async fn version( &mut self, request: impl tonic::IntoRequest<()>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/Version"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "Version")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "Version")); self.inner.unary(req, path, codec).await } /// Tx exposes read-only transactions for the key-value store @@ -1907,22 +1662,16 @@ pub mod kv_client { pub async fn tx( &mut self, request: impl tonic::IntoStreamingRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result>, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/Tx"); let mut req = request.into_streaming_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "Tx")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "Tx")); self.inner.streaming(req, path, codec).await } pub async fn state_changes( @@ -1932,18 +1681,14 @@ pub mod kv_client { tonic::Response>, tonic::Status, > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/StateChanges"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "StateChanges")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "StateChanges")); self.inner.server_streaming(req, path, codec).await } /// Snapshots returns list of current snapshot files. Then client can just open all of them. @@ -1951,18 +1696,14 @@ pub mod kv_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/Snapshots"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "Snapshots")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "Snapshots")); self.inner.unary(req, path, codec).await } /// Range [from, to) @@ -1973,36 +1714,28 @@ pub mod kv_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/Range"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "Range")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "Range")); self.inner.unary(req, path, codec).await } pub async fn sequence( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/Sequence"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "Sequence")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "Sequence")); self.inner.unary(req, path, codec).await } /// Temporal methods @@ -2010,135 +1743,96 @@ pub mod kv_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/GetLatest"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "GetLatest")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "GetLatest")); self.inner.unary(req, path, codec).await } pub async fn history_seek( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/HistorySeek"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "HistorySeek")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "HistorySeek")); self.inner.unary(req, path, codec).await } pub async fn index_range( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/IndexRange"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "IndexRange")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "IndexRange")); self.inner.unary(req, path, codec).await } pub async fn history_range( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/HistoryRange"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "HistoryRange")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "HistoryRange")); self.inner.unary(req, path, codec).await } pub async fn range_as_of( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/RangeAsOf"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "RangeAsOf")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "RangeAsOf")); self.inner.unary(req, path, codec).await } pub async fn has_prefix( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/HasPrefix"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "HasPrefix")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "HasPrefix")); self.inner.unary(req, path, codec).await } pub async fn history_start_from( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.KV/HistoryStartFrom", - ); + let path = http::uri::PathAndQuery::from_static("/remote.KV/HistoryStartFrom"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.KV", "HistoryStartFrom")); @@ -2147,22 +1841,13 @@ pub mod kv_client { pub async fn current_domain_version( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/remote.KV/CurrentDomainVersion", - ); + let path = http::uri::PathAndQuery::from_static("/remote.KV/CurrentDomainVersion"); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("remote.KV", "CurrentDomainVersion")); @@ -2172,18 +1857,14 @@ pub mod kv_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/remote.KV/StepSize"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("remote.KV", "StepSize")); + req.extensions_mut() + .insert(GrpcMethod::new("remote.KV", "StepSize")); self.inner.unary(req, path, codec).await } } diff --git a/crates/phaser-parquet-metadata/src/lib.rs b/crates/phaser-parquet-metadata/src/lib.rs index 0fca77a..6fecb45 100644 --- a/crates/phaser-parquet-metadata/src/lib.rs +++ b/crates/phaser-parquet-metadata/src/lib.rs @@ -27,10 +27,13 @@ pub struct PhaserMetadata { pub data_end: u64, /// Data type: "blocks", "transactions", or "logs" pub data_type: String, + /// True if written by live streaming worker, false if written by historical sync worker (added in version 2) + #[serde(default)] + pub is_live: bool, } impl PhaserMetadata { - pub const VERSION: u8 = 1; + pub const VERSION: u8 = 2; pub fn new( segment_start: u64, @@ -50,9 +53,15 @@ impl PhaserMetadata { data_start, data_end, data_type, + is_live: false, } } + pub fn with_is_live(mut self, is_live: bool) -> Self { + self.is_live = is_live; + self + } + /// Encode metadata to bytes using bincode pub fn encode(&self) -> Result> { Ok(bincode::serialize(self)?) @@ -61,7 +70,9 @@ impl PhaserMetadata { /// Decode metadata from bytes using bincode pub fn decode(bytes: &[u8]) -> Result { let meta: Self = bincode::deserialize(bytes)?; - if meta.version != Self::VERSION { + // Support both version 1 (without is_live) and version 2 (with it) + // The #[serde(default)] on is_live handles missing field gracefully + if meta.version != 1 && meta.version != Self::VERSION { anyhow::bail!("Unsupported metadata version: {}", meta.version); } Ok(meta) diff --git a/crates/phaser-query/src/parquet_writer.rs b/crates/phaser-query/src/parquet_writer.rs index fca43a7..2f55ec3 100644 --- a/crates/phaser-query/src/parquet_writer.rs +++ b/crates/phaser-query/src/parquet_writer.rs @@ -25,7 +25,8 @@ pub struct ParquetWriter { data_type: String, // "blocks", "transactions", or "logs" parquet_config: Option, is_live: bool, // true for live streaming, false for historical sync - requested_range: Option<(u64, u64)>, // (start, end) blocks for this sync session (segment range) + segment_range: Option<(u64, u64)>, // Logical segment boundaries for filename (e.g., 0-499999) + responsibility_range: Option<(u64, u64)>, // Actual range this worker is responsible for (may be capped by boundary) sequence_number: u32, // Incremented on each file rotation within the same segment } @@ -85,15 +86,49 @@ impl ParquetWriter { data_type, parquet_config, is_live, - requested_range: None, + segment_range: None, + responsibility_range: None, sequence_number: 0, }) } - /// Set the block range for this sync session - /// This will be added to parquet metadata so scanners know the full intended range + /// Set the segment range (logical segment boundaries, used for filename) + /// and responsibility range (actual range this worker is responsible for, used for metadata) + pub fn set_ranges( + &mut self, + segment_start: u64, + segment_end: u64, + responsibility_start: u64, + responsibility_end: u64, + ) { + if segment_end < segment_start { + warn!( + "segment_end ({}) < segment_start ({}), capping to segment_start", + segment_end, segment_start + ); + self.segment_range = Some((segment_start, segment_start)); + } else { + self.segment_range = Some((segment_start, segment_end)); + } + + if responsibility_end < responsibility_start { + warn!("responsibility_end ({}) < responsibility_start ({}), capping to responsibility_start", responsibility_end, responsibility_start); + self.responsibility_range = Some((responsibility_start, responsibility_start)); + } else { + self.responsibility_range = Some((responsibility_start, responsibility_end)); + } + } + + /// Set both segment and responsibility to the same range (for backwards compatibility) pub fn set_block_range(&mut self, start: u64, end: u64) { - self.requested_range = Some((start, end)); + if end < start { + warn!("end ({}) < start ({}), capping to start", end, start); + self.segment_range = Some((start, start)); + self.responsibility_range = Some((start, start)); + } else { + self.segment_range = Some((start, end)); + self.responsibility_range = Some((start, end)); + } } pub async fn write_batch(&mut self, batch: RecordBatch) -> Result { @@ -202,8 +237,8 @@ impl ParquetWriter { // Determine responsibility_start based on whether this is the first file in the segment let responsibility_start = if self.sequence_number == 0 { - // First file in segment - responsible from segment start - self.requested_range + // First file in segment - responsible from responsibility range start + self.responsibility_range .map(|(start, _)| start) .unwrap_or(block_num) } else { @@ -260,7 +295,7 @@ impl ParquetWriter { // Add segment range metadata if available // This stores the full segment range this file belongs to, plus the contiguous // block range this specific file is responsible for - if let Some((segment_start, segment_end)) = self.requested_range { + if let Some((segment_start, segment_end)) = self.segment_range { let mut metadata = Vec::new(); metadata.push(KeyValue::new( "phaser.segment_start".to_string(), @@ -342,17 +377,20 @@ impl ParquetWriter { current.writer.close()?; // Build final filename using segment range + sequence number - // Format: {data_type}_from_{segment_start}_to_{segment_end}_{sequence}.parquet - let final_filename = if let Some((segment_start, segment_end)) = self.requested_range { + // Format for historical: {data_type}_from_{segment_start}_to_{segment_end}_{sequence}.parquet + // Format for live: live_{data_type}_from_{segment_start}_to_{segment_end}_{sequence}.parquet + let final_filename = if let Some((segment_start, segment_end)) = self.segment_range { + let prefix = if self.is_live { "live_" } else { "" }; format!( - "{}_from_{}_to_{}_{}.parquet", - self.data_type, segment_start, segment_end, self.sequence_number + "{}{}_from_{}_to_{}_{}.parquet", + prefix, self.data_type, segment_start, segment_end, self.sequence_number ) } else { // Fallback for files without segment range (shouldn't happen in practice) + let prefix = if self.is_live { "live_" } else { "" }; format!( - "{}_from_{}_to_{}.parquet", - self.data_type, current.start_block, current.end_block + "{}{}_from_{}_to_{}.parquet", + prefix, self.data_type, current.start_block, current.end_block ) }; let final_path = self.data_dir.join(final_filename); @@ -361,12 +399,17 @@ impl ParquetWriter { fs::rename(¤t.temp_path, &final_path)?; // Update Phaser metadata in the file footer - if let Some((segment_start, segment_end)) = self.requested_range { - // For responsibility_end: use segment_end if we're at the end of the segment - // Check if current.end_block is at or beyond segment_end-1 (within last block of segment) + if let Some((segment_start, segment_end)) = self.segment_range { + // Get responsibility range (defaults to segment range if not specified) + let (resp_start, resp_end) = self + .responsibility_range + .unwrap_or((segment_start, segment_end)); + + // For responsibility_end: use resp_end if we're at the end of the responsibility range + // Check if current.end_block is at or beyond resp_end-1 (within last block of range) let responsibility_end = - if current.end_block >= segment_end || current.end_block == segment_end - 1 { - segment_end + if current.end_block >= resp_end || current.end_block == resp_end - 1 { + resp_end } else { current.end_block }; @@ -379,7 +422,8 @@ impl ParquetWriter { current.start_block, // data_start (actual first block with data) current.end_block, // data_end (actual last block with data) self.data_type.clone(), - ); + ) + .with_is_live(self.is_live); if let Err(e) = PhaserMetadata::update_file_metadata(&final_path, &phaser_meta) { warn!( @@ -391,13 +435,18 @@ impl ParquetWriter { } // Log the finalization with both segment range and actual data range - if let Some((segment_start, segment_end)) = self.requested_range { + if let Some((segment_start, segment_end)) = self.segment_range { + let (resp_start, resp_end) = self + .responsibility_range + .unwrap_or((segment_start, segment_end)); info!( - "Finalized parquet file: {} with {} rows, segment {}-{} seq={} (actual data: {}-{})", + "Finalized parquet file: {} with {} rows, segment {}-{} responsibility {}-{} seq={} (actual data: {}-{})", final_path.display(), current.row_count, segment_start, segment_end, + resp_start, + resp_end, self.sequence_number, current.start_block, current.end_block diff --git a/crates/phaser-query/src/sync/data_scanner.rs b/crates/phaser-query/src/sync/data_scanner.rs index 16e5a4c..22e1553 100644 --- a/crates/phaser-query/src/sync/data_scanner.rs +++ b/crates/phaser-query/src/sync/data_scanner.rs @@ -635,12 +635,16 @@ impl DataScanner { continue; } - // Determine data type from filename - let data_type = if filename_str.starts_with("blocks_") { + // Determine data type from filename (handle both historical and live_ prefixed files) + let data_type = if filename_str.starts_with("blocks_") + || filename_str.starts_with("live_blocks_") + { "blocks" - } else if filename_str.starts_with("transactions_") { + } else if filename_str.starts_with("transactions_") + || filename_str.starts_with("live_transactions_") + { "transactions" - } else if filename_str.starts_with("logs_") { + } else if filename_str.starts_with("logs_") || filename_str.starts_with("live_logs_") { "logs" } else { continue; // Unknown file type @@ -1262,17 +1266,21 @@ impl DataScanner { entry.metadata()?.len() }; - // Categorize by type - if filename_str.starts_with("blocks_") { + // Categorize by type (handle both historical and live_ prefixed files) + if filename_str.starts_with("blocks_") || filename_str.starts_with("live_blocks_") { stats.blocks_files += 1; stats.blocks_disk_bytes += size; - } else if filename_str.starts_with("transactions_") { + } else if filename_str.starts_with("transactions_") + || filename_str.starts_with("live_transactions_") + { stats.transactions_files += 1; stats.transactions_disk_bytes += size; - } else if filename_str.starts_with("logs_") { + } else if filename_str.starts_with("logs_") || filename_str.starts_with("live_logs_") { stats.logs_files += 1; stats.logs_disk_bytes += size; - } else if filename_str.starts_with("proofs_") { + } else if filename_str.starts_with("proofs_") + || filename_str.starts_with("live_proofs_") + { stats.proofs_files += 1; stats.proofs_disk_bytes += size; } diff --git a/crates/phaser-query/src/sync/service.rs b/crates/phaser-query/src/sync/service.rs index 38725a7..c27f787 100644 --- a/crates/phaser-query/src/sync/service.rs +++ b/crates/phaser-query/src/sync/service.rs @@ -360,6 +360,7 @@ impl SyncServer { parquet_config.clone(), validation_stage, work.clone(), + historical_boundary, ) .with_progress_tracker(progress_tracker.clone()); diff --git a/crates/phaser-query/src/sync/worker.rs b/crates/phaser-query/src/sync/worker.rs index c4081a1..cb074ea 100644 --- a/crates/phaser-query/src/sync/worker.rs +++ b/crates/phaser-query/src/sync/worker.rs @@ -75,12 +75,31 @@ impl SyncWorker { parquet_config: Option, validation_stage: ValidationStage, segment_work: crate::sync::data_scanner::SegmentWork, + historical_boundary: Option, ) -> Self { + // Cap to_block at historical boundary if present + // This prevents syncing blocks that don't exist yet when near chain tip + let (effective_to_block, is_truncated) = if let Some(boundary) = historical_boundary { + // Don't sync past the block before live streaming starts + let boundary_limit = boundary.saturating_sub(1); + if to_block > boundary_limit { + info!( + "Worker {} capping segment range {}-{} at historical boundary {} (truncated)", + worker_id, from_block, to_block, boundary_limit + ); + (boundary_limit, true) + } else { + (to_block, false) + } + } else { + (to_block, false) + }; + // Initialize progress state let current_progress = Arc::new(RwLock::new(WorkerProgress { worker_id, from_block, - to_block, + to_block: effective_to_block, current_phase: "initializing".to_string(), blocks_completed: false, transactions_completed: false, @@ -97,7 +116,7 @@ impl SyncWorker { bridge_endpoint, data_dir, from_block, - to_block, + to_block: effective_to_block, segment_size, max_file_size_mb, _batch_size: batch_size, @@ -354,15 +373,21 @@ impl SyncWorker { .dec(); }); - let mut writer = ParquetWriter::with_config( + let mut writer = ParquetWriter::with_config_and_mode( self.data_dir.clone(), self.max_file_size_mb, self.segment_size, "blocks".to_string(), self.parquet_config.clone(), + false, // historical sync worker )?; - // Use segment boundaries for metadata, not gap boundaries - writer.set_block_range(self.from_block, self.to_block); + + // Calculate segment boundaries (logical 500K segments) + let segment_start = (self.from_block / self.segment_size) * self.segment_size; + let segment_end = segment_start + self.segment_size - 1; + + // Set both segment range (for filename) and responsibility range (for metadata) + writer.set_ranges(segment_start, segment_end, self.from_block, self.to_block); // Retry with resume logic const INITIAL_BACKOFF_SECS: u64 = 1; @@ -577,15 +602,21 @@ impl SyncWorker { .dec(); }); - let mut writer = ParquetWriter::with_config( + let mut writer = ParquetWriter::with_config_and_mode( self.data_dir.clone(), self.max_file_size_mb, self.segment_size, "transactions".to_string(), self.parquet_config.clone(), + false, // historical sync worker )?; - // Use segment boundaries for metadata, not gap boundaries - writer.set_block_range(self.from_block, self.to_block); + + // Calculate segment boundaries (logical 500K segments) + let segment_start = (self.from_block / self.segment_size) * self.segment_size; + let segment_end = segment_start + self.segment_size - 1; + + // Set both segment range (for filename) and responsibility range (for metadata) + writer.set_ranges(segment_start, segment_end, self.from_block, self.to_block); // Check if proof generation is enabled let generate_proofs = self @@ -599,15 +630,21 @@ impl SyncWorker { "Worker {} will generate merkle proofs for transactions", self.worker_id ); - let mut pw = ParquetWriter::with_config( + let mut pw = ParquetWriter::with_config_and_mode( self.data_dir.clone(), self.max_file_size_mb, self.segment_size, "proofs".to_string(), self.parquet_config.clone(), + false, // historical sync worker )?; - // Use segment boundaries for metadata, not gap boundaries - pw.set_block_range(self.from_block, self.to_block); + + // Calculate segment boundaries (logical 500K segments) + let segment_start = (self.from_block / self.segment_size) * self.segment_size; + let segment_end = segment_start + self.segment_size - 1; + + // Set both segment range (for filename) and responsibility range (for metadata) + pw.set_ranges(segment_start, segment_end, self.from_block, self.to_block); Some(pw) } else { None @@ -917,15 +954,21 @@ impl SyncWorker { .dec(); }); - let mut writer = ParquetWriter::with_config( + let mut writer = ParquetWriter::with_config_and_mode( self.data_dir.clone(), self.max_file_size_mb, self.segment_size, "logs".to_string(), self.parquet_config.clone(), + false, // historical sync worker )?; - // Use segment boundaries for metadata, not gap boundaries - writer.set_block_range(self.from_block, self.to_block); + + // Calculate segment boundaries (logical 500K segments) + let segment_start = (self.from_block / self.segment_size) * self.segment_size; + let segment_end = segment_start + self.segment_size - 1; + + // Set both segment range (for filename) and responsibility range (for metadata) + writer.set_ranges(segment_start, segment_end, self.from_block, self.to_block); // Retry with resume logic const INITIAL_BACKOFF_SECS: u64 = 1; diff --git a/docs/parquet-files.md b/docs/parquet-files.md index 30b82b4..9fd6ca4 100644 --- a/docs/parquet-files.md +++ b/docs/parquet-files.md @@ -7,15 +7,22 @@ Phaser uses Parquet files to store blockchain data (blocks, transactions, logs). ## Filename Convention ### Final Files + +**Historical sync files:** ``` {data_type}_from_{segment_start}_to_{segment_end}_{sequence}.parquet ``` +**Live streaming files:** +``` +live_{data_type}_from_{segment_start}_to_{segment_end}_{sequence}.parquet +``` + Examples: -- `blocks_from_0_to_499999_0.parquet` -- `transactions_from_500000_to_999999_0.parquet` -- `transactions_from_500000_to_999999_1.parquet` -- `logs_from_1000000_to_1499999_0.parquet` +- `blocks_from_0_to_499999_0.parquet` - Written by historical sync worker +- `transactions_from_500000_to_999999_0.parquet` - Written by historical sync worker +- `live_transactions_from_23500000_to_23999999_0.parquet` - Written by live streaming worker +- `logs_from_1000000_to_1499999_0.parquet` - Written by historical sync worker **Key points:** - `data_type`: One of `blocks`, `transactions`, or `logs` @@ -24,6 +31,7 @@ Examples: - Range is **inclusive** on both ends - Files are named by segment boundaries, not actual data ranges - Multiple files can exist for the same segment (indicated by sequence number) +- `live_` prefix indicates file was written by the **live streaming worker**, not the historical sync worker ### Temporary Files During Writing ``` @@ -48,16 +56,22 @@ Phaser stores two types of metadata in Parquet files: ### Phaser Metadata Format -Each file contains metadata with three range types: +Each file contains metadata with three range types plus a worker type flag: - **Segment range**: The full 500K block segment this file belongs to - **Responsibility range**: The block range this file is responsible for covering - **Data range**: The actual blocks that have data (may skip empty blocks) +- **is_live flag**: True if written by live streaming worker, false if written by historical sync worker Metadata storage: - Encoded with bincode, base64-encoded - Stored in `phaser.meta` key-value metadata - Can be updated in-place without rewriting file data +- Current version: 2 (version 1 didn't have is_live flag) + +The `is_live` flag distinguishes between files written by: +- **Historical sync workers**: Fetch specific block ranges via Historical mode (`is_live = false`) +- **Live streaming workers**: Subscribe to current head via Live mode (`is_live = true`) See [`../crates/phaser-parquet-metadata/src/lib.rs`](../crates/phaser-parquet-metadata/src/lib.rs) for `PhaserMetadata` struct definition and read/write methods.