Add durable primitive life owner lookup
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (checks) (push) Failing after 40s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (postgres) (push) Failing after 53s
Foundation / checks (tsan) (push) Failing after 33s
Foundation / checks (network) (push) Failing after 3m1s
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 3m53s

This commit is contained in:
dingo
2026-10-11 01:28:24 -04:00
parent 505c424750
commit 636740bc55
10 changed files with 198 additions and 58 deletions
+36 -28
View File
@@ -189,6 +189,7 @@ void upgrade_across_migration_and_barrier() {
" -v migration_sha_21=$(s 0021_cellular_trace_and_recovery.sql)"
" -v migration_sha_22=$(s 0022_cellular_birth_trace_bound.sql)"
" -v migration_sha_23=$(s 0023_cellular_birth_publication.sql)"
" -v migration_sha_24=$(s 0024_primitive_life_owner_lookup.sql)"
" -v runtime_role=evo_runtime_test -f migrations/apply.sql"
" > /dev/null 2>&1") != 0);
CHECK(history(*owner_db) == "1,2,3,4,5,6,7");
@@ -204,32 +205,41 @@ void upgrade_across_migration_and_barrier() {
CHECK(shell("PGDATABASE=" + database +
" EVO_PG_RUNTIME_ROLE=evo_runtime_test bash \"$EVO_SOURCE_ROOT/"
"tools/migrate-postgres.sh\" > /dev/null") == 0);
CHECK(history(*owner_db) ==
"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23");
CHECK(history(*owner_db) == "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24");
CHECK(scalar(*owner_db,
"SELECT (to_regprocedure('evolution.primitive_life_owner("
"evolution.u64,evolution.u64,uuid,evolution.u64,uuid)') IS NOT NULL)::text") ==
"true");
CHECK(scalar(*owner_db, "SELECT has_function_privilege('evo_runtime_login', "
"'evolution.primitive_life_owner(evolution.u64,evolution.u64,uuid,"
"evolution.u64,uuid)', 'EXECUTE')::text") == "true");
CHECK(scalar(*owner_db, "SELECT has_table_privilege('evo_runtime_login', "
"'evolution.life_reservations', 'SELECT')::text") == "false");
CHECK(scalar(*owner_db, "SELECT count(*) FROM information_schema.columns WHERE "
"table_schema = 'evolution' AND table_name = 'region_actions' AND "
"column_name IN ('input_bytes', 'result')") == "2");
CHECK(scalar(*owner_db,
"SELECT (to_regprocedure('evolution.find_region_action_record("
"evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64)') "
"IS NOT NULL)::text") == "true");
CHECK(scalar(*owner_db,
"SELECT evolution.valid_cellular_action_input(decode('01' || "
"repeat('00', 23), 'hex'), 1)::text") == "true");
CHECK(scalar(*owner_db,
"SELECT evolution.valid_cellular_action_input(decode(repeat('00', 24), "
"'hex'), 1)::text") == "false");
CHECK(scalar(*owner_db, "SELECT (to_regprocedure('evolution.find_region_action_record("
"evolution.u64,evolution.u64,uuid,evolution.u64,uuid,evolution.u64)') "
"IS NOT NULL)::text") == "true");
CHECK(scalar(*owner_db, "SELECT evolution.valid_cellular_action_input(decode('01' || "
"repeat('00', 23), 'hex'), 1)::text") == "true");
CHECK(scalar(*owner_db, "SELECT evolution.valid_cellular_action_input(decode(repeat('00', 24), "
"'hex'), 1)::text") == "false");
CHECK(scalar(*owner_db,
"SELECT evolution.check_cellular_action_block(decode(repeat('01', 16) || "
"'0100000000000000' || '0100000000000000' || repeat('00', 16), 'hex'), "
"0, 1)::text") == "1");
CHECK(scalar(*owner_db,
"SELECT (to_regprocedure('evolution.publish_cellular_checkpoint(bytea,bytea,bytea,bytea)') "
"IS NOT NULL)::text") == "true");
CHECK(scalar(*owner_db,
"SELECT has_function_privilege('evo_runtime_login', "
"'evolution.publish_cellular_checkpoint(bytea,bytea,bytea,bytea)', 'EXECUTE')::text") ==
"true");
CHECK(
scalar(*owner_db,
"SELECT "
"(to_regprocedure('evolution.publish_cellular_checkpoint(bytea,bytea,bytea,bytea)') "
"IS NOT NULL)::text") == "true");
CHECK(
scalar(
*owner_db,
"SELECT has_function_privilege('evo_runtime_login', "
"'evolution.publish_cellular_checkpoint(bytea,bytea,bytea,bytea)', 'EXECUTE')::text") ==
"true");
CHECK(scalar(*owner_db,
"SELECT has_function_privilege('evo_runtime_login', "
"'evolution.publish_cellular_checkpoint(bytea,bytea,bytea)', 'EXECUTE')::text") ==
@@ -242,9 +252,8 @@ void upgrade_across_migration_and_barrier() {
"SELECT has_function_privilege('evo_runtime_login', "
"'evolution.resolve_cellular_region_commit(evolution.u64,evolution.u64,uuid,"
"bytea,bytea,bytea,bytea)', 'EXECUTE')::text") == "true");
CHECK(scalar(*owner_db,
"SELECT has_table_privilege('evo_runtime_login', "
"'evolution.cellular_publications', 'INSERT')::text") == "false");
CHECK(scalar(*owner_db, "SELECT has_table_privilege('evo_runtime_login', "
"'evolution.cellular_publications', 'INSERT')::text") == "false");
CHECK(scalar(*owner_db,
"SELECT has_function_privilege('evo_runtime_login', "
"'evolution.publish_region_checkpoint_core(bytea,bytea)', 'EXECUTE')::text") ==
@@ -544,16 +553,15 @@ void concurrent_authority_and_classification() {
" EVO_PG_RUNTIME_ROLE=evo_runtime_test bash \"$EVO_SOURCE_ROOT/"
"tools/migrate-postgres.sh\" > /dev/null") == 0);
auto owner_db = connect_to(database, env("PGUSER"));
auto cellular = genesis_manifest({7, 90}, 9, filled<16>(0x70), 50000, digest_of(0xC4),
100, filled<32>(0xA9),
CheckpointProfile::cellular_lives_v1);
auto cellular = genesis_manifest({7, 90}, 9, filled<16>(0x70), 50000, digest_of(0xC4), 100,
filled<32>(0xA9), CheckpointProfile::cellular_lives_v1);
CHECK(cellular);
const auto cellular_bytes = encode_manifest(*cellular);
CHECK(cellular_bytes);
const std::array cellular_parameter{bytea_of(*cellular_bytes)};
const auto parsed_cellular = owner_db->query(
"SELECT (evolution.parse_checkpoint_manifest($1::bytea)).profile::text",
cellular_parameter, 5s);
const auto parsed_cellular =
owner_db->query("SELECT (evolution.parse_checkpoint_manifest($1::bytea)).profile::text",
cellular_parameter, 5s);
CHECK(parsed_cellular && parsed_cellular->size() == 1 &&
(*parsed_cellular)[0][0].value_or("") == "4");
auto wrong_cellular_versions = *cellular;