rpc: use minimal mode by default (backport #22734) (#22878)

* rpc: use minimal mode by default

(cherry picked from commit eac4a6df68)

# Conflicts:
#	core/src/validator.rs
#	local-cluster/tests/common.rs
#	local-cluster/tests/local_cluster.rs
#	replica-node/tests/local_replica.rs
#	rpc/src/rpc_service.rs
#	transaction-dos/src/main.rs

* test-validator-bin: reinstate full rpc method set

Co-authored-by: Trent Nelson <trent@solana.com>
This commit is contained in:
mergify[bot]
2022-02-03 21:11:58 +00:00
committed by GitHub
parent f32c33dd80
commit 430cdf679e
17 changed files with 107 additions and 38 deletions

View File

@@ -546,7 +546,7 @@ fn main() {
enable_rpc_transaction_history: true,
enable_cpi_and_log_storage: true,
faucet_addr,
..JsonRpcConfig::default()
..JsonRpcConfig::default_for_test()
})
.bpf_jit(!matches.is_present("no_bpf_jit"))
.rpc_port(rpc_port)

View File

@@ -1205,8 +1205,16 @@ pub fn main() {
Arg::with_name("minimal_rpc_api")
.long("--minimal-rpc-api")
.takes_value(false)
.hidden(true)
.help("Only expose the RPC methods required to serve snapshots to other nodes"),
)
.arg(
Arg::with_name("full_rpc_api")
.long("--full-rpc-api")
.conflicts_with("minimal_rpc_api")
.takes_value(false)
.help("Expose RPC methods for querying chain state and transaction history"),
)
.arg(
Arg::with_name("obsolete_v1_7_rpc_api")
.long("--enable-rpc-obsolete_v1_7")
@@ -2425,6 +2433,10 @@ pub fn main() {
None
};
if matches.is_present("minimal_rpc_api") {
warn!("--minimal-rpc-api is now the default behavior. This flag is deprecated and can be removed from the launch args")
}
let mut validator_config = ValidatorConfig {
require_tower: matches.is_present("require_tower"),
tower_path: value_t!(matches, "tower", PathBuf).ok(),
@@ -2447,7 +2459,7 @@ pub fn main() {
faucet_addr: matches.value_of("rpc_faucet_addr").map(|address| {
solana_net_utils::parse_host_port(address).expect("failed to parse faucet address")
}),
minimal_api: matches.is_present("minimal_rpc_api"),
full_api: matches.is_present("full_rpc_api"),
obsolete_v1_7_api: matches.is_present("obsolete_v1_7_rpc_api"),
max_multiple_accounts: Some(value_t_or_exit!(
matches,