Add cellular mutation action protocol v10
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m52s
Foundation / checks (checks) (push) Failing after 4m1s
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 (client) (push) Canceled after 11m9s
Foundation / checks (network) (push) Canceled after 9m18s
Foundation / checks (postgres) (push) Canceled after 7m18s

This commit is contained in:
dingo
2026-10-11 06:57:22 -04:00
parent 50b6e25c0c
commit 9da2bd37dd
6 changed files with 161 additions and 29 deletions
+15 -3
View File
@@ -15,7 +15,7 @@
// simulated watermark travel as QUIC DATAGRAMs.
// Each starts with an 8-byte header: magic "EVSN", version u16, type u8, flags u8 (0);
// every payload has a fixed size and explicit little-endian fields. Grants are opaque
// 160-byte credentials here. Later M10 segments add message types under a new version.
// 160-byte credentials here. Later M10/M11 segments add message types under new versions.
namespace evo::network {
inline constexpr std::uint32_t session_magic = 0x4E535645; // Bytes "EVSN".
// v2 (M10.5, ADR-0093): v1 plus interest, snapshot chunks and snapshot acks.
@@ -32,6 +32,9 @@ inline constexpr std::uint16_t session_protocol_v7 = 7;
inline constexpr std::uint16_t session_protocol_v8 = 8;
// v9 adds owner-only current reserve and last committed tick effects to the v8 view.
inline constexpr std::uint16_t session_protocol_v9 = 9;
// v10 adds a reliable owner choice for a previously earned cellular mutation offer.
// Its durable effect is committed on the next cellular tick.
inline constexpr std::uint16_t session_protocol_v10 = 10;
inline constexpr std::size_t max_cellular_perceived_patches = 256;
inline constexpr std::size_t session_address_bytes = 64; // Endpoint or server name field.
inline constexpr std::size_t session_datagram_bytes = 1200; // Whole message, ADR-0089.
@@ -62,7 +65,8 @@ enum class SessionMessageType : std::uint8_t {
primitive_life_query,
cellular_intention = 22,
cellular_action = 23,
cellular_perception = 24
cellular_perception = 24,
cellular_mutation_action = 25
};
// Admission answers for intentions and actions (wire 0..10).
enum class AdmitStatus : std::uint8_t {
@@ -178,6 +182,14 @@ struct CellularAction {
std::uint32_t intake_x_um{}, intake_y_um{};
friend bool operator==(const CellularAction&, const CellularAction&) = default;
};
// v10 reliable choice. The server binds these values to the authenticated account and
// action id, revalidates the exact outstanding offer, and reserves successor identity.
struct CellularMutationAction {
std::uint64_t session{}, epoch{}, action_id{}, tick{};
std::uint64_t life_identity{}, event_index{}, offer_tick{};
std::uint16_t operator_id{};
friend bool operator==(const CellularMutationAction&, const CellularMutationAction&) = default;
};
// v8 server-to-owner view. Addresses and current inventory are already filtered by
// authoritative cell position/range; provenance and account identity are omitted.
struct CellularPerceivedPatch {
@@ -334,7 +346,7 @@ using SessionMessage =
SimulatedThrough, SessionAction, ActionReceipt, ActionOutcome, ActionQuery,
SessionInterest, SnapshotChunk, SnapshotAck, HandoffOffer, SessionRedirect,
PrimitiveLifeRequest, PrimitiveLifeReceipt, PrimitiveLifeOutcome,
PrimitiveLifeQuery, CellularPerception>;
PrimitiveLifeQuery, CellularPerception, CellularMutationAction>;
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message);
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message,