Commit Graph

29022 Commits

Author SHA1 Message Date
Jōshin
2526c4b59d
vere: fix u3v_lily bounds checking
Before this, u3v_lily would erroneously accept atoms bigger than 64 bits
that, when truncated to 64 bits, were 31-bit numbers.

Decided to drop _cv_mole altogether. Another option would be to write a
u3r_chub_fit, write _cv_mole in terms of that, and check width in
u3v_lily as it currently does.

I tried to add a test case, but it seems that tests don't have access to
an ivory pill for +scot / +slaw. This would be the test case, more or
less:

    {
      c3_l lit_l;
      c3_w big_w[] = {0, 0, 1};
      u3_atom big = u3i_words(3, big_w);
      u3_noun cod = u3dc("scot", c3__ux, big);

      if ( c3y == u3v_lily(c3__ux, cod, &lit_l) ) {
        printf("fail\n");
      }
    }

(The refcounting was also messed up, possibly from my refactor to use
+slaw instead of +slay, but this seems to have been unrelated.)
2021-12-26 06:44:54 +00:00
Jōshin
d64674c0e8
khan: only plan %done if vane is present 2021-12-25 21:19:25 +00:00
Jōshin
e226161d03
khan: better noun refcounting, errors
- Caught a couple potential leaks.

- Reworded error messages to be more @tas-compliant.

- Used unique error codes in bal_f calls.

- Moved u3z calls onto same line as returns.
2021-12-25 21:07:59 +00:00
Jōshin
b61f4e5728
khan: comment changes
Not sure we actually want to guarantee exactly-once response semantics,
so you can't rely on request ordering to correlate requests even if you
never send simultaneous requests.

Also do a worked example of a %urth scry, which hopefully raises the
question of whether %urth should try to support views.
2021-12-25 20:42:19 +00:00
Jōshin
d505541498
Revert "behn: comment spacing"
Leave arvo stuff out of the next/vere changes entirely.

This reverts commit 0102bb271f.
2021-12-25 20:26:45 +00:00
Jōshin
69f4d57ccd
test: we stopped futureproofing at some point 2021-12-25 20:25:24 +00:00
Jōshin
9f0a1cc684
vere: export u3v_lily
It was if 0'd out in noun/vortex.c. That seems like a more reasonable
place to put it then a whole other self-contained file.

The commented version used slay instead of slaw and had an extra paren;
I opted to replace it with the impelementation from reck.c from http.c.
2021-12-25 19:54:21 +00:00
Jōshin
0911c39b0e
khan: comment fixes 2021-12-25 09:47:26 +00:00
Jōshin
d22618e89f
khan: comment formatting 2021-12-25 09:41:27 +00:00
Jōshin
736fc6f47c
khan: fix comment
It's a little atom; so 31 bits, not 32.
2021-12-25 08:44:36 +00:00
Jōshin
ddbe673a43
khan: naming scheme for _khan_init_sock 2021-12-25 08:41:42 +00:00
Jōshin
845d325dd7
khan: always open socket, make %fyrd conditional
Inlines the server initialization in _khan_io_talk. Adds a van_o loobean
that differentiates between having the vane and missing the vane; van_o
is c3n if the %born event failed. In that case, we don't bother
forwarding %fyrd requests at all, but %peek requests still go through.
2021-12-25 08:37:47 +00:00
Jōshin
969115d5c1
khan: document %peek overlay 2021-12-25 08:26:05 +00:00
Jōshin
6a783cda55
khan: remove _khan_close_socket
It was a mistake to call it except from _khan_close_chan, so just inline
it at the one call site. Also lets us stop doing our own pointer
juggling in _khan_io_exit.

While we're at it, flip argument order in _khan_close_chan;
superordinate first seems more natural.
2021-12-25 01:53:56 +00:00
Jōshin
18764678b0
khan: remove TODO, clean up docs 2021-12-25 01:31:37 +00:00
Jōshin
dfe2330d49
khan: urth namespace stub 2021-12-25 01:28:17 +00:00
Jōshin
fbe6cd5196
khan: include %avow in response 2021-12-25 00:19:28 +00:00
Jōshin
7386e3b0a3
khan: assert 2021-12-24 23:30:01 +00:00
Jōshin
9280c107c0
newt: remove fprintf
This was sorta here in case that decode case ever got tripped
erroneously. Calling bal_f ought to be sufficient to produce a log.
2021-12-24 22:51:07 +00:00
Jōshin
ee68f533fe
khan: redo error logic
No more retries. If something goes wrong, log it and close the channel.
If we receive an unknown message from the vane, crash the process.
2021-12-24 22:49:57 +00:00
Jōshin
a85dac4e65
khan: _khan_read_wire takes tag, rename fn
- Have _khan_read_wire take a tag rather than produce it; if the tag is
  not the one passed, it assumes it knows nothing of the rest of the
  wire structure and simply returns c3n.

- rename _khan_search_chan to _khan_find_chan, the latter being more
  flwy.
2021-12-24 22:29:59 +00:00
Jōshin
3cad739fdf
khan: reformat %peek, report %fyrd errors, misc
- Reformat %peek responses to start with request-id.

- Send %fyrd errors back over the channel that started the %fyrd.

- Factor out _khan_read_wire, reused by both _khan_poke_bail and
  _khan_io_kick.

- Move _khan_search_chan up above _khan_poke_bail to use it there.
2021-12-24 22:20:49 +00:00
Jōshin
8e1ab0ff35
khan: fix ci
liv_o was always c3n without the vane. The pier was waiting for all
drivers to report liv_o == c3y. Tragedy ensued.

Maybe now we want to open the socket for peeks and moves even if the
vane is not present, so this may need to be rethought even further.
This is just the simple resolution for the culprit unearthed by
git-bisect.
2021-12-24 07:39:26 +00:00
Jōshin
1b39475096
khan: cleanup, request-ids in kick_f
- Factor out _khan_send_noun.

- Fix inconsistent operator locations.
2021-12-23 23:13:21 +00:00
Jōshin
1b64a72b7d
khan: flip request-id order, add request list
Keeping a request list allows us to detect the case where a scry result
has returned on a connection that has already been closed, so we can
noop in that case.

Flipping the order of tag and request-id seems more natural for the
%fyrd case; otherwise there's no clear thing to send to the vane.
(Sending the whole jar sends request-id twice; once in the wire, once in
the body. Sending only the command itself loses context and introduces
potential namespace overlaps.)

As of now, scries are working.

And the format the IO driver takes is:

$:  request-id=@ud
$%  [%fyrd fyrd-args=*]
    [%peek peek-args=*]
    [%move move-args=*]
==
2021-12-23 10:04:16 +00:00
Jōshin
2d6ea34f7a
Revert "nix: remove socket in boot-fake-ship"
This reverts commit a115dce91c.
2021-12-23 09:42:30 +00:00
Jōshin
ceeb21d71e
khan: poke destructuring now case-independent
- Adds request-id to %fyrd.

- Adds log lines per poke.

- Missed a u3z(jar) in the switch default case.
2021-12-23 09:26:24 +00:00
Jōshin
07d5cfc0c0
vere: typo in lord.c peek docs 2021-12-23 07:18:21 +00:00
Jōshin
3cd1a697ef
Merge branch 'next/vere' into jo/khan-c3 2021-12-23 07:18:09 +00:00
Jōshin
0d9cc5b6af
khan: wip scries, moves, request ids
Also clean up some types and remove obsolete TODOs.
2021-12-23 07:15:54 +00:00
Joe Bryan
15148c72bf Merge branch 'master' into next/vere
* master:
  [nix] track nixos-21.11 branch whenever niv updates, bump to include qemu-in-virtualization fix
  webterm: v1.0.0
  herm: permission checks
  herm: avoid trailing empty path segments
  pmnsh: update secp256k1 configure flags
  secp256k1: use nixpkgs provided secp256k1 and add to sources-pmnsh
  webterm: remove border, let term live in page
  theme: cleaning up a few mismatches
  webterm: handle old-style blits and belts
  build: correct lmdb static builds
  build: explicitly override h2o build platforms to support darwin
  ci: upgrade cachix/install-nix-action from v13 -> v16
  build: remove haskell related nix code and haskell.nix dependency
  webterm: update imports
  @urbit/api: move term types
  webterm: fix broken imports
  webterm: update package name for lerna
  webterm: commit missing api files
  webterm: backport
2021-12-17 23:38:22 -05:00
Joe Bryan
663934b5cf
Merge pull request #5478 from urbit/bh/remove-haskell-nix
build: remove urbit-king haskell releases and haskell.nix dependency
2021-12-17 20:36:21 -08:00
Joe Bryan
eeac4e5489
Merge pull request #5195 from urbit/pp/leaks2
king: fix several more space leaks
2021-12-17 20:18:42 -08:00
Joe Bryan
c4cf6bf655
Merge pull request #5000 from ryjm/jm/merciful-king
king: don't kill on C-d
2021-12-17 20:17:52 -08:00
Joe Bryan
60cefe192e
Merge pull request #5182 from urbit/naive/preboot
L2 preboot validation (kh)
2021-12-17 20:16:33 -08:00
Joe Bryan
b111054ab2
Merge pull request #5419 from urbit/lf/fix-injection
vere: update event injection for four letter vanes
2021-12-17 07:52:34 -08:00
Edward Amsden
a50b7d0dff
[nix] track nixos-21.11 branch whenever niv updates, bump to include qemu-in-virtualization fix 2021-12-16 13:17:04 -06:00
Peter McEvoy
3a40b5731f
Merge pull request #5491 from urbit/peter/header-guards
u3: add header guards to header files in pkg/urbit/include
2021-12-15 17:46:38 -07:00
Peter McEvoy
6f42d9e30a u3: add header guards to header files in pkg/urbit/include 2021-12-15 17:45:25 -07:00
fang
0cb818a0ab
Merge pull request #5445 from urbit/m/hmac-gate-prep
jets: cache hmac hashing gate
2021-12-15 20:25:41 +01:00
fang
dd6b090bfa
Merge pull request #5454 from urbit/m/backport-nu-webterm
webterm: backport
2021-12-14 19:23:23 +01:00
Joe Bryan
53e8ee727c
Merge pull request #5493 from urbit/jb/hint-no-tail
u3: fix compilation of dynamic hints in tail position
2021-12-14 10:16:40 -08:00
fang
960f2b1ae2
webterm: v1.0.0 2021-12-14 17:17:32 +01:00
Joe Bryan
6d2764bc15
Merge pull request #5492 from laudiacay/fix-behn-tag-check
Adding tag == c3_doze check to _behn_io_kick in Behn io driver
2021-12-13 21:53:40 -08:00
Joe Bryan
df572b15f1 Merge branch 'master' into next/vere
* master: (55 commits)
  landscape: bump version, glob
  interface: hide invite if already joined
  landscape: update glob
  interface: do not redirect to joined group automatically
  interface: hide aborted requests
  invite-store: change /all scry to return %invite-update
  interface: fix tsc
  interface: address hunter review
  pkg: include atom mark in base-dev
  landscape: correct mark
  interface: refine spacing
  interface: fix invite notifications
  landscape: add invite declination
  landscape: prevent reflow jank in group summary on load
  interface: fix unjoined graph permalink redirect
  join: automatically join when done
  landscape: update glob, version
  notify: address mark review
  interface: fix publish url preprocessing
  bg-color: changing to always store ux, optimizing displayform and colorinput
  ...
2021-12-14 00:52:30 -05:00
Joe Bryan
1f055607e4 u3: fix compilation of dynamic hints in tail position
hinted formulas are never in tail position
2021-12-14 00:17:10 -05:00
Claudia Richoux
9014af72c8
adding check to fix 2021-12-13 22:17:29 -06:00
fang
fd375c1d90
herm: permission checks
Make sure herm can only be interacted with by the local ship.
2021-12-13 14:25:14 +01:00
fang
c7c601c041
herm: avoid trailing empty path segments
append /view to the existing subscription paths to "wrap" the possibly
empty path segment of the session name.
2021-12-13 14:24:20 +01:00
Jōshin
6a4855a616
khan: trivial style cleanup 2021-12-11 06:40:34 +00:00