Add M10.8c-2 client handoff switch and evo-server handoff configuration
Foundation / checks (deploy) (push) Successful in 3m20s
Foundation / checks (ecs) (push) Successful in 2m0s
Foundation / checks (client) (push) Failing after 12m9s
Foundation / checks (network) (push) Successful in 13m2s
Foundation / checks (tsan) (push) Successful in 8m7s
Foundation / checks (checks) (push) Successful in 32m1s
Foundation / checks (postgres) (push) Successful in 42m43s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Foundation / checks (deploy) (push) Successful in 3m20s
Foundation / checks (ecs) (push) Successful in 2m0s
Foundation / checks (client) (push) Failing after 12m9s
Foundation / checks (network) (push) Successful in 13m2s
Foundation / checks (tsan) (push) Successful in 8m7s
Foundation / checks (checks) (push) Successful in 32m1s
Foundation / checks (postgres) (push) Successful in 42m43s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
ADR-0096. The engineering client follows a HandoffOffer into the next region with its ticket (no grant, no pause, the view kept) and a Redirect to the probe's owner, picking grants by region claim in rising serial order. evo-server gains --m10-area, --m10-handoff-key and --m10-neighbour (dev only), wiring the PostgreSQL probe and handoff ledgers; the probe tool writes multi-region bundles and reports handoffs and redirects. Refreshes the dev session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
// account supersedes an earlier one without bookkeeping. The file is created new and
|
||||
// owner-only (a credential: never commit or share it); the issuer key stays here.
|
||||
// The region refuses grants longer than its --m10-max-grant-lifetime (default 300).
|
||||
// M10.8c (ADR-0096): --region may repeat; COUNT grants are written per region,
|
||||
// interleaved in serial order, so a client crossing between regions always has a newer
|
||||
// serial for the next one (serials must rise world-wide). A handoff key is a key pair
|
||||
// from `keys` (issuer.key for --m10-handoff-key, issuer.pub for --m10-neighbour).
|
||||
// evo-session-probe run --connect HOST:PORT --server-name NAME --ca FILE --issuer-key FILE
|
||||
// --world N --frame N --region N --account HEX32 --serial N [--lifetime S]
|
||||
// [--intents N] [--actions N --action-base ID] [--query ID]... [--timeout-ms N]
|
||||
@@ -25,6 +29,7 @@
|
||||
// --snapshots N waits for N; --interest asks for another focus than the default)
|
||||
// marker TICK X Y APPLIED (the session's own probe marker in each new snapshot: um
|
||||
// position after TICK and the newest applied intention sequence; ADR-0094)
|
||||
// handoff REGION ENDPOINT | redirect REGION ENDPOINT (v4, ADR-0096; then closed)
|
||||
// closed REASON TRANSPORT (TRANSPORT names why QUIC ended: untrusted means the server
|
||||
// answered but failed the pinned CA/name check; idle means nothing answered)
|
||||
// Statuses, results and reasons are the session-v1 wire values. Exits 0 once every
|
||||
@@ -162,6 +167,7 @@ struct RunOptions {
|
||||
action_base{1}, timeout_ms{20000};
|
||||
std::optional<AccountId> account;
|
||||
std::vector<std::uint64_t> queries;
|
||||
std::vector<std::uint64_t> more_regions; // grants: further --region values.
|
||||
std::optional<SessionInterest> interest;
|
||||
std::uint64_t snapshots{};
|
||||
};
|
||||
@@ -202,20 +208,29 @@ int grants(const RunOptions& o, const std::string& out, std::uint64_t count) {
|
||||
GrantClaims claims;
|
||||
claims.account = *o.account;
|
||||
claims.world = {o.world, o.frame};
|
||||
claims.region = o.region;
|
||||
claims.issued_at = now_seconds();
|
||||
claims.expires_at = claims.issued_at + o.lifetime;
|
||||
const auto first = o.serial != 0 ? o.serial : claims.issued_at * 64;
|
||||
std::vector<std::uint8_t> bundle;
|
||||
for (std::uint64_t i = 0; i < count; ++i) {
|
||||
claims.serial = first + i;
|
||||
const auto grant = sign(*key, claims);
|
||||
if (!grant) {
|
||||
std::puts("error grant");
|
||||
return 2;
|
||||
}
|
||||
bundle.insert(bundle.end(), grant->begin(), grant->end());
|
||||
std::vector<std::uint64_t> regions{o.region};
|
||||
regions.insert(regions.end(), o.more_regions.begin(), o.more_regions.end());
|
||||
if (count * regions.size() > 64) {
|
||||
std::puts("error count (at most 64 grants in all)");
|
||||
return 2;
|
||||
}
|
||||
std::vector<std::uint8_t> bundle;
|
||||
std::uint64_t serial = first;
|
||||
for (std::uint64_t i = 0; i < count; ++i)
|
||||
for (const auto region : regions) {
|
||||
claims.region = region;
|
||||
claims.serial = serial++;
|
||||
const auto grant = sign(*key, claims);
|
||||
if (!grant) {
|
||||
std::puts("error grant");
|
||||
return 2;
|
||||
}
|
||||
bundle.insert(bundle.end(), grant->begin(), grant->end());
|
||||
}
|
||||
count *= regions.size();
|
||||
if (!write_new(out, bundle)) {
|
||||
std::puts("error out (exists or unwritable)");
|
||||
return 1;
|
||||
@@ -277,6 +292,13 @@ int run(const RunOptions& o) {
|
||||
while (Clock::now() < deadline) {
|
||||
c.poll(Clock::now());
|
||||
if (c.state() == client::RegionSessionState::closed) {
|
||||
if (const auto offer = c.take_handoff())
|
||||
std::printf("handoff %llu %s\n",
|
||||
static_cast<unsigned long long>(offer->destination.region),
|
||||
offer->destination.endpoint.c_str());
|
||||
if (const auto& to = c.redirect())
|
||||
std::printf("redirect %llu %s\n", static_cast<unsigned long long>(to->region),
|
||||
to->endpoint.c_str());
|
||||
std::printf("closed %u %s\n",
|
||||
static_cast<unsigned>(
|
||||
c.close_reason().value_or(SessionCloseReason::connection_lost)),
|
||||
@@ -410,6 +432,8 @@ int main(int argc, char** argv) {
|
||||
o.world = *n;
|
||||
else if (n && flag == "--frame")
|
||||
o.frame = *n;
|
||||
else if (n && *n != 0 && flag == "--region" && bundle && o.region != 0)
|
||||
o.more_regions.push_back(*n);
|
||||
else if (n && flag == "--region")
|
||||
o.region = *n;
|
||||
else if (n && flag == "--serial")
|
||||
|
||||
Reference in New Issue
Block a user