Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

hardens %ames initialization #1138

Merged
merged 4 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis/pin-parent-pill-pier.url
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://ci-piers.urbit.org/zod-0838dd9396cc6742e8bdd8dfee2e1bf5a782a50d.tgz
https://ci-piers.urbit.org/zod-f9000e4ae042dd36f103da8c8f4e997a892b8697.tgz
2 changes: 1 addition & 1 deletion .travis/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function aqua(urb) {
urb.every(/TEST [^ ]* FAILED/, function(arg){
throw Error(arg);
});
return urb.line(":ph %run-all-tests");
return urb.line(":ph [%run-test %hi]");
})
.then(function(){
return urb.expectEcho("ALL TESTS SUCCEEDED")
Expand Down
47 changes: 38 additions & 9 deletions sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@
%- need %- need
%- (sloy-light ski)
[[151 %noun] %j our %saxo da+now /(scot %p who)]
:: +turf-scry: for network domains
::
++ turf-scry
~/ %turf
;; (list turf)
%- need %- need
%- (sloy-light ski)
[[151 %noun] %j our %turf da+now ~]
::
++ vein :: vein:am
~/ %vein
Expand Down Expand Up @@ -1300,7 +1308,14 @@
:_ fox [hen [%pass wire %j %pubs p.bon]]~
::
%bock
:_ fox [hen %give %turf tuf.fox]~
:: ignore %turf if we haven't yet learned a unix duct
::
:: Only happens during first boot.
::
?~ gad.fox
[~ fox]
:_ fox
[gad.fox %give %turf tuf.fox]~
::
%brew
:_ fox [hen [%pass / %j %turf ~]]~
Expand All @@ -1323,16 +1338,26 @@
:_ fox [hen %pass wire i.q.q.bon %west p.bon t.q.q.bon r.bon]~
::
%ouzo
:: drop packet if we haven't yet learned a unix duct
::
:: Only happens during first boot.
::
?~ gad.fox
[~ fox]
:: ~& [%send now p.bon `@p`(mug (shaf %flap q.bon))]
~| [%ames-bad-duct duct=gad.fox lane=p.bon]
?> ?=(^ gad.fox)
:_ fox
[[gad.fox [%give %send p.bon q.bon]] ~]
::
%pito
:_ fox(tim `p.bon)
%- flop
^- (list move)
:: XX should this be the unix duct (gad.fox)?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof good question

I suspect we should make a specific constant duct whose sole purpose is this Ames-Behn interaction.
~[/ames-behn] might be ok. I think we'd want it not to have a // at the front, to disambiguate it from ducts that have Unix origins.

If we do change that, though, I think we should do it in a different PR so we can git-bisect later if we need to.

::
:: It seems far more important that the duct be always
:: predictable than that it be the unix duct, which
:: may change, or be unset during first boot.
::
:- [gad.fox %pass /ames %b %wait p.bon]
?~ tim.fox ~
[gad.fox %pass /ames %b %rest u.tim.fox]~
Expand Down Expand Up @@ -1385,10 +1410,6 @@
::
%mack ?~ +>.sih $(sih [%g %nice ~]) :: XX using old code
$(sih [%g %mean `[%mack +>+.sih]])
::
%turf
=. tuf.fox turf.sih
[~ +>.$]
::
%pubs
?. ?=([%pubs @ ~] tea)
Expand Down Expand Up @@ -1431,6 +1452,12 @@
::
%wake
(~(wake am [our now fox ski]) hen)
::
%turf
?: =(tuf.fox turf.sih)
[~ fox]
=. tuf.fox turf.sih
[[%bock ~]~ fox]
::
?(%mean %nice) :: XX obsolete
?: ?=([%ye ~] tea)
Expand Down Expand Up @@ -1469,8 +1496,10 @@
^- [p=(list boon) q=fort]
?- -.kyz
%barn
:_ fox(gad hen)
[%bock ~]~
=: gad.fox hen
tuf.fox ~(turf-scry am [our now fox ski])
==
[[%bock ~]~ fox]
::
%bonk
:_ fox
Expand Down
4 changes: 4 additions & 0 deletions sys/vane/jael.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,10 @@
?: =(~ snaps.sap.lex)
snap.snap
$
::
%turf
?. ?=(~ tyl) [~ ~]
[~ ~ %noun !>(tuf.own.sub.lex)]
==
:: :: ++stay
++ stay :: preserve
Expand Down