mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-26 07:49:22 -05:00
use Reliable and PreferOrdered by default for private routes
This commit is contained in:
parent
f69b4cb40d
commit
071d294a70
@ -234,8 +234,8 @@ impl VeilidAPI {
|
|||||||
pub async fn new_private_route(&self) -> VeilidAPIResult<(RouteId, Vec<u8>)> {
|
pub async fn new_private_route(&self) -> VeilidAPIResult<(RouteId, Vec<u8>)> {
|
||||||
self.new_custom_private_route(
|
self.new_custom_private_route(
|
||||||
&VALID_CRYPTO_KINDS,
|
&VALID_CRYPTO_KINDS,
|
||||||
Stability::default(),
|
Stability::Reliable,
|
||||||
Sequencing::default(),
|
Sequencing::PreferOrdered,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ impl RoutingContext {
|
|||||||
preferred_route: None,
|
preferred_route: None,
|
||||||
hop_count: c.network.rpc.default_route_hop_count as usize,
|
hop_count: c.network.rpc.default_route_hop_count as usize,
|
||||||
stability: Stability::default(),
|
stability: Stability::default(),
|
||||||
sequencing: Sequencing::default(),
|
sequencing: Sequencing::PreferOrdered,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
@ -61,7 +61,7 @@ impl RoutingContext {
|
|||||||
///
|
///
|
||||||
/// * Hop count default is dependent on config, but is set to 1 extra hop.
|
/// * Hop count default is dependent on config, but is set to 1 extra hop.
|
||||||
/// * Stability default is to choose 'low latency' routes, preferring them over long-term reliability.
|
/// * Stability default is to choose 'low latency' routes, preferring them over long-term reliability.
|
||||||
/// * Sequencing default is to have no preference for ordered vs unordered message delivery
|
/// * Sequencing default is to prefer ordered before unordered message delivery
|
||||||
///
|
///
|
||||||
/// To customize the safety selection in use, use [RoutingContext::with_safety()].
|
/// To customize the safety selection in use, use [RoutingContext::with_safety()].
|
||||||
pub fn with_default_safety(self) -> VeilidAPIResult<Self> {
|
pub fn with_default_safety(self) -> VeilidAPIResult<Self> {
|
||||||
@ -72,7 +72,7 @@ impl RoutingContext {
|
|||||||
preferred_route: None,
|
preferred_route: None,
|
||||||
hop_count: c.network.rpc.default_route_hop_count as usize,
|
hop_count: c.network.rpc.default_route_hop_count as usize,
|
||||||
stability: Stability::default(),
|
stability: Stability::default(),
|
||||||
sequencing: Sequencing::default(),
|
sequencing: Sequencing::PreferOrdered,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +104,8 @@ async def test_routing_context_app_call_loopback():
|
|||||||
# purge routes to ensure we start fresh
|
# purge routes to ensure we start fresh
|
||||||
await api.debug("purge routes")
|
await api.debug("purge routes")
|
||||||
|
|
||||||
# make a routing context that uses a safety route
|
# make a routing context
|
||||||
rc = await (await api.new_routing_context()).with_sequencing(
|
rc = await api.new_routing_context()
|
||||||
veilid.Sequencing.ENSURE_ORDERED
|
|
||||||
)
|
|
||||||
async with rc:
|
async with rc:
|
||||||
# make a new local private route
|
# make a new local private route
|
||||||
prl, blob = await api.new_private_route()
|
prl, blob = await api.new_private_route()
|
||||||
@ -160,15 +158,10 @@ async def test_routing_context_app_message_loopback_big_packets():
|
|||||||
await api.debug("purge routes")
|
await api.debug("purge routes")
|
||||||
|
|
||||||
# make a routing context that uses a safety route
|
# make a routing context that uses a safety route
|
||||||
rc = await (await api.new_routing_context()).with_sequencing(
|
rc = await api.new_routing_context()
|
||||||
veilid.Sequencing.ENSURE_ORDERED
|
|
||||||
)
|
|
||||||
async with rc:
|
async with rc:
|
||||||
# make a new local private route
|
# make a new local private route
|
||||||
prl, blob = await api.new_custom_private_route(
|
prl, blob = await api.new_private_route()
|
||||||
[veilid.CryptoKind.CRYPTO_KIND_VLD0],
|
|
||||||
veilid.Stability.RELIABLE,
|
|
||||||
veilid.Sequencing.ENSURE_ORDERED)
|
|
||||||
|
|
||||||
# import it as a remote route as well so we can send to it
|
# import it as a remote route as well so we can send to it
|
||||||
prr = await api.import_remote_private_route(blob)
|
prr = await api.import_remote_private_route(blob)
|
||||||
@ -269,8 +262,6 @@ async def test_routing_context_app_message_loopback_bandwidth():
|
|||||||
await api.debug("purge routes")
|
await api.debug("purge routes")
|
||||||
|
|
||||||
# make a routing context that uses a safety route
|
# make a routing context that uses a safety route
|
||||||
# rc = await (await api.new_routing_context()).with_sequencing(veilid.Sequencing.ENSURE_ORDERED)
|
|
||||||
# rc = await api.new_routing_context()
|
|
||||||
rc = await api.new_routing_context()
|
rc = await api.new_routing_context()
|
||||||
async with rc:
|
async with rc:
|
||||||
# make a new local private route
|
# make a new local private route
|
||||||
|
Loading…
Reference in New Issue
Block a user