Skip to content

Commit

Permalink
changed page_size to Some(...) instead of None and enhanced rpc_config
Browse files Browse the repository at this point in the history
  • Loading branch information
PoulavBhowmick03 committed Nov 12, 2024
1 parent c90845d commit fd4c2e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/katana/src/cli/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ impl NodeArgs {
}

fn rpc_config(&self) -> RpcConfig {
const MAX_PAGE_SIZE: u64 = 10_000;
let page_size = Some(self.server.page_size.min(MAX_PAGE_SIZE));
let mut apis = HashSet::from([ApiKind::Starknet, ApiKind::Torii, ApiKind::Saya]);
// only enable `katana` API in dev mode
if self.development.dev {
Expand All @@ -222,7 +224,7 @@ impl NodeArgs {
addr: self.server.http_addr,
max_connections: self.server.max_connections,
cors_origins: self.server.http_cors_origins.clone(),
page_size: Some(self.server.page_size),
page_size,
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/katana/node/src/config/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Default for RpcConfig {
port: DEFAULT_RPC_PORT,
max_connections: DEFAULT_RPC_MAX_CONNECTIONS,
apis: HashSet::from([ApiKind::Starknet]),
page_size: None,
page_size: Some(DEFAULT_RPC_PAGE_SIZE),
}
}
}

0 comments on commit fd4c2e7

Please sign in to comment.