Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ solana-measure = { workspace = true }
solana-message = { workspace = true }
solana-metrics = { workspace = true }
solana-native-token = { workspace = true }
solana-net-utils = { workspace = true }
solana-perf = { workspace = true }
solana-poh = { workspace = true }
solana-poh-config = { workspace = true }
Expand Down Expand Up @@ -112,7 +113,6 @@ solana-compute-budget-interface = { workspace = true }
solana-fee-calculator = { workspace = true }
solana-fee-structure = { workspace = true }
solana-instruction = { workspace = true }
solana-net-utils = { workspace = true }
solana-nonce = { workspace = true }
solana-nonce-account = { workspace = true }
solana-program-option = { workspace = true }
Expand Down
7 changes: 6 additions & 1 deletion rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use {
},
solana_message::{AddressLoader, SanitizedMessage},
solana_metrics::inc_new_counter_info,
solana_net_utils::sockets::unique_port_range_for_tests,
solana_perf::packet::PACKET_DATA_SIZE,
solana_program_pack::Pack,
solana_pubkey::{Pubkey, PUBKEY_BYTES},
Expand Down Expand Up @@ -109,7 +110,7 @@ use {
cmp::{max, min, Reverse},
collections::{BinaryHeap, HashMap, HashSet},
convert::TryFrom,
net::SocketAddr,
net::{IpAddr, Ipv4Addr, SocketAddr},
str::FromStr,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Expand Down Expand Up @@ -204,6 +205,10 @@ impl Default for JsonRpcConfig {
impl JsonRpcConfig {
pub fn default_for_test() -> Self {
Self {
faucet_addr: Some(SocketAddr::new(
IpAddr::V4(Ipv4Addr::LOCALHOST),
unique_port_range_for_tests(1).start,
)),
Comment on lines +208 to +211
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you want to address port the issue here instead (may be other places too):

agave/faucet/src/faucet.rs

Lines 346 to 354 in 996570b

// For integration tests. Listens on random open port and reports port to Sender.
pub fn run_local_faucet(faucet_keypair: Keypair, per_time_cap: Option<u64>) -> SocketAddr {
let (sender, receiver) = unbounded();
run_local_faucet_with_port(faucet_keypair, sender, None, per_time_cap, None, 0);
receiver
.recv()
.expect("run_local_faucet")
.expect("faucet_addr")
}

from my understanding, this faucet_addr in this default_for_tests() appears to always get overwritten by some passed in faucet_addr, so setting the socketaddr here won't do anything.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have this PR here #7736 which does address it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be strange coincidence, but i observed changes in default_for_tests() having impact on how many tests bind at random high port. I'll investigate more, turning it draft for now. Thank you.

full_api: true,
disable_health_check: true,
..Self::default()
Expand Down
Loading