diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 9c979ab1f5a6b2..f0856aeae4b1a2 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -213,6 +213,15 @@ pub struct JsonRpcRequestProcessor { } impl Metadata for JsonRpcRequestProcessor {} +impl JsonRpcRequestProcessor { + pub fn clone_without_bigtable(&self) -> JsonRpcRequestProcessor { + Self { + bigtable_ledger_storage: None, // Disable BigTable + ..self.clone() + } + } +} + impl JsonRpcRequestProcessor { fn get_bank_with_config(&self, config: RpcContextConfig) -> Result> { let RpcContextConfig { diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index d8791ab6c3bf6b..303a1e94b223b2 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -525,7 +525,14 @@ impl JsonRpcService { ); let server = ServerBuilder::with_meta_extractor( io, - move |_req: &hyper::Request| request_processor.clone(), + move |req: &hyper::Request| { + let xbigtable = req.headers().get("x-bigtable"); + if xbigtable.is_some_and(|v| v == "disabled") { + request_processor.clone_without_bigtable() + } else { + request_processor.clone() + } + }, ) .event_loop_executor(runtime.handle().clone()) .threads(1)