DHT Widening

This commit is contained in:
Christien Rioux 2025-09-06 12:46:44 -04:00
parent 0ca19d6207
commit 88e0d420b4
36 changed files with 218 additions and 161 deletions

View file

@ -10,7 +10,7 @@ VEILID_REPO = "registry.gitlab.com/veilid/veilid"
ZIG_VERSION = "0.13.0"
CMAKE_VERSION_MINOR = "3.30"
CMAKE_VERSION_PATCH = "3.30.1"
WASM_BINDGEN_CLI_VERSION = "0.2.100"
WASM_BINDGEN_CLI_VERSION = "0.2.101"
RUST_VERSION = "1.86.0"
RETRY_COUNT = "12"

View file

@ -39,6 +39,7 @@
- Revert punishment for FailedToVerifySenderPeerInfo, with a better peer info filter, fixes [#470](https://gitlab.com/veilid/veilid/-/issues/470)
- Update keyring-manager to eliminate licensing issue
- Added 'tick lag' detection to check for missed watch updates
- Added 'DHT Widening', separates consensus width (server side dht operation acceptance) from consensus count (client side), fixes [#435](https://gitlab.com/veilid/veilid/-/issues/435)
- veilid-python:
- Correction of type hints

45
Cargo.lock generated
View file

@ -3093,9 +3093,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "js-sys"
version = "0.3.77"
version = "0.3.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738"
dependencies = [
"once_cell",
"wasm-bindgen",
@ -3308,9 +3308,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.27"
version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
dependencies = [
"value-bag",
]
@ -6960,9 +6960,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b"
dependencies = [
"cfg-if 1.0.3",
"once_cell",
@ -6970,13 +6970,14 @@ dependencies = [
"serde",
"serde_json",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb"
dependencies = [
"bumpalo",
"log",
@ -7010,9 +7011,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.50"
version = "0.4.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
checksum = "0ca85039a9b469b38336411d6d6ced91f3fc87109a2a27b0c197663f5144dffe"
dependencies = [
"cfg-if 1.0.3",
"js-sys",
@ -7023,9 +7024,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -7033,9 +7034,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa"
dependencies = [
"proc-macro2",
"quote",
@ -7046,18 +7047,18 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
version = "0.2.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wasm-bindgen-test"
version = "0.3.50"
version = "0.3.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3"
checksum = "80cc7f8a4114fdaa0c58383caf973fc126cf004eba25c9dc639bccd3880d55ad"
dependencies = [
"js-sys",
"minicov",
@ -7068,9 +7069,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-test-macro"
version = "0.3.50"
version = "0.3.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b"
checksum = "c5ada2ab788d46d4bda04c9d567702a79c8ced14f51f221646a16ed39d0e6a5d"
dependencies = [
"proc-macro2",
"quote",
@ -7096,9 +7097,9 @@ checksum = "323f4da9523e9a669e1eaf9c6e763892769b1d38c623913647bfdc1532fe4549"
[[package]]
name = "web-sys"
version = "0.3.77"
version = "0.3.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
checksum = "77e4b637749ff0d92b8fad63aa1f7cff3cbe125fd49c175cd6345e7272638b12"
dependencies = [
"js-sys",
"wasm-bindgen",

View file

@ -17,7 +17,7 @@ FROM ubuntu:18.04
ENV ZIG_VERSION=0.13.0
ENV CMAKE_VERSION_MINOR=3.30
ENV CMAKE_VERSION_PATCH=3.30.1
ENV WASM_BINDGEN_CLI_VERSION=0.2.100
ENV WASM_BINDGEN_CLI_VERSION=0.2.101
ENV RUST_VERSION=1.86.0
ENV RUSTUP_HOME=/usr/local/rustup
ENV RUSTUP_DIST_SERVER=https://static.rust-lang.org

View file

@ -146,7 +146,7 @@ $BREW_COMMAND install capnp cmake llvm jq
rustup target add aarch64-apple-darwin aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-darwin x86_64-apple-ios wasm32-unknown-unknown aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
# install cargo packages
cargo install wasm-bindgen-cli wasm-pack wasm-opt cargo-edit@0.13.0
cargo install wasm-bindgen-cli wasm-pack cargo-edit@0.13.0
# attempt to install pip packages - this may result in an error, which we will try to catch
pip3 install --upgrade bumpversion || ( \

View file

@ -81,6 +81,7 @@ core:
set_value_timeout_ms: 10000
set_value_count: 5
set_value_fanout: 4
consensus_width: 10
min_peer_count: 20
min_peer_refresh_time_ms: 60000
validate_dial_info_receipt_time_ms: 2000

View file

@ -250,6 +250,7 @@ dht:
set_value_timeout_ms: 10000
set_value_count: 5
set_value_fanout: 4
consensus_width: 10
min_peer_count: 20
min_peer_refresh_time_ms: 60000
validate_dial_info_receipt_time_ms: 2000

View file

@ -226,7 +226,7 @@ async_executors = { version = "0.7.0", default-features = false, features = [
"bindgen",
"timer",
] }
wasm-bindgen = "0.2.100"
wasm-bindgen = "0.2.101"
js-sys = "0.3.77"
wasm-bindgen-futures = "0.4.50"
send_wrapper = { version = "0.6.0", features = ["futures"] }
@ -312,7 +312,7 @@ bosion = { version = "1.1.2", default-features = false }
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-mutable-globals"]
wasm-opt = ["-O"]
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
dwarf-debug-info = true

View file

@ -20,7 +20,6 @@ impl Address {
SocketAddr::V6(v6) => Address::IPV6(*v6.ip()),
}
}
#[cfg_attr(all(target_arch = "wasm32", target_os = "unknown"), expect(dead_code))]
pub fn from_ip_addr(addr: IpAddr) -> Address {
match addr {
IpAddr::V4(v4) => Address::IPV4(v4),

View file

@ -19,6 +19,7 @@ impl<'a> RoutingDomainEditorPublicInternet<'a> {
}
}
#[cfg_attr(all(target_arch = "wasm32", target_os = "unknown"), expect(dead_code))]
pub fn set_interface_addresses(&mut self, interface_addresses: Vec<IfAddr>) -> &mut Self {
self.changes
.push(RoutingDomainChangePublicInternet::SetInterfaceAddresses {

View file

@ -249,12 +249,12 @@ impl RPCProcessor {
veilid_log!(self debug target: "dht", "{}", debug_string);
}
// See if we would have accepted this as a set
let set_value_count = self
// See if this is within the consensus width
let consensus_width = self
.config()
.with(|c| c.network.dht.set_value_count as usize);
.with(|c| c.network.dht.consensus_width as usize);
let (get_result_value, get_result_descriptor) =
if closer_to_key_peers.len() >= set_value_count {
if closer_to_key_peers.len() >= consensus_width {
// Not close enough
(None, None)
} else {

View file

@ -234,13 +234,13 @@ impl RPCProcessor {
veilid_log!(self debug target: "dht", "{}", debug_string);
}
// See if we would have accepted this as a set
let set_value_count = self
// See if this is within the consensus width
let consensus_width = self
.config()
.with(|c| c.network.dht.set_value_count as usize);
.with(|c| c.network.dht.consensus_width as usize);
let (inspect_result_seqs, inspect_result_descriptor) =
if closer_to_key_peers.len() >= set_value_count {
if closer_to_key_peers.len() >= consensus_width {
// Not close enough
(Vec::new(), None)
} else {

View file

@ -262,12 +262,12 @@ impl RPCProcessor {
veilid_log!(self debug target: "dht", "{}", debug_string);
// If there are less than 'set_value_count' peers that are closer, then store here too
let set_value_count = self
// If there are less than 'consensus_width' peers that are closer, then store here too
let consensus_width = self
.config()
.with(|c| c.network.dht.set_value_count as usize);
.with(|c| c.network.dht.consensus_width as usize);
let (set, new_value) = if closer_to_key_peers.len() >= set_value_count {
let (set, new_value) = if closer_to_key_peers.len() >= consensus_width {
// Not close enough
(false, None)
} else {

View file

@ -273,12 +273,13 @@ impl RPCProcessor {
vec![CAP_DHT]
));
// See if we would have accepted this as a set, same set_value_count for watches
let set_value_count = self
// See if this is within the consensus width
let consensus_width = self
.config()
.with(|c| c.network.dht.set_value_count as usize);
.with(|c| c.network.dht.consensus_width as usize);
let (ret_accepted, ret_expiration, ret_watch_id) =
if closer_to_key_peers.len() >= set_value_count {
if closer_to_key_peers.len() >= consensus_width {
// Not close enough, not accepted
veilid_log!(self debug "Not close enough for watch value");

View file

@ -396,7 +396,7 @@ impl StorageManager {
core::iter::once((ValueSubkeyRangeSet::single(subkey), result.fanout_result)),
false,
self.config()
.with(|c| c.network.dht.set_value_count as usize),
.with(|c| c.network.dht.consensus_width as usize),
);
// If we got a new value back then write it to the opened record

View file

@ -367,6 +367,11 @@ impl StorageManager {
want_descriptor: bool,
) -> VeilidAPIResult<NetworkResult<InspectResult>> {
let mut inner = self.inner.lock().await;
let subkeys = if subkeys.is_empty() {
ValueSubkeyRangeSet::full()
} else {
subkeys
};
// See if this is a remote or local value
let (_is_local, inspect_result) = {

View file

@ -643,14 +643,14 @@ impl StorageManager {
// We had an existing record, so check the network to see if we should
// update it with what we have here
let get_consensus = self
let set_consensus = self
.config()
.with(|c| c.network.dht.get_value_count as usize);
.with(|c| c.network.dht.set_value_count as usize);
self.add_rehydration_request(
record_key.opaque(),
ValueSubkeyRangeSet::full(),
get_consensus,
set_consensus,
)
.await;
@ -1482,7 +1482,7 @@ impl StorageManager {
results_iter,
false,
self.config()
.with(|c| c.network.dht.set_value_count as usize),
.with(|c| c.network.dht.consensus_width as usize),
);
if result.inspect_result.subkeys().is_empty() {
@ -1940,7 +1940,7 @@ impl StorageManager {
opaque_record_key: OpaqueRecordKey,
subkey_results_iter: I,
is_set: bool,
consensus_count: usize,
consensus_width: usize,
) {
// Get local record store
let local_record_store = inner.local_record_store.as_mut().unwrap();
@ -1964,7 +1964,7 @@ impl StorageManager {
}
}
// Purge nodes down to the N most recently seen, where N is the consensus count for a set operation
// Purge nodes down to the N most recently seen, where N is the consensus width
let mut nodes_ts = d
.nodes
.iter()
@ -1987,7 +1987,7 @@ impl StorageManager {
da.cmp(&db)
});
for dead_node_key in nodes_ts.iter().skip(consensus_count) {
for dead_node_key in nodes_ts.iter().skip(consensus_width) {
d.nodes.remove(&dead_node_key.0);
}
});

View file

@ -936,11 +936,8 @@ where
// Check if we can return some subkeys
if schema_subkeys.is_empty() {
apibail_invalid_argument!(
"subkeys set does not overlap schema",
"subkeys",
schema_subkeys
);
// No overlapping keys
return Ok(None);
}
// See if we have this inspection cached

View file

@ -293,7 +293,7 @@ impl StorageManager {
results_iter,
false,
self.config()
.with(|c| c.network.dht.set_value_count as usize),
.with(|c| c.network.dht.consensus_width as usize),
);
Ok(RehydrateReport {

View file

@ -380,7 +380,7 @@ impl StorageManager {
core::iter::once((ValueSubkeyRangeSet::single(subkey), result.fanout_result)),
true,
self.config()
.with(|c| c.network.dht.set_value_count as usize),
.with(|c| c.network.dht.consensus_width as usize),
);
// Record the set value locally since it was successfully set online

View file

@ -170,9 +170,9 @@ impl StorageManager {
// Process all results
#[instrument(level = "trace", target = "stor", skip_all)]
async fn process_single_result(&self, result: WorkItemResult) {
let consensus_count = self
let consensus_width = self
.config()
.with(|c| c.network.dht.set_value_count as usize);
.with(|c| c.network.dht.consensus_width as usize);
let mut inner = self.inner.lock().await;
@ -194,7 +194,7 @@ impl StorageManager {
result.work_item.opaque_record_key,
result.fanout_results.into_iter().map(|x| (x.0, x.1)),
true,
consensus_count,
consensus_width,
);
}

View file

@ -352,7 +352,7 @@ impl StorageManager {
core::iter::once((ValueSubkeyRangeSet::new(), fanout_result)),
false,
self.config()
.with(|c| c.network.dht.set_value_count as usize),
.with(|c| c.network.dht.consensus_width as usize),
);
let owvresult = context.lock().watch_value_result.clone();

View file

@ -70,10 +70,11 @@ fn test_config() {
assert_eq!(inner.network.dht.resolve_node_fanout, 4u32);
assert_eq!(inner.network.dht.get_value_timeout_ms, 10_000u32);
assert_eq!(inner.network.dht.get_value_count, 3u32);
assert_eq!(inner.network.dht.get_value_fanout, 4u32);
assert_eq!(inner.network.dht.get_value_fanout, 5u32);
assert_eq!(inner.network.dht.set_value_timeout_ms, 10_000u32);
assert_eq!(inner.network.dht.set_value_count, 5u32);
assert_eq!(inner.network.dht.set_value_fanout, 4u32);
assert_eq!(inner.network.dht.set_value_fanout, 5u32);
assert_eq!(inner.network.dht.consensus_width, 10u32);
assert_eq!(inner.network.dht.min_peer_count, 20u32);
assert_eq!(inner.network.dht.min_peer_refresh_time_ms, 60_000u32);
assert_eq!(

View file

@ -237,15 +237,16 @@ pub fn fix_fake_veilid_config() -> VeilidConfig {
},
dht: VeilidConfigDHT {
max_find_node_count: 1,
resolve_node_timeout_ms: 2,
resolve_node_timeout_ms: 10000,
resolve_node_count: 3,
resolve_node_fanout: 4,
get_value_timeout_ms: 5,
get_value_count: 6,
get_value_fanout: 7,
set_value_timeout_ms: 8,
set_value_count: 9,
set_value_fanout: 10,
get_value_timeout_ms: 100000,
get_value_count: 3,
get_value_fanout: 4,
set_value_timeout_ms: 10000,
set_value_count: 5,
set_value_fanout: 4,
consensus_width: 10,
min_peer_count: 11,
min_peer_refresh_time_ms: 12,
validate_dial_info_receipt_time_ms: 13,

View file

@ -2049,7 +2049,7 @@ impl VeilidAPI {
consensus_count.unwrap_or_else(|| {
registry
.config()
.with(|c| c.network.dht.get_value_count as usize)
.with(|c| c.network.dht.set_value_count as usize)
}),
)
.await;

View file

@ -206,7 +206,7 @@ impl RoutingContext {
Ok(())
}
#[instrument(target = "veilid_api", level = "debug", skip(message), fields(__VEILID_LOG_KEY = self.log_key(), message_len = message.len()), ret, err)]
#[instrument(target = "veilid_api", level = "debug", skip(message), fields(__VEILID_LOG_KEY = self.log_key(), message_len = message.len(), ret.len), err)]
async fn internal_app_call(
&self,
target: Target,
@ -238,6 +238,9 @@ impl RoutingContext {
Err(e) => return Err(e.into()),
};
#[cfg(feature = "verbose-tracing")]
tracing::Span::current().record("ret.len", answer.answer.len());
Ok(answer.answer)
}

View file

@ -427,6 +427,7 @@ pub struct VeilidConfigDHT {
pub set_value_timeout_ms: u32,
pub set_value_count: u32,
pub set_value_fanout: u32,
pub consensus_width: u32,
pub min_peer_count: u32,
pub min_peer_refresh_time_ms: u32,
pub validate_dial_info_receipt_time_ms: u32,
@ -476,10 +477,11 @@ impl Default for VeilidConfigDHT {
resolve_node_fanout: 4,
get_value_timeout_ms: 10000,
get_value_count: 3,
get_value_fanout: 4,
get_value_fanout: 5,
set_value_timeout_ms: 10000,
set_value_count: 5,
set_value_fanout: 4,
set_value_fanout: 5,
consensus_width: 10,
min_peer_count: 20,
min_peer_refresh_time_ms: 60000,
validate_dial_info_receipt_time_ms: 2000,
@ -1277,6 +1279,26 @@ impl VeilidStartupOptions {
if inner.network.rpc.timeout_ms < 1000 {
apibail_generic!("rpc timeout must be >= 1000 in 'network.rpc.timeout_ms'");
}
if inner.network.dht.consensus_width < inner.network.dht.set_value_count {
apibail_generic!(
"consensus width must be >= set value count in 'network.dht.consensus_width'"
);
}
if inner.network.dht.get_value_count <= (inner.network.dht.set_value_count / 2) {
apibail_generic!("get consensus count must be >= (set value count / 2) in 'network.dht.get_value_count'");
}
if inner.network.dht.get_value_fanout < 1 {
apibail_generic!("get value fanout must be >= 1 in 'network.dht.get_value_fanout'");
}
if inner.network.dht.set_value_fanout < 1 {
apibail_generic!("set value fanout must be >= 1 in 'network.dht.set_value_fanout'");
}
if inner.network.dht.get_value_timeout_ms < (2 * inner.network.rpc.timeout_ms) {
apibail_generic!("get value timeout must be >= (2 * the rpc timeout) in 'network.dht.get_value_timeout_ms'");
}
if inner.network.dht.set_value_timeout_ms < (2 * inner.network.rpc.timeout_ms) {
apibail_generic!("set value timeout must be >= (2 * the rpc timeout) in 'network.dht.set_value_timeout_ms'");
}
Ok(())
}

View file

@ -61,11 +61,12 @@ sealed class VeilidFFIConfigLoggingFlame with _$VeilidFFIConfigLoggingFlame {
@freezed
sealed class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging {
const factory VeilidFFIConfigLogging(
{required VeilidFFIConfigLoggingTerminal terminal,
required VeilidFFIConfigLoggingOtlp otlp,
required VeilidFFIConfigLoggingApi api,
required VeilidFFIConfigLoggingFlame flame}) = _VeilidFFIConfigLogging;
const factory VeilidFFIConfigLogging({
required VeilidFFIConfigLoggingTerminal terminal,
required VeilidFFIConfigLoggingOtlp otlp,
required VeilidFFIConfigLoggingApi api,
required VeilidFFIConfigLoggingFlame flame,
}) = _VeilidFFIConfigLogging;
factory VeilidFFIConfigLogging.fromJson(dynamic json) =>
_$VeilidFFIConfigLoggingFromJson(json as Map<String, dynamic>);
@ -73,9 +74,8 @@ sealed class VeilidFFIConfigLogging with _$VeilidFFIConfigLogging {
@freezed
sealed class VeilidFFIConfig with _$VeilidFFIConfig {
const factory VeilidFFIConfig({
required VeilidFFIConfigLogging logging,
}) = _VeilidFFIConfig;
const factory VeilidFFIConfig({required VeilidFFIConfigLogging logging}) =
_VeilidFFIConfig;
factory VeilidFFIConfig.fromJson(dynamic json) =>
_$VeilidFFIConfigFromJson(json as Map<String, dynamic>);
@ -97,7 +97,8 @@ sealed class VeilidWASMConfigLoggingPerformance
factory VeilidWASMConfigLoggingPerformance.fromJson(dynamic json) =>
_$VeilidWASMConfigLoggingPerformanceFromJson(
json as Map<String, dynamic>);
json as Map<String, dynamic>,
);
}
@freezed
@ -114,9 +115,10 @@ sealed class VeilidWASMConfigLoggingApi with _$VeilidWASMConfigLoggingApi {
@freezed
sealed class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging {
const factory VeilidWASMConfigLogging(
{required VeilidWASMConfigLoggingPerformance performance,
required VeilidWASMConfigLoggingApi api}) = _VeilidWASMConfigLogging;
const factory VeilidWASMConfigLogging({
required VeilidWASMConfigLoggingPerformance performance,
required VeilidWASMConfigLoggingApi api,
}) = _VeilidWASMConfigLogging;
factory VeilidWASMConfigLogging.fromJson(dynamic json) =>
_$VeilidWASMConfigLoggingFromJson(json as Map<String, dynamic>);
@ -124,9 +126,8 @@ sealed class VeilidWASMConfigLogging with _$VeilidWASMConfigLogging {
@freezed
sealed class VeilidWASMConfig with _$VeilidWASMConfig {
const factory VeilidWASMConfig({
required VeilidWASMConfigLogging logging,
}) = _VeilidWASMConfig;
const factory VeilidWASMConfig({required VeilidWASMConfigLogging logging}) =
_VeilidWASMConfig;
factory VeilidWASMConfig.fromJson(dynamic json) =>
_$VeilidWASMConfigFromJson(json as Map<String, dynamic>);
@ -195,11 +196,12 @@ sealed class VeilidConfigApplication with _$VeilidConfigApplication {
////////////
@freezed
sealed class VeilidConfigUDP with _$VeilidConfigUDP {
const factory VeilidConfigUDP(
{required bool enabled,
required int socketPoolSize,
required String listenAddress,
String? publicAddress}) = _VeilidConfigUDP;
const factory VeilidConfigUDP({
required bool enabled,
required int socketPoolSize,
required String listenAddress,
String? publicAddress,
}) = _VeilidConfigUDP;
factory VeilidConfigUDP.fromJson(dynamic json) =>
_$VeilidConfigUDPFromJson(json as Map<String, dynamic>);
@ -208,12 +210,13 @@ sealed class VeilidConfigUDP with _$VeilidConfigUDP {
////////////
@freezed
sealed class VeilidConfigTCP with _$VeilidConfigTCP {
const factory VeilidConfigTCP(
{required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
String? publicAddress}) = _VeilidConfigTCP;
const factory VeilidConfigTCP({
required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
String? publicAddress,
}) = _VeilidConfigTCP;
factory VeilidConfigTCP.fromJson(dynamic json) =>
_$VeilidConfigTCPFromJson(json as Map<String, dynamic>);
@ -222,13 +225,14 @@ sealed class VeilidConfigTCP with _$VeilidConfigTCP {
////////////
@freezed
sealed class VeilidConfigWS with _$VeilidConfigWS {
const factory VeilidConfigWS(
{required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
required String path,
String? url}) = _VeilidConfigWS;
const factory VeilidConfigWS({
required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
required String path,
String? url,
}) = _VeilidConfigWS;
factory VeilidConfigWS.fromJson(dynamic json) =>
_$VeilidConfigWSFromJson(json as Map<String, dynamic>);
@ -237,13 +241,14 @@ sealed class VeilidConfigWS with _$VeilidConfigWS {
////////////
@freezed
sealed class VeilidConfigWSS with _$VeilidConfigWSS {
const factory VeilidConfigWSS(
{required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
required String path,
String? url}) = _VeilidConfigWSS;
const factory VeilidConfigWSS({
required bool connect,
required bool listen,
required int maxConnections,
required String listenAddress,
required String path,
String? url,
}) = _VeilidConfigWSS;
factory VeilidConfigWSS.fromJson(dynamic json) =>
_$VeilidConfigWSSFromJson(json as Map<String, dynamic>);
@ -268,9 +273,8 @@ sealed class VeilidConfigProtocol with _$VeilidConfigProtocol {
@freezed
sealed class VeilidConfigPrivacy with _$VeilidConfigPrivacy {
const factory VeilidConfigPrivacy({
required bool requireInboundRelay,
}) = _VeilidConfigPrivacy;
const factory VeilidConfigPrivacy({required bool requireInboundRelay}) =
_VeilidConfigPrivacy;
factory VeilidConfigPrivacy.fromJson(dynamic json) =>
_$VeilidConfigPrivacyFromJson(json as Map<String, dynamic>);
@ -304,6 +308,7 @@ sealed class VeilidConfigDHT with _$VeilidConfigDHT {
required int setValueTimeoutMs,
required int setValueCount,
required int setValueFanout,
required int consensusWidth,
required int minPeerCount,
required int minPeerRefreshTimeMs,
required int validateDialInfoReceiptTimeMs,
@ -326,14 +331,15 @@ sealed class VeilidConfigDHT with _$VeilidConfigDHT {
@freezed
sealed class VeilidConfigRPC with _$VeilidConfigRPC {
const factory VeilidConfigRPC(
{required int concurrency,
required int queueSize,
required int timeoutMs,
required int maxRouteHopCount,
required int defaultRouteHopCount,
int? maxTimestampBehindMs,
int? maxTimestampAheadMs}) = _VeilidConfigRPC;
const factory VeilidConfigRPC({
required int concurrency,
required int queueSize,
required int timeoutMs,
required int maxRouteHopCount,
required int defaultRouteHopCount,
int? maxTimestampBehindMs,
int? maxTimestampAheadMs,
}) = _VeilidConfigRPC;
factory VeilidConfigRPC.fromJson(dynamic json) =>
_$VeilidConfigRPCFromJson(json as Map<String, dynamic>);
@ -420,13 +426,14 @@ sealed class VeilidConfigBlockStore with _$VeilidConfigBlockStore {
@freezed
sealed class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore {
const factory VeilidConfigProtectedStore(
{required bool allowInsecureFallback,
required bool alwaysUseInsecureStorage,
required String directory,
required bool delete,
required String deviceEncryptionKeyPassword,
String? newDeviceEncryptionKeyPassword}) = _VeilidConfigProtectedStore;
const factory VeilidConfigProtectedStore({
required bool allowInsecureFallback,
required bool alwaysUseInsecureStorage,
required String directory,
required bool delete,
required String deviceEncryptionKeyPassword,
String? newDeviceEncryptionKeyPassword,
}) = _VeilidConfigProtectedStore;
factory VeilidConfigProtectedStore.fromJson(dynamic json) =>
_$VeilidConfigProtectedStoreFromJson(json as Map<String, dynamic>);
@ -436,9 +443,8 @@ sealed class VeilidConfigProtectedStore with _$VeilidConfigProtectedStore {
@freezed
sealed class VeilidConfigCapabilities with _$VeilidConfigCapabilities {
const factory VeilidConfigCapabilities({
required List<String> disable,
}) = _VeilidConfigCapabilities;
const factory VeilidConfigCapabilities({required List<String> disable}) =
_VeilidConfigCapabilities;
factory VeilidConfigCapabilities.fromJson(dynamic json) =>
_$VeilidConfigCapabilitiesFromJson(json as Map<String, dynamic>);

View file

@ -5821,7 +5821,7 @@ as int,
/// @nodoc
mixin _$VeilidConfigDHT implements DiagnosticableTreeMixin {
int get resolveNodeTimeoutMs; int get resolveNodeCount; int get resolveNodeFanout; int get maxFindNodeCount; int get getValueTimeoutMs; int get getValueCount; int get getValueFanout; int get setValueTimeoutMs; int get setValueCount; int get setValueFanout; int get minPeerCount; int get minPeerRefreshTimeMs; int get validateDialInfoReceiptTimeMs; int get localSubkeyCacheSize; int get localMaxSubkeyCacheMemoryMb; int get remoteSubkeyCacheSize; int get remoteMaxRecords; int get remoteMaxSubkeyCacheMemoryMb; int get remoteMaxStorageSpaceMb; int get publicWatchLimit; int get memberWatchLimit; int get maxWatchExpirationMs;
int get resolveNodeTimeoutMs; int get resolveNodeCount; int get resolveNodeFanout; int get maxFindNodeCount; int get getValueTimeoutMs; int get getValueCount; int get getValueFanout; int get setValueTimeoutMs; int get setValueCount; int get setValueFanout; int get consensusWidth; int get minPeerCount; int get minPeerRefreshTimeMs; int get validateDialInfoReceiptTimeMs; int get localSubkeyCacheSize; int get localMaxSubkeyCacheMemoryMb; int get remoteSubkeyCacheSize; int get remoteMaxRecords; int get remoteMaxSubkeyCacheMemoryMb; int get remoteMaxStorageSpaceMb; int get publicWatchLimit; int get memberWatchLimit; int get maxWatchExpirationMs;
/// Create a copy of VeilidConfigDHT
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@ -5835,21 +5835,21 @@ $VeilidConfigDHTCopyWith<VeilidConfigDHT> get copyWith => _$VeilidConfigDHTCopyW
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'VeilidConfigDHT'))
..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs))..add(DiagnosticsProperty('resolveNodeCount', resolveNodeCount))..add(DiagnosticsProperty('resolveNodeFanout', resolveNodeFanout))..add(DiagnosticsProperty('maxFindNodeCount', maxFindNodeCount))..add(DiagnosticsProperty('getValueTimeoutMs', getValueTimeoutMs))..add(DiagnosticsProperty('getValueCount', getValueCount))..add(DiagnosticsProperty('getValueFanout', getValueFanout))..add(DiagnosticsProperty('setValueTimeoutMs', setValueTimeoutMs))..add(DiagnosticsProperty('setValueCount', setValueCount))..add(DiagnosticsProperty('setValueFanout', setValueFanout))..add(DiagnosticsProperty('minPeerCount', minPeerCount))..add(DiagnosticsProperty('minPeerRefreshTimeMs', minPeerRefreshTimeMs))..add(DiagnosticsProperty('validateDialInfoReceiptTimeMs', validateDialInfoReceiptTimeMs))..add(DiagnosticsProperty('localSubkeyCacheSize', localSubkeyCacheSize))..add(DiagnosticsProperty('localMaxSubkeyCacheMemoryMb', localMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteSubkeyCacheSize', remoteSubkeyCacheSize))..add(DiagnosticsProperty('remoteMaxRecords', remoteMaxRecords))..add(DiagnosticsProperty('remoteMaxSubkeyCacheMemoryMb', remoteMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteMaxStorageSpaceMb', remoteMaxStorageSpaceMb))..add(DiagnosticsProperty('publicWatchLimit', publicWatchLimit))..add(DiagnosticsProperty('memberWatchLimit', memberWatchLimit))..add(DiagnosticsProperty('maxWatchExpirationMs', maxWatchExpirationMs));
..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs))..add(DiagnosticsProperty('resolveNodeCount', resolveNodeCount))..add(DiagnosticsProperty('resolveNodeFanout', resolveNodeFanout))..add(DiagnosticsProperty('maxFindNodeCount', maxFindNodeCount))..add(DiagnosticsProperty('getValueTimeoutMs', getValueTimeoutMs))..add(DiagnosticsProperty('getValueCount', getValueCount))..add(DiagnosticsProperty('getValueFanout', getValueFanout))..add(DiagnosticsProperty('setValueTimeoutMs', setValueTimeoutMs))..add(DiagnosticsProperty('setValueCount', setValueCount))..add(DiagnosticsProperty('setValueFanout', setValueFanout))..add(DiagnosticsProperty('consensusWidth', consensusWidth))..add(DiagnosticsProperty('minPeerCount', minPeerCount))..add(DiagnosticsProperty('minPeerRefreshTimeMs', minPeerRefreshTimeMs))..add(DiagnosticsProperty('validateDialInfoReceiptTimeMs', validateDialInfoReceiptTimeMs))..add(DiagnosticsProperty('localSubkeyCacheSize', localSubkeyCacheSize))..add(DiagnosticsProperty('localMaxSubkeyCacheMemoryMb', localMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteSubkeyCacheSize', remoteSubkeyCacheSize))..add(DiagnosticsProperty('remoteMaxRecords', remoteMaxRecords))..add(DiagnosticsProperty('remoteMaxSubkeyCacheMemoryMb', remoteMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteMaxStorageSpaceMb', remoteMaxStorageSpaceMb))..add(DiagnosticsProperty('publicWatchLimit', publicWatchLimit))..add(DiagnosticsProperty('memberWatchLimit', memberWatchLimit))..add(DiagnosticsProperty('maxWatchExpirationMs', maxWatchExpirationMs));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is VeilidConfigDHT&&(identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || other.resolveNodeTimeoutMs == resolveNodeTimeoutMs)&&(identical(other.resolveNodeCount, resolveNodeCount) || other.resolveNodeCount == resolveNodeCount)&&(identical(other.resolveNodeFanout, resolveNodeFanout) || other.resolveNodeFanout == resolveNodeFanout)&&(identical(other.maxFindNodeCount, maxFindNodeCount) || other.maxFindNodeCount == maxFindNodeCount)&&(identical(other.getValueTimeoutMs, getValueTimeoutMs) || other.getValueTimeoutMs == getValueTimeoutMs)&&(identical(other.getValueCount, getValueCount) || other.getValueCount == getValueCount)&&(identical(other.getValueFanout, getValueFanout) || other.getValueFanout == getValueFanout)&&(identical(other.setValueTimeoutMs, setValueTimeoutMs) || other.setValueTimeoutMs == setValueTimeoutMs)&&(identical(other.setValueCount, setValueCount) || other.setValueCount == setValueCount)&&(identical(other.setValueFanout, setValueFanout) || other.setValueFanout == setValueFanout)&&(identical(other.minPeerCount, minPeerCount) || other.minPeerCount == minPeerCount)&&(identical(other.minPeerRefreshTimeMs, minPeerRefreshTimeMs) || other.minPeerRefreshTimeMs == minPeerRefreshTimeMs)&&(identical(other.validateDialInfoReceiptTimeMs, validateDialInfoReceiptTimeMs) || other.validateDialInfoReceiptTimeMs == validateDialInfoReceiptTimeMs)&&(identical(other.localSubkeyCacheSize, localSubkeyCacheSize) || other.localSubkeyCacheSize == localSubkeyCacheSize)&&(identical(other.localMaxSubkeyCacheMemoryMb, localMaxSubkeyCacheMemoryMb) || other.localMaxSubkeyCacheMemoryMb == localMaxSubkeyCacheMemoryMb)&&(identical(other.remoteSubkeyCacheSize, remoteSubkeyCacheSize) || other.remoteSubkeyCacheSize == remoteSubkeyCacheSize)&&(identical(other.remoteMaxRecords, remoteMaxRecords) || other.remoteMaxRecords == remoteMaxRecords)&&(identical(other.remoteMaxSubkeyCacheMemoryMb, remoteMaxSubkeyCacheMemoryMb) || other.remoteMaxSubkeyCacheMemoryMb == remoteMaxSubkeyCacheMemoryMb)&&(identical(other.remoteMaxStorageSpaceMb, remoteMaxStorageSpaceMb) || other.remoteMaxStorageSpaceMb == remoteMaxStorageSpaceMb)&&(identical(other.publicWatchLimit, publicWatchLimit) || other.publicWatchLimit == publicWatchLimit)&&(identical(other.memberWatchLimit, memberWatchLimit) || other.memberWatchLimit == memberWatchLimit)&&(identical(other.maxWatchExpirationMs, maxWatchExpirationMs) || other.maxWatchExpirationMs == maxWatchExpirationMs));
return identical(this, other) || (other.runtimeType == runtimeType&&other is VeilidConfigDHT&&(identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || other.resolveNodeTimeoutMs == resolveNodeTimeoutMs)&&(identical(other.resolveNodeCount, resolveNodeCount) || other.resolveNodeCount == resolveNodeCount)&&(identical(other.resolveNodeFanout, resolveNodeFanout) || other.resolveNodeFanout == resolveNodeFanout)&&(identical(other.maxFindNodeCount, maxFindNodeCount) || other.maxFindNodeCount == maxFindNodeCount)&&(identical(other.getValueTimeoutMs, getValueTimeoutMs) || other.getValueTimeoutMs == getValueTimeoutMs)&&(identical(other.getValueCount, getValueCount) || other.getValueCount == getValueCount)&&(identical(other.getValueFanout, getValueFanout) || other.getValueFanout == getValueFanout)&&(identical(other.setValueTimeoutMs, setValueTimeoutMs) || other.setValueTimeoutMs == setValueTimeoutMs)&&(identical(other.setValueCount, setValueCount) || other.setValueCount == setValueCount)&&(identical(other.setValueFanout, setValueFanout) || other.setValueFanout == setValueFanout)&&(identical(other.consensusWidth, consensusWidth) || other.consensusWidth == consensusWidth)&&(identical(other.minPeerCount, minPeerCount) || other.minPeerCount == minPeerCount)&&(identical(other.minPeerRefreshTimeMs, minPeerRefreshTimeMs) || other.minPeerRefreshTimeMs == minPeerRefreshTimeMs)&&(identical(other.validateDialInfoReceiptTimeMs, validateDialInfoReceiptTimeMs) || other.validateDialInfoReceiptTimeMs == validateDialInfoReceiptTimeMs)&&(identical(other.localSubkeyCacheSize, localSubkeyCacheSize) || other.localSubkeyCacheSize == localSubkeyCacheSize)&&(identical(other.localMaxSubkeyCacheMemoryMb, localMaxSubkeyCacheMemoryMb) || other.localMaxSubkeyCacheMemoryMb == localMaxSubkeyCacheMemoryMb)&&(identical(other.remoteSubkeyCacheSize, remoteSubkeyCacheSize) || other.remoteSubkeyCacheSize == remoteSubkeyCacheSize)&&(identical(other.remoteMaxRecords, remoteMaxRecords) || other.remoteMaxRecords == remoteMaxRecords)&&(identical(other.remoteMaxSubkeyCacheMemoryMb, remoteMaxSubkeyCacheMemoryMb) || other.remoteMaxSubkeyCacheMemoryMb == remoteMaxSubkeyCacheMemoryMb)&&(identical(other.remoteMaxStorageSpaceMb, remoteMaxStorageSpaceMb) || other.remoteMaxStorageSpaceMb == remoteMaxStorageSpaceMb)&&(identical(other.publicWatchLimit, publicWatchLimit) || other.publicWatchLimit == publicWatchLimit)&&(identical(other.memberWatchLimit, memberWatchLimit) || other.memberWatchLimit == memberWatchLimit)&&(identical(other.maxWatchExpirationMs, maxWatchExpirationMs) || other.maxWatchExpirationMs == maxWatchExpirationMs));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,resolveNodeTimeoutMs,resolveNodeCount,resolveNodeFanout,maxFindNodeCount,getValueTimeoutMs,getValueCount,getValueFanout,setValueTimeoutMs,setValueCount,setValueFanout,minPeerCount,minPeerRefreshTimeMs,validateDialInfoReceiptTimeMs,localSubkeyCacheSize,localMaxSubkeyCacheMemoryMb,remoteSubkeyCacheSize,remoteMaxRecords,remoteMaxSubkeyCacheMemoryMb,remoteMaxStorageSpaceMb,publicWatchLimit,memberWatchLimit,maxWatchExpirationMs]);
int get hashCode => Object.hashAll([runtimeType,resolveNodeTimeoutMs,resolveNodeCount,resolveNodeFanout,maxFindNodeCount,getValueTimeoutMs,getValueCount,getValueFanout,setValueTimeoutMs,setValueCount,setValueFanout,consensusWidth,minPeerCount,minPeerRefreshTimeMs,validateDialInfoReceiptTimeMs,localSubkeyCacheSize,localMaxSubkeyCacheMemoryMb,remoteSubkeyCacheSize,remoteMaxRecords,remoteMaxSubkeyCacheMemoryMb,remoteMaxStorageSpaceMb,publicWatchLimit,memberWatchLimit,maxWatchExpirationMs]);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'VeilidConfigDHT(resolveNodeTimeoutMs: $resolveNodeTimeoutMs, resolveNodeCount: $resolveNodeCount, resolveNodeFanout: $resolveNodeFanout, maxFindNodeCount: $maxFindNodeCount, getValueTimeoutMs: $getValueTimeoutMs, getValueCount: $getValueCount, getValueFanout: $getValueFanout, setValueTimeoutMs: $setValueTimeoutMs, setValueCount: $setValueCount, setValueFanout: $setValueFanout, minPeerCount: $minPeerCount, minPeerRefreshTimeMs: $minPeerRefreshTimeMs, validateDialInfoReceiptTimeMs: $validateDialInfoReceiptTimeMs, localSubkeyCacheSize: $localSubkeyCacheSize, localMaxSubkeyCacheMemoryMb: $localMaxSubkeyCacheMemoryMb, remoteSubkeyCacheSize: $remoteSubkeyCacheSize, remoteMaxRecords: $remoteMaxRecords, remoteMaxSubkeyCacheMemoryMb: $remoteMaxSubkeyCacheMemoryMb, remoteMaxStorageSpaceMb: $remoteMaxStorageSpaceMb, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)';
return 'VeilidConfigDHT(resolveNodeTimeoutMs: $resolveNodeTimeoutMs, resolveNodeCount: $resolveNodeCount, resolveNodeFanout: $resolveNodeFanout, maxFindNodeCount: $maxFindNodeCount, getValueTimeoutMs: $getValueTimeoutMs, getValueCount: $getValueCount, getValueFanout: $getValueFanout, setValueTimeoutMs: $setValueTimeoutMs, setValueCount: $setValueCount, setValueFanout: $setValueFanout, consensusWidth: $consensusWidth, minPeerCount: $minPeerCount, minPeerRefreshTimeMs: $minPeerRefreshTimeMs, validateDialInfoReceiptTimeMs: $validateDialInfoReceiptTimeMs, localSubkeyCacheSize: $localSubkeyCacheSize, localMaxSubkeyCacheMemoryMb: $localMaxSubkeyCacheMemoryMb, remoteSubkeyCacheSize: $remoteSubkeyCacheSize, remoteMaxRecords: $remoteMaxRecords, remoteMaxSubkeyCacheMemoryMb: $remoteMaxSubkeyCacheMemoryMb, remoteMaxStorageSpaceMb: $remoteMaxStorageSpaceMb, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)';
}
@ -5860,7 +5860,7 @@ abstract mixin class $VeilidConfigDHTCopyWith<$Res> {
factory $VeilidConfigDHTCopyWith(VeilidConfigDHT value, $Res Function(VeilidConfigDHT) _then) = _$VeilidConfigDHTCopyWithImpl;
@useResult
$Res call({
int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs
int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int consensusWidth, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs
});
@ -5877,7 +5877,7 @@ class _$VeilidConfigDHTCopyWithImpl<$Res>
/// Create a copy of VeilidConfigDHT
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? resolveNodeTimeoutMs = null,Object? resolveNodeCount = null,Object? resolveNodeFanout = null,Object? maxFindNodeCount = null,Object? getValueTimeoutMs = null,Object? getValueCount = null,Object? getValueFanout = null,Object? setValueTimeoutMs = null,Object? setValueCount = null,Object? setValueFanout = null,Object? minPeerCount = null,Object? minPeerRefreshTimeMs = null,Object? validateDialInfoReceiptTimeMs = null,Object? localSubkeyCacheSize = null,Object? localMaxSubkeyCacheMemoryMb = null,Object? remoteSubkeyCacheSize = null,Object? remoteMaxRecords = null,Object? remoteMaxSubkeyCacheMemoryMb = null,Object? remoteMaxStorageSpaceMb = null,Object? publicWatchLimit = null,Object? memberWatchLimit = null,Object? maxWatchExpirationMs = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? resolveNodeTimeoutMs = null,Object? resolveNodeCount = null,Object? resolveNodeFanout = null,Object? maxFindNodeCount = null,Object? getValueTimeoutMs = null,Object? getValueCount = null,Object? getValueFanout = null,Object? setValueTimeoutMs = null,Object? setValueCount = null,Object? setValueFanout = null,Object? consensusWidth = null,Object? minPeerCount = null,Object? minPeerRefreshTimeMs = null,Object? validateDialInfoReceiptTimeMs = null,Object? localSubkeyCacheSize = null,Object? localMaxSubkeyCacheMemoryMb = null,Object? remoteSubkeyCacheSize = null,Object? remoteMaxRecords = null,Object? remoteMaxSubkeyCacheMemoryMb = null,Object? remoteMaxStorageSpaceMb = null,Object? publicWatchLimit = null,Object? memberWatchLimit = null,Object? maxWatchExpirationMs = null,}) {
return _then(_self.copyWith(
resolveNodeTimeoutMs: null == resolveNodeTimeoutMs ? _self.resolveNodeTimeoutMs : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable
as int,resolveNodeCount: null == resolveNodeCount ? _self.resolveNodeCount : resolveNodeCount // ignore: cast_nullable_to_non_nullable
@ -5889,6 +5889,7 @@ as int,getValueFanout: null == getValueFanout ? _self.getValueFanout : getValueF
as int,setValueTimeoutMs: null == setValueTimeoutMs ? _self.setValueTimeoutMs : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable
as int,setValueCount: null == setValueCount ? _self.setValueCount : setValueCount // ignore: cast_nullable_to_non_nullable
as int,setValueFanout: null == setValueFanout ? _self.setValueFanout : setValueFanout // ignore: cast_nullable_to_non_nullable
as int,consensusWidth: null == consensusWidth ? _self.consensusWidth : consensusWidth // ignore: cast_nullable_to_non_nullable
as int,minPeerCount: null == minPeerCount ? _self.minPeerCount : minPeerCount // ignore: cast_nullable_to_non_nullable
as int,minPeerRefreshTimeMs: null == minPeerRefreshTimeMs ? _self.minPeerRefreshTimeMs : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable
as int,validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs ? _self.validateDialInfoReceiptTimeMs : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable
@ -5983,10 +5984,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int consensusWidth, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _VeilidConfigDHT() when $default != null:
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);case _:
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.consensusWidth,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);case _:
return orElse();
}
@ -6004,10 +6005,10 @@ return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveN
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int consensusWidth, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs) $default,) {final _that = this;
switch (_that) {
case _VeilidConfigDHT():
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);}
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.consensusWidth,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);}
}
/// A variant of `when` that fallback to returning `null`
///
@ -6021,10 +6022,10 @@ return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveN
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int consensusWidth, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs)? $default,) {final _that = this;
switch (_that) {
case _VeilidConfigDHT() when $default != null:
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);case _:
return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveNodeFanout,_that.maxFindNodeCount,_that.getValueTimeoutMs,_that.getValueCount,_that.getValueFanout,_that.setValueTimeoutMs,_that.setValueCount,_that.setValueFanout,_that.consensusWidth,_that.minPeerCount,_that.minPeerRefreshTimeMs,_that.validateDialInfoReceiptTimeMs,_that.localSubkeyCacheSize,_that.localMaxSubkeyCacheMemoryMb,_that.remoteSubkeyCacheSize,_that.remoteMaxRecords,_that.remoteMaxSubkeyCacheMemoryMb,_that.remoteMaxStorageSpaceMb,_that.publicWatchLimit,_that.memberWatchLimit,_that.maxWatchExpirationMs);case _:
return null;
}
@ -6036,7 +6037,7 @@ return $default(_that.resolveNodeTimeoutMs,_that.resolveNodeCount,_that.resolveN
@JsonSerializable()
class _VeilidConfigDHT with DiagnosticableTreeMixin implements VeilidConfigDHT {
const _VeilidConfigDHT({required this.resolveNodeTimeoutMs, required this.resolveNodeCount, required this.resolveNodeFanout, required this.maxFindNodeCount, required this.getValueTimeoutMs, required this.getValueCount, required this.getValueFanout, required this.setValueTimeoutMs, required this.setValueCount, required this.setValueFanout, required this.minPeerCount, required this.minPeerRefreshTimeMs, required this.validateDialInfoReceiptTimeMs, required this.localSubkeyCacheSize, required this.localMaxSubkeyCacheMemoryMb, required this.remoteSubkeyCacheSize, required this.remoteMaxRecords, required this.remoteMaxSubkeyCacheMemoryMb, required this.remoteMaxStorageSpaceMb, required this.publicWatchLimit, required this.memberWatchLimit, required this.maxWatchExpirationMs});
const _VeilidConfigDHT({required this.resolveNodeTimeoutMs, required this.resolveNodeCount, required this.resolveNodeFanout, required this.maxFindNodeCount, required this.getValueTimeoutMs, required this.getValueCount, required this.getValueFanout, required this.setValueTimeoutMs, required this.setValueCount, required this.setValueFanout, required this.consensusWidth, required this.minPeerCount, required this.minPeerRefreshTimeMs, required this.validateDialInfoReceiptTimeMs, required this.localSubkeyCacheSize, required this.localMaxSubkeyCacheMemoryMb, required this.remoteSubkeyCacheSize, required this.remoteMaxRecords, required this.remoteMaxSubkeyCacheMemoryMb, required this.remoteMaxStorageSpaceMb, required this.publicWatchLimit, required this.memberWatchLimit, required this.maxWatchExpirationMs});
factory _VeilidConfigDHT.fromJson(Map<String, dynamic> json) => _$VeilidConfigDHTFromJson(json);
@override final int resolveNodeTimeoutMs;
@ -6049,6 +6050,7 @@ class _VeilidConfigDHT with DiagnosticableTreeMixin implements VeilidConfigDHT {
@override final int setValueTimeoutMs;
@override final int setValueCount;
@override final int setValueFanout;
@override final int consensusWidth;
@override final int minPeerCount;
@override final int minPeerRefreshTimeMs;
@override final int validateDialInfoReceiptTimeMs;
@ -6076,21 +6078,21 @@ Map<String, dynamic> toJson() {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'VeilidConfigDHT'))
..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs))..add(DiagnosticsProperty('resolveNodeCount', resolveNodeCount))..add(DiagnosticsProperty('resolveNodeFanout', resolveNodeFanout))..add(DiagnosticsProperty('maxFindNodeCount', maxFindNodeCount))..add(DiagnosticsProperty('getValueTimeoutMs', getValueTimeoutMs))..add(DiagnosticsProperty('getValueCount', getValueCount))..add(DiagnosticsProperty('getValueFanout', getValueFanout))..add(DiagnosticsProperty('setValueTimeoutMs', setValueTimeoutMs))..add(DiagnosticsProperty('setValueCount', setValueCount))..add(DiagnosticsProperty('setValueFanout', setValueFanout))..add(DiagnosticsProperty('minPeerCount', minPeerCount))..add(DiagnosticsProperty('minPeerRefreshTimeMs', minPeerRefreshTimeMs))..add(DiagnosticsProperty('validateDialInfoReceiptTimeMs', validateDialInfoReceiptTimeMs))..add(DiagnosticsProperty('localSubkeyCacheSize', localSubkeyCacheSize))..add(DiagnosticsProperty('localMaxSubkeyCacheMemoryMb', localMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteSubkeyCacheSize', remoteSubkeyCacheSize))..add(DiagnosticsProperty('remoteMaxRecords', remoteMaxRecords))..add(DiagnosticsProperty('remoteMaxSubkeyCacheMemoryMb', remoteMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteMaxStorageSpaceMb', remoteMaxStorageSpaceMb))..add(DiagnosticsProperty('publicWatchLimit', publicWatchLimit))..add(DiagnosticsProperty('memberWatchLimit', memberWatchLimit))..add(DiagnosticsProperty('maxWatchExpirationMs', maxWatchExpirationMs));
..add(DiagnosticsProperty('resolveNodeTimeoutMs', resolveNodeTimeoutMs))..add(DiagnosticsProperty('resolveNodeCount', resolveNodeCount))..add(DiagnosticsProperty('resolveNodeFanout', resolveNodeFanout))..add(DiagnosticsProperty('maxFindNodeCount', maxFindNodeCount))..add(DiagnosticsProperty('getValueTimeoutMs', getValueTimeoutMs))..add(DiagnosticsProperty('getValueCount', getValueCount))..add(DiagnosticsProperty('getValueFanout', getValueFanout))..add(DiagnosticsProperty('setValueTimeoutMs', setValueTimeoutMs))..add(DiagnosticsProperty('setValueCount', setValueCount))..add(DiagnosticsProperty('setValueFanout', setValueFanout))..add(DiagnosticsProperty('consensusWidth', consensusWidth))..add(DiagnosticsProperty('minPeerCount', minPeerCount))..add(DiagnosticsProperty('minPeerRefreshTimeMs', minPeerRefreshTimeMs))..add(DiagnosticsProperty('validateDialInfoReceiptTimeMs', validateDialInfoReceiptTimeMs))..add(DiagnosticsProperty('localSubkeyCacheSize', localSubkeyCacheSize))..add(DiagnosticsProperty('localMaxSubkeyCacheMemoryMb', localMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteSubkeyCacheSize', remoteSubkeyCacheSize))..add(DiagnosticsProperty('remoteMaxRecords', remoteMaxRecords))..add(DiagnosticsProperty('remoteMaxSubkeyCacheMemoryMb', remoteMaxSubkeyCacheMemoryMb))..add(DiagnosticsProperty('remoteMaxStorageSpaceMb', remoteMaxStorageSpaceMb))..add(DiagnosticsProperty('publicWatchLimit', publicWatchLimit))..add(DiagnosticsProperty('memberWatchLimit', memberWatchLimit))..add(DiagnosticsProperty('maxWatchExpirationMs', maxWatchExpirationMs));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _VeilidConfigDHT&&(identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || other.resolveNodeTimeoutMs == resolveNodeTimeoutMs)&&(identical(other.resolveNodeCount, resolveNodeCount) || other.resolveNodeCount == resolveNodeCount)&&(identical(other.resolveNodeFanout, resolveNodeFanout) || other.resolveNodeFanout == resolveNodeFanout)&&(identical(other.maxFindNodeCount, maxFindNodeCount) || other.maxFindNodeCount == maxFindNodeCount)&&(identical(other.getValueTimeoutMs, getValueTimeoutMs) || other.getValueTimeoutMs == getValueTimeoutMs)&&(identical(other.getValueCount, getValueCount) || other.getValueCount == getValueCount)&&(identical(other.getValueFanout, getValueFanout) || other.getValueFanout == getValueFanout)&&(identical(other.setValueTimeoutMs, setValueTimeoutMs) || other.setValueTimeoutMs == setValueTimeoutMs)&&(identical(other.setValueCount, setValueCount) || other.setValueCount == setValueCount)&&(identical(other.setValueFanout, setValueFanout) || other.setValueFanout == setValueFanout)&&(identical(other.minPeerCount, minPeerCount) || other.minPeerCount == minPeerCount)&&(identical(other.minPeerRefreshTimeMs, minPeerRefreshTimeMs) || other.minPeerRefreshTimeMs == minPeerRefreshTimeMs)&&(identical(other.validateDialInfoReceiptTimeMs, validateDialInfoReceiptTimeMs) || other.validateDialInfoReceiptTimeMs == validateDialInfoReceiptTimeMs)&&(identical(other.localSubkeyCacheSize, localSubkeyCacheSize) || other.localSubkeyCacheSize == localSubkeyCacheSize)&&(identical(other.localMaxSubkeyCacheMemoryMb, localMaxSubkeyCacheMemoryMb) || other.localMaxSubkeyCacheMemoryMb == localMaxSubkeyCacheMemoryMb)&&(identical(other.remoteSubkeyCacheSize, remoteSubkeyCacheSize) || other.remoteSubkeyCacheSize == remoteSubkeyCacheSize)&&(identical(other.remoteMaxRecords, remoteMaxRecords) || other.remoteMaxRecords == remoteMaxRecords)&&(identical(other.remoteMaxSubkeyCacheMemoryMb, remoteMaxSubkeyCacheMemoryMb) || other.remoteMaxSubkeyCacheMemoryMb == remoteMaxSubkeyCacheMemoryMb)&&(identical(other.remoteMaxStorageSpaceMb, remoteMaxStorageSpaceMb) || other.remoteMaxStorageSpaceMb == remoteMaxStorageSpaceMb)&&(identical(other.publicWatchLimit, publicWatchLimit) || other.publicWatchLimit == publicWatchLimit)&&(identical(other.memberWatchLimit, memberWatchLimit) || other.memberWatchLimit == memberWatchLimit)&&(identical(other.maxWatchExpirationMs, maxWatchExpirationMs) || other.maxWatchExpirationMs == maxWatchExpirationMs));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _VeilidConfigDHT&&(identical(other.resolveNodeTimeoutMs, resolveNodeTimeoutMs) || other.resolveNodeTimeoutMs == resolveNodeTimeoutMs)&&(identical(other.resolveNodeCount, resolveNodeCount) || other.resolveNodeCount == resolveNodeCount)&&(identical(other.resolveNodeFanout, resolveNodeFanout) || other.resolveNodeFanout == resolveNodeFanout)&&(identical(other.maxFindNodeCount, maxFindNodeCount) || other.maxFindNodeCount == maxFindNodeCount)&&(identical(other.getValueTimeoutMs, getValueTimeoutMs) || other.getValueTimeoutMs == getValueTimeoutMs)&&(identical(other.getValueCount, getValueCount) || other.getValueCount == getValueCount)&&(identical(other.getValueFanout, getValueFanout) || other.getValueFanout == getValueFanout)&&(identical(other.setValueTimeoutMs, setValueTimeoutMs) || other.setValueTimeoutMs == setValueTimeoutMs)&&(identical(other.setValueCount, setValueCount) || other.setValueCount == setValueCount)&&(identical(other.setValueFanout, setValueFanout) || other.setValueFanout == setValueFanout)&&(identical(other.consensusWidth, consensusWidth) || other.consensusWidth == consensusWidth)&&(identical(other.minPeerCount, minPeerCount) || other.minPeerCount == minPeerCount)&&(identical(other.minPeerRefreshTimeMs, minPeerRefreshTimeMs) || other.minPeerRefreshTimeMs == minPeerRefreshTimeMs)&&(identical(other.validateDialInfoReceiptTimeMs, validateDialInfoReceiptTimeMs) || other.validateDialInfoReceiptTimeMs == validateDialInfoReceiptTimeMs)&&(identical(other.localSubkeyCacheSize, localSubkeyCacheSize) || other.localSubkeyCacheSize == localSubkeyCacheSize)&&(identical(other.localMaxSubkeyCacheMemoryMb, localMaxSubkeyCacheMemoryMb) || other.localMaxSubkeyCacheMemoryMb == localMaxSubkeyCacheMemoryMb)&&(identical(other.remoteSubkeyCacheSize, remoteSubkeyCacheSize) || other.remoteSubkeyCacheSize == remoteSubkeyCacheSize)&&(identical(other.remoteMaxRecords, remoteMaxRecords) || other.remoteMaxRecords == remoteMaxRecords)&&(identical(other.remoteMaxSubkeyCacheMemoryMb, remoteMaxSubkeyCacheMemoryMb) || other.remoteMaxSubkeyCacheMemoryMb == remoteMaxSubkeyCacheMemoryMb)&&(identical(other.remoteMaxStorageSpaceMb, remoteMaxStorageSpaceMb) || other.remoteMaxStorageSpaceMb == remoteMaxStorageSpaceMb)&&(identical(other.publicWatchLimit, publicWatchLimit) || other.publicWatchLimit == publicWatchLimit)&&(identical(other.memberWatchLimit, memberWatchLimit) || other.memberWatchLimit == memberWatchLimit)&&(identical(other.maxWatchExpirationMs, maxWatchExpirationMs) || other.maxWatchExpirationMs == maxWatchExpirationMs));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,resolveNodeTimeoutMs,resolveNodeCount,resolveNodeFanout,maxFindNodeCount,getValueTimeoutMs,getValueCount,getValueFanout,setValueTimeoutMs,setValueCount,setValueFanout,minPeerCount,minPeerRefreshTimeMs,validateDialInfoReceiptTimeMs,localSubkeyCacheSize,localMaxSubkeyCacheMemoryMb,remoteSubkeyCacheSize,remoteMaxRecords,remoteMaxSubkeyCacheMemoryMb,remoteMaxStorageSpaceMb,publicWatchLimit,memberWatchLimit,maxWatchExpirationMs]);
int get hashCode => Object.hashAll([runtimeType,resolveNodeTimeoutMs,resolveNodeCount,resolveNodeFanout,maxFindNodeCount,getValueTimeoutMs,getValueCount,getValueFanout,setValueTimeoutMs,setValueCount,setValueFanout,consensusWidth,minPeerCount,minPeerRefreshTimeMs,validateDialInfoReceiptTimeMs,localSubkeyCacheSize,localMaxSubkeyCacheMemoryMb,remoteSubkeyCacheSize,remoteMaxRecords,remoteMaxSubkeyCacheMemoryMb,remoteMaxStorageSpaceMb,publicWatchLimit,memberWatchLimit,maxWatchExpirationMs]);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'VeilidConfigDHT(resolveNodeTimeoutMs: $resolveNodeTimeoutMs, resolveNodeCount: $resolveNodeCount, resolveNodeFanout: $resolveNodeFanout, maxFindNodeCount: $maxFindNodeCount, getValueTimeoutMs: $getValueTimeoutMs, getValueCount: $getValueCount, getValueFanout: $getValueFanout, setValueTimeoutMs: $setValueTimeoutMs, setValueCount: $setValueCount, setValueFanout: $setValueFanout, minPeerCount: $minPeerCount, minPeerRefreshTimeMs: $minPeerRefreshTimeMs, validateDialInfoReceiptTimeMs: $validateDialInfoReceiptTimeMs, localSubkeyCacheSize: $localSubkeyCacheSize, localMaxSubkeyCacheMemoryMb: $localMaxSubkeyCacheMemoryMb, remoteSubkeyCacheSize: $remoteSubkeyCacheSize, remoteMaxRecords: $remoteMaxRecords, remoteMaxSubkeyCacheMemoryMb: $remoteMaxSubkeyCacheMemoryMb, remoteMaxStorageSpaceMb: $remoteMaxStorageSpaceMb, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)';
return 'VeilidConfigDHT(resolveNodeTimeoutMs: $resolveNodeTimeoutMs, resolveNodeCount: $resolveNodeCount, resolveNodeFanout: $resolveNodeFanout, maxFindNodeCount: $maxFindNodeCount, getValueTimeoutMs: $getValueTimeoutMs, getValueCount: $getValueCount, getValueFanout: $getValueFanout, setValueTimeoutMs: $setValueTimeoutMs, setValueCount: $setValueCount, setValueFanout: $setValueFanout, consensusWidth: $consensusWidth, minPeerCount: $minPeerCount, minPeerRefreshTimeMs: $minPeerRefreshTimeMs, validateDialInfoReceiptTimeMs: $validateDialInfoReceiptTimeMs, localSubkeyCacheSize: $localSubkeyCacheSize, localMaxSubkeyCacheMemoryMb: $localMaxSubkeyCacheMemoryMb, remoteSubkeyCacheSize: $remoteSubkeyCacheSize, remoteMaxRecords: $remoteMaxRecords, remoteMaxSubkeyCacheMemoryMb: $remoteMaxSubkeyCacheMemoryMb, remoteMaxStorageSpaceMb: $remoteMaxStorageSpaceMb, publicWatchLimit: $publicWatchLimit, memberWatchLimit: $memberWatchLimit, maxWatchExpirationMs: $maxWatchExpirationMs)';
}
@ -6101,7 +6103,7 @@ abstract mixin class _$VeilidConfigDHTCopyWith<$Res> implements $VeilidConfigDHT
factory _$VeilidConfigDHTCopyWith(_VeilidConfigDHT value, $Res Function(_VeilidConfigDHT) _then) = __$VeilidConfigDHTCopyWithImpl;
@override @useResult
$Res call({
int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs
int resolveNodeTimeoutMs, int resolveNodeCount, int resolveNodeFanout, int maxFindNodeCount, int getValueTimeoutMs, int getValueCount, int getValueFanout, int setValueTimeoutMs, int setValueCount, int setValueFanout, int consensusWidth, int minPeerCount, int minPeerRefreshTimeMs, int validateDialInfoReceiptTimeMs, int localSubkeyCacheSize, int localMaxSubkeyCacheMemoryMb, int remoteSubkeyCacheSize, int remoteMaxRecords, int remoteMaxSubkeyCacheMemoryMb, int remoteMaxStorageSpaceMb, int publicWatchLimit, int memberWatchLimit, int maxWatchExpirationMs
});
@ -6118,7 +6120,7 @@ class __$VeilidConfigDHTCopyWithImpl<$Res>
/// Create a copy of VeilidConfigDHT
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? resolveNodeTimeoutMs = null,Object? resolveNodeCount = null,Object? resolveNodeFanout = null,Object? maxFindNodeCount = null,Object? getValueTimeoutMs = null,Object? getValueCount = null,Object? getValueFanout = null,Object? setValueTimeoutMs = null,Object? setValueCount = null,Object? setValueFanout = null,Object? minPeerCount = null,Object? minPeerRefreshTimeMs = null,Object? validateDialInfoReceiptTimeMs = null,Object? localSubkeyCacheSize = null,Object? localMaxSubkeyCacheMemoryMb = null,Object? remoteSubkeyCacheSize = null,Object? remoteMaxRecords = null,Object? remoteMaxSubkeyCacheMemoryMb = null,Object? remoteMaxStorageSpaceMb = null,Object? publicWatchLimit = null,Object? memberWatchLimit = null,Object? maxWatchExpirationMs = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? resolveNodeTimeoutMs = null,Object? resolveNodeCount = null,Object? resolveNodeFanout = null,Object? maxFindNodeCount = null,Object? getValueTimeoutMs = null,Object? getValueCount = null,Object? getValueFanout = null,Object? setValueTimeoutMs = null,Object? setValueCount = null,Object? setValueFanout = null,Object? consensusWidth = null,Object? minPeerCount = null,Object? minPeerRefreshTimeMs = null,Object? validateDialInfoReceiptTimeMs = null,Object? localSubkeyCacheSize = null,Object? localMaxSubkeyCacheMemoryMb = null,Object? remoteSubkeyCacheSize = null,Object? remoteMaxRecords = null,Object? remoteMaxSubkeyCacheMemoryMb = null,Object? remoteMaxStorageSpaceMb = null,Object? publicWatchLimit = null,Object? memberWatchLimit = null,Object? maxWatchExpirationMs = null,}) {
return _then(_VeilidConfigDHT(
resolveNodeTimeoutMs: null == resolveNodeTimeoutMs ? _self.resolveNodeTimeoutMs : resolveNodeTimeoutMs // ignore: cast_nullable_to_non_nullable
as int,resolveNodeCount: null == resolveNodeCount ? _self.resolveNodeCount : resolveNodeCount // ignore: cast_nullable_to_non_nullable
@ -6130,6 +6132,7 @@ as int,getValueFanout: null == getValueFanout ? _self.getValueFanout : getValueF
as int,setValueTimeoutMs: null == setValueTimeoutMs ? _self.setValueTimeoutMs : setValueTimeoutMs // ignore: cast_nullable_to_non_nullable
as int,setValueCount: null == setValueCount ? _self.setValueCount : setValueCount // ignore: cast_nullable_to_non_nullable
as int,setValueFanout: null == setValueFanout ? _self.setValueFanout : setValueFanout // ignore: cast_nullable_to_non_nullable
as int,consensusWidth: null == consensusWidth ? _self.consensusWidth : consensusWidth // ignore: cast_nullable_to_non_nullable
as int,minPeerCount: null == minPeerCount ? _self.minPeerCount : minPeerCount // ignore: cast_nullable_to_non_nullable
as int,minPeerRefreshTimeMs: null == minPeerRefreshTimeMs ? _self.minPeerRefreshTimeMs : minPeerRefreshTimeMs // ignore: cast_nullable_to_non_nullable
as int,validateDialInfoReceiptTimeMs: null == validateDialInfoReceiptTimeMs ? _self.validateDialInfoReceiptTimeMs : validateDialInfoReceiptTimeMs // ignore: cast_nullable_to_non_nullable

View file

@ -345,6 +345,7 @@ _VeilidConfigDHT _$VeilidConfigDHTFromJson(Map<String, dynamic> json) =>
setValueTimeoutMs: (json['set_value_timeout_ms'] as num).toInt(),
setValueCount: (json['set_value_count'] as num).toInt(),
setValueFanout: (json['set_value_fanout'] as num).toInt(),
consensusWidth: (json['consensus_width'] as num).toInt(),
minPeerCount: (json['min_peer_count'] as num).toInt(),
minPeerRefreshTimeMs: (json['min_peer_refresh_time_ms'] as num).toInt(),
validateDialInfoReceiptTimeMs:
@ -376,6 +377,7 @@ Map<String, dynamic> _$VeilidConfigDHTToJson(
'set_value_timeout_ms': instance.setValueTimeoutMs,
'set_value_count': instance.setValueCount,
'set_value_fanout': instance.setValueFanout,
'consensus_width': instance.consensusWidth,
'min_peer_count': instance.minPeerCount,
'min_peer_refresh_time_ms': instance.minPeerRefreshTimeMs,
'validate_dial_info_receipt_time_ms': instance.validateDialInfoReceiptTimeMs,

View file

@ -102,6 +102,7 @@ class VeilidConfigDHT(ConfigBase):
set_value_timeout_ms: int
set_value_count: int
set_value_fanout: int
consensus_width: int
min_peer_count: int
min_peer_refresh_time_ms: int
validate_dial_info_receipt_time_ms: int

View file

@ -4064,6 +4064,11 @@
"description": "Configure the Distributed Hash Table (DHT).\nDefaults should be used here unless you are absolutely sure you know what you're doing.\nIf you change the count/fanout/timeout parameters, you may render your node inoperable\nfor correct DHT operations.",
"type": "object",
"properties": {
"consensus_width": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"get_value_count": {
"type": "integer",
"format": "uint32",
@ -4186,6 +4191,7 @@
"set_value_timeout_ms",
"set_value_count",
"set_value_fanout",
"consensus_width",
"min_peer_count",
"min_peer_refresh_time_ms",
"validate_dial_info_receipt_time_ms",

View file

@ -167,6 +167,7 @@ core:
set_value_timeout_ms: 10000
set_value_count: 5
set_value_fanout: 4
consensus_width: 10
min_peer_count: 20
min_peer_refresh_time_ms: 60000
validate_dial_info_receipt_time_ms: 2000
@ -684,6 +685,7 @@ pub struct Dht {
pub set_value_timeout_ms: u32,
pub set_value_count: u32,
pub set_value_fanout: u32,
pub consensus_width: u32,
pub min_peer_count: u32,
pub min_peer_refresh_time_ms: u32,
pub validate_dial_info_receipt_time_ms: u32,
@ -1326,6 +1328,7 @@ impl Settings {
set_config_value!(inner.core.network.dht.set_value_timeout_ms, value);
set_config_value!(inner.core.network.dht.set_value_count, value);
set_config_value!(inner.core.network.dht.set_value_fanout, value);
set_config_value!(inner.core.network.dht.consensus_width, value);
set_config_value!(inner.core.network.dht.min_peer_count, value);
set_config_value!(inner.core.network.dht.min_peer_refresh_time_ms, value);
set_config_value!(
@ -1511,6 +1514,7 @@ impl Settings {
set_value_timeout_ms: inner.core.network.dht.set_value_timeout_ms,
set_value_count: inner.core.network.dht.set_value_count,
set_value_fanout: inner.core.network.dht.set_value_fanout,
consensus_width: inner.core.network.dht.consensus_width,
min_peer_count: inner.core.network.dht.min_peer_count,
min_peer_refresh_time_ms: inner.core.network.dht.min_peer_refresh_time_ms,
validate_dial_info_receipt_time_ms: inner
@ -1895,6 +1899,7 @@ mod tests {
assert_eq!(s.core.network.dht.set_value_timeout_ms, 10_000u32);
assert_eq!(s.core.network.dht.set_value_count, 5u32);
assert_eq!(s.core.network.dht.set_value_fanout, 4u32);
assert_eq!(s.core.network.dht.consensus_width, 10u32);
assert_eq!(s.core.network.dht.min_peer_count, 20u32);
assert_eq!(s.core.network.dht.min_peer_refresh_time_ms, 60_000u32);
assert_eq!(

View file

@ -137,7 +137,7 @@ rand_chacha = { version = "0.3.1", optional = true }
# Dependencies for WASM builds only
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
wasm-bindgen = "0.2.100"
wasm-bindgen = "0.2.101"
js-sys = "0.3.77"
wasm-bindgen-futures = "0.4.50"
async_executors = { version = "0.7.0", default-features = false }
@ -192,7 +192,7 @@ veilid-tracing-wasm = "^0"
### BUILD OPTIONS
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-mutable-globals"]
wasm-opt = ["-O"]
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
dwarf-debug-info = true

View file

@ -35,7 +35,7 @@ tracing = { version = "^0", features = ["log", "attributes"] }
veilid-tracing-wasm = "^0"
tracing-subscriber = "^0"
wasm-bindgen = { version = "^0", features = ["serde-serialize"] }
wasm-bindgen = { version = "0.2.101", features = ["serde-serialize"] }
console_error_panic_hook = "^0"
cfg-if = "^1"
wasm-bindgen-futures = "^0"

View file

@ -17,7 +17,7 @@ if [[ "$1" == "release" ]]; then
./wasm_remap_paths.sh cargo build --target wasm32-unknown-unknown --release --no-default-features --features=default-dart
mkdir -p $OUTPUTDIR
wasm-bindgen --out-dir $OUTPUTDIR --target web --weak-refs $INPUTDIR/veilid_wasm.wasm
wasm-opt -O --enable-mutable-globals $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.optimized
wasm-opt -O $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.optimized
mv $OUTPUTDIR/veilid_wasm_bg.wasm.optimized $OUTPUTDIR/veilid_wasm_bg.wasm
else
OUTPUTDIR=$SCRIPTDIR/../target/wasm32-unknown-unknown/debug/pkg