This PR factors out a couple small modules from ames, in anticipation of
merging in the directed messaging driver. Built on top of (and
targeting) #639.
This PR refactors ames' galaxy dns resolution and simplifies its STUN
protocol state machine. By removing the packet queueing in the old
galaxy dns handling, this PR also plugs a memory leak introduced in #305
(f9e8542f95 specifically).
This PR:
1. Adds the `--serf-bin` option for specifying a serf executable
2. Sets `u3_Host.wrk_c` to `--serf-bin`'s value if specified, self
otherwise
3. Performs boot's replay in a subprocess that spawns our own serf (by
default) or the specified serf if provided
4. Spawns a thread in `_cw_play` that exits if it reads `EOF` from
`STDIN` (thereby ensuring the child process for replaying events exits
whenever the parent is killed)
These changes allow Ares (or any other runtime) to implement its own
`play` subcommand and have Vere use it for the boot process's replay
functionality.
Tests:
- [x] `linux-x86_64` subcommand, replay via boot, killing king via INT,
KILL, TERM
- [x] `macos-aarch64` subcommand, replay via boot, killing king via INT,
KILL, TERM
This is #593 that got reverted in #644 because it broke `urbit/urbit`
CI. This PR fixes the issue which was unconditionally calling
`uv_poll_init` on a socket that was initialized with `initnatpmp`
without checking if `initnatpmp` returned an error first.
Solves #660
Prevents Nock 9 from crashing the pier if the axis argument is a cell.
Without the check Vere may call `u3qc_cap` on a cell, leading to a
segfault or an assertion failure:
```
Assertion '_(u3a_is_atom(b))' failed in pkg/noun/retrieve.c:1011
```
To reproduce the bug, run in Dojo:
```
.*(0 [9 [2 2] 0 1])
```
Is there a way to add a unit test to guard against a downgrade?
Adds `--lmdb-map-size` to specify LMDB's initial memory mapping size,
intended for use by users who need a size smaller than our default of
500G. Note: `case 12` to avoid collision with the other arg added in
#654.
CTRL+z to force kill an urbit process has been broken for some time.
This was caused by our SIGTSTP handler being overwritten in
`_cw_play_imp` that gets called not only during replay but on every boot
if we're not a new pier.
Same as https://github.com/urbit/urbit/pull/3261 but for vere. From what
I can tell this NAT-PMP stuff is fairly well supported by routers, works
on my machine at least.