pub struct JsonRpcSource { /* private fields */ }Expand description
BalSource + StateSource over plain JSON-RPC. One request per call;
no batching, no retries — callers own that policy.
Implementations§
Source§impl JsonRpcSource
impl JsonRpcSource
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Talk to the JSON-RPC endpoint at url. Requests time out after 30 s
so a stalled gateway cannot hang a sync forever; redirects are not
followed, so a request never silently goes to a host you did not name.
Sourcepub fn try_new(url: impl Into<String>) -> Result<Self>
pub fn try_new(url: impl Into<String>) -> Result<Self>
Like JsonRpcSource::new but surfaces a client-construction failure.
Sourcepub async fn call(&self, method: &str, params: Value) -> Result<Value>
pub async fn call(&self, method: &str, params: Value) -> Result<Value>
Raw JSON-RPC call; returns the result member or the error object as
SourceError::Rpc. Transport failures (5xx from a gateway, a
connection dropped mid-body) are retried a few times with backoff;
RPC errors and malformed JSON are not.
Sourcepub async fn bal(&self, number: u64) -> Result<BlockAccessList>
pub async fn bal(&self, number: u64) -> Result<BlockAccessList>
Fetch and decode the BAL of number via eth_getBlockAccessList.
Sourcepub async fn probe(&self, old_block_age: u64) -> Result<ProbeReport>
pub async fn probe(&self, old_block_age: u64) -> Result<ProbeReport>
Day-0 probe: Q1 (is the BAL served?), Q2 (for old blocks too?), and does our codec reproduce the header hash on real data.
Trait Implementations§
Source§impl BalSource for JsonRpcSource
impl BalSource for JsonRpcSource
Source§fn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
BalSource::block.Source§fn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn finalized<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn finalized<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn block<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<SourcedBlock>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<SourcedBlock>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl StateSource for JsonRpcSource
impl StateSource for JsonRpcSource
Source§fn proof<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: Address,
slots: &'life1 [B256],
block: u64,
) -> Pin<Box<dyn Future<Output = Result<AccountProof>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn proof<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: Address,
slots: &'life1 [B256],
block: u64,
) -> Pin<Box<dyn Future<Output = Result<AccountProof>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
eth_getProof(addr, slots, block). One call per (address, block)
carries any number of slots — batching happens here, not in JSON-RPC.