Commit Graph

19315 Commits

Author SHA1 Message Date
Pyry Kovanen
6aaa489058
ames: factor out stun implementation and basic de/serialization functions (#662)
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.
2024-07-02 19:39:22 +03:00
Pyry Kovanen
64eb9f37d4
ames: only print packet drop-count on drop (#665)
Resolves #
2024-07-01 19:26:10 +03:00
Joe Bryan
32fa09d296 ames: only print packet drop-count on drop 2024-07-01 10:43:35 -04:00
Joe Bryan
0d7be247a2
vere: respect --loom in subprocess replay (#664)
building on #663, improving #654.
2024-06-28 11:40:30 -04:00
Joe Bryan
837e515756 vere: respect --loom in subprocess replay 2024-06-28 11:34:17 -04:00
Pyry Kovanen
79f351af36
vere: support .run in subprocess replay (#663)
This PR fixes an issue introduced in #654, whereby docked binaries could
not replay.
2024-06-28 11:52:14 +03:00
Joe Bryan
14f02291c2 vere: quiet replay when no-op 2024-06-27 14:41:38 -04:00
Joe Bryan
c5e93ca799 vere: refactors replay subprocess argument construction 2024-06-27 14:41:32 -04:00
Joe Bryan
d6b2fb7f79 vere: fix argument order in binary copying error msg 2024-06-27 12:42:57 -04:00
Joe Bryan
053ef2b3b2 vere: support .run in subprocess replay 2024-06-27 12:42:42 -04:00
Pyry Kovanen
1a336ed83d
ames: resolve galaxy dns in batches; plug leak (#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).
2024-06-27 17:05:43 +03:00
Joe Bryan
0e8ca703d8 ames: move "network-on" flag to a static variable 2024-06-26 13:54:58 -04:00
Joe Bryan
34e43e1179 ames: removes old logging code 2024-06-26 13:54:47 -04:00
Joe Bryan
8480a3c97d ames: factors out stun protocol library 2024-06-26 13:53:16 -04:00
Joe Bryan
54137ad5e4 c3: factors out sift/etch functions for scalars 2024-06-26 13:50:58 -04:00
Joe Bryan
fc2c3abc5a Merge branch 'develop' into jb/ames-dequeue 2024-06-26 13:45:47 -04:00
Joe Bryan
81d3836358 ames: fix bugs in czar batch-dns resolution 2024-06-26 12:54:27 -04:00
Pyry Kovanen
81b31caf53
boot: replay in subprocess (#654)
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
2024-06-24 19:14:38 +03:00
Matthew LeVan
a819801f91 Merge branch 'msl/replay-in-subprocess' of https://github.com/urbit/vere into msl/replay-in-subprocess 2024-06-24 11:26:31 -04:00
Matthew LeVan
34809cd534 remove pkg/.DS_Store 2024-06-24 11:26:26 -04:00
Pyry Kovanen
df4624ed5e
Merge branch 'develop' into msl/replay-in-subprocess 2024-06-24 18:23:53 +03:00
Pyry Kovanen
2080cfb31c
ames: libnatpmp for real this time (#646)
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.
2024-06-24 18:06:36 +03:00
pkova
00f659e77b ames: more accurate condition for cleaning up libnatpmp handle 2024-06-24 15:54:58 +03:00
Pyry Kovanen
36900c57b4
fix nock 9 crashing pier if axis is cell (#661)
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?
2024-06-24 15:04:18 +03:00
~dozreg-toplud
55eb4852cc
fix nock 9 crashing pier if axis is cell 2024-06-20 16:23:37 -04:00
Pyry Kovanen
b3b7c1496f
ames: free packet on successful galaxy dns resolution (#658) 2024-06-11 21:57:16 +03:00
Joe Bryan
9ab5c7e6b7 ames: free packet on successful galaxy dns resolution 2024-06-07 11:16:31 -04:00
Matthew LeVan
5212f9a266 play: handle termination cases 2024-06-05 11:30:16 -04:00
Matthew LeVan
585fad2a19 mars: remove printf 2024-05-30 12:40:08 -04:00
Matthew LeVan
5f41711ce2 play: flip loob 2024-05-30 12:34:11 -04:00
Matthew LeVan
da773cf6b2 play: serf commits sudoku when king dies 2024-05-30 12:31:37 -04:00
Pyry Kovanen
51b2e471ee
disk: parameterize lmdb map size (#655)
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.
2024-05-29 18:07:25 +03:00
Pyry Kovanen
6c072927c6
main: restore SIGTSTP handler after replay (#656)
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.
2024-05-29 18:05:36 +03:00
Matthew LeVan
8dd289942c play: produce args better 2024-05-28 10:55:29 -04:00
Pyry Kovanen
5ba82e80b4
main: restore SIGTSTP handler after replay 2024-05-27 16:02:16 +03:00
Matthew LeVan
b0de3aac55 play: add args to _cw_play_fork 2024-05-25 21:11:47 -04:00
Matthew LeVan
41fa70ec38 cli: add --lmdb-map-size to subcommands; always init siz_i; use correct format specifier 2024-05-24 15:15:22 -04:00
Matthew LeVan
d67090b6e5 disk: parameterize lmdb map size 2024-05-24 13:32:16 -04:00
Matthew LeVan
798aa3fa53 play: remove print 2024-05-24 12:57:36 -04:00
Matthew LeVan
837799b4a2 play: use u3_Host.wrk_c 2024-05-24 12:55:48 -04:00
Matthew LeVan
206e03c548 play: use u3_Host strings 2024-05-24 12:35:00 -04:00
Matthew LeVan
53223be13e Revert "Revert "vere: add --serf-bin option to provide path to serf""
This reverts commit a37f052480.
2024-05-24 12:23:29 -04:00
Matthew LeVan
0602d1d65c play: replay in a subprocess 2024-05-24 12:21:29 -04:00
pkova
879e86d628 ames: clean up libnatpmp stuff in _ames_io_exit 2024-05-14 14:38:25 +03:00
pkova
cca7582774 ames: check status in natpmp_cb 2024-05-10 19:45:35 +03:00
pkova
d02c620f20 ames: check uv_poll_init for errors in natpmp codepath 2024-05-10 18:52:59 +03:00
pkova
c496367699 ames: fix libnatpmp initialization problems 2024-05-10 17:15:28 +03:00
Pyry Kovanen
14be6deff8 ames: add libnatpmp for automatic port forwarding (#593)
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.
2024-05-10 17:00:34 +03:00
Pyry Kovanen
07e781ac27
Revert "disk: fix broken chop error message" (#643)
Reverts urbit/vere#642

There's something very mysterious going on, `urbit/urbit` CI segfaults
but `urbit/vere` does not.
2024-05-02 13:44:38 +03:00
Pyry Kovanen
c305c50b8a
Revert "ames: add libnatpmp for automatic port forwarding" (#644)
Reverts urbit/vere#593

This is very likely what is breaking `urbit/urbit` CI.
2024-05-01 21:57:42 +03:00