mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
vere: effectively removes single-homing from the serf
but leaves the IPC protocol structures as they were
This commit is contained in:
parent
9c82eadd11
commit
d1b655c5c9
@ -13,8 +13,8 @@
|
||||
u3_noun wen; // current time, as text
|
||||
u3_noun sev_l; // instance number
|
||||
u3_noun sen; // instance string
|
||||
u3_noun our; // identity
|
||||
u3_noun fak; // c3y is fake
|
||||
u3_noun our; // identity XX Remove
|
||||
u3_noun fak; // c3y is fake XX Remove
|
||||
u3_noun roc; // kernel core
|
||||
} u3v_arvo;
|
||||
|
||||
|
@ -1659,8 +1659,6 @@ u3m_boot(c3_c* dir_c)
|
||||
/* Basic initialization.
|
||||
*/
|
||||
memset(u3A, 0, sizeof(*u3A));
|
||||
u3A->our = u3_none;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -1692,8 +1690,6 @@ u3m_boot_lite(void)
|
||||
/* Basic initialization.
|
||||
*/
|
||||
memset(u3A, 0, sizeof(*u3A));
|
||||
u3A->our = u3_none;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -254,25 +254,11 @@ _pier_db_load_commits(u3_pier* pir_u,
|
||||
c3_d lav_d,
|
||||
c3_d len_d)
|
||||
{
|
||||
if (lav_d == 1) {
|
||||
// We are restarting from event 1. That means we need to set the ship from
|
||||
// the log identity information.
|
||||
u3_noun who, fak, len;
|
||||
c3_o ret = u3_lmdb_read_identity(pir_u->log_u->db_u,
|
||||
&who,
|
||||
&fak,
|
||||
&len);
|
||||
if (ret == c3n) {
|
||||
u3l_log("Failed to load identity for replay. Exiting...");
|
||||
u3_pier_bail();
|
||||
}
|
||||
|
||||
_pier_boot_set_ship(pir_u, u3k(who), u3k(fak));
|
||||
pir_u->lif_d = u3r_chub(0, len);
|
||||
|
||||
u3z(who);
|
||||
u3z(fak);
|
||||
u3z(len);
|
||||
if ( 1ULL == lav_d ) {
|
||||
// We are replaying the entire event log, and must
|
||||
// read the header to ensure that our %boot msg is correct.
|
||||
//
|
||||
_pier_db_read_header(pir_u);
|
||||
}
|
||||
|
||||
c3_o ret = u3_lmdb_read_events(pir_u,
|
||||
@ -910,37 +896,30 @@ _pier_work_poke(void* vod_p,
|
||||
|
||||
// the worker process starts with a %play task,
|
||||
// which tells us where to start playback
|
||||
// (and who we are, if it knows) XX remove in favor of event-log header
|
||||
//
|
||||
// XX [our fak] ignored. Remove
|
||||
//
|
||||
case c3__play: {
|
||||
c3_d lav_d;
|
||||
c3_l mug_l;
|
||||
|
||||
if ( (c3n == u3r_qual(u3t(jar), 0, &p_jar, &q_jar, &r_jar)) ||
|
||||
(c3n == u3ud(p_jar)) ||
|
||||
(u3r_met(6, p_jar) != 1) ||
|
||||
(c3n == u3ud(q_jar)) ||
|
||||
(u3r_met(5, p_jar) != 1) ||
|
||||
(c3n == u3du(r_jar)) ||
|
||||
(c3n == u3ud(u3h(r_jar))) ||
|
||||
((c3y != u3t(r_jar)) && (c3n != u3t(r_jar))) )
|
||||
{
|
||||
if ( u3_nul == u3t(jar) ) {
|
||||
lav_d = 1ULL;
|
||||
mug_l = 0;
|
||||
}
|
||||
else {
|
||||
if ( u3_nul == u3t(jar) ) {
|
||||
lav_d = 1ULL;
|
||||
mug_l = 0;
|
||||
}
|
||||
else {
|
||||
if ( (c3n == u3r_qual(u3t(jar), 0, &p_jar, &q_jar, 0)) ||
|
||||
(c3n == u3ud(p_jar)) ||
|
||||
(u3r_met(6, p_jar) != 1) ||
|
||||
(c3n == u3ud(q_jar)) ||
|
||||
(u3r_met(5, q_jar) != 1) )
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if ( u3_nul != u3t(jar) ) {
|
||||
lav_d = u3r_chub(0, p_jar);
|
||||
mug_l = u3r_word(0, q_jar);
|
||||
|
||||
// single-home
|
||||
//
|
||||
_pier_boot_set_ship(pir_u, u3k(u3h(r_jar)), u3k(u3t(r_jar)));
|
||||
else {
|
||||
lav_d = u3r_chub(0, p_jar);
|
||||
mug_l = u3r_word(0, q_jar);
|
||||
}
|
||||
}
|
||||
|
||||
_pier_work_play(pir_u, lav_d, mug_l);
|
||||
|
@ -857,13 +857,9 @@ _worker_poke_exit(c3_w cod_w) // exit code
|
||||
/* _worker_poke_boot(): prepare to boot.
|
||||
*/
|
||||
static void
|
||||
_worker_poke_boot(u3_noun who, u3_noun fak, c3_w len_w)
|
||||
_worker_poke_boot(c3_w len_w)
|
||||
{
|
||||
c3_assert( u3_none == u3A->our );
|
||||
c3_assert( 0 != len_w );
|
||||
|
||||
u3A->our = who;
|
||||
u3A->fak = fak;
|
||||
u3V.len_w = len_w;
|
||||
}
|
||||
|
||||
@ -883,15 +879,13 @@ _worker_poke(void* vod_p, u3_noun mat)
|
||||
goto error;
|
||||
}
|
||||
|
||||
// XX [our fak] ignored. Remove
|
||||
//
|
||||
case c3__boot: {
|
||||
u3_noun who, fak, len;
|
||||
c3_w len_w;
|
||||
u3_noun len;
|
||||
c3_w len_w;
|
||||
|
||||
if ( (c3n == u3r_qual(jar, 0, &who, &fak, &len)) ||
|
||||
(c3n == u3ud(who)) ||
|
||||
(1 < u3r_met(7, who)) ||
|
||||
(c3n == u3ud(fak)) ||
|
||||
(1 < u3r_met(0, fak)) ||
|
||||
if ( (c3n == u3r_qual(jar, 0, 0, 0, &len)) ||
|
||||
(c3n == u3ud(len)) ||
|
||||
(1 < u3r_met(3, len)) )
|
||||
{
|
||||
@ -899,11 +893,8 @@ _worker_poke(void* vod_p, u3_noun mat)
|
||||
}
|
||||
|
||||
len_w = u3r_word(0, len);
|
||||
u3k(who);
|
||||
u3k(fak);
|
||||
u3z(jar);
|
||||
|
||||
return _worker_poke_boot(who, fak, len_w);
|
||||
return _worker_poke_boot(len_w);
|
||||
}
|
||||
|
||||
case c3__work: {
|
||||
@ -986,22 +977,18 @@ u3_worker_boot(void)
|
||||
c3_d nex_d = 1ULL;
|
||||
u3_noun dat = u3_nul;
|
||||
|
||||
if ( u3_none != u3A->our ) {
|
||||
u3V.mug_l = u3r_mug(u3A->roc);
|
||||
nex_d = u3V.dun_d + 1ULL;
|
||||
dat = u3nc(u3_nul, u3nt(u3i_chubs(1, &nex_d),
|
||||
u3V.mug_l,
|
||||
u3nc(u3k(u3A->our), u3k(u3A->fak))));
|
||||
|
||||
// disable hashboard for fake ships
|
||||
//
|
||||
if ( c3y == u3A->fak ) {
|
||||
u3C.wag_w |= u3o_hashless;
|
||||
}
|
||||
|
||||
if ( 0 != u3V.dun_d ) {
|
||||
// no boot sequence expected
|
||||
//
|
||||
u3V.len_w = 0;
|
||||
u3V.mug_l = u3r_mug(u3A->roc);
|
||||
nex_d = u3V.dun_d + 1ULL;
|
||||
// XX [our fak] is unused/ignored. Remove.
|
||||
// Temporarily defaulted to [~zod fake=&]
|
||||
//
|
||||
dat = u3nc(u3_nul, u3nt(u3i_chubs(1, &nex_d),
|
||||
u3V.mug_l,
|
||||
u3nc(0, 0)));
|
||||
}
|
||||
|
||||
u3l_log("work: play %" PRIu64 "\r\n", nex_d);
|
||||
|
Loading…
Reference in New Issue
Block a user