Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2c029fd
Allow duplicate topics in smart contract events (#13065)
xgreenx Jan 11, 2023
293c1f2
[NFTs] Track item's metadata depositor (#13124)
jsidorenko Jan 11, 2023
e752af1
`IntegrityTest` implementation should be feature gated (#13094)
bkchr Jan 11, 2023
ad58606
Bump git2 from 0.14.4 to 0.16.0 (#13123)
dependabot[bot] Jan 11, 2023
6d3596f
Scheduler is already at V4 (#13105)
ggwpez Jan 11, 2023
f9d1dcd
Optimize merkle proofs for efficient verification in Solidity (#12857)
doubledup Jan 12, 2023
e9b0fac
client/beefy: fix logs (#13130)
acatangiu Jan 12, 2023
2bfc1dd
Stop keeping track of epoch changes for the sync gap (#13127)
davxy Jan 12, 2023
d92281a
CI: Unpin `ci-linux` and use Rust 1.66.1 (#13134)
rcny Jan 13, 2023
88be4b6
sp-beefy: align authority id key type with its signature type (#13131)
acatangiu Jan 13, 2023
cbc525f
Use the balance trait as we have one (#13136)
gilescope Jan 13, 2023
30641ee
CI: Code mark to request a pipeline failure (#13139)
rcny Jan 13, 2023
49962f7
Annotate thiserror for sp_core::crypto::SecretStringError (#13144)
jasl Jan 15, 2023
70f2e36
pallet-offences-benchmarking: Box events in verify (#13151)
bkchr Jan 16, 2023
ea00240
More improvements for the crate publishing pipeline (#13153)
joao-paulo-parity Jan 16, 2023
7ff6fa2
txpool: don't maintain the pool during major sync (#13004)
michalkucharczyk Jan 16, 2023
2893730
[client/network] Add support for `/wss` addresses (#13152)
melekes Jan 17, 2023
6bac243
NIS should retain funds in reserve (#12928)
gavofyork Jan 17, 2023
414caff
Refactory of `next_slot` method (#13155)
davxy Jan 17, 2023
f7e53fe
Breakout mock runtimes to separate files (#13150)
gilescope Jan 17, 2023
42f38db
frame-benchmarking: Macros should not force a particular env (#13161)
bkchr Jan 17, 2023
cfe9262
Fix the `storage_size`/`state_getStorageSize` RPC call (#13154)
koute Jan 18, 2023
a447f03
[contracts] Adapt storage reading host functions to Weights V2 (#12976)
agryaznov Jan 18, 2023
af5a499
zobmienet tests are not supposed to fail (#13015)
michalkucharczyk Jan 18, 2023
cba5977
[contracts] Add integrity checks by pallet hook (#12993)
agryaznov Jan 18, 2023
911c9ab
Expose `UnknownBlock` error via `ApiError` (#12707)
tdimitrov Jan 19, 2023
d4384f2
Notification-based block pinning (#13157)
skunert Jan 19, 2023
0b6aec5
Make DispatchError impl MEL (#13169)
gavofyork Jan 19, 2023
b85d631
Remove fixtures from crate (#13181)
athei Jan 19, 2023
d7acf9e
txpool: LOG_TARGET const added (#13180)
michalkucharczyk Jan 19, 2023
de943ee
Fix potential huge allocation as a result of `validate_block` output …
mrcnski Jan 20, 2023
593c76b
sc-network: Ensure private addresses are disabled if requested (#13185)
bkchr Jan 20, 2023
38ec2d8
Warn validators with slow hardware (#12620)
Szegoo Jan 20, 2023
2c16842
Use year 2023 in the License headers (#13193)
ggwpez Jan 20, 2023
355e4a9
Move slow hardware warning print logic to CLI (#13198)
ggwpez Jan 21, 2023
79cb2e6
Fix flaky BABE test (#13199)
bkchr Jan 21, 2023
1f70226
Add debug info in assert_has_event and assert_last_event (#12979)
zjb0807 Jan 22, 2023
ed3f055
new proc-macro-based benchmarking syntax (#12924)
sam0x17 Jan 23, 2023
d0a2c4a
Rename `*-private-ipv4` to `*-private-ip` CLI args (#13208)
bkchr Jan 23, 2023
e72f72f
Remove dead code (#13213)
koute Jan 23, 2023
419b840
[Fix] CountedMap::set now takes Counter into account (#13214)
ruseinov Jan 23, 2023
52d72b3
debug assert events at genesis (#13217)
muharem Jan 23, 2023
9052607
BlockId removal: refactor: CallExecutor trait (#13173)
michalkucharczyk Jan 24, 2023
ca5a505
service: storage monitor added (#13082)
michalkucharczyk Jan 24, 2023
84af672
beefy: Add LOG_TARGET constant (#13222)
al3mart Jan 24, 2023
09de7b4
Upgrade wasm-opt to 0.111.0 (#13038)
brson Jan 24, 2023
5749760
storage-monitor: statvfs arithmetic bug fixed (#13234)
michalkucharczyk Jan 24, 2023
d2afb5d
Bump parity-db (#13226)
arkpar Jan 24, 2023
1314eec
pallet-assets: Rename `total_supply` to `amount` (#13229)
bkchr Jan 25, 2023
e393874
Babe: bad epoch index with skipped epochs and warp sync (#13135)
davxy Jan 25, 2023
1a1600b
contracts: Deprecate random interface (#13204)
athei Jan 25, 2023
d74eab8
[contracts] Add upfront weight of merkle trie proofs for storage read…
agryaznov Jan 25, 2023
d22e68c
CI: Rewrite `check-each-crate` in python (#13238)
bkchr Jan 25, 2023
d029225
Fix try-runtime with create-snapshot (#13223)
zjb0807 Jan 25, 2023
8b4331c
reduce exec time of fast-unstake benchmarks (#13120)
kianenigma Jan 25, 2023
9db957c
Rework the trie cache (#12982)
koute Jan 26, 2023
64a1a36
Add task type label to metrics (#13240)
sandreim Jan 26, 2023
f4bc993
upgrade nix to 0.26.1 (#13230)
michalkucharczyk Jan 26, 2023
2dbf625
Add WeightToFee and LengthToFee impls to transaction-payment Runtime …
notlesh Jan 26, 2023
495cc0e
Correct arithmetical semantic of `PerDispatchClass` (#13194)
ggwpez Jan 26, 2023
65d1d03
Aura: Fix warp syncing (#13221)
bkchr Jan 26, 2023
ff9921a
Add Proof Size to Weight Output (#11637)
shawntabrizi Jan 26, 2023
248fdf0
Use non-binary pronouns in comments. (#13209)
DanHenton Jan 27, 2023
ce2cee3
migrate new benchmarking syntax from `frame_support::benchmarking` to…
sam0x17 Jan 27, 2023
9762613
mutate_exists for StorageValue with ValueQuery (#13245)
muraca Jan 27, 2023
1e6b892
Fix derive PassByInner with generics (#13247)
conr2d Jan 28, 2023
ece32a7
docs: Fix broken documentation links for pallets (#13241)
Jonathas-Conceicao Jan 28, 2023
0100b3b
sc-finality-grandpa: Warp proof generation can not expect justificati…
bkchr Jan 28, 2023
6c11190
update criterion to v0.4.0 (#13142)
koushiro Jan 28, 2023
f4caddb
fix up template (#13205)
shawntabrizi Jan 29, 2023
fdff2b2
Remove `uncles` related code (#13216)
bkchr Jan 29, 2023
a9c4334
Implement RIType traits for u8 array with an arbitrary size (#13256)
conr2d Jan 30, 2023
129fee7
grandpa: cleanup stale entries in set id session mapping (#13237)
andresilva Jan 30, 2023
8cfe326
Benchmark's successful origin api update (#13146)
muharem Feb 1, 2023
c4b2db5
hooks default impl missing where clause (#13264)
kianenigma Feb 1, 2023
b2b2e65
implemented `contains_prefix` for StorageDoubleMap and StorageNMap (#…
muraca Feb 1, 2023
3bc3742
Calling proxy doesn't remove announcement (#13267)
Szegoo Feb 1, 2023
5a281ce
Fix block pruning (#13323)
arkpar Feb 7, 2023
15e218a
grandpa: don't error if best block and finality target are inconsiste…
andresilva Feb 12, 2023
18bb7c7
benchmarks: EnsureRankedMember must add ranked members (#13297) (#13348)
muharem Feb 13, 2023
c304070
Merge remote-tracking branch 'upstream/polkadot-v0.9.38' into polkado…
kacperzuk-neti Apr 17, 2023
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
Prev Previous commit
Next Next commit
Rename *-private-ipv4 to *-private-ip CLI args (#13208)
* Rename `*-private-ipv4` to `*-private-ip` CLI args

Renames the `*-private-ipv4` to `*-private-ip` in the CLI interface. The old names are staying as
alias, thus it will not break for anyone. Besides that it also fixes the naming in the rest of the code.

* FMT
  • Loading branch information
bkchr authored Jan 23, 2023
commit d0a2c4ab86232a9a762d03f559715a14727bef3e
18 changes: 9 additions & 9 deletions client/cli/src/params/network_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ pub struct NetworkParams {
#[arg(long, value_name = "PORT", conflicts_with_all = &[ "listen_addr" ])]
pub port: Option<u16>,

/// Always forbid connecting to private IPv4 addresses (as specified in
/// Always forbid connecting to private IPv4/IPv6 addresses (as specified in
/// [RFC1918](https://tools.ietf.org/html/rfc1918)), unless the address was passed with
/// `--reserved-nodes` or `--bootnodes`. Enabled by default for chains marked as "live" in
/// their chain specifications.
#[arg(long, conflicts_with_all = &["allow_private_ipv4"])]
pub no_private_ipv4: bool,
#[arg(long, alias = "no-private-ipv4", conflicts_with_all = &["allow_private_ip"])]
pub no_private_ip: bool,

/// Always accept connecting to private IPv4 addresses (as specified in
/// Always accept connecting to private IPv4/IPv6 addresses (as specified in
/// [RFC1918](https://tools.ietf.org/html/rfc1918)). Enabled by default for chains marked as
/// "local" in their chain specifications, or when `--dev` is passed.
#[arg(long, conflicts_with_all = &["no_private_ipv4"])]
pub allow_private_ipv4: bool,
#[arg(long, alias = "allow-private-ipv4", conflicts_with_all = &["no_private_ip"])]
pub allow_private_ip: bool,

/// Specify the number of outgoing connections we're trying to maintain.
#[arg(long, value_name = "COUNT", default_value_t = 15)]
Expand Down Expand Up @@ -200,8 +200,8 @@ impl NetworkParams {
self.discover_local ||
is_dev || matches!(chain_type, ChainType::Local | ChainType::Development);

let allow_private_ipv4 = match (self.allow_private_ipv4, self.no_private_ipv4) {
(true, true) => unreachable!("`*_private_ipv4` flags are mutually exclusive; qed"),
let allow_private_ip = match (self.allow_private_ip, self.no_private_ip) {
(true, true) => unreachable!("`*_private_ip` flags are mutually exclusive; qed"),
(true, false) => true,
(false, true) => false,
(false, false) =>
Expand Down Expand Up @@ -231,7 +231,7 @@ impl NetworkParams {
client_version: client_id.to_string(),
transport: TransportConfig::Normal {
enable_mdns: !is_dev && !self.no_mdns,
allow_private_ipv4,
allow_private_ip,
},
max_parallel_downloads: self.max_parallel_downloads,
enable_dht_random_walk: !self.reserved_only,
Expand Down
4 changes: 2 additions & 2 deletions client/network/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ pub enum TransportConfig {
/// and connect to them if they support the same chain.
enable_mdns: bool,

/// If true, allow connecting to private IPv4 addresses (as defined in
/// If true, allow connecting to private IPv4/IPv6 addresses (as defined in
/// [RFC1918](https://tools.ietf.org/html/rfc1918)). Irrelevant for addresses that have
/// been passed in `::sc_network::config::NetworkConfiguration::boot_nodes`.
allow_private_ipv4: bool,
allow_private_ip: bool,
},

/// Only allow connections within the same process.
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl NetworkConfiguration {
extra_sets: Vec::new(),
client_version: client_version.into(),
node_name: node_name.into(),
transport: TransportConfig::Normal { enable_mdns: false, allow_private_ipv4: true },
transport: TransportConfig::Normal { enable_mdns: false, allow_private_ip: true },
max_parallel_downloads: 5,
sync_mode: SyncMode::Full,
enable_dht_random_walk: true,
Expand Down
26 changes: 13 additions & 13 deletions client/network/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct DiscoveryConfig {
local_peer_id: PeerId,
permanent_addresses: Vec<(PeerId, Multiaddr)>,
dht_random_walk: bool,
allow_private_ipv4: bool,
allow_private_ip: bool,
allow_non_globals_in_dht: bool,
discovery_only_if_under_num: u64,
enable_mdns: bool,
Expand All @@ -111,7 +111,7 @@ impl DiscoveryConfig {
local_peer_id: local_public_key.to_peer_id(),
permanent_addresses: Vec::new(),
dht_random_walk: true,
allow_private_ipv4: true,
allow_private_ip: true,
allow_non_globals_in_dht: false,
discovery_only_if_under_num: std::u64::MAX,
enable_mdns: false,
Expand Down Expand Up @@ -142,9 +142,9 @@ impl DiscoveryConfig {
self
}

/// Should private IPv4 addresses be reported?
pub fn allow_private_ipv4(&mut self, value: bool) -> &mut Self {
self.allow_private_ipv4 = value;
/// Should private IPv4/IPv6 addresses be reported?
pub fn allow_private_ip(&mut self, value: bool) -> &mut Self {
self.allow_private_ip = value;
self
}

Expand Down Expand Up @@ -189,7 +189,7 @@ impl DiscoveryConfig {
local_peer_id,
permanent_addresses,
dht_random_walk,
allow_private_ipv4,
allow_private_ip,
allow_non_globals_in_dht,
discovery_only_if_under_num,
enable_mdns,
Expand Down Expand Up @@ -231,7 +231,7 @@ impl DiscoveryConfig {
pending_events: VecDeque::new(),
local_peer_id,
num_connections: 0,
allow_private_ipv4,
allow_private_ip,
discovery_only_if_under_num,
mdns: if enable_mdns {
match TokioMdns::new(mdns::Config::default()) {
Expand Down Expand Up @@ -278,9 +278,9 @@ pub struct DiscoveryBehaviour {
local_peer_id: PeerId,
/// Number of nodes we're currently connected to.
num_connections: u64,
/// If false, `addresses_of_peer` won't return any private IPv4 address, except for the ones
/// stored in `permanent_addresses` or `ephemeral_addresses`.
allow_private_ipv4: bool,
/// If false, `addresses_of_peer` won't return any private IPv4/IPv6 address, except for the
/// ones stored in `permanent_addresses` or `ephemeral_addresses`.
allow_private_ip: bool,
/// Number of active connections over which we interrupt the discovery process.
discovery_only_if_under_num: u64,
/// Should non-global addresses be added to the DHT?
Expand Down Expand Up @@ -506,7 +506,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
list_to_filter.extend(mdns.addresses_of_peer(peer_id));
}

if !self.allow_private_ipv4 {
if !self.allow_private_ip {
list_to_filter.retain(|addr| match addr.iter().next() {
Some(Protocol::Ip4(addr)) if !IpNetwork::from(addr).is_global() => false,
Some(Protocol::Ip6(addr)) if !IpNetwork::from(addr).is_global() => false,
Expand Down Expand Up @@ -947,7 +947,7 @@ mod tests {
let mut config = DiscoveryConfig::new(keypair.public());
config
.with_permanent_addresses(first_swarm_peer_id_and_addr.clone())
.allow_private_ipv4(true)
.allow_private_ip(true)
.allow_non_globals_in_dht(true)
.discovery_limit(50)
.with_kademlia(genesis_hash, fork_id, &protocol_id);
Expand Down Expand Up @@ -1065,7 +1065,7 @@ mod tests {
let keypair = Keypair::generate_ed25519();
let mut config = DiscoveryConfig::new(keypair.public());
config
.allow_private_ipv4(true)
.allow_private_ip(true)
.allow_non_globals_in_dht(true)
.discovery_limit(50)
.with_kademlia(supported_genesis_hash, None, &supported_protocol_id);
Expand Down
10 changes: 7 additions & 3 deletions client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,15 @@ where
match params.network_config.transport {
TransportConfig::MemoryOnly => {
config.with_mdns(false);
config.allow_private_ipv4(false);
config.allow_private_ip(false);
},
TransportConfig::Normal { enable_mdns, allow_private_ipv4, .. } => {
TransportConfig::Normal {
enable_mdns,
allow_private_ip: allow_private_ipv4,
..
} => {
config.with_mdns(enable_mdns);
config.allow_private_ipv4(allow_private_ipv4);
config.allow_private_ip(allow_private_ipv4);
},
}

Expand Down
2 changes: 1 addition & 1 deletion client/service/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn node_config<
);

network_config.transport =
TransportConfig::Normal { enable_mdns: false, allow_private_ipv4: true };
TransportConfig::Normal { enable_mdns: false, allow_private_ip: true };

Configuration {
impl_name: String::from("network-test-impl"),
Expand Down