pub struct RpcApiContext {
pub storage: Store,
pub blockchain: Arc<Blockchain>,
pub active_filters: ActiveFilters,
pub syncer: Option<Arc<SyncManager>>,
pub peer_handler: Option<PeerHandler>,
pub node_data: NodeData,
pub gas_tip_estimator: Arc<Mutex<GasTipEstimator>>,
pub log_filter_handler: Option<Handle<EnvFilter, Registry>>,
pub gas_ceil: u64,
pub block_worker_channel: UnboundedSender<(Sender<Result<Option<ExecutionWitness>, ChainError>>, Block, Option<BlockAccessList>, bool)>,
pub ws: Option<WebSocketConfig>,
pub allowed_namespaces: Arc<HashSet<RpcNamespace>>,
}Expand description
This struct contains all the dependencies that RPC handlers need to process requests, including storage access, blockchain state, P2P networking, and configuration.
The context is cloned for each request, with most fields being cheap Arc references.
Fields§
§storage: StoreDatabase storage for blocks, transactions, and state.
blockchain: Arc<Blockchain>Blockchain instance for block validation and execution.
active_filters: ActiveFiltersActive log filters for eth_newFilter / eth_getFilterChanges endpoints.
syncer: Option<Arc<SyncManager>>Sync manager for coordinating block synchronization (None for L2 nodes).
peer_handler: Option<PeerHandler>Peer handler for P2P network operations (None for L2 nodes).
node_data: NodeDataNode identity and configuration data.
gas_tip_estimator: Arc<Mutex<GasTipEstimator>>Gas tip estimator for eth_gasPrice and eth_maxPriorityFeePerGas.
log_filter_handler: Option<Handle<EnvFilter, Registry>>Handler for dynamically changing log filter levels via admin_setLogLevel.
gas_ceil: u64Maximum gas limit for blocks (used in payload building).
block_worker_channel: UnboundedSender<(Sender<Result<Option<ExecutionWitness>, ChainError>>, Block, Option<BlockAccessList>, bool)>Channel for sending blocks to the block executor worker thread.
ws: Option<WebSocketConfig>WebSocket configuration. None when the WS server is disabled.
allowed_namespaces: Arc<HashSet<RpcNamespace>>Set of RPC namespaces that are allowed over the public HTTP/WS endpoints.
Methods belonging to namespaces not in this set return MethodNotFound.
The engine namespace is always served via the authenticated RPC port
and is not gated here.
Trait Implementations§
Source§impl Clone for RpcApiContext
impl Clone for RpcApiContext
Source§fn clone(&self) -> RpcApiContext
fn clone(&self) -> RpcApiContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for RpcApiContext
impl !RefUnwindSafe for RpcApiContext
impl !UnwindSafe for RpcApiContext
impl Send for RpcApiContext
impl Sync for RpcApiContext
impl Unpin for RpcApiContext
impl UnsafeUnpin for RpcApiContext
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.