Route cellular logins to existing life owners
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 2m1s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 22s
Foundation / checks (network) (push) Canceled after 1m58s
Foundation / checks (client) (push) Canceled after 2m39s

This commit is contained in:
dingo
2026-10-11 01:32:14 -04:00
parent 636740bc55
commit a6b1c62168
11 changed files with 273 additions and 106 deletions
+30 -1
View File
@@ -63,10 +63,14 @@ struct M10Options {
// neighbours "REGION=X0,Y0,X1,Y1=HOST:PORT=SERVER_NAME=PUBLIC_KEY_FILE".
std::string area, handoff_key;
std::vector<std::string> neighbours;
// M11 owner routing, independent of --m10-neighbour:
// REGION=HOST:PORT=TLS_NAME, one entry per region in the world.
std::vector<std::string> life_routes;
[[nodiscard]] bool any() const noexcept {
return !listen.empty() || !certificate.empty() || !key.empty() || !issuer.empty() ||
!environment.empty() || !session_window.empty() || max_grant_lifetime != 0 ||
!area.empty() || !handoff_key.empty() || !neighbours.empty() || !load_governor;
!area.empty() || !handoff_key.empty() || !neighbours.empty() ||
!life_routes.empty() || !load_governor;
}
[[nodiscard]] bool complete() const noexcept {
return !listen.empty() && !certificate.empty() && !key.empty() && !issuer.empty() &&
@@ -80,6 +84,27 @@ inline constexpr std::uint64_t m10_carry_ahead_ticks = 8;
inline constexpr std::size_t m10_max_sessions = 2000;
#ifdef EVO_SERVER_M10
inline std::optional<std::vector<server::LifeOwnerRoute>>
parse_life_owner_routes(const M10Options& options) {
std::vector<server::LifeOwnerRoute> routes;
routes.reserve(options.life_routes.size());
for (const auto& item : options.life_routes) {
const auto first = item.find('=');
const auto second =
first == std::string::npos ? std::string::npos : item.find('=', first + 1);
if (first == std::string::npos || second == std::string::npos ||
item.find('=', second + 1) != std::string::npos)
return std::nullopt;
std::uint64_t region{};
const auto [end, error] = std::from_chars(item.data(), item.data() + first, region);
if (error != std::errc{} || end != item.data() + first || region == 0)
return std::nullopt;
routes.push_back({network::RegionAddress{region, item.substr(first + 1, second - first - 1),
item.substr(second + 1)}});
}
return routes;
}
inline constexpr bool m10_available = true;
template <typename Host> class M10Bridge {
public:
@@ -185,6 +210,10 @@ template <typename Host> class M10Bridge {
config.handoff = bridge.handoff_.get();
std::printf("m10 handoff neighbours=%zu\n", config.neighbours.size());
}
const auto life_routes = parse_life_owner_routes(o);
if (!life_routes)
return fail("error m10-life-routes");
config.life_owner_routes = *life_routes;
auto sessions = server::RegionSessions::create(std::move(config));
if (!sessions)
return fail(sessions.error() == server::RegionSessionsError::keys ? "error m10-issuer"