From 80540c2142ef375a76a182fe497c2c4551bb5e8f Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 3 Dec 2020 11:13:59 -0800 Subject: [PATCH 01/27] king: stat --- pkg/hs/urbit-king/lib/Urbit/Prelude.hs | 6 +++ pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 39 ++++++++++++++------ pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs | 5 ++- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 7 +++- pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs | 39 ++++++++++++++++++++ pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs | 15 ++++++-- 6 files changed, 93 insertions(+), 18 deletions(-) create mode 100644 pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs diff --git a/pkg/hs/urbit-king/lib/Urbit/Prelude.hs b/pkg/hs/urbit-king/lib/Urbit/Prelude.hs index fb8f599638..8d29b6de68 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Prelude.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Prelude.hs @@ -16,6 +16,7 @@ module Urbit.Prelude , io, rio , logTrace , acquireWorker, acquireWorkerBound + , hark ) where import ClassyPrelude @@ -38,6 +39,8 @@ import RIO (HasLogFunc, LogFunc, LogLevel(..), logDebug, logError, logFuncL, logInfo, logOptionsHandle, logOther, logWarn, mkLogFunc, setLogMinLevel, setLogUseLoc, setLogUseTime, withLogFunc) +import qualified RIO + io :: MonadIO m => IO a -> m a io = liftIO @@ -47,6 +50,9 @@ rio = liftRIO logTrace :: HasLogFunc e => Utf8Builder -> RIO e () logTrace = logOther "trace" +-- | Composes a log message out of textual components. +hark :: [Text] -> Utf8Builder +hark = RIO.displayBytesUtf8 . foldMap encodeUtf8 -- Utils for Spawning Worker Threads ------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index b83e187921..442bdd288e 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -24,6 +24,7 @@ import Urbit.King.App (HasKingId(..), HasPierEnv(..)) import Urbit.Vere.Ames.DNS (NetworkMode(..), ResolvServ(..)) import Urbit.Vere.Ames.DNS (galaxyPort, resolvServ) import Urbit.Vere.Ames.UDP (UdpServ(..), fakeUdpServ, realUdpServ) +import Urbit.Vere.Stat (AmesStat(..)) import qualified Urbit.Noun.Time as Time @@ -125,13 +126,14 @@ udpPort isFake who = do udpServ :: (HasLogFunc e, HasNetworkConfig e, HasPortControlApi e) => Bool -> Ship + -> AmesStat -> RIO e UdpServ -udpServ isFake who = do +udpServ isFake who stat = do mode <- netMode isFake port <- udpPort isFake who case modeAddress mode of Nothing -> fakeUdpServ - Just host -> realUdpServ port host + Just host -> realUdpServ port host stat _bornFailed :: e -> WorkError -> IO () _bornFailed env _ = runRIO env $ do @@ -141,10 +143,11 @@ ames' :: HasPierEnv e => Ship -> Bool + -> AmesStat -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) -> (Text -> RIO e ()) -> RIO e ([Ev], RAcquire e (DriverApi NewtEf)) -ames' who isFake scry stderr = do +ames' who isFake stat scry stderr = do -- Unfortunately, we cannot use TBQueue because the only behavior -- provided for when full is to block the writer. The implementation -- below uses materially the same data structures as TBQueue, however. @@ -168,7 +171,7 @@ ames' who isFake scry stderr = do pure pM env <- ask - let (bornEvs, startDriver) = ames env who isFake scry enqueuePacket stderr + let (bornEvs, startDriver) = ames env who isFake stat scry enqueuePacket stderr let runDriver = do diOnEffect <- startDriver @@ -195,11 +198,12 @@ ames => e -> Ship -> Bool + -> AmesStat -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) -> (EvErr -> STM PacketOutcome) -> (Text -> RIO e ()) -> ([Ev], RAcquire e (NewtEf -> IO ())) -ames env who isFake scry enqueueEv stderr = (initialEvents, runAmes) +ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) where king = fromIntegral (env ^. kingIdL) @@ -221,7 +225,7 @@ ames env who isFake scry enqueueEv stderr = (initialEvents, runAmes) aDropped <- newTVarIO 0 aVersion <- newTVarIO Nothing aVersTid <- trackVersionThread aVersion - aUdpServ <- udpServ isFake who + aUdpServ <- udpServ isFake who stat aResolvr <- resolvServ aTurfs (usSend aUdpServ) stderr aRecvTid <- queuePacketsThread aDropped @@ -229,10 +233,19 @@ ames env who isFake scry enqueueEv stderr = (initialEvents, runAmes) cachedScryLane (send aUdpServ aResolvr mode) aUdpServ + stat pure (AmesDrv { .. }) - hearFailed _ = pure () + hearFailed AmesStat {..} = runRIO env . \case + RunSwap{} -> atomically $ modifyTVar' asSwp (+ 1) + RunBail gs -> do + for gs \(t, es) -> + for es \e -> + logWarn $ hark + ["ames: goof: ", unTerm t, ": ", tankToText e] + atomically $ modifyTVar' asBal (+ 1) + RunOkay{} -> atomically $ modifyTVar' asOky (+ 1) trackVersionThread :: HasLogFunc e => TVar (Maybe Version) -> RIO e (Async ()) trackVersionThread versSlot = async $ forever do @@ -254,12 +267,15 @@ ames env who isFake scry enqueueEv stderr = (initialEvents, runAmes) -> (Ship -> RIO e (Maybe [AmesDest])) -> (AmesDest -> ByteString -> RIO e ()) -> UdpServ + -> AmesStat -> RIO e (Async ()) - queuePacketsThread dropCtr vers lan forward UdpServ{..} = async $ forever $ do + queuePacketsThread dropCtr vers lan forward UdpServ{..} s@(AmesStat{..}) = async $ forever $ do -- port number, host address, bytestring - (p, a, b) <- atomically usRecv + (p, a, b) <- atomically (modifyTVar' asRcv (+ 1) >> usRecv) ver <- readTVarIO vers - + serfsUp p a b + -- TODO make this make sense with stats + {- case decode b of Right (pkt@Packet {..}) | ver == Nothing || ver == Just pktVersion -> do logDebug $ displayShow ("ames: bon packet", pkt, showUD $ bytesAtom b) @@ -294,10 +310,11 @@ ames env who isFake scry enqueueEv stderr = (initialEvents, runAmes) -- they cannot be filtered, as we do not know their semantics -- Left e -> logInfo $ displayShow ("ames: dropping malformed", e) + -} where serfsUp p a b = - atomically (enqueueEv (EvErr (hearEv p a b) hearFailed)) >>= \case + atomically (enqueueEv (EvErr (hearEv p a b) (hearFailed s))) >>= \case Intake -> pure () Ouster -> do d <- atomically $ do diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs index a0175b8292..90bc8bffac 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs @@ -34,6 +34,7 @@ where import Urbit.Prelude import Urbit.Vere.Ports +import Urbit.Vere.Stat import Network.Socket @@ -156,8 +157,9 @@ realUdpServ . (HasLogFunc e, HasPortControlApi e) => PortNumber -> HostAddress + -> AmesStat -> RIO e UdpServ -realUdpServ por hos = do +realUdpServ por hos sat = do logInfo $ displayShow ("AMES", "UDP", "Starting real UDP server.") env <- ask @@ -239,6 +241,7 @@ realUdpServ por hos = do pure () Right (Just (b, p, a)) -> do logDebug "AMES: UDP: Received packet." + atomically $ modifyTVar' (asUdp sat) (+ 1) enqueueRecvPacket p a b let shutdown = do diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 8f1169e88e..d56bb69a38 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -23,6 +23,7 @@ import RIO.Directory import Urbit.Arvo import Urbit.King.App import Urbit.Vere.Pier.Types +import Urbit.Vere.Stat import Control.Monad.STM (retry) import System.Environment (getExecutablePath) @@ -429,9 +430,11 @@ drivers -> Site.KingSubsite -> RAcquire e ([Ev], RAcquire e Drivers) drivers env who isFake plan scry termSys stderr serfSIGINT sub = do + stat@Stat{..} <- newStat + (behnBorn, runBehn) <- rio Behn.behn' - (termBorn, runTerm) <- rio (Term.term' termSys serfSIGINT) - (amesBorn, runAmes) <- rio (Ames.ames' who isFake scry stderr) + (termBorn, runTerm) <- rio (Term.term' termSys (renderStat stat) serfSIGINT) + (amesBorn, runAmes) <- rio (Ames.ames' who isFake statAmes scry stderr) (httpBorn, runEyre) <- rio (Eyre.eyre' who isFake stderr sub) (clayBorn, runClay) <- rio Clay.clay' (irisBorn, runIris) <- rio Iris.client' diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs new file mode 100644 index 0000000000..e8549f2fe9 --- /dev/null +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs @@ -0,0 +1,39 @@ +module Urbit.Vere.Stat where + +import Urbit.Prelude + +data Stat = Stat + { statAmes :: AmesStat + } + +data AmesStat = AmesStat + { asUdp :: TVar Word + , asRcv :: TVar Word + , asSwp :: TVar Word + , asBal :: TVar Word + , asOky :: TVar Word + } + +newStat :: MonadIO m => m Stat +newStat = do + asUdp <- newTVarIO 0 + asRcv <- newTVarIO 0 + asSwp <- newTVarIO 0 + asBal <- newTVarIO 0 + asOky <- newTVarIO 0 + pure Stat{statAmes = AmesStat{..}} + +type RenderedStat = [Text] + +renderStat :: MonadIO m => Stat -> m RenderedStat +renderStat Stat{statAmes = AmesStat{..}} = + sequence + [ pure "stat:" + , pure " ames:" + , (" udp: " <>) <$> tshow <$> readTVarIO asUdp + , (" rcv: " <>) <$> tshow <$> readTVarIO asRcv + , (" swp: " <>) <$> tshow <$> readTVarIO asSwp + , (" bal: " <>) <$> tshow <$> readTVarIO asBal + , (" oky: " <>) <$> tshow <$> readTVarIO asOky + ] + diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs index a5ab80b92e..2bf6327e4e 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs @@ -27,6 +27,7 @@ import Urbit.Vere.Pier.Types import Data.List ((!!)) import RIO.Directory (createDirectoryIfMissing) import Urbit.King.API (readPortsFile) +import Urbit.Vere.Stat (RenderedStat) import Urbit.TermSize (TermSize(TermSize)) import Urbit.Vere.Term.API (Client(Client), ClientTake(..)) @@ -556,11 +557,15 @@ localClient doneSignal = fst <$> mkRAcquire start stop loop rd else if w == 3 then do -- ETX (^C) - logInfo $ displayShow "Ctrl-c interrupt" + logInfo $ "Ctrl-c interrupt" atomically $ do writeTQueue wq [Term.Trace "interrupt\r\n"] writeTQueue rq $ Ctl $ Cord "c" loop rd + else if w == 20 then do + -- DC4 (^T) + atomically $ writeTQueue wq [Term.Trace "\r\n"] + loop rd else if w <= 26 then do case pack [BS.w2c (w + 97 - 1)] of "d" -> atomically doneSignal @@ -597,9 +602,10 @@ localClient doneSignal = fst <$> mkRAcquire start stop term' :: HasPierEnv e => (TermSize, Client) + -> IO RenderedStat -> IO () -> RIO e ([Ev], RAcquire e (DriverApi TermEf)) -term' (tsize, client) serfSIGINT = do +term' (tsize, client) stat serfSIGINT = do let TermSize wi hi = tsize initEv = [blewEvent wi hi, initialHail] @@ -608,7 +614,7 @@ term' (tsize, client) serfSIGINT = do runDriver = do env <- ask ventQ :: TQueue EvErr <- newTQueueIO - diOnEffect <- term env (tsize, client) (writeTQueue ventQ) serfSIGINT + diOnEffect <- term env (tsize, client) (writeTQueue ventQ) stat serfSIGINT let diEventSource = fmap RRWork <$> tryReadTQueue ventQ @@ -621,9 +627,10 @@ term :: forall e. (HasPierEnv e) => e -> (TermSize, Client) -> (EvErr -> STM ()) + -> IO RenderedStat -> IO () -> RAcquire e (TermEf -> IO ()) -term env (tsize, Client{..}) plan serfSIGINT = runTerm +term env (tsize, Client{..}) plan stat serfSIGINT = runTerm where runTerm :: RAcquire e (TermEf -> IO ()) runTerm = do From 24cc0502cd2becc5f00dd4ff1ae0cfa0faebe9b9 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 3 Dec 2020 23:12:14 -0800 Subject: [PATCH 02/27] king: actually use ~_~ for stats display --- pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 38 +++++++++++-------- pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs | 5 +-- .../lib/Urbit/Vere/Eyre/KingSubsite.hs | 28 +++++++++++--- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 13 +++++-- pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs | 31 ++++++++++++--- 5 files changed, 82 insertions(+), 33 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index 442bdd288e..4f083d3706 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -24,7 +24,7 @@ import Urbit.King.App (HasKingId(..), HasPierEnv(..)) import Urbit.Vere.Ames.DNS (NetworkMode(..), ResolvServ(..)) import Urbit.Vere.Ames.DNS (galaxyPort, resolvServ) import Urbit.Vere.Ames.UDP (UdpServ(..), fakeUdpServ, realUdpServ) -import Urbit.Vere.Stat (AmesStat(..)) +import Urbit.Vere.Stat (AmesStat(..), bump, bump') import qualified Urbit.Noun.Time as Time @@ -238,14 +238,14 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) pure (AmesDrv { .. }) hearFailed AmesStat {..} = runRIO env . \case - RunSwap{} -> atomically $ modifyTVar' asSwp (+ 1) + RunSwap{} -> bump asSwp RunBail gs -> do for gs \(t, es) -> for es \e -> logWarn $ hark ["ames: goof: ", unTerm t, ": ", tankToText e] - atomically $ modifyTVar' asBal (+ 1) - RunOkay{} -> atomically $ modifyTVar' asOky (+ 1) + bump asBal + RunOkay{} -> bump asOky trackVersionThread :: HasLogFunc e => TVar (Maybe Version) -> RIO e (Async ()) trackVersionThread versSlot = async $ forever do @@ -271,28 +271,35 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) -> RIO e (Async ()) queuePacketsThread dropCtr vers lan forward UdpServ{..} s@(AmesStat{..}) = async $ forever $ do -- port number, host address, bytestring - (p, a, b) <- atomically (modifyTVar' asRcv (+ 1) >> usRecv) + (p, a, b) <- atomically (bump' asRcv >> usRecv) ver <- readTVarIO vers - serfsUp p a b - -- TODO make this make sense with stats - {- + case decode b of Right (pkt@Packet {..}) | ver == Nothing || ver == Just pktVersion -> do logDebug $ displayShow ("ames: bon packet", pkt, showUD $ bytesAtom b) if pktRcvr == who - then serfsUp p a b + then do + bump asSup + serfsUp p a b else lan pktRcvr >>= \case Just ls | dest:_ <- filter notSelf ls - -> forward dest $ encode pkt - { pktOrigin = pktOrigin <|> Just (ipDest p a) } + -> do + bump asFwd + forward dest $ encode pkt + { pktOrigin = pktOrigin <|> Just (ipDest p a) } where notSelf (EachYes g) = who /= Ship (fromIntegral g) notSelf (EachNo _) = True - _ -> logInfo $ displayShow ("ames: dropping unroutable", pkt) - Right pkt -> logInfo $ displayShow ("ames: dropping ill-versed", pkt, ver) + _ -> do + bump asDrt + logInfo $ displayShow ("ames: dropping unroutable", pkt) + + Right pkt -> do + bump asDvr + logInfo $ displayShow ("ames: dropping ill-versed", pkt, ver) -- XX better handle misversioned or illegible packets. -- Remarks from 67f06ce5, pkg/urbit/vere/io/ames.c, L1010: @@ -309,8 +316,9 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) -- trigger printfs suggesting upgrade. -- they cannot be filtered, as we do not know their semantics -- - Left e -> logInfo $ displayShow ("ames: dropping malformed", e) - -} + Left e -> do + bump asDml + logInfo $ displayShow ("ames: dropping malformed", e) where serfsUp p a b = diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs index 90bc8bffac..2df601fa40 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs @@ -34,13 +34,12 @@ where import Urbit.Prelude import Urbit.Vere.Ports -import Urbit.Vere.Stat import Network.Socket import Control.Monad.STM (retry) import Network.Socket.ByteString (recvFrom, sendTo) - +import Urbit.Vere.Stat (AmesStat(..), bump) -- Types ----------------------------------------------------------------------- @@ -241,7 +240,7 @@ realUdpServ por hos sat = do pure () Right (Just (b, p, a)) -> do logDebug "AMES: UDP: Received packet." - atomically $ modifyTVar' (asUdp sat) (+ 1) + bump (asUdp sat) enqueueRecvPacket p a b let shutdown = do diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs index 3430c1612f..960035c3b5 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs @@ -17,6 +17,7 @@ import Urbit.Vere.Serf.Types import Data.Conduit (ConduitT, Flush(..), yield) import Data.Text.Encoding (encodeUtf8Builder) +import Urbit.Vere.Stat (RenderedStat) import qualified Data.Text.Encoding as E import qualified Network.HTTP.Types as H @@ -44,9 +45,10 @@ streamSlog a = do kingSubsite :: HasLogFunc e => Ship -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) + -> IO RenderedStat -> TVar ((Atom, Tank) -> IO ()) -> RAcquire e KingSubsite -kingSubsite who scry func = do +kingSubsite who scry stat func = do clients <- newTVarIO (mempty :: Map Word (SlogAction -> IO ())) nextId <- newTVarIO (0 :: Word) baton <- newTMVarIO () @@ -77,15 +79,29 @@ kingSubsite who scry func = do else let loop = yield Flush >> forever (atomically (readTQueue q) >>= streamSlog) - in respond $ W.responseSource (H.mkStatus 200 "OK") heads loop) + in respond $ W.responseSource (H.mkStatus 200 "OK") slogHeads loop) + + ["~_~", "stat"] -> do + authed <- authenticated env req + if not authed + then respond $ emptyResponse 403 "Permission Denied" + else do + lines <- stat + let msg = mconcat ((<> "\n") . encodeUtf8Builder <$> lines) + <> "\nRefresh for more current data." + respond $ W.responseBuilder (H.mkStatus 200 "OK") statHeads msg _ -> respond $ emptyResponse 404 "Not Found" where - heads = [ ("Content-Type" , "text/event-stream") - , ("Cache-Control", "no-cache") - , ("Connection" , "keep-alive") - ] + slogHeads = [ ("Content-Type", "text/event-stream") + , ("Cache-Control", "no-cache") + , ("Connection", "keep-alive") + ] + + statHeads = [ ("Content-Type", "text/plain") + , ("Cache-Control", "no-cache") + ] emptyResponse cod mes = W.responseLBS (H.mkStatus cod mes) [] "" diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index d56bb69a38..67bdea89e2 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -296,9 +296,13 @@ pier (serf, log) vSlog startedSig injected = do atomically $ writeTQueue scryQ (w, b, g, putMVar res) takeMVar res + -- Set up the runtime stat counters. + stat <- newStat + -- Set up the runtime subsite server and its capability to slog + -- and display stats. siteSlog <- newTVarIO (const $ pure ()) - runtimeSubsite <- Site.kingSubsite ship scry siteSlog + runtimeSubsite <- Site.kingSubsite ship scry (renderStat stat) siteSlog -- Slogs go to stderr, to the runtime subsite, and to the terminal. env <- ask @@ -312,7 +316,7 @@ pier (serf, log) vSlog startedSig injected = do let err = atomically . Term.trace muxed . (<> "\r\n") siz <- atomically $ Term.curDemuxSize demux let fak = isFake logId - drivers env ship fak compute scry (siz, muxed) err sigint runtimeSubsite + drivers env ship fak compute scry (siz, muxed) err sigint stat runtimeSubsite let computeConfig = ComputeConfig { ccOnWork = takeTMVar computeQ , ccOnKill = onKill @@ -427,10 +431,11 @@ drivers -> (TermSize, Term.Client) -> (Text -> RIO e ()) -> IO () + -> Stat -> Site.KingSubsite -> RAcquire e ([Ev], RAcquire e Drivers) -drivers env who isFake plan scry termSys stderr serfSIGINT sub = do - stat@Stat{..} <- newStat +drivers env who isFake plan scry termSys stderr serfSIGINT stat sub = do + let Stat{..} = stat (behnBorn, runBehn) <- rio Behn.behn' (termBorn, runTerm) <- rio (Term.term' termSys (renderStat stat) serfSIGINT) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs index e8549f2fe9..bff2349687 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs @@ -9,6 +9,11 @@ data Stat = Stat data AmesStat = AmesStat { asUdp :: TVar Word , asRcv :: TVar Word + , asSup :: TVar Word + , asFwd :: TVar Word + , asDrt :: TVar Word + , asDvr :: TVar Word + , asDml :: TVar Word , asSwp :: TVar Word , asBal :: TVar Word , asOky :: TVar Word @@ -18,11 +23,22 @@ newStat :: MonadIO m => m Stat newStat = do asUdp <- newTVarIO 0 asRcv <- newTVarIO 0 + asSup <- newTVarIO 0 + asFwd <- newTVarIO 0 + asDrt <- newTVarIO 0 + asDvr <- newTVarIO 0 + asDml <- newTVarIO 0 asSwp <- newTVarIO 0 asBal <- newTVarIO 0 asOky <- newTVarIO 0 pure Stat{statAmes = AmesStat{..}} +bump :: MonadIO m => TVar Word -> m () +bump s = atomically $ bump' s + +bump' :: TVar Word -> STM () +bump' s = modifyTVar' s (+ 1) + type RenderedStat = [Text] renderStat :: MonadIO m => Stat -> m RenderedStat @@ -30,10 +46,15 @@ renderStat Stat{statAmes = AmesStat{..}} = sequence [ pure "stat:" , pure " ames:" - , (" udp: " <>) <$> tshow <$> readTVarIO asUdp - , (" rcv: " <>) <$> tshow <$> readTVarIO asRcv - , (" swp: " <>) <$> tshow <$> readTVarIO asSwp - , (" bal: " <>) <$> tshow <$> readTVarIO asBal - , (" oky: " <>) <$> tshow <$> readTVarIO asOky + , (" udp ingress: " <>) <$> tshow <$> readTVarIO asUdp + , (" driver ingress: " <>) <$> tshow <$> readTVarIO asRcv + , (" sent to serf: " <>) <$> tshow <$> readTVarIO asSup + , (" forwarded: " <>) <$> tshow <$> readTVarIO asFwd + , (" dropped (unroutable): " <>) <$> tshow <$> readTVarIO asDrt + , (" dropped (wrong version): " <>) <$> tshow <$> readTVarIO asDvr + , (" dropped (malformed): " <>) <$> tshow <$> readTVarIO asDml + , (" serf swapped: " <>) <$> tshow <$> readTVarIO asSwp + , (" serf bailed: " <>) <$> tshow <$> readTVarIO asBal + , (" serf okay: " <>) <$> tshow <$> readTVarIO asOky ] From 0f4450d43b4e1c586ac12eb1ac41e82b8b021c9a Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 3 Dec 2020 23:23:46 -0800 Subject: [PATCH 03/27] king: remove spurious Term changes --- pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs index 2bf6327e4e..c05695be34 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Term.hs @@ -562,10 +562,6 @@ localClient doneSignal = fst <$> mkRAcquire start stop writeTQueue wq [Term.Trace "interrupt\r\n"] writeTQueue rq $ Ctl $ Cord "c" loop rd - else if w == 20 then do - -- DC4 (^T) - atomically $ writeTQueue wq [Term.Trace "\r\n"] - loop rd else if w <= 26 then do case pack [BS.w2c (w + 97 - 1)] of "d" -> atomically doneSignal From f5d1f9260c81b602620f784c9b2f5bc881dd4e1f Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 4 Dec 2020 14:19:03 -0800 Subject: [PATCH 04/27] king: more stats, log 'rotation' --- pkg/hs/urbit-king/lib/Urbit/King/App.hs | 3 ++- pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 19 +++++++------------ pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs | 3 +++ pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs | 17 ++++++++++++++++- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/King/App.hs b/pkg/hs/urbit-king/lib/Urbit/King/App.hs index 6be577a653..10fc2be305 100644 --- a/pkg/hs/urbit-king/lib/Urbit/King/App.hs +++ b/pkg/hs/urbit-king/lib/Urbit/King/App.hs @@ -119,7 +119,8 @@ defaultLogFile :: IO FilePath defaultLogFile = do logDir <- getXdgDirectory XdgCache "urbit" createDirectoryIfMissing True logDir - pure (logDir "king.log") + logId :: Word32 <- randomIO + pure (logDir "king-" <> show logId <> ".log") runKingEnvNoLog :: RIO KingEnv a -> IO a runKingEnvNoLog act = runKingEnv mempty mempty act diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index 4f083d3706..511821cff5 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -48,7 +48,6 @@ type Version = Word8 data AmesDrv = AmesDrv { aTurfs :: TVar (Maybe [Turf]) - , aDropped :: TVar Word , aVersion :: TVar (Maybe Version) , aUdpServ :: UdpServ , aResolvr :: ResolvServ @@ -167,7 +166,7 @@ ames' who isFake stat scry stderr = do pure Ouster dequeuePacket = do pM <- tryReadTQueue ventQ - when (isJust pM) $ modifyTVar avail (+ 1) + when (isJust pM) $ modifyTVar' avail (+ 1) pure pM env <- ask @@ -222,13 +221,11 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) cachedScryLane <- cache scryLane aTurfs <- newTVarIO Nothing - aDropped <- newTVarIO 0 aVersion <- newTVarIO Nothing aVersTid <- trackVersionThread aVersion aUdpServ <- udpServ isFake who stat aResolvr <- resolvServ aTurfs (usSend aUdpServ) stderr aRecvTid <- queuePacketsThread - aDropped aVersion cachedScryLane (send aUdpServ aResolvr mode) @@ -262,14 +259,13 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) threadDelay (10 * 60 * 1_000_000) -- 10m queuePacketsThread :: HasLogFunc e - => TVar Word - -> TVar (Maybe Version) + => TVar (Maybe Version) -> (Ship -> RIO e (Maybe [AmesDest])) -> (AmesDest -> ByteString -> RIO e ()) -> UdpServ -> AmesStat -> RIO e (Async ()) - queuePacketsThread dropCtr vers lan forward UdpServ{..} s@(AmesStat{..}) = async $ forever $ do + queuePacketsThread vers lan forward UdpServ{..} s@(AmesStat{..}) = async $ forever $ do -- port number, host address, bytestring (p, a, b) <- atomically (bump' asRcv >> usRecv) ver <- readTVarIO vers @@ -323,13 +319,12 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) where serfsUp p a b = atomically (enqueueEv (EvErr (hearEv p a b) (hearFailed s))) >>= \case - Intake -> pure () + Intake -> bump asSrf Ouster -> do d <- atomically $ do - d <- readTVar dropCtr - writeTVar dropCtr (d + 1) - pure d - when (d `rem` packetsDroppedPerComplaint == 0) $ + bump' asQuf + readTVar asQuf + when (d `rem` packetsDroppedPerComplaint == 1) $ logWarn "ames: queue full; dropping inbound packets" stop :: forall e. AmesDrv -> RIO e () diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs index 2df601fa40..f38b1a868b 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/UDP.hs @@ -193,6 +193,7 @@ realUdpServ por hos sat = do enqueueRecvPacket p a b = do did <- atomically (tryWriteTBQueue qRecv (p, a, b)) when (did == False) $ do + bump (asUqf sat) logWarn $ displayShow $ ("AMES", "UDP",) "Dropping inbound packet because queue is full." @@ -233,9 +234,11 @@ realUdpServ por hos sat = do Just sk -> do recvPacket sk >>= \case Left exn -> do + bump (asUdf sat) logError "AMES: UDP: Failed to receive packet" signalBrokenSocket sk Right Nothing -> do + bump (asUi6 sat) logError "AMES: UDP: Dropping non-ipv4 packet" pure () Right (Just (b, p, a)) -> do diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs index bff2349687..910df9c347 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Stat.hs @@ -8,8 +8,13 @@ data Stat = Stat data AmesStat = AmesStat { asUdp :: TVar Word + , asUqf :: TVar Word + , asUdf :: TVar Word + , asUi6 :: TVar Word , asRcv :: TVar Word , asSup :: TVar Word + , asSrf :: TVar Word + , asQuf :: TVar Word , asFwd :: TVar Word , asDrt :: TVar Word , asDvr :: TVar Word @@ -22,8 +27,13 @@ data AmesStat = AmesStat newStat :: MonadIO m => m Stat newStat = do asUdp <- newTVarIO 0 + asUqf <- newTVarIO 0 + asUdf <- newTVarIO 0 + asUi6 <- newTVarIO 0 asRcv <- newTVarIO 0 asSup <- newTVarIO 0 + asSrf <- newTVarIO 0 + asQuf <- newTVarIO 0 asFwd <- newTVarIO 0 asDrt <- newTVarIO 0 asDvr <- newTVarIO 0 @@ -47,8 +57,13 @@ renderStat Stat{statAmes = AmesStat{..}} = [ pure "stat:" , pure " ames:" , (" udp ingress: " <>) <$> tshow <$> readTVarIO asUdp + , (" udp queue evict: " <>) <$> tshow <$> readTVarIO asUqf + , (" udp recv fail: " <>) <$> tshow <$> readTVarIO asUdf + , (" udp dropped non-ipv4: " <>) <$> tshow <$> readTVarIO asUi6 , (" driver ingress: " <>) <$> tshow <$> readTVarIO asRcv - , (" sent to serf: " <>) <$> tshow <$> readTVarIO asSup + , (" enqueued for serf: " <>) <$> tshow <$> readTVarIO asSup + , (" sent to serf: " <>) <$> tshow <$> readTVarIO asSrf + , (" serf queue evict: " <>) <$> tshow <$> readTVarIO asQuf , (" forwarded: " <>) <$> tshow <$> readTVarIO asFwd , (" dropped (unroutable): " <>) <$> tshow <$> readTVarIO asDrt , (" dropped (wrong version): " <>) <$> tshow <$> readTVarIO asDvr From 50ce7370dcaa334111185abe94c39a8cf6a292be Mon Sep 17 00:00:00 2001 From: fang Date: Sat, 5 Dec 2020 02:29:20 +0100 Subject: [PATCH 05/27] vere: report, not crash, on unreasonable -Y and -Z Previously, we would crash on attempting to +scot cells, or parse invalid paths. Now we catch those cases, and print legible error messages instead. --- pkg/urbit/vere/pier.c | 70 +++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/pkg/urbit/vere/pier.c b/pkg/urbit/vere/pier.c index 02d15f2834..7216bab3b6 100644 --- a/pkg/urbit/vere/pier.c +++ b/pkg/urbit/vere/pier.c @@ -461,6 +461,14 @@ u3_pier_peek_last(u3_pier* pir_u, _pier_peek_plan(pir_u, pic_u); } +/* _pier_stab(): parse path +*/ +static u3_noun +_pier_stab(u3_noun pac) +{ + return u3do("stab", pac); +} + /* _pier_on_scry_done(): scry callback. */ static void @@ -473,48 +481,64 @@ _pier_on_scry_done(void* ptr_v, u3_noun nun) u3l_log("pier: scry failed\n"); } else { + u3_weak out, pad; + c3_c *ext_c, *pac_c; + u3l_log("pier: scry succeeded\n"); - // serialize as desired + if ( u3_Host.ops_u.puk_c ) { + pac_c = u3_Host.ops_u.puk_c; + } + else { + pac_c = u3_Host.ops_u.pek_c; + } + + // try to serialize as requested // - u3_atom out; - c3_c* ext_c; { u3_atom puf = u3i_string(u3_Host.ops_u.puf_c); if ( c3y == u3r_sing(c3__jam, puf) ) { out = u3qe_jam(res); ext_c = "jam"; } - else { + else if ( c3y == u3a_is_atom(res) ) { out = u3dc("scot", u3k(puf), u3k(res)); ext_c = "txt"; } + else { + u3l_log("pier: cannot export cell as %s\n", u3_Host.ops_u.puf_c); + out = u3_none; + } u3z(puf); } - c3_c* pac_c = u3_Host.ops_u.puk_c; - if (!pac_c) { - pac_c = u3_Host.ops_u.pek_c; - } - - u3_noun pad; + // try to build export target path + // { - // XX crashes if [pac_c] is not a valid path - // XX virtualize or fix - // - u3_noun pax = u3do("stab", u3i_string(pac_c)); - c3_w len_w = u3kb_lent(u3k(pax)); - pad = u3nt(c3_s4('.','u','r','b'), - c3_s3('p','u','t'), - u3qb_scag(len_w - 1, pax)); - u3z(pax); + u3_noun pro = u3m_soft(0, _pier_stab, u3i_string(pac_c)); + if ( 0 == u3h(pro) ) { + c3_w len_w = u3kb_lent(u3k(u3t(pro))); + pad = u3nt(c3_s4('.', 'u', 'r', 'b'), + c3_s3('p', 'u', 't'), + u3qb_scag(len_w - 1, u3t(pro))); + } + else { + u3l_log("pier: invalid export path %s\n", pac_c); + pad = u3_none; + } + u3z(pro); } - c3_c fil_c[2048]; - snprintf(fil_c, 2048, "%s/.urb/put/%s.%s", pir_u->pax_c, pac_c+1, ext_c); + // if serialization and export path succeeded, write to disk + // + if ( (u3_none != out) && (u3_none != pad) ) { + c3_c fil_c[2048]; + snprintf(fil_c, 2048, "%s/.urb/put/%s.%s", + pir_u->pax_c, pac_c+1, ext_c); - u3_walk_save(fil_c, 0, out, pir_u->pax_c, pad); - u3l_log("pier: scry in %s\n", fil_c); + u3_walk_save(fil_c, 0, out, pir_u->pax_c, pad); + u3l_log("pier: scry result in %s\n", fil_c); + } } u3l_log("pier: exit\n"); From 18e40a46d0ce8efcce5e52c46c4d9fabfe27866d Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 9 Dec 2020 22:12:18 +0100 Subject: [PATCH 06/27] vere: commit the specified mountpoint only Instead of committing all mountpoints regardless of what was specified. --- pkg/urbit/vere/io/unix.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/urbit/vere/io/unix.c b/pkg/urbit/vere/io/unix.c index ec07e53a54..b27921936f 100644 --- a/pkg/urbit/vere/io/unix.c +++ b/pkg/urbit/vere/io/unix.c @@ -79,7 +79,7 @@ struct _u3_ufil; } u3_unix; void -u3_unix_ef_look(u3_unix* unx_u, u3_noun all); +u3_unix_ef_look(u3_unix* unx_u, u3_noun mon, u3_noun all); /* u3_readdir_r(): */ @@ -609,8 +609,7 @@ static void _unix_commit_mount_point(u3_unix* unx_u, u3_noun mon) { unx_u->dyr = c3y; - u3z(mon); - u3_unix_ef_look(unx_u, c3n); + u3_unix_ef_look(unx_u, mon, c3n); return; } @@ -1355,19 +1354,25 @@ u3_unix_release(c3_c* pax_c) c3_free(paf_c); } -/* u3_unix_ef_look(): update the root. +/* u3_unix_ef_look(): update the root of a specific mount point. */ void -u3_unix_ef_look(u3_unix* unx_u, u3_noun all) +u3_unix_ef_look(u3_unix* unx_u, u3_noun mon, u3_noun all) { if ( c3y == unx_u->dyr ) { unx_u->dyr = c3n; - u3_umon* mon_u; + u3_umon* mon_u = unx_u->mon_u; - for ( mon_u = unx_u->mon_u; mon_u; mon_u = mon_u->nex_u ) { + while ( mon_u && ( c3n == u3r_sing_c(mon_u->nam_c, mon) ) ) { + mon_u = mon_u->nex_u; + } + + if ( mon_u ) { _unix_update_mount(unx_u, mon_u, all); } } + + u3z(mon); } /* _unix_io_talk(): start listening for fs events. From 1a9b1a83a57574f1bb7a3bfc37d999c16d9ae404 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 10 Dec 2020 17:56:56 -0800 Subject: [PATCH 07/27] king: 'implement' joe's breaching ev/ef path reform --- pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs | 13 +++++- pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs | 50 ++++++---------------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs index b6a2bd1747..db78cc955f 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs @@ -254,14 +254,23 @@ data Ef | EfExit Cord EvilPath -- second path component, rest of path deriving (Eq, Ord, Show) +-- XX HACK +clip :: Noun -> Noun +clip (C (C _ x) y) = C x y +clip _ = error "misclip" + +tack :: Noun -> Noun +tack (C x y) = C (C (A 0) x) y +tack _ = error "mistack" + instance ToNoun Ef where - toNoun = \case + toNoun = clip . \case EfVane v -> toNoun $ reorgThroughNoun ("", v) EfExit s p -> toNoun $ ReOrg "" s "exit" p (A 0) EfVega s p -> toNoun $ ReOrg "" s "vega" p (A 0) instance FromNoun Ef where - parseNoun = parseNoun >=> \case + parseNoun = tack >>> parseNoun >=> \case ReOrg "" s "exit" p (A 0) -> pure (EfExit s p) ReOrg "" s "exit" p _ -> fail "%exit effect expects nil value" ReOrg "" s "vega" p (A 0) -> pure (EfVega s p) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs index f95166a495..cfd968a8f0 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs @@ -218,9 +218,7 @@ instance Show Entropy where data ArvoEv = ArvoEvWhom () Ship | ArvoEvWack () Entropy - | ArvoEvWarn Path Noun | ArvoEvCrud Path Noun - | ArvoEvVeer Atom Noun deriving (Eq, Ord, Show) deriveNoun ''ArvoEv @@ -318,50 +316,29 @@ data BlipEv deriveNoun ''BlipEv --- Boot Events ----------------------------------------------------------------- - -data Vane - = VaneVane VaneEv - | VaneZuse ZuseEv - deriving (Eq, Ord, Show) - -data VaneName - = Ames | Behn | Clay | Dill | Eyre | Ford | Gall | Iris | Jael - deriving (Eq, Ord, Show, Enum, Bounded) - -data ZuseEv - = ZEVeer () Cord Path BigCord - | ZEVoid Void - deriving (Eq, Ord, Show) - -data VaneEv - = VEVeer (VaneName, ()) Cord Path BigCord - | VEVoid Void - deriving (Eq, Ord, Show) - -deriveNoun ''Vane -deriveNoun ''VaneName -deriveNoun ''VaneEv -deriveNoun ''ZuseEv - - -- The Main Event Type --------------------------------------------------------- data Ev = EvBlip BlipEv - | EvVane Vane deriving (Eq, Show) instance ToNoun Ev where - toNoun = \case - EvBlip v -> toNoun $ reorgThroughNoun (Cord "", v) - EvVane v -> toNoun $ reorgThroughNoun (Cord "vane", v) + toNoun = toNoun . \case + EvBlip v@BlipEvAmes{} -> reorgThroughNoun ("ames", v) + EvBlip v@BlipEvArvo{} -> reorgThroughNoun ("", v) + EvBlip v@BlipEvBehn{} -> reorgThroughNoun ("behn", v) + EvBlip v@BlipEvBoat{} -> reorgThroughNoun ("clay", v) + EvBlip v@BlipEvHttpClient{} -> reorgThroughNoun ("iris", v) + EvBlip v@BlipEvHttpServer{} -> reorgThroughNoun ("eyre", v) + EvBlip v@BlipEvNewt{} -> reorgThroughNoun ("ames", v) + EvBlip v@BlipEvSync{} -> reorgThroughNoun ("clay", v) + EvBlip v@BlipEvTerm{} -> reorgThroughNoun ("dill", v) +-- XX We really should check the first path element, but since this is used only +-- in the event browser, which otherwise is broken, I don't care right now. instance FromNoun Ev where parseNoun = parseNoun >=> \case - ReOrg "" s t p v -> fmap EvBlip $ parseNoun $ toNoun (s,t,p,v) - ReOrg "vane" s t p v -> fmap EvVane $ parseNoun $ toNoun (s,t,p,v) - ReOrg _ _ _ _ _ -> fail "First path-elem must be ?($ %vane)" + ReOrg _ s t p v -> fmap EvBlip $ parseNoun $ toNoun (s,t,p,v) -- Short Event Names ----------------------------------------------------------- @@ -373,7 +350,6 @@ instance FromNoun Ev where -} getSpinnerNameForEvent :: Ev -> Maybe Text getSpinnerNameForEvent = \case - EvVane _ -> Nothing EvBlip b -> case b of BlipEvAmes _ -> Just "ames" BlipEvArvo _ -> Just "arvo" From 716ed1203b70cf24d6a3590d1d147a5fedd3258d Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 10 Dec 2020 18:05:10 -0800 Subject: [PATCH 08/27] king: fix warning --- pkg/hs/urbit-king/lib/Urbit/Vere/Behn.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Behn.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Behn.hs index 35c462ac22..0957a8eda4 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Behn.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Behn.hs @@ -10,7 +10,7 @@ module Urbit.Vere.Behn (behn, DriverApi(..), behn') where import Data.Time.Clock.System (SystemTime) -import Urbit.Arvo hiding (Behn) +import Urbit.Arvo import Urbit.Prelude import Urbit.Vere.Pier.Types From 876fb521eefb255ca6ac43be6297e53ec902266b Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Thu, 3 Dec 2020 13:41:03 -0500 Subject: [PATCH 09/27] First draft adding wyrd; doesn't boot. --- pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs | 22 +++++++++++++- pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs | 3 +- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 24 +++++++++++++++ pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs | 30 +++++++++++++++++-- .../urbit-king/lib/Urbit/Vere/Serf/Types.hs | 5 +++- 5 files changed, 79 insertions(+), 5 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs index f02c7f69d5..4794e0322a 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs @@ -12,6 +12,7 @@ -} module Urbit.Arvo.Common ( KingId(..), ServId(..) + , Vere(..), Wynn(..) , Json, JsonNode(..) , Desk(..), Mime(..) , Port(..), Turf(..) @@ -21,7 +22,7 @@ module Urbit.Arvo.Common , AmesDest, Ipv4(..), Ipv6(..), Patp(..), Galaxy, AmesAddress(..) ) where -import Urbit.Prelude hiding (Term) +import Urbit.Prelude import Control.Monad.Fail (fail) @@ -45,6 +46,25 @@ newtype KingId = KingId { unKingId :: UV } newtype ServId = ServId { unServId :: UV } deriving newtype (Eq, Ord, Show, Num, Enum, Integral, Real, FromNoun, ToNoun) +-- Arvo Version Negotiation ---------------------------------------------------- + +-- Information about the king runtime passed to Arvo. +data Vere = Vere { vereName :: Term, + vereRev :: (Term, UD, UD, UD), + vereWynn :: Wynn } + deriving (Eq, Ord, Show) + +instance ToNoun Vere where + toNoun Vere{..} = toNoun ((vereName, vereRev), vereWynn) + +instance FromNoun Vere where + parseNoun n = named "Vere" $ do + ((vereName, vereRev), vereWynn) <- parseNoun n + pure $ Vere {..} + +-- A list of names and their kelvin numbers, used in version negotiations. +newtype Wynn = Wynn { unWynn :: [(Term, UD)] } + deriving newtype (Eq, Ord, Show, FromNoun, ToNoun) -- Http Common ----------------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs index f95166a495..6c1c458daf 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs @@ -12,7 +12,7 @@ module Urbit.Arvo.Event where import Urbit.Prelude hiding (Term) import Control.Monad.Fail (fail) -import Urbit.Arvo.Common (KingId(..), ServId(..)) +import Urbit.Arvo.Common (KingId(..), ServId(..), Vere(..)) import Urbit.Arvo.Common (Desk, Mime) import Urbit.Arvo.Common (Header(..), HttpEvent) import Urbit.Arvo.Common (AmesDest, Ipv4, Ipv6, Port, Turf) @@ -221,6 +221,7 @@ data ArvoEv | ArvoEvWarn Path Noun | ArvoEvCrud Path Noun | ArvoEvVeer Atom Noun + | ArvoEvWyrd Vere deriving (Eq, Ord, Show) deriveNoun ''ArvoEv diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index ed18cefc7e..158ba43507 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -335,6 +335,10 @@ pier (serf, log) vSlog startedSig injected = do tSerf <- acquireWorker "Serf" (runCompute serf computeConfig) + -- TODO: Go through the version negotionation with the serf. Before we start + -- the drivers, we send a %wyrd event and wait for a %wynn + doVersionNegotiation compute + -- Run all born events and retry them until they succeed. wackEv <- EvBlip . BlipEvArvo . ArvoEvWack () <$> genEntropy rio $ for_ (wackEv : bootEvents) $ \ev -> do @@ -414,6 +418,26 @@ death tag tid = do Left exn -> Left (tag, exn) Right () -> Right tag +-- %wyrd version negotiation --------------------------------------------------- + +doVersionNegotiation + :: HasPierEnv e + => (RunReq -> STM ()) + -> RAcquire e () +doVersionNegotiation compute = do + -- What we want to do is actually inspect the effects here. + arvoVer <- fromNounExn $ toNoun $ Cord "arvo-kelvin" + let k = Wynn [("zuse", 309), + ("arvo", arvoVer), + ("hoon", 141), + ("nock", 4)] + sen = MkTerm "121331" -- TODO: What is sen? I can just generate a nonce here. + v = Vere sen ("KingHaskell", 0, 10, 9) k + + retVar <- newEmptyTMVarIO + atomically $ compute $ RRWyrd v (putTMVar retVar) + ret <- atomically $ takeTMVar retVar + pure () -- Start All Drivers ----------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs index 71c2ef2f38..70cc7a28ac 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs @@ -84,7 +84,8 @@ import Foreign.Ptr (castPtr) import Foreign.Storable (peek, poke) import RIO.Prelude (decodeUtf8Lenient) import System.Posix.Signals (sigINT, sigKILL, signalProcess) -import Urbit.Arvo (Ev, FX) +import Urbit.Arvo (FX, Vere, Wynn) +import Urbit.Arvo.Event import Urbit.Noun.Time (Wen) import qualified Data.ByteString as BS @@ -367,6 +368,27 @@ compact serf = withSerfLockIO serf $ \ss -> do sendCompactionRequest serf pure (ss, ()) +{-| + Tells the serf our version number and puts any returned version information + into the passed in d +-} +wyrd :: Vere -> (Maybe Wynn -> STM ()) -> Serf -> IO () +wyrd v ret serf = withSerfLockIO serf $ \ss -> do + now <- Time.now + sendWrit serf (WWork 0 now $ EvBlip $ BlipEvArvo $ ArvoEvWyrd v) + recvWork serf >>= \case + WBail goofs -> do + throwIO (BailDuringWyrd goofs) + WSwap eid hash (wen, noun) fx -> do + throwIO (SwapDuringWyrd hash (wen, noun) fx) + WDone eid hash fx -> do + -- Looks at the + + pure (ss, ()) + + -- yield (eid, fx) + -- loop hash eid + {-| Peek into the serf state. -} @@ -374,7 +396,6 @@ scry :: Serf -> Wen -> Gang -> Path -> IO (Maybe (Term, Noun)) scry serf w g p = withSerfLockIO serf $ \ss -> do (ss,) <$> sendScryRequest serf w g p - {-| Given a list of boot events, send them to to the serf in a single %play message. They must all be sent in a single %play event so that @@ -493,11 +514,15 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRSave () -> doSave RRKill () -> doKill RRPack () -> doPack + RRWyrd v ret -> doWyrd v ret RRScry w g p k -> doScry w g p k doPack :: IO () doPack = compact serf >> topLoop + doWyrd :: Vere -> (Maybe Wynn -> STM ()) -> IO () + doWyrd v w = wyrd v w serf >> topLoop + waitForLog :: IO () waitForLog = do serfLast <- serfLastEventBlocking serf @@ -530,6 +555,7 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRSave () -> atomically (closeTBMQueue que) >> pure doSave RRPack () -> atomically (closeTBMQueue que) >> pure doPack RRScry w g p k -> atomically (closeTBMQueue que) >> pure (doScry w g p k) + RRWyrd v ret -> atomically (closeTBMQueue que) >> pure (doWyrd v ret) RRWork workErr -> atomically (writeTBMQueue que workErr) >> workLoop que onWorkResp :: Wen -> EvErr -> Work -> IO () diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs index 91f8a659ed..5de79b269b 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs @@ -2,7 +2,7 @@ module Urbit.Vere.Serf.Types where import Urbit.Prelude -import Urbit.Arvo (Ev, FX) +import Urbit.Arvo (Ev, FX, Vere, Wynn) import Urbit.Noun.Time (Wen) @@ -94,6 +94,7 @@ data RunReq | RRSave () | RRKill () | RRPack () + | RRWyrd Vere (Maybe Wynn -> STM ()) | RRScry Wen Gang Path (Maybe (Term, Noun) -> IO ()) @@ -111,6 +112,8 @@ data SerfExn | SerfNotRunning | MissingBootEventsInEventLog Word Word | SnapshotAheadOfLog EventId EventId + | BailDuringWyrd [Goof] + | SwapDuringWyrd Mug (Wen, Noun) FX deriving (Show, Exception) From 4f67f90c9c47a72e52e11d087deeeadf1ca89b07 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 7 Dec 2020 10:34:47 -0500 Subject: [PATCH 10/27] Dumping --- pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs | 2 +- pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs index 6c1c458daf..745e22d12b 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs @@ -362,7 +362,7 @@ instance FromNoun Ev where parseNoun = parseNoun >=> \case ReOrg "" s t p v -> fmap EvBlip $ parseNoun $ toNoun (s,t,p,v) ReOrg "vane" s t p v -> fmap EvVane $ parseNoun $ toNoun (s,t,p,v) - ReOrg _ _ _ _ _ -> fail "First path-elem must be ?($ %vane)" + ReOrg x _ _ _ _ -> fail $ "First path-elem must be ?($ %vane): found " ++ show x -- Short Event Names ----------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs index 70cc7a28ac..bbb8612a83 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs @@ -382,13 +382,10 @@ wyrd v ret serf = withSerfLockIO serf $ \ss -> do WSwap eid hash (wen, noun) fx -> do throwIO (SwapDuringWyrd hash (wen, noun) fx) WDone eid hash fx -> do - -- Looks at the - + -- TODO: fish around in the fx for the upgrade event here. The equivalent + -- of _pier_on_lord_wyrd_done(). pure (ss, ()) - -- yield (eid, fx) - -- loop hash eid - {-| Peek into the serf state. -} From aefb53e64e8e65113e168a1e8ded1bb0cfe0f95b Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Tue, 15 Dec 2020 13:46:26 -0800 Subject: [PATCH 11/27] king: path format chage, fix tests --- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 12 +++++--- .../urbit-king/lib/Urbit/Vere/Pier/Types.hs | 15 ++++++---- pkg/hs/urbit-king/test/ArvoTests.hs | 30 +------------------ pkg/hs/urbit-king/test/Options.hs | 2 +- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 8f1169e88e..52820353f4 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -70,16 +70,20 @@ setupPierDirectory shipPath = do -- Load pill into boot sequence. ----------------------------------------------- +data CannotBootFromIvoryPill = CannotBootFromIvoryPill + deriving (Show, Exception) + genEntropy :: MonadIO m => m Entropy genEntropy = Entropy . fromIntegral . bytesAtom <$> io (Ent.getEntropy 64) genBootSeq :: MonadIO m => Ship -> Pill -> Bool -> LegacyBootEvent -> m BootSeq -genBootSeq ship Pill {..} lite boot = io $ do +genBootSeq _ PillIvory {} _ _ = throwIO CannotBootFromIvoryPill +genBootSeq ship PillPill {..} lite boot = io $ do ent <- genEntropy - let ovums = preKern ent <> pKernelOvums <> postKern <> pUserspaceOvums - pure $ BootSeq ident pBootFormulas ovums + let ova = preKern ent <> pKernelOva <> postKern <> pUserspaceOva + pure $ BootSeq ident pBootFormulae ova where - ident = LogIdentity ship isFake (fromIntegral $ length pBootFormulas) + ident = LogIdentity ship isFake (fromIntegral $ length pBootFormulae) preKern ent = [ EvBlip $ BlipEvArvo $ ArvoEvWhom () ship , EvBlip $ BlipEvArvo $ ArvoEvWack () ent diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs index ab5adba732..3b01660a86 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs @@ -17,7 +17,7 @@ module Urbit.Vere.Pier.Types ) where -import Urbit.Prelude hiding (Term) +import Urbit.Prelude import Urbit.Arvo import Urbit.Noun.Time @@ -44,11 +44,14 @@ instance Show Nock where -------------------------------------------------------------------------------- -data Pill = Pill - { pBootFormulas :: ![Nock] - , pKernelOvums :: ![Ev] - , pUserspaceOvums :: ![Ev] - } +data Pill + = PillIvory [Noun] + | PillPill + { pName :: Term + , pBootFormulae :: ![Nock] + , pKernelOva :: ![Ev] + , pUserspaceOva :: ![Ev] + } deriving (Eq, Show) data BootSeq = BootSeq !LogIdentity ![Nock] ![Ev] diff --git a/pkg/hs/urbit-king/test/ArvoTests.hs b/pkg/hs/urbit-king/test/ArvoTests.hs index b2396b4296..bdd87ff3eb 100644 --- a/pkg/hs/urbit-king/test/ArvoTests.hs +++ b/pkg/hs/urbit-king/test/ArvoTests.hs @@ -31,18 +31,6 @@ roundTrip x = Just x == fromNoun (toNoun x) nounEq :: (ToNoun a, ToNoun b) => a -> b -> Bool nounEq x y = toNoun x == toNoun y -data EvExample = EvEx Ev Noun - deriving (Eq, Show) - -eventSanity :: [EvExample] -> Bool -eventSanity = all $ \(EvEx e n) -> toNoun e == n - -instance Arbitrary EvExample where - arbitrary = oneof $ fmap pure $ - [ EvEx (EvVane $ VaneVane $ VEVeer (Jael, ()) "" (Path []) "") - (toNoun (Path ["vane", "vane", "jael"], Cord "veer", (), (), ())) - ] - -------------------------------------------------------------------------------- tests :: TestTree @@ -51,7 +39,6 @@ tests = [ testProperty "Round Trip Effect" (roundTrip @Ef) , testProperty "Round Trip Event" (roundTrip @Ev) , testProperty "Round Trip AmesDest" (roundTrip @AmesDest) - , testProperty "Basic Event Sanity" eventSanity ] @@ -131,24 +118,9 @@ instance Arbitrary BlipEv where ] instance Arbitrary Ev where - arbitrary = oneof [ EvVane <$> arb - , EvBlip <$> arb + arbitrary = oneof [ EvBlip <$> arb ] -instance Arbitrary Vane where - arbitrary = oneof [ VaneVane <$> arb - , VaneZuse <$> arb - ] - -instance Arbitrary VaneName where - arbitrary = oneof $ pure <$> [minBound .. maxBound] - -instance Arbitrary VaneEv where - arbitrary = VEVeer <$> arb <*> arb <*> arb <*> arb - -instance Arbitrary ZuseEv where - arbitrary = ZEVeer () <$> arb <*> arb <*> arb - instance Arbitrary StdMethod where arbitrary = oneof $ pure <$> [ minBound .. maxBound ] diff --git a/pkg/hs/urbit-king/test/Options.hs b/pkg/hs/urbit-king/test/Options.hs index 21f1f826ad..3b9aa7456c 100644 --- a/pkg/hs/urbit-king/test/Options.hs +++ b/pkg/hs/urbit-king/test/Options.hs @@ -35,7 +35,7 @@ instance KnownSymbol name => Options.IsOption (Pill name) where ) defaultValue = - Pill ( "../../../bin" + Pill ( "../../../bin/" ++ TypeLits.symbolVal (Proxy @name) ++ ".pill" ) From 13590dec37d48b900726a5f3a78f911fa97dbea1 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Dec 2020 13:54:26 -0800 Subject: [PATCH 12/27] vere: set arvo verbosity based on presence of -v --- pkg/urbit/vere/io/fore.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/urbit/vere/io/fore.c b/pkg/urbit/vere/io/fore.c index cb46fd187d..1834cc7e11 100644 --- a/pkg/urbit/vere/io/fore.c +++ b/pkg/urbit/vere/io/fore.c @@ -121,14 +121,10 @@ _fore_io_talk(u3_auto* car_u) // set verbose as per -v // - // XX should be explicit, not a toggle - // - if ( c3y == u3_Host.ops_u.veb ) { - // XX this path shouldn't be necessary - // - wir = u3nt(c3__term, '1', u3_nul); - cad = u3nc(c3__verb, u3_nul); - + { + c3_o lac_o = ( c3y == u3_Host.ops_u.veb ) ? c3n : c3y; + wir = u3nc(c3__arvo, u3_nul); + cad = u3nt(c3__verb, u3_nul, lac_o); u3_auto_plan(car_u, u3_ovum_init(0, u3_blip, wir, cad)); } From 4d9fc482384d76d1779573aa6d6e6816845b0856 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Dec 2020 13:58:48 -0800 Subject: [PATCH 13/27] vere: refactor wire handling in boot sequence construction --- pkg/urbit/vere/pier.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkg/urbit/vere/pier.c b/pkg/urbit/vere/pier.c index 42f12a0b4c..eb491fd965 100644 --- a/pkg/urbit/vere/pier.c +++ b/pkg/urbit/vere/pier.c @@ -1707,20 +1707,18 @@ _pier_boot_make(u3_noun who, u3_noun wyr, u3_noun ven, u3_noun pil) // prepend entropy and identity to the module sequence // { - u3_noun wir, cad; + u3_noun cad, wir = u3nt(u3_blip, c3__arvo, u3_nul); c3_w eny_w[16]; - c3_rand(eny_w); - wir = u3nt(u3_blip, c3__arvo, u3_nul); + cad = u3nc(c3__wack, u3i_words(16, eny_w)); - bot_u.mod = u3nc(u3nc(wir, cad), bot_u.mod); + bot_u.mod = u3nc(u3nc(u3k(wir), cad), bot_u.mod); + + cad = u3nc(c3__whom, who); // transfer [who] + bot_u.mod = u3nc(u3nc(u3k(wir), cad), bot_u.mod); wir = u3nt(u3_blip, c3__arvo, u3_nul); - cad = u3nc(c3__whom, who); // transfer - bot_u.mod = u3nc(u3nc(wir, cad), bot_u.mod); - - wir = u3nt(u3_blip, c3__arvo, u3_nul); - bot_u.mod = u3nc(u3nc(wir, wyr), bot_u.mod); + bot_u.mod = u3nc(u3nc(wir, wyr), bot_u.mod); // transfer [wir] and [wyr] } // prepend legacy boot event to the userspace sequence From ee5bd32a744ddd9ede3d436f028f602dc9576604 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Dec 2020 14:01:03 -0800 Subject: [PATCH 14/27] vere: also set arvo verbosity early during boot --- pkg/urbit/vere/pier.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/urbit/vere/pier.c b/pkg/urbit/vere/pier.c index eb491fd965..af93fed230 100644 --- a/pkg/urbit/vere/pier.c +++ b/pkg/urbit/vere/pier.c @@ -1711,6 +1711,9 @@ _pier_boot_make(u3_noun who, u3_noun wyr, u3_noun ven, u3_noun pil) c3_w eny_w[16]; c3_rand(eny_w); + cad = u3nt(c3__verb, u3_nul, ( c3y == u3_Host.ops_u.veb ) ? c3n : c3y); + bot_u.mod = u3nc(u3nc(u3k(wir), cad), bot_u.mod); + cad = u3nc(c3__wack, u3i_words(16, eny_w)); bot_u.mod = u3nc(u3nc(u3k(wir), cad), bot_u.mod); From 268a012c548e06d1a2bbfb7469275c2419320ae4 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Dec 2020 14:10:31 -0800 Subject: [PATCH 15/27] jets: fix "hot jet" registraton path printing --- pkg/urbit/noun/jets.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/urbit/noun/jets.c b/pkg/urbit/noun/jets.c index e443e7b3b9..0b3e2fb7aa 100644 --- a/pkg/urbit/noun/jets.c +++ b/pkg/urbit/noun/jets.c @@ -1796,13 +1796,13 @@ _cj_minx(u3_noun cey, u3_noun cor) } static void -_cj_print_tas(FILE* fh, u3_noun tas) +_cj_print_tas(u3_noun tas) { c3_w met_w = u3r_met(3, tas); c3_c* str_c = alloca(met_w + 1); u3r_bytes(0, met_w, (c3_y*)str_c, tas); str_c[met_w] = 0; - fprintf(fh, "/%s", str_c); + u3l_log("/%s", str_c); } /* _cj_mine(): declare a core and produce location. RETAIN. @@ -1851,7 +1851,7 @@ _cj_mine(u3_noun cey, u3_noun cor, u3_noun bas) u3_noun i = bal; u3l_log("hot jet: "); while ( i != u3_nul ) { - _cj_print_tas(stderr, u3h(i)); + _cj_print_tas(u3h(i)); i = u3t(i); } u3l_log("\r\n axe %d, jax %d,\r\n bash ", axe, jax_l); From 5cff66347df02c42fdd3faa7ea4c4465c7ce7168 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Dec 2020 14:10:44 -0800 Subject: [PATCH 16/27] jets: updates declarations, adding/updating hashes and hooks --- pkg/urbit/jets/tree.c | 433 ++++++++++++++++++++++++++++-------------- 1 file changed, 289 insertions(+), 144 deletions(-) diff --git a/pkg/urbit/jets/tree.c b/pkg/urbit/jets/tree.c index eb06e6efd0..e9c5066e61 100644 --- a/pkg/urbit/jets/tree.c +++ b/pkg/urbit/jets/tree.c @@ -17,11 +17,13 @@ static u3j_harm _140_hex_mimes_base16_en_a[] = {{".2", u3we_en_base16}, {}}; static c3_c* _140_hex_mimes_base16_en_ha[] = { + "669807766b6802719769fcbfe149d77fb352fcf0922afaf35dc4ab8c201d84e5", 0 }; static u3j_harm _140_hex_mimes_base16_de_a[] = {{".2", u3we_de_base16}, {}}; static c3_c* _140_hex_mimes_base16_de_ha[] = { + "f1e04d0f452f2783e17b3bd5bbbcf95a651624fe7a2aca28dd9a7feae1319734", 0 }; @@ -31,6 +33,7 @@ static u3j_core _140_hex_mimes_base16_d[] = {} }; static c3_c* _140_hex_mimes_base16_ha[] = { + "c71bdcc8542fd49aa307f296ac097e300a714fb3b3d1e475426f0916fa61f12c", 0 }; @@ -39,92 +42,99 @@ static u3j_core _140_hex_mimes_d[] = {} }; static c3_c* _140_hex_mimes_ha[] = { + "bca2510fd7172643812f9d224deb95ddd69400c990db3d8cfb517a7292e8f06e", 0 }; static u3j_harm _140_hex_aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}}; static c3_c* _140_hex_aes_ecba_en_ha[] = { - "a4eaaead7ffeb213cf8d611f20d7be4786b34f31a27f41c77538125992107c2d", + "d7674ad72666a787580c52785c5d4d37ca462ba05e904efbeded5d1bd8b02b4b", 0 }; static u3j_harm _140_hex_aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}}; static c3_c* _140_hex_aes_ecba_de_ha[] = { - "f34036da1666cd2a19be04684f44486fe5e90cbab96d5288e19c4e2bad6e07dd", + "6e6599e93bea2e4297b621814bfb17a9b10849f920d50b14e808ef2e4fe62383", 0 }; static u3j_harm _140_hex_aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}}; static c3_c* _140_hex_aes_ecbb_en_ha[] = { - "44678df63ff8c63be64266d3c06c4a27efbe99f21f078ed3698d3d45fae1807f", + "2c0e3c8f4d741b37324563ecd0ab8fbf87721d1e017f1eeeaf8b6a60515c483b", 0 }; static u3j_harm _140_hex_aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}}; static c3_c* _140_hex_aes_ecbb_de_ha[] = { - "81d2f078236aecaecfebd1d0f69fad64dcada7a7478f50c97ecf7d43a5b48f0c", + "cf78f314a1dbbc53b28d6405b98c66a4451350757872d8f7cf0477411e731acc", 0 }; static u3j_harm _140_hex_aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}}; static c3_c* _140_hex_aes_ecbc_en_ha[] = { - "ecc3da3bdd3381476eb826cdfb1b839b19e550bb3b4798c8cf7c308efa897c79", + "f56450f2662082e27ba1aecd2fe04c66aa8641d6eb155f8d3707e242a1e1cf1c", 0 }; static u3j_harm _140_hex_aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}}; static c3_c* _140_hex_aes_ecbc_de_ha[] = { - "62e93207275b261a281ad76250408da7cfc6eb6e87bc4b3fd5d99bbf8acc58bd", + "28c8c44002799fbe94d4aa07922f2b74dbbf234c84684cd8c3187622b4be6a5f", 0 }; static u3j_harm _140_hex_aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}}; static c3_c* _140_hex_aes_cbca_en_ha[] = { - "6b9c992891931f63d0db62d7b28436f88fa6a5cad9920740e94b531cdbf6a7ea", + "f85366d520b3179c5dabfb58ee1fa0554f5044f676340439db875841cd4058de", 0 }; static u3j_harm _140_hex_aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}}; static c3_c* _140_hex_aes_cbca_de_ha[] = { - "7ddd8a076c15ff737f9e3a0b91bc531c4f7f4a40733fb23e3a3dde98be86bb63", + "8b876fbdb1849d8fbabba5e143aea0532a0e5dfff1c784d7ad15fd497ea376b1", 0 }; static u3j_harm _140_hex_aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}}; static c3_c* _140_hex_aes_cbcb_en_ha[] = { - "449ea4600038a80c659705342f6f855a683ad933543679c8f37239e4e438b0d1", + "6f961e0629c5efce47793e6a352220d355bb8fba6656c6941a68efb3ba10999d", 0 }; static u3j_harm _140_hex_aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}}; static c3_c* _140_hex_aes_cbcb_de_ha[] = { - "7c26d5e55854c26ddfd3c42c4ae90b496cb81b67bb86eacfb6a5f3328bd6404b", + "7ee2f33f80612e91fda1fd84201266dea6cab596a4e23a535d1a14fb0763f1a3", 0 }; static u3j_harm _140_hex_aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}}; static c3_c* _140_hex_aes_cbcc_en_ha[] = { - "5c1a99a2a95cef482951a833dfe1d567f0c3ba41db8250baa2c34e7465fd6ee9", + "b2578cf17a3095f48cc96cf7690dd7ab4f4e0b76b2578eadc1dce31a075f5b12", 0 }; static u3j_harm _140_hex_aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}}; static c3_c* _140_hex_aes_cbcc_de_ha[] = { - "b9d521b4d5e1d9387b34bbf5ca38f4d52ba86952ea54490dad7e2670183c572b", + "36586f89d702bedb8c2a01ea3614f61627e762488e373106cbb1b27c46e3493c", 0 }; static u3j_harm _140_hex_aes_siva_en_a[] = {{".2", u3wea_siva_en}, {}}; static c3_c* _140_hex_aes_siva_en_ha[] = { + "2a137039301788b8540ed81cbfafe450c9306348d02a6576f5c14f6d6f20ba81", 0 }; static u3j_harm _140_hex_aes_siva_de_a[] = {{".2", u3wea_siva_de}, {}}; static c3_c* _140_hex_aes_siva_de_ha[] = { + "d0130e9229e71c589429dd87843dc104bc4ee5b426400a547081d8c91a548eaa", 0 }; static u3j_harm _140_hex_aes_sivb_en_a[] = {{".2", u3wea_sivb_en}, {}}; static c3_c* _140_hex_aes_sivb_en_ha[] = { + "1638f56e8728f285e4175c7b514c5a4e1a24205acf33e105f0513cad7ae843cf", 0 }; static u3j_harm _140_hex_aes_sivb_de_a[] = {{".2", u3wea_sivb_de}, {}}; static c3_c* _140_hex_aes_sivb_de_ha[] = { + "64c9b199fffd6d31baf7457bf27d5a510121be45201b2ae5cc1d9565c0bdd0ff", 0 }; static u3j_harm _140_hex_aes_sivc_en_a[] = {{".2", u3wea_sivc_en}, {}}; static c3_c* _140_hex_aes_sivc_en_ha[] = { + "d721486dea943efd52d9e6450f4f48dd191c89637a2f842d3ff6edfd3beecbb9", 0 }; static u3j_harm _140_hex_aes_sivc_de_a[] = {{".2", u3wea_sivc_de}, {}}; static c3_c* _140_hex_aes_sivc_de_ha[] = { + "3ded831b992ea100582229a4d1d9b5c80380128ae6b59b5bb36403ed13dc5d55", 0 }; @@ -134,7 +144,7 @@ static u3j_core _140_hex_aes_ecba_d[] = {} }; static c3_c* _140_hex_aes_ecba_ha[] = { - "95a46cbd493f303080f31b9b376df4c981cee336223bd6cffa7c971d38c2749b", + "693409d27b777f73ce92cebd38e9ebceebe1e9c27ad8c9de9afc091e31bd7d9f", 0 }; @@ -144,7 +154,7 @@ static u3j_core _140_hex_aes_ecbb_d[] = {} }; static c3_c* _140_hex_aes_ecbb_ha[] = { - "6d9488a29d64e307bbce89400bc13420e0ea52a158715cae4f663536ed0a9a58", + "7255c39f10e068007d0d64dd40e4f6e83492ed2e3222919440be0d28fd42a5e3", 0 }; @@ -154,7 +164,7 @@ static u3j_core _140_hex_aes_ecbc_d[] = {} }; static c3_c* _140_hex_aes_ecbc_ha[] = { - "6c998edf14a8ca78ef1c03c31804662422b424187741c7f9ea8fa721de7b5bcb", + "65da73b8de06a6660ca2d36be881b708362e1f8bc12c01290aed90fdb2977667", 0 }; @@ -164,7 +174,7 @@ static u3j_core _140_hex_aes_cbca_d[] = {} }; static c3_c* _140_hex_aes_cbca_ha[] = { - "59b5e7a31d01156e1c1c9332ce2ef57211b4f2ce27854bc2fe901cffc30fd93d", + "420d04c03b7816b656fe4e8d9fce04f7e6d51d3d274c6511e89cfdb43ebf107e", 0 }; @@ -174,7 +184,7 @@ static u3j_core _140_hex_aes_cbcb_d[] = {} }; static c3_c* _140_hex_aes_cbcb_ha[] = { - "b7dd467d0920c5eaf9703af6c5c4a04f419ba010e75035072109d49dbcb1983c", + "1b84daab497795f2afd7238a6a6090be68b78eb6051b0ffa076b2ed9fedeebe5", 0 }; @@ -184,7 +194,7 @@ static u3j_core _140_hex_aes_cbcc_d[] = {} }; static c3_c* _140_hex_aes_cbcc_ha[] = { - "703d019a7e12ca9c2836707f60cdb8d32b61b20c720e438d84d3a787f20e99f5", + "3bab1a59c7673afeb659821d54754e8e5e281243e79624fdbe4d7f85cae192c5", 0 }; @@ -194,6 +204,7 @@ static u3j_core _140_hex_aes_siva_d[] = {} }; static c3_c* _140_hex_aes_siva_ha[] = { + "435c5c769d2522d71ab60332bb57440d69c6803d5ca9a5faae88c825cb55d72e", 0 }; static u3j_core _140_hex_aes_sivb_d[] = @@ -202,6 +213,7 @@ static u3j_core _140_hex_aes_sivb_d[] = {} }; static c3_c* _140_hex_aes_sivb_ha[] = { + "0683f3f9067c2a16f68805c778c404179dc5df9019bbbe0f8d680a99a69e61fc", 0 }; static u3j_core _140_hex_aes_sivc_d[] = @@ -210,6 +222,7 @@ static u3j_core _140_hex_aes_sivc_d[] = {} }; static c3_c* _140_hex_aes_sivc_ha[] = { + "23ef582f110d28aff82b0795305b02e5a718d667bcae97091c08bc26790e7176", 0 }; @@ -226,12 +239,13 @@ static u3j_core _140_hex_aes_d[] = {} }; static c3_c* _140_hex_aes_ha[] = { - "a5340a7ffcb8adac8085317094b9bd6bc4eb0a52badbbfb138e9ff3ce8b49a97", + "ca4c1b0cff03db74ceca1b844f0223d669aa42934152a784d431469f0eb71527", 0 }; static u3j_harm _140_hex_leer_a[] = {{".2", u3we_leer}, {}}; static c3_c* _140_hex_leer_ha[] = { + "8a4486bb09639f6b8cf7631f9bf883256529c6d7d9aa320ab6dfa5517611f0d7", 0 }; static u3j_harm _140_hex_lore_a[] = {{".2", u3we_lore}, {}}; @@ -241,7 +255,7 @@ static c3_c* _140_hex_lore_ha[] = { }; static u3j_harm _140_hex_loss_a[] = {{".2", u3we_loss}, {}}; static c3_c* _140_hex_loss_ha[] = { - "6c4fe849ec8520e847c09804c056aa0c5c890553e53f07c00b6e1f158e6deb8f", + "67aacd21484078828ad4342297d44c38d9213b8809f83f695c2996378a92dc2a", 0 }; static u3j_harm _140_hex_lune_a[] = {{".2", u3we_lune}, {}}; @@ -252,22 +266,22 @@ static c3_c* _140_hex_lune_ha[] = { static u3j_harm _140_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; static c3_c* _140_hex_coed__ed_puck_ha[] = { - "540b16bba2321015feeb401cd65150d2050188de57041fd9d3d1ac8902cc1e63", + "1bc694675842345c50b0e20a2193bb5bcbb42f163fc832431a3d1822a81e4c98", 0 }; static u3j_harm _140_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; static c3_c* _140_hex_coed__ed_sign_ha[] = { - "de2e5ebf5bdb96e24e05a231b4eac0e0f803984c69948c16cd0e2397aa5dabc1", + "34ad749bf8443611cbf1f7de90a066318bd12be36f2f7f6f55281f6f7ed79754", 0 }; static u3j_harm _140_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; static c3_c* _140_hex_coed__ed_veri_ha[] = { - "a0fa913b3a823e67ae3d6f416d623c9ff692a324deffd80d057020bbac91d223", + "047a7eeccb2e68aeeee631b6db86e11a5a3aa9e179660553eca6304327612dcf", 0 }; static u3j_harm _140_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; static c3_c* _140_hex_coed__ed_shar_ha[] = { - "2115b6722bf59ebac897791293eeb7fe0a83e73b1e57d4a098d52af0948cb7b4", + "52d3b0a2f51f2b0a9dd72bb33db38c73dc873029c365d871d0559a1472a80e72", 0 }; @@ -276,15 +290,31 @@ static u3j_harm _140_hex_coed__ed_point_add_a[] = static u3j_harm _140_hex_coed__ed_scalarmult_a[] = {{".2", u3wee_scalarmult}, {}}; +static c3_c* _140_hex_coed__ed_scalarmult_ha[] = { + "72e71cd3aa3af429cd65baa78632500c60edd1d4c82a39d3ba7f231ef97e6316", + 0 +}; static u3j_harm _140_hex_coed__ed_scalarmult_base_a[] = {{".2", u3wee_scalarmult_base}, {}}; +static c3_c* _140_hex_coed__ed_scalarmult_base_ha[] = { + "976fdb8251f9b767af689a0d2c41b88941921bf53777c1ceeb5297511021f9d8", + 0 +}; static u3j_harm _140_hex_coed__ed_add_scalarmult_scalarmult_base_a[] = {{".2", u3wee_add_scalarmult_scalarmult_base}, {}}; +static c3_c* _140_hex_coed__ed_add_scalarmult_scalarmult_base_ha[] = { + "11819071c24a2d7b36daea6e16c78b2e05f9ca3e857cf4815ffe652ce677a61a", + 0 +}; static u3j_harm _140_hex_coed__ed_add_double_scalarmult_a[] = {{".2", u3wee_add_double_scalarmult}, {}}; +static c3_c* _140_hex_coed__ed_add_double_scalarmult_ha[] = { + "0fab78a1e890e53cecade1c22b95813db77e066044e33417a0919695b6cde9ba", + 0 +}; static u3j_core _140_hex_coed__ed_d[] = { { "sign", 7, _140_hex_coed__ed_sign_a, 0, _140_hex_coed__ed_sign_ha }, @@ -292,16 +322,20 @@ static u3j_core _140_hex_coed__ed_d[] = { "veri", 7, _140_hex_coed__ed_veri_a, 0, _140_hex_coed__ed_veri_ha }, { "shar", 7, _140_hex_coed__ed_shar_a, 0, _140_hex_coed__ed_shar_ha }, { "point-add", 7, _140_hex_coed__ed_point_add_a, 0, 0 }, - { "scalarmult", 7, _140_hex_coed__ed_scalarmult_a, 0, 0 }, - { "scalarmult-base", 7, _140_hex_coed__ed_scalarmult_base_a, 0, 0 }, + { "scalarmult", 7, _140_hex_coed__ed_scalarmult_a, 0, + _140_hex_coed__ed_scalarmult_ha }, + { "scalarmult-base", 7, _140_hex_coed__ed_scalarmult_base_a, 0, + _140_hex_coed__ed_scalarmult_base_ha }, { "add-scalarmult-scalarmult-base", 7, - _140_hex_coed__ed_add_scalarmult_scalarmult_base_a, 0, 0 }, + _140_hex_coed__ed_add_scalarmult_scalarmult_base_a, 0, + _140_hex_coed__ed_add_scalarmult_scalarmult_base_ha }, { "add-double-scalarmult", 7, - _140_hex_coed__ed_add_double_scalarmult_a, 0, 0 }, + _140_hex_coed__ed_add_double_scalarmult_a, 0, + _140_hex_coed__ed_add_double_scalarmult_ha }, {} }; static c3_c* _140_hex_coed__ed_ha[] = { - "33223ee36ddc84831eff43939b035afe00bb23c7ba1475cbeadb24954216b814", + "7a44a962aa72933588b5c99a8b68ebac21ce3c4710c081cb66b3599b45af9ced", 0 }; @@ -310,13 +344,13 @@ static u3j_core _140_hex_coed_d[] = {} }; static c3_c* _140_hex_coed_ha[] = { - "1f68bb8e3214032195e1183e61b05bccff19808df3cbdaeb6c7fcce9cd27a24d", + "4be0254f06d953b69509eb15550595ffad8767d3c3dc2dafcd7c22f92f7704c4", 0 }; static u3j_harm _140_hex_hmac_hmac_a[] = {{".2", u3we_hmac}, {}}; static c3_c* _140_hex_hmac_hmac_ha[] = { - "41a3eb915ac8105751d5bc7ac309a21400896a82e129d3314cc5be300f2660db", + "d0dbd778156aef21d18f44a8cffd87296826120af5a4af020dd7aff0f95f03b1", 0 }; static u3j_core _140_hex_hmac_d[] = @@ -324,13 +358,13 @@ static u3j_core _140_hex_hmac_d[] = {} }; static c3_c* _140_hex_hmac_ha[] = { - "c6cacf4657372591769ccb9b686be4c16d7dbe0d815f4b8d9e81ddc97c36b770", + "976bb4508dbe659eb12aa32d4a481dbd885e40f8a15c505762f1acf43b744234", 0 }; static u3j_harm _140_hex_argon2_a[] = {{".2", u3we_argon2}, {}}; static c3_c* _140_hex_argon2_ha[] = { - "ef21e4f9108b5f2e6831145df4c21e0d44152abcd0f575532894d406425c04c9", + "4df7cec141ffa2cc76b058846474ca42cc9840666ee3e7e80e565803e83ea98b", 0 }; static u3j_core _140_hex_argon_d[] = @@ -338,18 +372,27 @@ static u3j_core _140_hex_argon_d[] = {} }; static c3_c* _140_hex_argon_ha[] = { - "7d8acf91db0262d485641547db6cc9ab4ef260c393fc7f12336fab393263056a", + "dc704c786192ecd09d4c206a8f28db3202b6e0eb03e3ce63a95987510ac312d6", 0 }; static c3_c* _140_hex_secp_secp256k1_make_ha[] = { 0 }; static u3j_harm _140_hex_secp_secp256k1_make_a[] = {{".2", u3we_make, c3y}, {}}; -static c3_c* _140_hex_secp_secp256k1_sign_ha[] = { 0 }; +static c3_c* _140_hex_secp_secp256k1_sign_ha[] = { + "3e75b3452b74776488d5eec75a91211700d9f360a4e06dd779600d5128d9c600", + 0 +}; static u3j_harm _140_hex_secp_secp256k1_sign_a[] = {{".2", u3we_sign, c3y}, {}}; -static c3_c* _140_hex_secp_secp256k1_reco_ha[] = { 0 }; +static c3_c* _140_hex_secp_secp256k1_reco_ha[] = { + "449f3aa878b61962c3048e167c23ba54a0736d3aa1ab7762bd54016fbba136ee", + 0 +}; static u3j_harm _140_hex_secp_secp256k1_reco_a[] = {{".2", u3we_reco, c3y}, {}}; -static c3_c* _140_hex_secp_secp256k1_ha[] = { 0 }; +static c3_c* _140_hex_secp_secp256k1_ha[] = { + "e7fc0971a970aba7ded43bd89e9c82623eb2f346c9c720c63b22f2a646927861", + 0 +}; static u3j_core _140_hex_secp_secp256k1_d[] = { { "make", 7, _140_hex_secp_secp256k1_make_a, 0, _140_hex_secp_secp256k1_make_ha }, { "sign", 7, _140_hex_secp_secp256k1_sign_a, 0, _140_hex_secp_secp256k1_sign_ha }, @@ -357,7 +400,10 @@ static u3j_core _140_hex_secp_secp256k1_d[] = {} }; -static c3_c* _140_hex_secp_ha[] = { 0 }; +static c3_c* _140_hex_secp_ha[] = { + "9f5c23f0e7923b6cf1603388ba52401b6e43881be3560b3acfaab20b25071792", + 0 +}; static u3j_core _140_hex_secp_d[] = { { "secp256k1", 3, 0, _140_hex_secp_secp256k1_d, _140_hex_secp_secp256k1_ha }, {} @@ -365,7 +411,7 @@ static u3j_core _140_hex_secp_d[] = static u3j_harm _140_hex_blake2b_a[] = {{".2", u3we_blake, c3y}, {}}; static c3_c* _140_hex_blake2b_ha[] = { - "affddbd9861660e0381edf82c88da18e18d2dd0aa0f430f9d8661c5a57e13cb5", + "c432216ca53b5ad2284259167952761bb1046e280268c4d3b9ca70a2024e1934", 0 }; static u3j_core _140_hex_blake_d[] = @@ -373,13 +419,13 @@ static u3j_core _140_hex_blake_d[] = {} }; static c3_c* _140_hex_blake_ha[] = { - "3a63284428b509489233513a0d6b13f705a67c5bed4354a64ef09054529a7c35", + "ff30d99ffb3e13d8aa50b2b8461c8edfabf0e76de22312d16d1d6daaf3636b5f", 0 }; static u3j_harm _140_hex_ripemd_160_a[] = {{".2", u3we_ripe, c3y}, {}}; static c3_c* _140_hex_ripemd_160_ha[] = { - "c918e263c56723986b6a5ba4a994199ec2afe12df42b2efa497e1b51f572ce13", + "176684b29926a01f5c60fa584e4691b0cbdc9b93608dcbe7d0cf3585683fa42f", 0 }; static u3j_core _140_hex_ripe_d[] = @@ -387,7 +433,7 @@ static u3j_core _140_hex_ripe_d[] = {} }; static c3_c* _140_hex_ripe_ha[] = { - "fe7e2579d5053dead2f5ce27e0aa6bda1f9a84684db45349af38fe5bc827613a", + "b0cb16bf206c0496bb480e5759ea1afa7dee1748b64e5243c23fddb09720ebd0", 0 }; @@ -410,7 +456,7 @@ static u3j_core _140_hex_d[] = {} }; static c3_c* _140_hex_ha[] = { - "b3352eada800d6c9db030ac128262e8286c245162b2ab2b317c43dc39f3e152d", + "7e393356dd7ac64eed5cd9f5cf0e320d401ca36a0a0ce0f954e7538824114844", 0 }; @@ -423,7 +469,7 @@ static c3_c* _140_pen_cell_ha[] = { }; static u3j_harm _140_pen_comb_a[] = {{".2", u3wf_comb}, {}}; static c3_c* _140_pen_comb_ha[] = { - "137e940853b2f823bac751069f7dd3e81367bda77037afe1c3cb4d0cd26982db", + "f9e37c3b3d5036c31af60f7047391594068638b54db7cf94bfea9dabbdffa547", 0 }; static u3j_harm _140_pen_cons_a[] = {{".2", u3wf_cons}, {}}; @@ -443,7 +489,7 @@ static c3_c* _140_pen_face_ha[] = { }; static u3j_harm _140_pen_fitz_a[] = {{".2", u3wf_fitz}, {}}; static c3_c* _140_pen_fitz_ha[] = { - "31ebe9b8ece572a90c8e8d6b8b334f445c010b92c0ce83380d0fd6ad21b014af", + "469abe976ec15eeff9a87bce385f2c87c9bd89814ce2858aa9fee094beea1e5d", 0 }; static u3j_harm _140_pen_flan_a[] = {{".2", u3wf_flan}, {}}; @@ -463,7 +509,7 @@ static c3_c* _140_pen_flor_ha[] = { }; static u3j_harm _140_pen_fork_a[] = {{".2", u3wf_fork}, {}}; static c3_c* _140_pen_fork_ha[] = { - "000af0f7a46f669c66b4f5d2de1d28544f093b579d93c16e41e717c3c40d1823", + "36f0ea0e2eb30328b8b83ed43a81c8c9a1f5b4c5a03fd68fd25701991a40b9dd", 0 }; @@ -478,52 +524,64 @@ static c3_c* _140_pen_look_ha[] = { }; static u3j_harm _140_pen_loot_a[] = {{".2", u3wf_loot}, {}}; static c3_c* _140_pen_loot_ha[] = { - "be73de8944cd05c117fa698523940fd0a6a2a2286c56d8586ae35034d0a32200", + "e275da4562ae6da9bd333aeae6b9829e886874c8b891898c0ef5306268eb45c1", 0 }; static u3j_harm _140_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; static c3_c* _140_pen__ut_crop_ha[] = { - "d83e5e47f712870aba815d79943d287cbefdc00640409464b30bf755115d4a1a", + "e2c6fc3e714a3a98ccd28423dcb9f2c6480935e26b54dd0581eb2ad7e5b16d6f", 0 }; static u3j_harm _140_pen__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; static c3_c* _140_pen__ut_fish_ha[] = { - "2fd315436f48351002d9aa8c137649ca95b01fd57dba09db53d7235f84a284bf", + "080caee60b5ee4616bf9568bdbceabbf044379c47466e0ae3968cb0146049a84", 0 }; static u3j_harm _140_pen__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; static c3_c* _140_pen__ut_fuse_ha[] = { - "43d8bfdf9255f548bb58d9975bac273e2dcebe5ae98bd7e466b6fff6ff43a944", + "519aac7b40b7018d5df00ddf3977c2ebe0c2e05bcee34796d56a1d54c15e0c84", 0 }; static u3j_harm _140_pen__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; static c3_c* _140_pen__ut_mint_ha[] = { - "43a06316365bcd14a94f8ed1f3fe5a8f61d1da5bea989296a192b62a966fca11", + "7d980f7425b51bb10fbbd8b465b5d83f5dd4cb6e66d88758a9f7490b812a765e", 0 }; static u3j_harm _140_pen__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; static c3_c* _140_pen__ut_mull_ha[] = { - "9fe555b3f9ad666f04194037437d71ee98f6b884f7aacc46a11ad27407cb7e8e", + "c806329aefd920501ea0faa0cfb0ce3280a74408782efe6d82878ec43ec44fb7", 0 }; - static c3_c* _140_pen__ut_nest_ha[] = {0}; - static u3j_harm _140_pen__ut_nest_dext_a[] = {{".2", u3wfu_nest_dext}, {}}; - static c3_c* _140_pen__ut_nest_dext_ha[] = {0}; + + static u3j_harm _140_pen__ut_nest_dext_a[] = {{".2", u3wfu_nest_dext}, {}}; + static c3_c* _140_pen__ut_nest_dext_ha[] = { + "72f33df96800034fc63531293f9b110e6505027195bf8a10ff94b9a1f1ef719b", + 0 + }; static u3j_core _140_pen__ut_nest_in_d[] = { { "nest-dext", 3, _140_pen__ut_nest_dext_a, 0, _140_pen__ut_nest_dext_ha }, {} }; - static c3_c* _140_pen__ut_nest_in_ha[] = {0}; + static c3_c* _140_pen__ut_nest_in_ha[] = { + "68378dfa1d1fee0b1cd9593fb561234cec2ae9371a5ffa287c3d2ab9620e198c", + 0 + }; + static u3j_core _140_pen__ut_nest_d[] = { { "nest-in", 7, 0, _140_pen__ut_nest_in_d, _140_pen__ut_nest_in_ha }, {} }; + static c3_c* _140_pen__ut_nest_ha[] = { + "1e8de5d1225facc1158c92c2ea5e0dc84129cbb317fde3691e224b8c2550d950", + 0 + }; + static u3j_harm _140_pen__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; static c3_c* _140_pen__ut_rest_ha[] = { - "2e2d15f3efca0a4bf8ce08cca48c54d1d5a7204e2b0525137f59c3e7b037d2fd", + "b4a83073f4cb03898ef099fab5722a046122dc96a5332ffc82f988df6c186e74", 0 }; @@ -540,14 +598,55 @@ static u3j_core _140_pen__ut_d[] = }; static c3_c* _140_pen__ut_ha[] = { - "479d0051e5fabe291e4cded603a071fce0f10734503638fd7d30e9c6d799969c", + "50c79204c82a3ba8f01e085a2e27e7716e5c7ab1929f94423ef1da92cf5ac631", 0 }; static u3j_hood _140_pen__ut_ho[] = { + { "ar", 12282 }, { "fan", 28, c3n }, { "rib", 58, c3n }, { "vet", 59, c3n }, + + { "blow", 6015 }, + { "burp", 342 }, + { "busk", 1373 }, + { "buss", 374 }, + { "crop", 1494 }, + { "duck", 1524 }, + { "dune", 2991 }, + { "dunk", 3066 }, + { "epla", 12206 }, + { "emin", 1534 }, + { "emul", 6134 }, + { "feel", 1502 }, + { "felt", 94 }, + { "fine", 49086 }, + { "fire", 4 }, + { "fish", 6006 }, + { "fond", 12283 }, + { "fund", 6014 }, + // XX +funk is not part of +ut, and this hook appears to be unused + // remove from here and the +ut hint + // + { "funk", 0xbefafa, c3y, 31 }, + { "fuse", 24021 }, + { "gain", 380 }, + { "lose", 0x2fefe }, + { "mile", 382 }, + { "mine", 372 }, + { "mint", 49083 }, + { "moot", 0x2feff }, + { "mull", 24020 }, + { "nest", 92 }, + { "peel", 1526 }, + { "play", 3006 }, + { "peek", 1532 }, + { "repo", 22 }, + { "rest", 6102 }, + { "tack", 6007 }, + { "toss", 24540 }, + { "wrap", 6140 }, {}, }; @@ -588,13 +687,13 @@ static u3j_core _140_pen_d[] = {} }; static c3_c* _140_pen_ha[] = { - "5197c4be0f72a57d77ecda9f3976ba06cd22648751f434f40162f6759688b725", + "e6c9e2362bdf2d1f9a2837a0efa154c0b8b9d51aea03a86b5aece573ff423cb1", 0 }; static u3j_hood _140_pen_ho[] = { - { "ap", 86 }, - { "ut", 342 }, + { "ap", 22 }, + { "ut", 86 }, {}, }; @@ -602,12 +701,13 @@ static u3j_hood _140_pen_ho[] = { */ static u3j_harm _140_qua_trip_a[] = {{".2", u3we_trip}, {}}; static c3_c* _140_qua_trip_ha[] = { - "2f4df71315caaab44495ebd6b0c541484cb76d26d4caa306207a33876b09509c", + "05423b940d10d03891cc23f36eea14b233e5884ef539de3d985d6818dd427b05", 0 }; static u3j_harm _140_qua_slaw_a[] = {{".2", u3we_slaw}, {}}; static c3_c* _140_qua_slaw_ha[] = { + "306c9692f48e2700675ed6581e9df4feaee951e1bed3cad7f89aab392e80000f", 0 }; static u3j_harm _140_qua_scot_a[] = {{".2", u3we_scot}, {}}; @@ -631,12 +731,12 @@ static c3_c* _140_qua__po_ins_ha[] = { }; static u3j_harm _140_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}}; static c3_c* _140_qua__po_tod_ha[] = { - "c69fdde3a83159207e1e838e960fe48e809fc9eb296300ee85169aadf126339c", + "153aeba45ca2a87aa918e9cea1b26e8104a6e4395979257b075546c1e2654a17", 0 }; static u3j_harm _140_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}}; static c3_c* _140_qua__po_tos_ha[] = { - "eba705fc6e46193f4a4f3e20c37f06140d0b8eae0f8db6e6c7a53659803a3f04", + "7c5ffad03bcf8b4ea9bdf0c7f7500351923bc0431f3d62d6ce0472790f668fb4", 0 }; static u3j_core _140_qua__po_d[] = @@ -647,13 +747,13 @@ static c3_c* _140_qua__po_tos_ha[] = { {} }; static c3_c* _140_qua__po_ha[] = { - "6ca8581f72f693ae465e658fd58e8cb7d705927f67254bcc95a449df9c9f7d1b", + "efc5fa7c0efedd490e9a270bb5cf9f90809e6b224f8a381a6b8a481253b237a1", 0 }; static u3j_harm _140_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; static c3_c* _140_qua__bend_fun_ha[] = { - "6a560ff29ece25d1f02a60a500feeb6288ec4d51b27b759fb8066abdce74ddbb", + "e6ea05e3d765a005fccde9eb88fb93e06f0b6ea198afa8ed599b056ba179396a", 0 }; static u3j_core _140_qua__bend_d[] = @@ -661,7 +761,7 @@ static c3_c* _140_qua__bend_fun_ha[] = { {} }; static c3_c* _140_qua__bend_ha[] = { - "f9d15e37e625cec2d505532a2d83a7eba9dd9afb339d0a4e83613f5eca2e6c88", + "adc59c6db6d5b26122bc6c04e25c3efe830c9eef68ecf81c492a59ee5e9e20a2", 0 }; @@ -695,7 +795,7 @@ static c3_c* _140_qua__cook_fun_ha[] = { static u3j_harm _140_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; static c3_c* _140_qua__comp_fun_ha[] = { - "60e5ff2cea860d80f8af65e1323518f58a081b93b49ad7351a1ea1dfe87380e4", + "bd7fdba84b05b00a63c24d19a03b882578ee9a3b922a3a688f7827c6e64daf96", 0 }; static u3j_core _140_qua__comp_d[] = @@ -703,7 +803,7 @@ static c3_c* _140_qua__comp_fun_ha[] = { {} }; static c3_c* _140_qua__comp_ha[] = { - "4960a20da1b43ff953b86ba08cbdeb9a4468af8bfd27fcde12f39f1449fdee9c", + "7baad25ba87bcbba8ce4fe328280a799765dcf62a8bb761ffd87b939dd8734f2", 0 }; @@ -723,7 +823,7 @@ static c3_c* _140_qua__easy_fun_ha[] = { static u3j_harm _140_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; static c3_c* _140_qua__glue_fun_ha[] = { - "7a4b978b56658b5c93fc79cb9394e3b46b9f02428a3668958de05e326c512d6b", + "ffe0fe8815a2298c51a58e963efbbb7af90830abf11ce50bf9a47f479ce452fb", 0 }; static u3j_core _140_qua__glue_d[] = @@ -731,7 +831,7 @@ static c3_c* _140_qua__glue_fun_ha[] = { {} }; static c3_c* _140_qua__glue_ha[] = { - "9510f468b9c5d64f80a20d56d8cffd7a1ba0b6444aef9299f2d0a8c3e619b387", + "079c8a395428c2921b266a84bcf271fbe62f3d873b26680661e13a78df1a3989", 0 }; @@ -751,7 +851,7 @@ static c3_c* _140_qua__here_fun_ha[] = { static u3j_harm _140_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}}; static c3_c* _140_qua__just_fun_ha[] = { - "2a77a5aec1b5394cd282f7ba3a6a0492906446e18f9569b15810c979ec5842de", + "38bf1fb843bc29837868f2828f32d7e2bbb419b0cb9a1236adea28dfc6ce1040", 0 }; static u3j_core _140_qua__just_d[] = @@ -759,13 +859,13 @@ static c3_c* _140_qua__just_fun_ha[] = { {} }; static c3_c* _140_qua__just_ha[] = { - "3d3f00579c4b1d2707418eff6cdb037e95f5c499d986a3cdb535faa35bbf05a6", + "7d6b2165e52dec478d96cf72478a35b7a92b014e6a15f046f026c0c8cb07679b", 0 }; static u3j_harm _140_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; static c3_c* _140_qua__mask_fun_ha[] = { - "04bd9009b0c52c6140256c9694df4823e735733ed0c825b14a1f7bce1f8fc0f8", + "892dfcd5f3d90981fa6e7608e93f0517000d316e7d9c07b3bd390c4966c97f5f", 0 }; static u3j_core _140_qua__mask_d[] = @@ -773,13 +873,13 @@ static c3_c* _140_qua__mask_fun_ha[] = { {} }; static c3_c* _140_qua__mask_ha[] = { - "9ec051bb1101cfd7411795e30c43a0564b80c7d2ca68940ef54f9f6d332adac0", + "48e11fc12d7c453cda6ca42577d68e968446aa4d0ad3b99cc674affc7f4507b4", 0 }; static u3j_harm _140_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; static c3_c* _140_qua__shim_fun_ha[] = { - "64c01dcfb9d3a66fbfcf6182770cf3421f1be08c693d61476d0dfc223fc6b762", + "4e26a0e98adb13ee6718fd68d90910c630df9bb7023b3e3ef40cda6710075fc9", 0 }; static u3j_core _140_qua__shim_d[] = @@ -787,7 +887,7 @@ static c3_c* _140_qua__shim_fun_ha[] = { {} }; static c3_c* _140_qua__shim_ha[] = { - "838be7322079341d7f0135069d84212527a8dfefd7fab7cafa5e1d5d18406228", + "226b96d1a59daada23a1ea80227c2dbf32ddd748d4c6363f316147ab7f292ced", 0 }; @@ -807,7 +907,7 @@ static c3_c* _140_qua__stag_fun_ha[] = { static u3j_harm _140_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; static c3_c* _140_qua__stew_fun_ha[] = { - "677c85d6ba46e134025f652d94049b3db54b576d32159707d16a4c0a56578951", + "a700f6bdfdb83ba33b2a3fe92fda3cb1bbfe95e595401538c8371b55fcc61447", 0 }; static u3j_core _140_qua__stew_d[] = @@ -815,13 +915,13 @@ static c3_c* _140_qua__stew_fun_ha[] = { {} }; static c3_c* _140_qua__stew_ha[] = { - "11b3c70145eedcd888f4b3f51861e759da7405b0b93398b59cfb82d187b29889", + "29303fd6ab78cbbccdfc5bcf23d0bff126a0ef2bf4fa11ce70fcf4e6aa5fe60b", 0 }; static u3j_harm _140_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; static c3_c* _140_qua__stir_fun_ha[] = { - "ad1e756459e084cc7463c6e1ebdcef013fdfbe915c345657aee859622e311985", + "6251308ea3c741e76ef9cb2dc5a71c9d8706d6cce6fdb420fef12915e0c032d6", 0 }; static u3j_core _140_qua__stir_d[] = @@ -829,7 +929,7 @@ static c3_c* _140_qua__stir_fun_ha[] = { {} }; static c3_c* _140_qua__stir_ha[] = { - "aa51d9e03f44ae821553dde66bf84e40e1b95867d5ccc51ed6f390771c97a708", + "4e466aef4d91f0ced008c00e8a4330afb3a43ef81dc1a6d93f1853685f69b9ca", 0 }; @@ -841,12 +941,12 @@ static c3_c* _140_qua_pfix_ha[] = { static u3j_harm _140_qua_plug_a[] = {{".2", u3we_plug}, {}}; static c3_c* _140_qua_plug_ha[] = { - "dd5a5a82b572ebb3009f9e1dbb52d0a955273742b8e1f5be27885ca208a0c9c7", + "5f5a9824e0952fd565748cc0a20f96cf883a41e2f5707c8a7797e6edd617b79c", 0 }; static u3j_harm _140_qua_pose_a[] = {{".2", u3we_pose}, {}}; static c3_c* _140_qua_pose_ha[] = { - "8586df7438d5b37935f9fa1bc3ac6d8740f13fa9885f6b4f1acfe672e4e4cc33", + "5c77203f288ef0f7bcd87871c69673db7fc804b647ecc42992707dc32f0f4611", 0 }; @@ -858,10 +958,12 @@ static c3_c* _140_qua_sfix_ha[] = { static u3j_harm _140_qua_mink_a[] = {{".2", u3we_mink}, {}}; static c3_c* _140_qua_mink_ha[] = { + "99b653da6a21fa3375424811af288f59164592ece4a072abc460df03e81abcaf", 0 }; static u3j_harm _140_qua_mole_a[] = {{".2", u3we_mole}, {}}; static c3_c* _140_qua_mole_ha[] = { + "029c1acaff1911c54ce31a3693397394604ea970bf076078c1a1cfa23d2fa74e", 0 }; static u3j_harm _140_qua_mule_a[] = {{".2", u3we_mule}, {}}; @@ -909,13 +1011,14 @@ static u3j_core _140_qua_d[] = {} }; static c3_c* _140_qua_ha[] = { - "0efd1620ed40369f957d53d796c0bf497e0585100829e5f37ede41f6a841d0f8", + "db9b4b21c0a8a8324105cbccc1421ef2a715ef0562c280b943fe1d96651cd9cc", 0 }; static u3j_hood _140_qua_ho[] = { { "mute", 0x2fbabe }, - { "show", 24406 }, + { "show", 24406 }, + { "mure", 1404 }, {}, }; @@ -1239,7 +1342,7 @@ static c3_c* _140_tri__rh_ha[] = { static u3j_harm _140_tri__og_raw_a[] = {{".2", u3weo_raw}, {}}; static c3_c* _140_tri__og_raw_ha[] = { - "280709dd8e0e720487dc9af267e0b44d096a59d7257b11a66d1d43f0608cfc3a", + "bbcbefc237dbebf6c141ba14fd9e0464a836127fd123d10da5f121e82d49ebdb", 0 }; static u3j_core _140_tri__og_d[] = @@ -1247,13 +1350,13 @@ static u3j_core _140_tri__og_d[] = {} }; static c3_c* _140_tri__og_ha[] = { - "6e39a44e0fc50378090e8c71f0cfac01d3ee07f11f5125f71619605d86b51676", + "74b9ae67eeabbffcff969ac7fdc7f4f0f4f67af64931e969bcac50d084e15fc0", 0 }; static u3j_harm _140_tri__sha_sha1_a[] = {{".2", u3we_sha1}, {}}; static c3_c* _140_tri__sha_sha1_ha[] = { - "20a18116548d3bfa459ae426d92a1c27535425b124d6a48ec1642945d27e5548", + "75aababa0688619d9df36238269119302a64ad2e3c69c53bd0057fe6b1abaf0c", 0 }; static u3j_core _140_tri__sha_d[] = @@ -1261,31 +1364,44 @@ static u3j_core _140_tri__sha_d[] = {} }; static c3_c* _140_tri__sha_ha[] = { - "d3e4be4c3a39f94a51f675fd9a712bf1cfef9ac7ae6fc980160fc370a93bbf3b", + "3c22d2f8719cb626e8dfe1a4206bcbc14b678c1422c48322054b40f84416d557", 0 }; static u3j_harm _140_tri_shax_a[] = {{".2", u3we_shax}, {}}; static c3_c* _140_tri_shax_ha[] = { - "48ee5b29692df484bd1d0fd30ca01ea843f89f70fff8698a8f6af5c38639afe8", + "0fc53de3ddc8b8f84a46136f1728fa3ed66a5113888d14907589d16bf5927ad8", 0 }; static u3j_harm _140_tri_shay_a[] = {{".2", u3we_shay}, {}}; static c3_c* _140_tri_shay_ha[] = { - "02bcd048fca47fe895b5da5412cf1472eb09abbd2513de96d30a784f629410c9", + "b6dbc72e15c2204f83f902619b7a60328f29c9d302ddb35c435111dea28c5470", 0 }; static u3j_harm _140_tri_shas_a[] = {{".2", u3we_shas}, {}}; static c3_c* _140_tri_shas_ha[] = { - "d6e39714b8e1a324be185a6d4f7a776f78eedd54becc820edbe53ce83f239e9b", + "5230583767b7625b3496248ed03b6b94c1d4ee9b26342f9390bf999ec9b6cfdb", 0 }; static u3j_harm _140_tri_shal_a[] = {{".2", u3we_shal}, {}}; static c3_c* _140_tri_shal_ha[] = { - "a9b750ed311b4fde51a51374cea35c6e0c4775908c9ad997ee470a003f086290", + "3242912e29e3e1ed8d1a395cc860a82d78961b4278ed79bbdeb37cb5615bbf20", 0 }; +static u3j_core _140_ob_d[] = +{ {} +}; +static c3_c* _140_ob_ha[] = { + "13ebfbdee69396bc1d980fc4dcbcdaa9cc3fb9c011e6cf188e71311a8bffc8e6", + 0 +}; +static u3j_hood _140_ob_ho[] = { + { "fein", 42 }, + { "fynd", 20 }, + {}, +}; + static u3j_core _140_tri_d[] = { { "qua", 3, 0, _140_qua_d, _140_qua_ha, _140_qua_ho }, { "cofl", 7, 0, _140_tri__cofl_d, _140_tri__cofl_ha }, @@ -1300,22 +1416,31 @@ static u3j_core _140_tri_d[] = { "shay", 7, _140_tri_shay_a, 0, _140_tri_shay_ha }, { "shas", 7, _140_tri_shas_a, 0, _140_tri_shas_ha }, { "shal", 7, _140_tri_shal_a, 0, _140_tri_shal_ha }, + { "ob", 3, 0, _140_ob_d, _140_ob_ha, _140_ob_ho }, {} }; static c3_c* _140_tri_ha[] = { - "6c8837fca8182e808dfd8019435663b584a79a6572e9b33f1c3f4afe0a86f6b9", + "e7339eb317038f64555717c5624e4571fe9654d471c1a78454129afdbcad9b53", 0 }; +static u3j_hood _140_tri_ho[] = { + { "ob", 20 }, + { "yore", 5462 }, + { "year", 44975 }, + {}, +}; + /* layer two */ static u3j_harm _140_two_find_a[] = {{".2", u3wb_find, c3y}, {}}; static c3_c* _140_two_find_ha[] = { + "cab18d537962b48d38fa061844f44c4635ee11c74fdf403aa80d3a6d1b15c177", 0 }; static u3j_harm _140_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; static c3_c* _140_two_flop_ha[] = { - "73ac3be0119bcb822621de738f90975d98ce1ff3fb9a52853adc638271f61cd2", + "73d496aac2ce6fd9475645c76f949ae0228f8f5ae6738529b08ed9aeb58255fe", 0 }; static u3j_harm _140_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; @@ -1335,12 +1460,12 @@ static c3_c* _140_two_lien_ha[] = { }; static u3j_harm _140_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; static c3_c* _140_two_murn_ha[] = { - "e3ce526989bdb076849f594d6e2f72670d69e7d5d7d8b7bae464cf318a65f357", + "53257aaee131c2a892529c2ee75271160811814086456e8fdf249eebdf31b990", 0 }; static u3j_harm _140_two_need_a[] = {{".2", u3wb_need, c3y}, {}}; static c3_c* _140_two_need_ha[] = { - "7bb1c43a5766a77fea1dc949121dd3f13529da62b726c76f34248047bc74f29f", + "bfdd39af478811efe816e69e8c9202d10c41f646c0d27f39c23e4fe1aec807dd", 0 }; static u3j_harm _140_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; @@ -1355,7 +1480,7 @@ static c3_c* _140_two_reel_ha[] = { }; static u3j_harm _140_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; static c3_c* _140_two_roll_ha[] = { - "42abc6b3defd7c5eb8f6d14d57a14ba2a02d559907c03140c70a65e0803c01e5", + "42abc6b3defd7c5eb8f6d14d57a14ba2a02d559907c03141c70a65e0803c01e5", 0 }; static u3j_harm _140_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; @@ -1390,12 +1515,12 @@ static c3_c* _140_two_snag_ha[] = { }; static u3j_harm _140_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; static c3_c* _140_two_sort_ha[] = { - "f3f89553fc2eafd9702b9533b6dd405bae8056b4aa9674d5f12248d5a964149f", + "dc14f91fdedacd3b77bdf241d22555fe2bf0a231e9cab58b4ae779791e54c4e7", 0 }; static u3j_harm _140_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; static c3_c* _140_two_turn_ha[] = { - "cd4a292788acd440d6ace689f82fa999b342bb749585bc0e173098529bb75fb8", + "e13d9f52434ba810e182017f50a73d4d44eaa298a833231e90353f2a32ea6a78", 0 }; static u3j_harm _140_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; @@ -1405,10 +1530,12 @@ static c3_c* _140_two_weld_ha[] = { }; static u3j_harm _140_two_welp_a[] = {{".2", u3wb_welp, c3y}, {}}; static c3_c* _140_two_welp_ha[] = { + "0bccae6625e62ce622c62f9e828a2a6469e2fbf42342d95e23c3b926f340140d", 0 }; static u3j_harm _140_two_zing_a[] = {{".2", u3wb_zing, c3y}, {}}; static c3_c* _140_two_zing_ha[] = { + "113bdea043e9e05cf4a63dac793caf34634bc58414d00250af87139405521b9d", 0 }; @@ -1419,27 +1546,27 @@ static c3_c* _140_two_bex_ha[] = { }; static u3j_harm _140_two_can_a[] = {{".2", u3wc_can, c3y}, {}}; static c3_c* _140_two_can_ha[] = { - "5fe17c6d254a231e8c9ff94bc47f994c0c1bc202cc9fc2705faaf3fb351c78ec", + "c49ee52487369ba17a0105a61aa658df60e7a537e3e8737ab582644fe00b3938", 0 }; static u3j_harm _140_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; static c3_c* _140_two_cat_ha[] = { - "292d9fd88787d017fc1bfd743950d33143b8847212cad718b391a92ba725475a", + "467f007931110ac0755dcd44c5aaee65785a63b9042b8eea6a7838fa86cc5d8f", 0 }; static u3j_harm _140_two_con_a[] = {{".2", u3wc_con, c3y}, {}}; static c3_c* _140_two_con_ha[] = { - "4a5b1e559516a4208ac058371e045dcbe237dbc56a0a51f9cd4647c1efda5e5d", + "d20f091bd4f28d37c1a78373df939f3d3a41e025129e9a2bb5e2b9a710358965", 0 }; static u3j_harm _140_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; static c3_c* _140_two_cut_ha[] = { - "c5892a89fb38f542b111240e882f02e0fdece4d91a90e5bf2d1f32c0a4770ffb", + "96bb4e9a259d6a1ede5461956b6a6fb73f05cb8e745c4803c2bae4ec0b7f0800", 0 }; static u3j_harm _140_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; static c3_c* _140_two_dis_ha[] = { - "a2e8b319b7b87d93572622b2b982d23c3f833b7fd652fc26ac8718153fbc0235", + "4b3987314451e20a45d2c7baff51d5d39be57e5970f23f86df4dd6569826ddff", 0 }; static u3j_harm _140_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; @@ -1449,77 +1576,77 @@ static c3_c* _140_two_dor_ha[] = { }; static u3j_harm _140_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; static c3_c* _140_two_end_ha[] = { - "45a0efc0c4ae4b93f554d480a9d2c52474d5ebd6b1b9b0ab888b9bee2117db55", + "403c9f12f2481966ffb07842006713149960c67c6bcad8edd78cdf837bc0d854", 0 }; static u3j_harm _140_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; static c3_c* _140_two_gor_ha[] = { - "3ab7d6a56b8b347bd677a77ec43cda984d1eb869bab5c9bc2185f5c4a366703a", + "8a1e3ed1de749ff2ff61d489466df618e4e0773498cb9693ec2e612e9733385c", 0 }; static u3j_harm _140_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; static c3_c* _140_two_lsh_ha[] = { - "a93f01f1db5bcaf1973d01234bbcec8f8adf9d6402a8d715a1b13b70a140a428", + "3db89b02bc596a57c7fb72a991c9fbf3197de501c56b3d1df26911b664c45f3d", 0 }; static u3j_harm _140_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; static c3_c* _140_two_met_ha[] = { - "6654d029fcee53f56439e35e824d955a1ec4081134916b0c5394941febb17b1e", + "39dc9b1d10d9e93414b43f315f9a375596c99b4e8172d71d26759996bb7bab08", 0 }; static u3j_harm _140_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; static c3_c* _140_two_mix_ha[] = { - "311a0350d86dac62f8f4b89c8fdf3ec61f14a4d66cc4cf59f9f548f806e4fe31", + "c84b3e487850d73dd5e4af18fb54b623028be3c45ae9b712718754233057fbc3", 0 }; static u3j_harm _140_two_mor_a[] = {{".2", u3wc_mor, c3y}, {}}; static c3_c* _140_two_mor_ha[] = { - "10ee585bfd1f9109535f09a57fd86e02522e9f019d05edfb70bcedf8b01521b8", + "7c2d86e952606e571e5bcd988e70ded072c0eaa45d1fd958849d76360a763ddf", 0 }; static u3j_harm _140_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; static c3_c* _140_two_mug_ha[] = { - "4ce008be48d5e609df8fa981bdce3d00722128aab1702573aa0c1a528477c3a7", + "6da3f3aa1e951ef2d00e5131945d140fb52728558867237891e029160b7f5010", 0 }; static u3j_harm _140_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; static c3_c* _140_two_muk_ha[] = { - "de425abca39f90204eee4b89958f4b1be21eada95754ffc37597bd76653a689d", + "5a04a09bf7d22c8ef048ba2cc86be8f3a02066eab84cf4a45bbdf2bf534ff9f6", 0 }; static u3j_harm _140_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; static c3_c* _140_two_pow_ha[] = { - "3bc8ad91db75395dc15a996ae7e8c2522f97d8f4b8037e23e2675061c5029792", + "6cfcb9da6ad812eb72788e22e1370b4ab1b6ab64ab0628dfdff78ccead325406", 0 }; static u3j_harm _140_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; static c3_c* _140_two_rap_ha[] = { - "575b53509cddb0a58026f885bd0f53be371ba9f5720f09c4c28a2ba97f89ae99", + "f694f96bcbf97b339285d6c73ed5d33d112b911f7a991acefdef223ff01d8834", 0 }; static u3j_harm _140_two_rep_a[] = {{".2", u3wc_rep, c3y}, {}}; static c3_c* _140_two_rep_ha[] = { - "41c77539ac2d81936770a56791f19156c57e3faf46be3d3b7f4426d87a5a199b", + "25aa2f1746e1cf2235117f22a3db152fa86e003d9bf9f9cfcda79e76e51f382f", 0 }; static u3j_harm _140_two_rev_a[] = {{".2", u3wc_rev, c3y}, {}}; static c3_c* _140_two_rev_ha[] = { - "e9cbd82073ced7b2b96a6ba0a4794c9f5dc90ddc362f9de5a65a1f2fa4fa9cd3", + "15e20592ac1d9c0c80d99589e67cadb4ed7566be1d21844bbe7ef936e0db4524", 0 }; static u3j_harm _140_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; static c3_c* _140_two_rip_ha[] = { - "e8e0b834aded0d2738bcf38a93bf373d412a51e0cee7f274277a6393e634a65e", + "16026c27499953978f69dbf81c1530b2dec8d5a2403c5561f7a5afcc180e129e", 0 }; static u3j_harm _140_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; static c3_c* _140_two_rsh_ha[] = { - "a401145b4c11ec8d17a729fe30f06c295865ffed1b970b0a788f0fec1ed0a703", + "55bd777f239a2a7c849e0c7a35bb967b79279c79bbd985f31ba272761f97928f", 0 }; static u3j_harm _140_two_swp_a[] = {{".2", u3wc_swp, c3y}, {}}; static c3_c* _140_two_swp_ha[] = { - "f809ed11a87db6cef8944c7252d53cda1e030240ee52912c3843d56805ac17fa", + "2c4583c36d73c9c2857052b893b87e1170a794e0edbbdba9d767ba7639e7c1ec", 0 }; static u3j_harm _140_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; @@ -1529,27 +1656,28 @@ static c3_c* _140_two_sqt_ha[] = { }; static u3j_harm _140_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; static c3_c* _140_two_xeb_ha[] = { - "39501080d96580dab9086d3cbdf95356c0821897fd54a930a8cfe2684cf3c7de", + "41403aafe1e2ccb1a02edde96fe742085feffe028d02529eb2b13f925884a499", 0 }; static u3j_harm _140_two__in_apt_a[] = {{".2", u3wdi_apt}, {}}; static c3_c* _140_two__in_apt_ha[] = { + "a40812fa255f13afdaf196bff38d2d9bfcb38f09c48ace9139a2701a555a0c9a", 0 }; static u3j_harm _140_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; static c3_c* _140_two__in_bif_ha[] = { - "7ccbde61c80246056f6acfd8dc30f560af9e5abd44841c22ba0f49951dbc2f2a", + "edd0d727b9099e75c3e5b73b3025ad9737136eacedc2f8088b6edb02dbe06cb3", 0 }; static u3j_harm _140_two__in_del_a[] = {{".2", u3wdi_del}, {}}; static c3_c* _140_two__in_del_ha[] = { - "b03dc379cfa0b9eca24cf01d57cadd20f65c64311b5ee90732ec2def97c8a673", + "33a21e7aaf71105e2d48e1af61ff463fb8a0b7e04f8a8c30a6f6a2d1f967795f", 0 }; static u3j_harm _140_two__in_dif_a[] = {{".2", u3wdi_dif}, {}}; static c3_c* _140_two__in_dif_ha[] = { - "e4367b9e5d425687a18c98def65e36385d05b4e7ed5d30420807bf147fd5fabb", + "a488f0be5adbb1c04e2038a2315ac065591e7daadcafc1d47aea272979680468", 0 }; static u3j_harm _140_two__in_gas_a[] = {{".2", u3wdi_gas}, {}}; @@ -1559,24 +1687,29 @@ static c3_c* _140_two_xeb_ha[] = { }; static u3j_harm _140_two__in_has_a[] = {{".2", u3wdi_has}, {}}; static c3_c* _140_two__in_has_ha[] = { - "eebeebeaff243c5795575a468191474459c7b191fb575e1b96feb484fcbc19dc", + "a65e666e92176401040a883801e4f05bd650fe6c094a6c8d7f4afcaee9cf55ad", 0 }; static u3j_harm _140_two__in_int_a[] = {{".2", u3wdi_int}, {}}; - static c3_c* _140_two__in_int_ha[] = {0}; + static c3_c* _140_two__in_int_ha[] = { + "a71b0e355fa02d18447c02922f69096f42043da451e8c79e7a9270460c3a44e6", + 0 + }; static u3j_harm _140_two__in_put_a[] = {{".2", u3wdi_put}, {}}; static c3_c* _140_two__in_put_ha[] = { - "4a9fd615fecd2fd36485b3a2f24cdc13afc86f9a478362934b4654297496a03c", + "19b27267e18ef156d85d84d37e02692a17fec0b7a2a0fe4120a3ae02b841c8f4", 0 }; static u3j_harm _140_two__in_rep_a[] = {{".2", u3wdi_rep}, {}}; static c3_c* _140_two__in_rep_ha[] = { + "05bfb84a52ed8ccc330a96faca29a49afd28300960ac089d00dba32212b971a7", 0 }; static u3j_harm _140_two__in_run_a[] = {{".2", u3wdi_run}, {}}; static c3_c* _140_two__in_run_ha[] = { + "7f2061dbee19fa20925bd5a80cc41ed71e462e0f49ee6e845fd750c219734864", 0 }; static u3j_harm _140_two__in_tap_a[] = {{".2", u3wdi_tap}, {}}; @@ -1591,7 +1724,7 @@ static c3_c* _140_two_xeb_ha[] = { }; static u3j_harm _140_two__in_uni_a[] = {{".2", u3wdi_uni}, {}}; static c3_c* _140_two__in_uni_ha[] = { - "8369d11970bfa09bd20c5b112a353fa10e8e64c9c081e3a5b17bcf3700127add", + "6bd72ef1fb12482a839f4435a2b163ace1b56036297a3cec6968be33d6863096", 0 }; @@ -1612,34 +1745,37 @@ static u3j_core _140_two__in_d[] = {} }; static c3_c* _140_two__in_ha[] = { - "abf20b11b7d7f9aa8cc7b4de01c15ec3aca3ea07ca09a461a3277fe24c640849", + "8bbb90ce0a49d627194aa267f6cf1fd78df677111b553ce03119fea19f9d763c", 0 }; static u3j_harm _140_two__by_all_a[] = {{".2", u3wdb_all, c3y}, {}}; static c3_c* _140_two__by_all_ha[] = { + "c2e87d0047c14b4488d03aad98fa43080c736d86d2ff723a037aaf1843aa9285", 0 }; static u3j_harm _140_two__by_any_a[] = {{".2", u3wdb_any, c3y}, {}}; static c3_c* _140_two__by_any_ha[] = { + "96b95c942dcbc97f5291fa6f7342c3e19a87d69cc254965b0f75d95133a19301", 0 }; static u3j_harm _140_two__by_apt_a[] = {{".2", u3wdb_apt, c3y}, {}}; static c3_c* _140_two__by_apt_ha[] = { + "1f0a6f8b945b243520b77069060589938d9e651e34b24924db9528d02a98014f", 0 }; static u3j_harm _140_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; static c3_c* _140_two__by_bif_ha[] = { - "09ce4cf00dd9b4f95d4d93a984ffab94cb99cb6017bb73531245ea4813855f4e", + "d377a032a3866e76f6f5217c7c0ed0519b768d8b1c5107e35f7dbf18d8f60880", 0 }; static u3j_harm _140_two__by_del_a[] = {{".2", u3wdb_del, c3y}, {}}; static c3_c* _140_two__by_del_ha[] = { - "c51c30a2c58c351d4c7cbc3f8276432140b74f3f2b3a76db4b46b189f5cd8cfe", + "09f78d6235d3fce8303c7bc663988349b7d4592abdacfb09b833d2f43629b6b6", 0 }; static u3j_harm _140_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; static c3_c* _140_two__by_dif_ha[] = { - "f40cac6183410ea88c1d6dd43fd2b2c7fb6178bcbf9d5ceb4accf5e28a0c1103", + "0334e6df6fd0bd5013b94a1b22c29e4c436da0a2d5573f1992faad1c8a059cc7", 0 }; static u3j_harm _140_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; @@ -1649,7 +1785,7 @@ static c3_c* _140_two__in_ha[] = { }; static u3j_harm _140_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; static c3_c* _140_two__by_get_ha[] = { - "ce021b5e383d672ab43d771857239b6789a8cdb145a626799c77c748a2f7c918", + "4de4cea8fa98ef48e9faae10c90ba5bd77971670030ffb00483d0608af4c466f", 0 }; static u3j_harm _140_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; @@ -1659,28 +1795,34 @@ static c3_c* _140_two__in_ha[] = { }; static u3j_harm _140_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; - static c3_c* _140_two__by_int_ha[] = {0}; + static c3_c* _140_two__by_int_ha[] = { + "a2345429482c271a1668f3c0675a559452bb7b13cb7393c3acb7de44c603aef9", + 0 + }; static u3j_harm _140_two__by_jab_a[] = {{".2", u3wdb_jab, c3y}, {}}; static c3_c* _140_two__by_jab_ha[] = { - "8bc992aefabd2e0f43c900f2c4f3b06cf330973774d8f43428049cc3b3cb5b94", + "48930133d9b26e912dce54d1bc486cfe9dcb32bb3c2b1ad76143382799aec156", 0 }; static u3j_harm _140_two__by_key_a[] = {{".2", u3wdb_key, c3y}, {}}; static c3_c* _140_two__by_key_ha[] = { + "0096c77b93e9fe36b98d9f433eb73300f024283b93b3d73a4001afb9f9804d1b", 0 }; static u3j_harm _140_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; static c3_c* _140_two__by_put_ha[] = { - "2cc9f005fde5314e9ad545286493a8c81b5c3b775d645ad82954f405d9414a32", + "b7307589fed604bfb92e8ad5ffad611c82d835baf02a86c6911b279930f4e8d7", 0 }; static u3j_harm _140_two__by_rep_a[] = {{".2", u3wdb_rep, c3y}, {}}; static c3_c* _140_two__by_rep_ha[] = { + "05bfb84a52ed8ccc330a96faca29a49afd28300960ac089d00dba32212b971a7", 0 }; static u3j_harm _140_two__by_run_a[] = {{".2", u3wdb_run, c3y}, {}}; static c3_c* _140_two__by_run_ha[] = { + "adea01e9036e0b40e4969814d4eed935d7d69a52e4a55de5520df2fa5204d8e7", 0 }; static u3j_harm _140_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; @@ -1690,14 +1832,17 @@ static c3_c* _140_two__in_ha[] = { }; static u3j_harm _140_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; static c3_c* _140_two__by_uni_ha[] = { + "f18bc4dac19abe14a6f56afc15d838b7394d48969156f4b37c3c84edd5d46752", 0 }; static u3j_harm _140_two__by_urn_a[] = {{".2", u3wdb_urn, c3y}, {}}; static c3_c* _140_two__by_urn_ha[] = { + "a409cf78e7f1c2ce8440115730f74367839b658cde2d6a1daa8af067b790eb83", 0 }; static u3j_harm _140_two__by_wyt_a[] = {{".2", u3wdb_wyt, c3y}, {}}; static c3_c* _140_two__by_wyt_ha[] = { + "fac9248ebd1defade9df695cd81f94355bebb271f85b164ff34658a5f45c71a0", 0 }; @@ -1724,18 +1869,18 @@ static u3j_core _140_two__by_d[] = {} }; static c3_c* _140_two__by_ha[] = { - "2bb4c60da0ae916cd0aa596588bdd0f7070f0832e698526aac951fd55a4abbdc", + "9c70e973de46335405a7ff932d4742743f54db579f2584758ef2b02afd4fbfe8", 0 }; static u3j_harm _140_two_cue_a[] = {{".2", u3we_cue}, {}}; static c3_c* _140_two_cue_ha[] = { - "87acffeccdc6e1ce72d74e41f91c8f1d190f70e09ce755c6a487e0c951dcc139", + "a52b584c5a92fc653e47f50c3389caf3427e13d20ddb8bd701a2d7bca12cb742", 0 }; static u3j_harm _140_two_jam_a[] = {{".2", u3we_jam}, {}}; static c3_c* _140_two_jam_ha[] = { - "5c52fe8ebea73c478aaac344d06e9ff48c075be67c3a3cc77a57ef0143bd9219", + "61f86be74cb1fd5a1d7f531cc9588f8f34a972be8de487c93d25c8e026592ed2", 0 }; static u3j_harm _140_two_mat_a[] = {{".2", u3we_mat}, {}}; @@ -1750,7 +1895,7 @@ static c3_c* _140_two_rub_ha[] = { }; static u3j_core _140_two_d[] = -{ { "tri", 3, 0, _140_tri_d, _140_tri_ha }, +{ { "tri", 3, 0, _140_tri_d, _140_tri_ha, _140_tri_ho }, { "find", 7, _140_two_find_a, 0, _140_two_find_ha }, { "flop", 7, _140_two_flop_a, 0, _140_two_flop_ha }, @@ -1808,7 +1953,7 @@ static u3j_core _140_two_d[] = {} }; static c3_c* _140_two_ha[] = { - "56cd63625015fb07de63ad95cbb90a303dd2e1e1efca4c93a1bc053e0b6a9f7a", + "f693e1f5ff57ec741fe28a48a18252b3e12dead2bfe3bcd4ea8e904a36905c0b", 0 }; @@ -1882,7 +2027,7 @@ static c3_c* _140_one_peg_ha[] = { }; static u3j_harm _140_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; static c3_c* _140_one_mas_ha[] = { - "94bfb3ec6e032bf386349e9ae0784f37144e65692830d11a06fa89602e313f7f", + "1439dcd809f0819b09fb5fe7e83bc1292ca6fd33b5819d78e706d402c053b02a", 0 }; @@ -1907,7 +2052,7 @@ static u3j_core _140_one_d[] = {} }; static c3_c* _140_one_ha[] = { - "3f22006efef06ab8171cfd03057dbcb1af325c16f03662a67119d4060b3b0f6a", + "2501f8dbe62384d144ab0f805501ed66325bd77a733eca0c80d1da673e4b16fb", 0 }; @@ -1916,7 +2061,7 @@ u3j_core _k140_d[] = {} }; static c3_c* _k140_ha[] = { - "7768e2670a7d95397c0587f4d7834652602f70f0206efce6c3345c3f70dfc12a", + "9b82a903093c077afb3f0b9d4e95e1a9c9789d1ca605b57bbacf79857e3d5c52", 0 }; From d6def3c4cb03fe01899d3f2a38349abbfa4421c3 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Wed, 16 Dec 2020 11:17:13 -0500 Subject: [PATCH 17/27] WIP: Got to the point where we boot and goof on the event --- bin/solid.pill | 4 +- pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs | 4 +- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 44 +++++++++++++------ .../urbit-king/lib/Urbit/Vere/Pier/Types.hs | 9 ++++ pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs | 29 ++---------- .../urbit-king/lib/Urbit/Vere/Serf/Types.hs | 5 +-- 6 files changed, 50 insertions(+), 45 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 73512ca328..35c5e5f636 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9ec1e0a325bc754493e32c3f2d62d13620db1b1afac40ef45b1718eb10ff8f3 -size 10037688 +oid sha256:0cdea6bdb29cfdf3bda2ef068a2389b0cfc5a38a42d60fb0061f59deaebbf0c9 +size 8041008 diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs index 4794e0322a..e445ef380c 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs @@ -50,7 +50,7 @@ newtype ServId = ServId { unServId :: UV } -- Information about the king runtime passed to Arvo. data Vere = Vere { vereName :: Term, - vereRev :: (Term, UD, UD, UD), + vereRev :: [Cord], vereWynn :: Wynn } deriving (Eq, Ord, Show) @@ -63,7 +63,7 @@ instance FromNoun Vere where pure $ Vere {..} -- A list of names and their kelvin numbers, used in version negotiations. -newtype Wynn = Wynn { unWynn :: [(Term, UD)] } +newtype Wynn = Wynn { unWynn :: [(Term, Noun)] } deriving newtype (Eq, Ord, Show, FromNoun, ToNoun) -- Http Common ----------------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 158ba43507..2c676e2193 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -350,7 +350,7 @@ pier (serf, log) vSlog startedSig injected = do cb :: Int -> WorkError -> IO () cb n | n >= 3 = error ("boot event failed: " <> show ev) cb n = \case - RunOkay _ -> putMVar okaySig () + RunOkay _ _ -> putMVar okaySig () RunSwap _ _ _ _ _ -> putMVar okaySig () RunBail _ -> inject (n + 1) @@ -377,7 +377,7 @@ pier (serf, log) vSlog startedSig injected = do let inject = atomically $ compute $ RRWork $ EvErr ev $ cb cb :: WorkError -> IO () cb = \case - RunOkay _ -> putMVar okaySig (Right ()) + RunOkay _ _ -> putMVar okaySig (Right ()) RunSwap _ _ _ _ _ -> putMVar okaySig (Right ()) RunBail goofs -> putMVar okaySig (Left goofs) @@ -426,18 +426,36 @@ doVersionNegotiation -> RAcquire e () doVersionNegotiation compute = do -- What we want to do is actually inspect the effects here. - arvoVer <- fromNounExn $ toNoun $ Cord "arvo-kelvin" - let k = Wynn [("zuse", 309), - ("arvo", arvoVer), - ("hoon", 141), - ("nock", 4)] - sen = MkTerm "121331" -- TODO: What is sen? I can just generate a nonce here. - v = Vere sen ("KingHaskell", 0, 10, 9) k + let k = Wynn [("zuse", toNoun $ UD 309), + ("lull", toNoun $ UD 303), + ("arvo", toNoun $ UD 240), + ("hoon", toNoun $ UD 141), + ("nock", toNoun $ UD 4)] + sen = MkTerm "121331" -- TODO: I can just generate a nonce here. + v = Vere sen [Cord "KingHaskell", Cord "1.0"] k + ev = EvBlip $ BlipEvArvo $ ArvoEvWyrd v + + okaySig :: MVar (Either [Goof] FX) <- newEmptyMVar + let inject = atomically $ compute $ RRWork $ EvErr ev $ cb + cb :: WorkError -> IO () + cb = \case + RunOkay _ fx -> putMVar okaySig (Right fx) + RunSwap _ _ _ _ fx -> putMVar okaySig (Right fx) + RunBail goofs -> putMVar okaySig (Left goofs) + + -- OK, we are actually getting an exception from the remote side here. + logDebug "About to inject wyrd" + io inject + logDebug "Injected wyrd" + + takeMVar okaySig >>= \case + Left goof -> logError $ display @Text ("Goof in wyrd event: " <> + tshow goof) + Right fx -> do + -- TODO: We need to actually iterate over the fx list to search for + -- version negotiation events. + logDebug $ display @Text ("FX list: " <> tshow fx) - retVar <- newEmptyTMVarIO - atomically $ compute $ RRWyrd v (putTMVar retVar) - ret <- atomically $ takeTMVar retVar - pure () -- Start All Drivers ----------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs index ab5adba732..be03833ccb 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs @@ -44,6 +44,15 @@ instance Show Nock where -------------------------------------------------------------------------------- +-- A Pill is a pair of [pil_p pil_q], where pil_p is cued and pil_q is an +-- optional set of userspace ovums. +-- +-- The cued pil_p is a trel of [mot tag dat], where mot is 0 (version number?), +-- tag is a cord about the type of pill, and dat is the traditional trel of +-- [pBootForumlas pKernelOvums pUserspaceOvums]. +-- +-- So what's with pil_q? It looks like it is search for the %into. + data Pill = Pill { pBootFormulas :: ![Nock] , pKernelOvums :: ![Ev] diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs index bbb8612a83..fab6070d02 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs @@ -84,7 +84,7 @@ import Foreign.Ptr (castPtr) import Foreign.Storable (peek, poke) import RIO.Prelude (decodeUtf8Lenient) import System.Posix.Signals (sigINT, sigKILL, signalProcess) -import Urbit.Arvo (FX, Vere, Wynn) +import Urbit.Arvo (FX) import Urbit.Arvo.Event import Urbit.Noun.Time (Wen) @@ -164,6 +164,7 @@ sendWrit s = sendBytes s . jamBS . toNoun recvPlea :: Serf -> IO Plea recvPlea w = do b <- recvResp w + putStrLn "recvPleas recvResp" n <- fromRightExn (cueBS b) (const $ BadPleaAtom $ bytesAtom b) p <- fromRightExn (fromNounErr @Plea n) (\(p, m) -> BadPleaNoun n p m) pure p @@ -368,24 +369,6 @@ compact serf = withSerfLockIO serf $ \ss -> do sendCompactionRequest serf pure (ss, ()) -{-| - Tells the serf our version number and puts any returned version information - into the passed in d --} -wyrd :: Vere -> (Maybe Wynn -> STM ()) -> Serf -> IO () -wyrd v ret serf = withSerfLockIO serf $ \ss -> do - now <- Time.now - sendWrit serf (WWork 0 now $ EvBlip $ BlipEvArvo $ ArvoEvWyrd v) - recvWork serf >>= \case - WBail goofs -> do - throwIO (BailDuringWyrd goofs) - WSwap eid hash (wen, noun) fx -> do - throwIO (SwapDuringWyrd hash (wen, noun) fx) - WDone eid hash fx -> do - -- TODO: fish around in the fx for the upgrade event here. The equivalent - -- of _pier_on_lord_wyrd_done(). - pure (ss, ()) - {-| Peek into the serf state. -} @@ -511,15 +494,11 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRSave () -> doSave RRKill () -> doKill RRPack () -> doPack - RRWyrd v ret -> doWyrd v ret RRScry w g p k -> doScry w g p k doPack :: IO () doPack = compact serf >> topLoop - doWyrd :: Vere -> (Maybe Wynn -> STM ()) -> IO () - doWyrd v w = wyrd v w serf >> topLoop - waitForLog :: IO () waitForLog = do serfLast <- serfLastEventBlocking serf @@ -552,13 +531,12 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRSave () -> atomically (closeTBMQueue que) >> pure doSave RRPack () -> atomically (closeTBMQueue que) >> pure doPack RRScry w g p k -> atomically (closeTBMQueue que) >> pure (doScry w g p k) - RRWyrd v ret -> atomically (closeTBMQueue que) >> pure (doWyrd v ret) RRWork workErr -> atomically (writeTBMQueue que workErr) >> workLoop que onWorkResp :: Wen -> EvErr -> Work -> IO () onWorkResp wen (EvErr evn err) = \case WDone eid hash fx -> do - io $ err (RunOkay eid) + io $ err (RunOkay eid fx) atomically $ sendOn ((Fact eid hash wen (toNoun evn)), fx) WSwap eid hash (wen, noun) fx -> do io $ err (RunSwap eid hash wen noun fx) @@ -566,6 +544,7 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop WBail goofs -> do io $ err (RunBail goofs) + {-| Given: diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs index 5de79b269b..4bffdf0fd4 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs @@ -2,7 +2,7 @@ module Urbit.Vere.Serf.Types where import Urbit.Prelude -import Urbit.Arvo (Ev, FX, Vere, Wynn) +import Urbit.Arvo (Ev, FX) import Urbit.Noun.Time (Wen) @@ -82,7 +82,7 @@ data EvErr = EvErr Ev (WorkError -> IO ()) data WorkError -- TODO Rename type and constructors = RunSwap EventId Mug Wen Noun FX -- TODO Maybe provide less info here? | RunBail [Goof] - | RunOkay EventId + | RunOkay EventId FX {- - RRWork: Ask the serf to do work, will output (Fact, FX) if work @@ -94,7 +94,6 @@ data RunReq | RRSave () | RRKill () | RRPack () - | RRWyrd Vere (Maybe Wynn -> STM ()) | RRScry Wen Gang Path (Maybe (Term, Noun) -> IO ()) From 44d8119119344dc2f0393f913a314a6beccce0a7 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Wed, 16 Dec 2020 11:46:54 -0500 Subject: [PATCH 18/27] That was it. Fixed the wyrd:insane issue. --- pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs | 2 +- pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs | 2 +- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs index e445ef380c..d62a445c1d 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs @@ -63,7 +63,7 @@ instance FromNoun Vere where pure $ Vere {..} -- A list of names and their kelvin numbers, used in version negotiations. -newtype Wynn = Wynn { unWynn :: [(Term, Noun)] } +newtype Wynn = Wynn { unWynn :: [(Term, Word)] } deriving newtype (Eq, Ord, Show, FromNoun, ToNoun) -- Http Common ----------------------------------------------------------------- diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs index b2208d242b..4ede406253 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs @@ -219,7 +219,7 @@ data ArvoEv = ArvoEvWhom () Ship | ArvoEvWack () Entropy | ArvoEvCrud Path Noun - | ArvoEvWyrd Vere + | ArvoEvWyrd () Vere deriving (Eq, Ord, Show) deriveNoun ''ArvoEv diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 2c676e2193..8eb1fe265a 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -426,14 +426,14 @@ doVersionNegotiation -> RAcquire e () doVersionNegotiation compute = do -- What we want to do is actually inspect the effects here. - let k = Wynn [("zuse", toNoun $ UD 309), - ("lull", toNoun $ UD 303), - ("arvo", toNoun $ UD 240), - ("hoon", toNoun $ UD 141), - ("nock", toNoun $ UD 4)] + let k = Wynn [("zuse", 420), + ("lull", 330), + ("arvo", 240), + ("hoon", 140), + ("nock", 4)] sen = MkTerm "121331" -- TODO: I can just generate a nonce here. - v = Vere sen [Cord "KingHaskell", Cord "1.0"] k - ev = EvBlip $ BlipEvArvo $ ArvoEvWyrd v + v = Vere sen [Cord "kh", Cord "1.0"] k + ev = EvBlip $ BlipEvArvo $ ArvoEvWyrd () v okaySig :: MVar (Either [Goof] FX) <- newEmptyMVar let inject = atomically $ compute $ RRWork $ EvErr ev $ cb From 3451e02cd1c2d273890b08554313a35854eb99c3 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Wed, 16 Dec 2020 16:53:25 -0500 Subject: [PATCH 19/27] OK, and now we are walking through the effects --- pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs | 5 +- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 51 ++++++++++++++------ pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs | 1 - 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs index 50bf0d7f18..5a57829124 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Effect.hs @@ -18,7 +18,7 @@ import Urbit.Arvo.Common (KingId(..), ServId(..)) import Urbit.Arvo.Common (Header, HttpEvent, HttpServerConf, Method, Mime) import Urbit.Arvo.Common (AmesDest, Turf) import Urbit.Arvo.Common (ReOrg(..), reorgThroughNoun) -import Urbit.Arvo.Common (Desk) +import Urbit.Arvo.Common (Desk, Wynn) -- Newt Effects ---------------------------------------------------------------- @@ -259,6 +259,7 @@ data Ef = EfVane VaneEf | EfVega Cord EvilPath -- second path component, rest of path | EfExit Cord EvilPath -- second path component, rest of path + | EfWend Wynn deriving (Eq, Ord, Show) -- XX HACK @@ -275,6 +276,7 @@ instance ToNoun Ef where EfVane v -> toNoun $ reorgThroughNoun ("", v) EfExit s p -> toNoun $ ReOrg "" s "exit" p (A 0) EfVega s p -> toNoun $ ReOrg "" s "vega" p (A 0) + EfWend w -> toNoun $ reorgThroughNoun ("", w) instance FromNoun Ef where parseNoun = tack >>> parseNoun >=> \case @@ -282,6 +284,7 @@ instance FromNoun Ef where ReOrg "" s "exit" p _ -> fail "%exit effect expects nil value" ReOrg "" s "vega" p (A 0) -> pure (EfVega s p) ReOrg "" s "vega" p _ -> fail "%vega effect expects nil value" + ReOrg "" s "wend" p val -> EfWend <$> parseNoun val ReOrg "" s tag p val -> EfVane <$> parseNoun (toNoun (s, tag, p, val)) ReOrg _ _ _ _ _ -> fail "Non-empty first path-element" diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 8eb1fe265a..57685687bc 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -37,6 +37,7 @@ import Urbit.TermSize (TermSize(..), termSize) import Urbit.Vere.Serf (Serf) import qualified Data.Text as T +import qualified Data.List as L import qualified System.Entropy as Ent import qualified Urbit.EventLog.LMDB as Log import qualified Urbit.King.API as King @@ -316,9 +317,9 @@ pier (serf, log) vSlog startedSig injected = do io $ readTVarIO siteSlog >>= ($ s) logOther "serf" (display $ T.strip $ tankToText tank) + let err = atomically . Term.trace muxed . (<> "\r\n") (bootEvents, startDrivers) <- do env <- ask - let err = atomically . Term.trace muxed . (<> "\r\n") siz <- atomically $ Term.curDemuxSize demux let fak = isFake logId drivers env ship fak compute scry (siz, muxed) err sigint stat runtimeSubsite @@ -335,9 +336,7 @@ pier (serf, log) vSlog startedSig injected = do tSerf <- acquireWorker "Serf" (runCompute serf computeConfig) - -- TODO: Go through the version negotionation with the serf. Before we start - -- the drivers, we send a %wyrd event and wait for a %wynn - doVersionNegotiation compute + doVersionNegotiation compute err -- Run all born events and retry them until they succeed. wackEv <- EvBlip . BlipEvArvo . ArvoEvWack () <$> genEntropy @@ -420,18 +419,26 @@ death tag tid = do -- %wyrd version negotiation --------------------------------------------------- +data PierVersionNegotiationFailed = PierVersionNegotiationFailed + deriving (Show, Exception) + +zuseVersion :: Word +zuseVersion = 420 + doVersionNegotiation :: HasPierEnv e => (RunReq -> STM ()) + -> (Text -> RIO e ()) -> RAcquire e () -doVersionNegotiation compute = do - -- What we want to do is actually inspect the effects here. - let k = Wynn [("zuse", 420), +doVersionNegotiation compute stderr = do + king <- tshow <$> view kingIdL + + let k = Wynn [("zuse", zuseVersion), ("lull", 330), ("arvo", 240), ("hoon", 140), ("nock", 4)] - sen = MkTerm "121331" -- TODO: I can just generate a nonce here. + sen = MkTerm king v = Vere sen [Cord "kh", Cord "1.0"] k ev = EvBlip $ BlipEvArvo $ ArvoEvWyrd () v @@ -443,18 +450,29 @@ doVersionNegotiation compute = do RunSwap _ _ _ _ fx -> putMVar okaySig (Right fx) RunBail goofs -> putMVar okaySig (Left goofs) - -- OK, we are actually getting an exception from the remote side here. - logDebug "About to inject wyrd" + rio $ stderr "vere: checking version compatibility" io inject - logDebug "Injected wyrd" takeMVar okaySig >>= \case - Left goof -> logError $ display @Text ("Goof in wyrd event: " <> - tshow goof) + Left goof -> do + rio $ stderr "pier: version negotation failed" + logError $ display @Text ("Goof in wyrd event: " <> tshow goof) + throwIO PierVersionNegotiationFailed + Right fx -> do - -- TODO: We need to actually iterate over the fx list to search for - -- version negotiation events. - logDebug $ display @Text ("FX list: " <> tshow fx) + -- Walk through the returned fx looking for a wend effect. If we find + -- one, check the zuse versions. + rio $ for_ fx $ \case + GoodParse (EfWend (Wynn xs)) -> case L.lookup "zuse" xs of + Nothing -> pure () + Just zuseVerInWynn -> + if zuseVerInWynn /= zuseVersion + then do + rio $ stderr "pier: pier: version negotiation failed; downgrade" + throwIO PierVersionNegotiationFailed + else + pure () + _ -> pure () -- Start All Drivers ----------------------------------------------------------- @@ -544,6 +562,7 @@ router slog waitFx Drivers {..} = do case ef of GoodParse (EfVega _ _ ) -> vega GoodParse (EfExit _ _ ) -> exit + GoodParse (EfWend _ ) -> pure () GoodParse (EfVane (VEBehn ef)) -> io (dBehn ef) GoodParse (EfVane (VEBoat ef)) -> io (dSync ef) GoodParse (EfVane (VEClay ef)) -> io (dSync ef) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs index fab6070d02..a6aa8c7a55 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs @@ -164,7 +164,6 @@ sendWrit s = sendBytes s . jamBS . toNoun recvPlea :: Serf -> IO Plea recvPlea w = do b <- recvResp w - putStrLn "recvPleas recvResp" n <- fromRightExn (cueBS b) (const $ BadPleaAtom $ bytesAtom b) p <- fromRightExn (fromNounErr @Plea n) (\(p, m) -> BadPleaNoun n p m) pure p From 29cc12d206c41e22a3859245613af1e195006673 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 18 Dec 2020 17:00:56 -0800 Subject: [PATCH 20/27] king: various fixes and improvements --- pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs | 2 +- pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs | 8 +++- pkg/hs/urbit-king/lib/Urbit/King/Main.hs | 2 +- pkg/hs/urbit-king/lib/Urbit/King/Scry.hs | 36 ++++++++-------- pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 19 +++++---- .../lib/Urbit/Vere/Eyre/KingSubsite.hs | 6 +-- pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs | 42 +++++++++++-------- .../urbit-king/lib/Urbit/Vere/Pier/Types.hs | 9 +++- pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs | 35 +++++++++------- .../lib/Urbit/Vere/Serf/IPC/Types.hs | 3 +- .../urbit-king/lib/Urbit/Vere/Serf/Types.hs | 16 ++++++- pkg/hs/urbit-king/package.yaml | 2 +- pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs | 7 +++- 13 files changed, 112 insertions(+), 75 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs index d62a445c1d..bf504c2a1f 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs @@ -132,7 +132,7 @@ deriveNoun ''HttpServerConf -- Desk and Mime --------------------------------------------------------------- newtype Desk = Desk { unDesk :: Cord } - deriving newtype (Eq, Ord, Show, ToNoun, FromNoun) + deriving newtype (Eq, Ord, Show, ToNoun, FromNoun, IsString) data Mime = Mime Path File deriving (Eq, Ord, Show) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs index 4ede406253..3b97d599b6 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs @@ -9,7 +9,7 @@ -} module Urbit.Arvo.Event where -import Urbit.Prelude hiding (Term) +import Urbit.Prelude import Control.Monad.Fail (fail) import Urbit.Arvo.Common (KingId(..), ServId(..), Vere(..)) @@ -218,8 +218,12 @@ instance Show Entropy where data ArvoEv = ArvoEvWhom () Ship | ArvoEvWack () Entropy - | ArvoEvCrud Path Noun | ArvoEvWyrd () Vere + | ArvoEvCrud Path Noun + | ArvoEvTrim UD + | ArvoEvWhat [Noun] + | ArvoEvWhey () + | ArvoEvVerb (Maybe Bool) deriving (Eq, Ord, Show) deriveNoun ''ArvoEv diff --git a/pkg/hs/urbit-king/lib/Urbit/King/Main.hs b/pkg/hs/urbit-king/lib/Urbit/King/Main.hs index 5960154281..e93a671b4c 100644 --- a/pkg/hs/urbit-king/lib/Urbit/King/Main.hs +++ b/pkg/hs/urbit-king/lib/Urbit/King/Main.hs @@ -382,7 +382,7 @@ replayPartEvs top last = do {-| Interesting -} -testPill :: HasLogFunc e => FilePath -> Bool -> Bool -> RIO e () +testPill :: HasKingEnv e => FilePath -> Bool -> Bool -> RIO e () testPill pax showPil showSeq = do logInfo "Reading pill file." pillBytes <- readFile pax diff --git a/pkg/hs/urbit-king/lib/Urbit/King/Scry.hs b/pkg/hs/urbit-king/lib/Urbit/King/Scry.hs index f2a989be39..8692374770 100644 --- a/pkg/hs/urbit-king/lib/Urbit/King/Scry.hs +++ b/pkg/hs/urbit-king/lib/Urbit/King/Scry.hs @@ -2,30 +2,32 @@ Scry helpers -} -module Urbit.King.Scry (scryNow) where +module Urbit.King.Scry + ( scryNow + , module Urbit.Vere.Pier.Types + ) +where import Urbit.Prelude import Urbit.Vere.Serf.Types -import qualified Urbit.Noun.Time as Time +import Urbit.Arvo.Common (Desk) +import Urbit.Vere.Pier.Types (ScryFunc) scryNow :: forall e n . (HasLogFunc e, FromNoun n) - => (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) - -> Text -- ^ vane + care as two-letter string - -> Ship -- ^ ship in scry path, usually the local ship - -> Text -- ^ desk in scry path + => ScryFunc + -> Term -- ^ vane + care as two-letter string + -> Desk -- ^ desk in scry path -> [Text] -- ^ resource path to scry for -> RIO e (Maybe n) -scryNow scry vare ship desk path = do - env <- ask - wen <- io Time.now - let wan = tshow $ Time.MkDate wen - let pax = Path $ fmap MkKnot $ vare : (tshow ship) : desk : wan : path - io (scry wen Nothing pax) >>= \case - Just (_, fromNoun @n -> Just v) -> pure $ Just v - Just (_, n) -> do - logError $ displayShow ("uncanny scry result", vare, pax, n) - pure Nothing - Nothing -> pure Nothing +scryNow scry vare desk path = + io (scry Nothing (EachNo $ DemiOnce vare desk (Path $ MkKnot <$> path))) + >>= \case + Just ("omen", fromNoun @(Path, Term, n) -> Just (_,_,v)) -> pure $ Just v + Just (_, fromNoun @n -> Just v) -> pure $ Just v + Just (_, n) -> do + logError $ displayShow ("uncanny scry result", vare, path, n) + pure Nothing + Nothing -> pure Nothing diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index 511821cff5..b025d6ec2a 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -15,19 +15,17 @@ import Urbit.Arvo hiding (Fake) import Urbit.King.Config import Urbit.King.Scry import Urbit.Vere.Ames.LaneCache -import Urbit.Vere.Ames.Packet +--import Urbit.Vere.Ames.Packet import Urbit.Vere.Pier.Types import Urbit.Vere.Ports -import Data.Serialize (decode, encode) +-- import Data.Serialize (decode, encode) import Urbit.King.App (HasKingId(..), HasPierEnv(..)) import Urbit.Vere.Ames.DNS (NetworkMode(..), ResolvServ(..)) import Urbit.Vere.Ames.DNS (galaxyPort, resolvServ) import Urbit.Vere.Ames.UDP (UdpServ(..), fakeUdpServ, realUdpServ) import Urbit.Vere.Stat (AmesStat(..), bump, bump') -import qualified Urbit.Noun.Time as Time - -- Constants ------------------------------------------------------------------- @@ -143,7 +141,7 @@ ames' => Ship -> Bool -> AmesStat - -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) + -> ScryFunc -> (Text -> RIO e ()) -> RIO e ([Ev], RAcquire e (DriverApi NewtEf)) ames' who isFake stat scry stderr = do @@ -198,7 +196,7 @@ ames -> Ship -> Bool -> AmesStat - -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) + -> ScryFunc -> (EvErr -> STM PacketOutcome) -> (Text -> RIO e ()) -> ([Ev], RAcquire e (NewtEf -> IO ())) @@ -269,7 +267,9 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) -- port number, host address, bytestring (p, a, b) <- atomically (bump' asRcv >> usRecv) ver <- readTVarIO vers - + -- TODO + serfsUp p a b + {- case decode b of Right (pkt@Packet {..}) | ver == Nothing || ver == Just pktVersion -> do logDebug $ displayShow ("ames: bon packet", pkt, showUD $ bytesAtom b) @@ -315,6 +315,7 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) Left e -> do bump asDml logInfo $ displayShow ("ames: dropping malformed", e) + -} where serfsUp p a b = @@ -362,12 +363,12 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) EachNo addr -> to (ipv4Addr addr) scryVersion :: HasLogFunc e => RIO e (Maybe Version) - scryVersion = scryNow scry "ax" who "" ["protocol", "version"] + scryVersion = scryNow scry "ax" "" ["protocol", "version"] scryLane :: HasLogFunc e => Ship -> RIO e (Maybe [AmesDest]) - scryLane ship = scryNow scry "ax" who "" ["peers", tshow ship, "forward-lane"] + scryLane ship = scryNow scry "ax" "" ["peers", tshow ship, "forward-lane"] ipv4Addr (Jammed (AAVoid v )) = absurd v ipv4Addr (Jammed (AAIpv4 a p)) = SockAddrInet (fromIntegral p) (unIpv4 a) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs index 960035c3b5..c75d78c0db 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Eyre/KingSubsite.hs @@ -13,7 +13,6 @@ import Urbit.Prelude hiding (Builder) import Data.ByteString.Builder import Urbit.King.Scry -import Urbit.Vere.Serf.Types import Data.Conduit (ConduitT, Flush(..), yield) import Data.Text.Encoding (encodeUtf8Builder) @@ -23,7 +22,6 @@ import qualified Data.Text.Encoding as E import qualified Network.HTTP.Types as H import qualified Network.Wai as W import qualified Network.Wai.Conduit as W -import qualified Urbit.Noun.Time as Time newtype KingSubsite = KS { runKingSubsite :: W.Application } @@ -44,7 +42,7 @@ streamSlog a = do kingSubsite :: HasLogFunc e => Ship - -> (Time.Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) + -> ScryFunc -> IO RenderedStat -> TVar ((Atom, Tank) -> IO ()) -> RAcquire e KingSubsite @@ -118,7 +116,7 @@ kingSubsite who scry stat func = do => Text -> RIO e (Maybe Bool) scryAuth cookie = - scryNow scry "ex" who "" ["authenticated", "cookie", textAsTa cookie] + scryNow scry "ex" "" ["authenticated", "cookie", textAsTa cookie] fourOhFourSubsite :: Ship -> KingSubsite fourOhFourSubsite who = KS $ \req respond -> diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs index 28a2d40c58..5600496792 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs @@ -32,7 +32,6 @@ import System.Posix.Files (ownerModes, setFileMode) import Urbit.EventLog.LMDB (EventLog) import Urbit.EventLog.Event (buildLogEvent) import Urbit.King.API (TermConn) -import Urbit.Noun.Time (Wen) import Urbit.TermSize (TermSize(..), termSize) import Urbit.Vere.Serf (Serf) @@ -79,11 +78,13 @@ data CannotBootFromIvoryPill = CannotBootFromIvoryPill genEntropy :: MonadIO m => m Entropy genEntropy = Entropy . fromIntegral . bytesAtom <$> io (Ent.getEntropy 64) -genBootSeq :: MonadIO m => Ship -> Pill -> Bool -> LegacyBootEvent -> m BootSeq +genBootSeq :: HasKingEnv e + => Ship -> Pill -> Bool -> LegacyBootEvent -> RIO e BootSeq genBootSeq _ PillIvory {} _ _ = throwIO CannotBootFromIvoryPill -genBootSeq ship PillPill {..} lite boot = io $ do - ent <- genEntropy - let ova = preKern ent <> pKernelOva <> postKern <> pUserspaceOva +genBootSeq ship PillPill {..} lite boot = do + ent <- io genEntropy + wyr <- wyrd + let ova = preKern ent <> [wyr] <> pKernelOva <> postKern <> pUserspaceOva pure $ BootSeq ident pBootFormulae ova where ident = LogIdentity ship isFake (fromIntegral $ length pBootFormulae) @@ -301,9 +302,9 @@ pier (serf, log) vSlog startedSig injected = do let execute = writeTQueue executeQ let persist = writeTQueue persistQ let sigint = Serf.sendSIGINT serf - let scry = \w b g -> do + let scry = \g r -> do res <- newEmptyMVar - atomically $ writeTQueue scryQ (w, b, g, putMVar res) + atomically $ writeTQueue scryQ (g, r, putMVar res) takeMVar res -- Set up the runtime stat counters. @@ -429,12 +430,8 @@ data PierVersionNegotiationFailed = PierVersionNegotiationFailed zuseVersion :: Word zuseVersion = 420 -doVersionNegotiation - :: HasPierEnv e - => (RunReq -> STM ()) - -> (Text -> RIO e ()) - -> RAcquire e () -doVersionNegotiation compute stderr = do +wyrd :: HasKingEnv e => RIO e Ev +wyrd = do king <- tshow <$> view kingIdL let k = Wynn [("zuse", zuseVersion), @@ -443,8 +440,17 @@ doVersionNegotiation compute stderr = do ("hoon", 140), ("nock", 4)] sen = MkTerm king - v = Vere sen [Cord "kh", Cord "1.0"] k - ev = EvBlip $ BlipEvArvo $ ArvoEvWyrd () v + v = Vere sen [Cord "king-haskell", Cord "1.0"] k + + pure $ EvBlip $ BlipEvArvo $ ArvoEvWyrd () v + +doVersionNegotiation + :: HasPierEnv e + => (RunReq -> STM ()) + -> (Text -> RIO e ()) + -> RAcquire e () +doVersionNegotiation compute stderr = do + ev <- rio wyrd okaySig :: MVar (Either [Goof] FX) <- newEmptyMVar let inject = atomically $ compute $ RRWork $ EvErr ev $ cb @@ -496,7 +502,7 @@ drivers -> Ship -> Bool -> (RunReq -> STM ()) - -> (Wen -> Gang -> Path -> IO (Maybe (Term, Noun))) + -> ScryFunc -> (TermSize, Term.Client) -> (Text -> RIO e ()) -> IO () @@ -602,7 +608,7 @@ data ComputeConfig = ComputeConfig { ccOnWork :: STM RunReq , ccOnKill :: STM () , ccOnSave :: STM () - , ccOnScry :: STM (Wen, Gang, Path, Maybe (Term, Noun) -> IO ()) + , ccOnScry :: STM (Gang, ScryReq, Maybe (Term, Noun) -> IO ()) , ccPutResult :: (Fact, FX) -> STM () , ccShowSpinner :: Maybe Text -> STM () , ccHideSpinner :: STM () @@ -616,7 +622,7 @@ runCompute serf ComputeConfig {..} = do let onRR = asum [ ccOnKill <&> Serf.RRKill , ccOnSave <&> Serf.RRSave , ccOnWork - , ccOnScry <&> \(w,g,p,k) -> Serf.RRScry w g p k + , ccOnScry <&> \(g,r,k) -> Serf.RRScry g r k ] vEvProcessing :: TMVar Ev <- newEmptyTMVarIO diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs index ff69a93332..148d935d0a 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs @@ -14,6 +14,7 @@ module Urbit.Vere.Pier.Types , jobId , jobMug , DriverApi(..) + , ScryFunc ) where @@ -56,8 +57,8 @@ instance Show Nock where data Pill = PillIvory [Noun] | PillPill - { pName :: Term - , pBootFormulae :: ![Nock] + { pName :: Noun + , pBootFormulae :: ![Nock] -- XX not actually nock, semantically , pKernelOva :: ![Ev] , pUserspaceOva :: ![Ev] } @@ -99,6 +100,10 @@ data DriverApi ef = DriverApi } +-- Scrying -------------------------------------------------------------------- + +type ScryFunc = Gang -> ScryReq -> IO (Maybe (Term, Noun)) + -- Instances ------------------------------------------------------------------- instance ToNoun Work where diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs index a6aa8c7a55..f977907a2b 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC.hs @@ -16,15 +16,16 @@ |% :: +writ: from king to serf :: - +$ gang (unit (set ship)) +$ writ $% $: %live $% [%cram eve=@] [%exit cod=@] [%save eve=@] + [%meld ~] [%pack ~] == == - [%peek mil=@ now=@da lyc=gang pat=path] + :: sam=[gang (each path $%([%once @tas @tas path] [beam @tas beam]))] + [%peek mil=@ sam=*] [%play eve=@ lit=(list ?((pair @da ovum) *))] [%work mil=@ job=(pair @da ovum)] == @@ -33,7 +34,8 @@ +$ plea $% [%live ~] [%ripe [pro=%1 hon=@ nok=@] eve=@ mug=@] - [%slog pri=@ ?(cord tank)] + [%slog pri=@ tank] + [%flog cord] $: %peek $% [%done dat=(unit (cask))] [%bail dud=goof] @@ -48,6 +50,7 @@ [%bail lud=(list goof)] == == == + -- ``` -} @@ -172,9 +175,9 @@ recvPleaHandlingSlog :: Serf -> IO Plea recvPleaHandlingSlog serf = loop where loop = recvPlea serf >>= \case - PSlog info -> serfSlog serf info >> loop - other -> pure other - + PSlog info -> serfSlog serf info >> loop + PFlog (Cord ofni) -> serfSlog serf (0, Tank $ Leaf $ Tape $ ofni) >> loop + other -> pure other -- Higher-Level IPC Functions -------------------------------------------------- @@ -220,9 +223,9 @@ sendCompactionRequest serf = do sendWrit serf (WLive $ LPack ()) recvLive serf -sendScryRequest :: Serf -> Wen -> Gang -> Path -> IO (Maybe (Term, Noun)) -sendScryRequest serf w g p = do - sendWrit serf (WPeek 0 w g p) +sendScryRequest :: Serf -> Gang -> ScryReq -> IO (Maybe (Term, Noun)) +sendScryRequest serf g r = do + sendWrit serf (WPeek 0 g r) recvPeek serf sendShutdownRequest :: Serf -> Atom -> IO () @@ -371,9 +374,9 @@ compact serf = withSerfLockIO serf $ \ss -> do {-| Peek into the serf state. -} -scry :: Serf -> Wen -> Gang -> Path -> IO (Maybe (Term, Noun)) -scry serf w g p = withSerfLockIO serf $ \ss -> do - (ss,) <$> sendScryRequest serf w g p +scry :: Serf -> Gang -> ScryReq -> IO (Maybe (Term, Noun)) +scry serf g r = withSerfLockIO serf $ \ss -> do + (ss,) <$> sendScryRequest serf g r {-| Given a list of boot events, send them to to the serf in a single @@ -493,7 +496,7 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRSave () -> doSave RRKill () -> doKill RRPack () -> doPack - RRScry w g p k -> doScry w g p k + RRScry g r k -> doScry g r k doPack :: IO () doPack = compact serf >> topLoop @@ -511,8 +514,8 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop doKill :: IO () doKill = waitForLog >> snapshot serf >> pure () - doScry :: Wen -> Gang -> Path -> (Maybe (Term, Noun) -> IO ()) -> IO () - doScry w g p k = (scry serf w g p >>= k) >> topLoop + doScry :: Gang -> ScryReq -> (Maybe (Term, Noun) -> IO ()) -> IO () + doScry g r k = (scry serf g r >>= k) >> topLoop doWork :: EvErr -> IO () doWork firstWorkErr = do @@ -529,7 +532,7 @@ run serf maxBatchSize getLastEvInLog onInput sendOn spin = topLoop RRKill () -> atomically (closeTBMQueue que) >> pure doKill RRSave () -> atomically (closeTBMQueue que) >> pure doSave RRPack () -> atomically (closeTBMQueue que) >> pure doPack - RRScry w g p k -> atomically (closeTBMQueue que) >> pure (doScry w g p k) + RRScry g r k -> atomically (closeTBMQueue que) >> pure (doScry g r k) RRWork workErr -> atomically (writeTBMQueue que workErr) >> workLoop que onWorkResp :: Wen -> EvErr -> Work -> IO () diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC/Types.hs index 88fed803e8..09f1b36a99 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/IPC/Types.hs @@ -35,7 +35,7 @@ data Work data Writ = WLive Live - | WPeek Atom Wen Gang Path + | WPeek Atom Gang ScryReq | WPlay EventId [Noun] | WWork Atom Wen Ev deriving (Show) @@ -44,6 +44,7 @@ data Plea = PLive () | PRipe SerfInfo | PSlog Slog + | PFlog Cord | PPeek Scry | PPlay Play | PWork Work diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs index 4bffdf0fd4..c0979a8787 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Serf/Types.hs @@ -2,7 +2,7 @@ module Urbit.Vere.Serf.Types where import Urbit.Prelude -import Urbit.Arvo (Ev, FX) +import Urbit.Arvo (Desk, Ev, FX) import Urbit.Noun.Time (Wen) @@ -94,7 +94,19 @@ data RunReq | RRSave () | RRKill () | RRPack () - | RRScry Wen Gang Path (Maybe (Term, Noun) -> IO ()) + | RRScry Gang ScryReq (Maybe (Term, Noun) -> IO ()) + +type ScryReq = (Each Path Demi) + +data Demi + = DemiOnce Term Desk Path + | DemiBeam Term Beam + deriving (Show) + +-- TODO +type Beam = Void + +deriveNoun ''Demi -- Exceptions ------------------------------------------------------------------ diff --git a/pkg/hs/urbit-king/package.yaml b/pkg/hs/urbit-king/package.yaml index 4879b06701..728845bcc0 100644 --- a/pkg/hs/urbit-king/package.yaml +++ b/pkg/hs/urbit-king/package.yaml @@ -1,5 +1,5 @@ name: urbit-king -version: 0.10.8 +version: 1.0 license: MIT license-file: LICENSE data-files: diff --git a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs index f2a97569a5..54ba660d5d 100644 --- a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs +++ b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/TH.hs @@ -147,7 +147,9 @@ enumFromAtom :: [(String, Name)] -> Exp enumFromAtom cons = LamE [VarP x] body where (x, c) = (mkName "x", mkName "c") - getTag = BindS (VarP c) $ AppE (VarE 'parseNounUtf8Atom) (VarE x) + getTag = BindS (VarP c) + $ AppE (AppE (VarE 'named) matchFail) + $ AppE (VarE 'parseNounUtf8Atom) (VarE x) examine = NoBindS $ CaseE (VarE c) (matches ++ [fallback]) matches = mkMatch <$> cons fallback = Match WildP (NormalB $ AppE (VarE 'fail) matchFail) [] @@ -194,6 +196,7 @@ taggedFromNoun cons = LamE [VarP n] (DoE [getHead, getTag, examine]) $ AppE (VarE 'parseNoun) (VarE n) getTag = BindS (SigP (VarP c) (ConT ''Text)) + $ AppE (AppE (VarE 'named) tagFail) $ AppE (VarE 'parseNounUtf8Atom) (VarE h) examine = NoBindS @@ -208,6 +211,8 @@ taggedFromNoun cons = LamE [VarP n] (DoE [getHead, getTag, examine]) fallback = Match WildP (NormalB $ AppE (VarE 'fail) matchFail) [] matchFail = unexpectedTag (fst <$> cons) (VarE c) + tagFail = LitE $ StringL (intercalate " " (('%':) <$> (fst <$> cons))) + -------------------------------------------------------------------------------- tagString :: Int -> Name -> String From 958ebc5a24658bece75dc20c052debe54c486341 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Sun, 10 Jan 2021 21:19:40 -0800 Subject: [PATCH 21/27] king: ted's new packet format --- pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs | 10 +- pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 17 +- .../urbit-king/lib/Urbit/Vere/Ames/Packet.hs | 170 ++++++++++++------ pkg/hs/urbit-king/test/AmesTests.hs | 3 +- 4 files changed, 140 insertions(+), 60 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs index bf504c2a1f..d91362c243 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs @@ -25,6 +25,7 @@ module Urbit.Arvo.Common import Urbit.Prelude import Control.Monad.Fail (fail) +import Data.Bits import qualified Network.HTTP.Types.Method as H import qualified Urbit.Ob as Ob @@ -166,7 +167,14 @@ newtype Port = Port { unPort :: Word16 } -- @if newtype Ipv4 = Ipv4 { unIpv4 :: Word32 } - deriving newtype (Eq, Ord, Show, Enum, Real, Integral, Num, ToNoun, FromNoun) + deriving newtype (Eq, Ord, Enum, Real, Integral, Num, ToNoun, FromNoun) + +instance Show Ipv4 where + show (Ipv4 i) = + show ((shiftL i 24) .&. 0xff) ++ "." ++ + show ((shiftL i 16) .&. 0xff) ++ "." ++ + show ((shiftL i 8) .&. 0xff) ++ "." ++ + show (i .&. 0xff) -- @is newtype Ipv6 = Ipv6 { unIpv6 :: Word128 } diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index b025d6ec2a..bb62eff36e 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -15,11 +15,11 @@ import Urbit.Arvo hiding (Fake) import Urbit.King.Config import Urbit.King.Scry import Urbit.Vere.Ames.LaneCache ---import Urbit.Vere.Ames.Packet +import Urbit.Vere.Ames.Packet import Urbit.Vere.Pier.Types import Urbit.Vere.Ports --- import Data.Serialize (decode, encode) +import Data.Serialize (decode, encode) import Urbit.King.App (HasKingId(..), HasPierEnv(..)) import Urbit.Vere.Ames.DNS (NetworkMode(..), ResolvServ(..)) import Urbit.Vere.Ames.DNS (galaxyPort, resolvServ) @@ -145,6 +145,12 @@ ames' -> (Text -> RIO e ()) -> RIO e ([Ev], RAcquire e (DriverApi NewtEf)) ames' who isFake stat scry stderr = do + stderr "YO-HOI" + stderr $ tshow (AAIpv4 (Ipv4 16777343) 60008) + -- stderr $ pack $ showUD $ bytesAtom $ encode + -- $ Packet 0 (Ship 1) (Ship 0) 2 3 Nothing "hi" + -- stderr $ pack $ showUD $ bytesAtom $ encode + -- $ Packet 0 (Ship 1) (Ship 0) 2 3 (Just $ AAIpv4 (Ipv4 0xffeeffee) 0xaacc) "hi" -- Unfortunately, we cannot use TBQueue because the only behavior -- provided for when full is to block the writer. The implementation -- below uses materially the same data structures as TBQueue, however. @@ -267,9 +273,6 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) -- port number, host address, bytestring (p, a, b) <- atomically (bump' asRcv >> usRecv) ver <- readTVarIO vers - -- TODO - serfsUp p a b - {- case decode b of Right (pkt@Packet {..}) | ver == Nothing || ver == Just pktVersion -> do logDebug $ displayShow ("ames: bon packet", pkt, showUD $ bytesAtom b) @@ -284,7 +287,8 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) -> do bump asFwd forward dest $ encode pkt - { pktOrigin = pktOrigin <|> Just (ipDest p a) } + { pktOrigin = pktOrigin + <|> Just (AAIpv4 (Ipv4 a) (fromIntegral p)) } where notSelf (EachYes g) = who /= Ship (fromIntegral g) notSelf (EachNo _) = True @@ -315,7 +319,6 @@ ames env who isFake stat scry enqueueEv stderr = (initialEvents, runAmes) Left e -> do bump asDml logInfo $ displayShow ("ames: dropping malformed", e) - -} where serfsUp p a b = diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/Packet.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/Packet.hs index 4c1ebb6bd3..8c90bd169e 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/Packet.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames/Packet.hs @@ -9,18 +9,19 @@ import Urbit.Prelude import Control.Monad.Fail import Data.Bits import Data.LargeWord +import Data.List (genericIndex) import Data.Serialize -import Urbit.Arvo (AmesDest) +import Urbit.Arvo (AmesAddress(..), Ipv4(..), Port(..)) data Packet = Packet - { pktVersion :: Word8 - , pktEncrypted :: Bool - -- - , pktSndr :: Ship - , pktRcvr :: Ship - , pktOrigin :: Maybe AmesDest - , pktContent :: Bytes + { pktVersion :: Word3 + , pktSndr :: Ship + , pktRcvr :: Ship + , pktSndrTick :: Word4 + , pktRcvrTick :: Word4 + , pktOrigin :: Maybe AmesAddress + , pktContent :: ByteString } deriving Eq @@ -28,73 +29,140 @@ instance Show Packet where show Packet {..} = "Packet {pktVersion = " <> show pktVersion - <> ", pktEncrypted = " - <> show pktEncrypted <> ", pktSndr = " <> show pktSndr <> ", pktRcvr = " <> show pktRcvr + <> ", pktSndrTick = " + <> show pktSndrTick + <> ", pktRcvrTick = " + <> show pktRcvrTick <> ", pktOrigin = " <> show pktOrigin <> ", pktContent = " - <> showUD (bytesAtom $ unBytes pktContent) + <> showUD (bytesAtom pktContent) <> "}" +{- +-- Wire format +data PacketHeader = PacketHeader + { pktIsAmes :: Bool -- sim_o + , pktVersion :: Word3 -- ver_y + , pktSndrClass :: ShipClass -- sac_y + , pktRcvrClass :: ShipClass -- rac_y + , pktChecksum :: Word20 -- mug_l + , pktIsRelayed :: Bool -- rel_o + } + deriving Eq + +data PacketBody = PacketBody + { pktSndr :: Ship -- sen_d + , pktRcvr :: Ship -- rec_d + , pktSndrTick :: Word4 -- sic_y + , pktRcvrTick :: Word4 -- ric_y + , pktContent :: ByteString -- (con_s, con_y) + , pktOrigin :: Maybe AmesAddress -- rog_d + } + deriving Eq +-} + +type Word3 = Word8 +type Word4 = Word8 +type Word20 = Word32 + +data ShipClass + = Lord + | Planet + | Moon + | Comet + deriving (Eq, Show) + +muk :: ByteString -> Word20 +muk bs = mugBS bs .&. (2 ^ 20 - 1) + +-- XX check this +getAmesAddress :: Get AmesAddress +getAmesAddress = AAIpv4 <$> (Ipv4 <$> getWord32le) <*> (Port <$> getWord16le) + +putAmesAddress :: Putter AmesAddress +putAmesAddress = \case + AAIpv4 (Ipv4 ip) (Port port) -> putWord32le ip >> putWord16le port + instance Serialize Packet where get = do -- header head <- getWord32le - let pktVersion = head .&. 0b111 & fromIntegral - let checksum = shiftR head 3 .&. (2 ^ 20 - 1) - let sndrRank = shiftR head 23 .&. 0b11 - let rcvrRank = shiftR head 25 .&. 0b11 - let pktEncrypted = testBit head 27 & not -- loobean - -- verify checksum + -- skip first three bits + let isAmes = testBit head 3 & not + let pktVersion = shiftR head 4 .&. 0b111 & fromIntegral + let sndrRank = shiftR head 7 .&. 0b11 + let rcvrRank = shiftR head 9 .&. 0b11 + let checksum = shiftR head 11 .&. (2 ^ 20 - 1) + let isRelayed = testBit head 31 & not -- loobean + let sndrClass = genericIndex [Lord, Planet, Moon, Comet] sndrRank + let rcvrClass = genericIndex [Lord, Planet, Moon, Comet] rcvrRank + guard isAmes + + pktOrigin <- if isRelayed + then Just <$> getAmesAddress + else pure Nothing + + -- body lookAhead $ do - len <- remaining + len <- remaining body <- getBytes len - let chk = fromIntegral (mugBS body) .&. (2 ^ 20 - 1) + let chk = muk body when (checksum /= chk) $ fail ("checksum mismatch: expected " <> show checksum <> "; got " <> show chk) - -- body - pktSndr <- getShip sndrRank - pktRcvr <- getShip rcvrRank - len <- remaining - payload <- getBytes len - -- data ("payload") - (pktOrigin, pktContent) <- case cueBS payload of - Left e -> fail (show e) - Right n -> case fromNounErr n of - Left e -> fail (show e) - Right c -> pure c - pure Packet {..} + + tick <- getWord8 + let pktSndrTick = tick .&. 0b1111 + let pktRcvrTick = shiftR tick 4 + + pktSndr <- getShip sndrClass + pktRcvr <- getShip rcvrClass + + len <- remaining + pktContent <- getBytes len + + pure Packet{..} where getShip = fmap Ship . \case - 0 -> fromIntegral <$> getWord16le -- galaxy / star - 1 -> fromIntegral <$> getWord32le -- planet - 2 -> fromIntegral <$> getWord64le -- moon - 3 -> LargeKey <$> getWord64le <*> getWord64le -- comet - _ -> fail "impossibiru" + Lord -> fromIntegral <$> getWord16le + Planet -> fromIntegral <$> getWord32le + Moon -> fromIntegral <$> getWord64le + Comet -> LargeKey <$> getWord64le <*> getWord64le - put Packet {..} = do - let load = jamBS $ toNoun (pktOrigin, pktContent) + put Packet{..} = do let (sndR, putSndr) = putShipGetRank pktSndr let (rcvR, putRcvr) = putShipGetRank pktRcvr - let body = runPut (putSndr <> putRcvr <> putByteString load) - let chek = fromIntegral (mugBS body) .&. (2 ^ 20 - 1) - let encr = pktEncrypted + + let body = runPut $ do + putWord8 $ (pktSndrTick .&. 0b1111) + .|. shiftL (pktRcvrTick .&. 0b1111) 4 + putSndr + putRcvr + putByteString pktContent + let vers = fromIntegral pktVersion .&. 0b111 - let head = vers - .|. shiftL chek 3 - .|. shiftL sndR 23 - .|. shiftL rcvR 25 - .|. if encr then 0 else bit 27 + let chek = muk body + + -- skip first 3 bytes, set 4th to yes (0) for "is ames" + let head = shiftL vers 4 + .|. shiftL sndR 7 + .|. shiftL rcvR 9 + .|. shiftL chek 11 + .|. if isJust pktOrigin then 0 else bit 31 + putWord32le head - putByteString body -- XX can we avoid copy? + case pktOrigin of + Just o -> putAmesAddress o + Nothing -> pure () + putByteString body where putShipGetRank s@(Ship (LargeKey p q)) = case () of - _ | s < 2 ^ 16 -> (0, putWord16le $ fromIntegral s) -- gar - | s < 2 ^ 32 -> (1, putWord32le $ fromIntegral s) -- pan - | s < 2 ^ 64 -> (2, putWord64le $ fromIntegral s) -- mon - | otherwise -> (3, putWord64le p >> putWord64le q) -- com + _ | s < 2 ^ 16 -> (0, putWord16le $ fromIntegral s) -- lord + | s < 2 ^ 32 -> (1, putWord32le $ fromIntegral s) -- planet + | s < 2 ^ 64 -> (2, putWord64le $ fromIntegral s) -- moon + | otherwise -> (3, putWord64le p >> putWord64le q) -- comet diff --git a/pkg/hs/urbit-king/test/AmesTests.hs b/pkg/hs/urbit-king/test/AmesTests.hs index 01cfbcb97d..11c31f5c85 100644 --- a/pkg/hs/urbit-king/test/AmesTests.hs +++ b/pkg/hs/urbit-king/test/AmesTests.hs @@ -108,9 +108,10 @@ instance Arbitrary LogIdentity where instance Arbitrary Packet where arbitrary = do pktVersion <- suchThat arb (< 8) - pktEncrypted <- arb pktSndr <- arb pktRcvr <- arb + pktSndrTick <- suchThat arb (< 16) + pktRcvrTick <- suchThat arb (< 16) pktOrigin <- arb pktContent <- arb pure Packet {..} From fbe13d411d39192755ad51b1c64d344532cae119 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 21 Jan 2021 14:55:03 -0800 Subject: [PATCH 22/27] king: elim zigzag in --stderr (still interlacing) --- pkg/hs/urbit-king/lib/Urbit/King/App.hs | 18 ++++++++++++++++++ pkg/hs/urbit-king/lib/Urbit/King/Main.hs | 5 ++++- pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs | 6 ------ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/King/App.hs b/pkg/hs/urbit-king/lib/Urbit/King/App.hs index 10fc2be305..7c2ac9f9ea 100644 --- a/pkg/hs/urbit-king/lib/Urbit/King/App.hs +++ b/pkg/hs/urbit-king/lib/Urbit/King/App.hs @@ -4,6 +4,7 @@ module Urbit.King.App ( KingEnv , runKingEnvStderr + , runKingEnvStderrRaw , runKingEnvLogFile , runKingEnvNoLog , kingEnvKillSignal @@ -29,6 +30,7 @@ where import Urbit.King.Config import Urbit.Prelude +import RIO (logGeneric) import System.Directory ( createDirectoryIfMissing , getXdgDirectory , XdgDirectory(XdgCache) @@ -90,6 +92,22 @@ runKingEnvStderr verb lvl inner = do <&> setLogMinLevel lvl withLogFunc logOptions $ \logFunc -> runKingEnv logFunc logFunc inner +runKingEnvStderrRaw :: Bool -> LogLevel -> RIO KingEnv a -> IO a +runKingEnvStderrRaw verb lvl inner = do + logOptions <- + logOptionsHandle stderr verb + <&> setLogUseTime True + <&> setLogUseLoc False + <&> setLogMinLevel lvl + withLogFunc logOptions $ \logFunc -> + let lf = wrapCarriage logFunc + in runKingEnv lf lf inner + +-- XX loses callstack +wrapCarriage :: LogFunc -> LogFunc +wrapCarriage lf = mkLogFunc $ \_ ls ll bldr -> + runRIO lf $ logGeneric ls ll (bldr <> "\r") + runKingEnvLogFile :: Bool -> LogLevel -> Maybe FilePath -> RIO KingEnv a -> IO a runKingEnvLogFile verb lvl fileM inner = do logFile <- case fileM of diff --git a/pkg/hs/urbit-king/lib/Urbit/King/Main.hs b/pkg/hs/urbit-king/lib/Urbit/King/Main.hs index e93a671b4c..1a394110b6 100644 --- a/pkg/hs/urbit-king/lib/Urbit/King/Main.hs +++ b/pkg/hs/urbit-king/lib/Urbit/King/Main.hs @@ -678,10 +678,13 @@ main = do runKingEnv args log = let verb = verboseLogging args + runStderr = case args of + CLI.CmdRun {} -> runKingEnvStderrRaw + _ -> runKingEnvStderr CLI.Log {..} = log in case logTarget lTarget args of CLI.LogFile f -> runKingEnvLogFile verb lLevel f - CLI.LogStderr -> runKingEnvStderr verb lLevel + CLI.LogStderr -> runStderr verb lLevel CLI.LogOff -> runKingEnvNoLog setupSignalHandlers = do diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs index bb62eff36e..7efea95f71 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Ames.hs @@ -145,12 +145,6 @@ ames' -> (Text -> RIO e ()) -> RIO e ([Ev], RAcquire e (DriverApi NewtEf)) ames' who isFake stat scry stderr = do - stderr "YO-HOI" - stderr $ tshow (AAIpv4 (Ipv4 16777343) 60008) - -- stderr $ pack $ showUD $ bytesAtom $ encode - -- $ Packet 0 (Ship 1) (Ship 0) 2 3 Nothing "hi" - -- stderr $ pack $ showUD $ bytesAtom $ encode - -- $ Packet 0 (Ship 1) (Ship 0) 2 3 (Just $ AAIpv4 (Ipv4 0xffeeffee) 0xaacc) "hi" -- Unfortunately, we cannot use TBQueue because the only behavior -- provided for when full is to block the writer. The implementation -- below uses materially the same data structures as TBQueue, however. From 8db4e2ad7ec36fdc98ceff6a77ddf989160e2470 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Thu, 21 Jan 2021 19:41:19 -0800 Subject: [PATCH 23/27] king: new mug --- pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs index 3847ed6419..a15095042d 100644 --- a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs +++ b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs @@ -5,6 +5,7 @@ module Urbit.Noun.Mug where import ClassyPrelude import Data.Bits +import Data.ByteString.Builder import Urbit.Atom import Data.Hash.Murmur (murmur3) @@ -13,14 +14,7 @@ type Mug = Word32 {-# INLINE mugBS #-} mugBS :: ByteString -> Word32 -mugBS = go 0xcafebabe - where - go seed buf = - let haz = murmur3 seed buf - ham = shiftR haz 31 `xor` (haz .&. 0x7fff_ffff) - in if ham == 0 - then go (seed + 1) buf - else ham +mugBS = mum 0xcafe_babe 0x7fff -- XX is there a way to do this without copy? {-# INLINE mugAtom #-} @@ -29,4 +23,16 @@ mugAtom = mugBS . atomBytes {-# INLINE mugBoth #-} mugBoth :: Word32 -> Word32 -> Word32 -mugBoth m n = mugAtom $ fromIntegral $ m `xor` 0x7fff_ffff `xor` n +mugBoth m n = mum 0xdead_beef 0xfffe + $ toStrict $ toLazyByteString (word32LE m <> word32LE n) + +mum :: Word32 -> Word32 -> ByteString -> Word32 +mum syd fal key = go syd 0 + where + go syd 8 = fal + go syd i = + let haz = murmur3 syd key + ham = shiftR haz 31 `xor` (haz .&. 0x7fff_ffff) + in if ham /= 0 + then ham + else go (syd + 1) (i + 1) \ No newline at end of file From 9ed4f9fbe0c343b718138315af6f99f41417aa9f Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 22 Jan 2021 11:53:22 -0800 Subject: [PATCH 24/27] king: fix dat gold (again) --- pkg/hs/urbit-king/test/gold/hoontree.gold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hs/urbit-king/test/gold/hoontree.gold b/pkg/hs/urbit-king/test/gold/hoontree.gold index c788a9e2d4..0b4589065a 100644 --- a/pkg/hs/urbit-king/test/gold/hoontree.gold +++ b/pkg/hs/urbit-king/test/gold/hoontree.gold @@ -1 +1 @@ -2082167031 \ No newline at end of file +233234490 \ No newline at end of file From d90370cfc042970edc102388d66992d257afd485 Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Mon, 25 Jan 2021 17:34:46 -0800 Subject: [PATCH 25/27] king: restore king to rightful place in default.nix --- default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 668b017025..ac85d95ee0 100644 --- a/default.nix +++ b/default.nix @@ -155,8 +155,7 @@ let contents = { "${name}/urbit" = "${urbit}/bin/urbit"; "${name}/urbit-worker" = "${urbit}/bin/urbit-worker"; - # temporarily removed for compatibility reasons - # "${name}/urbit-king" = "${urbit-king}/bin/urbit-king"; + "${name}/urbit-king" = "${urbit-king}/bin/urbit-king"; }; }; From 2fdc5ad351863a3dc122ec198065723fa84905ac Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 29 Jan 2021 13:37:50 -0800 Subject: [PATCH 26/27] king: version number 1.1 --- pkg/hs/urbit-king/package.yaml | 2 +- pkg/urbit/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/hs/urbit-king/package.yaml b/pkg/hs/urbit-king/package.yaml index 728845bcc0..647dda006a 100644 --- a/pkg/hs/urbit-king/package.yaml +++ b/pkg/hs/urbit-king/package.yaml @@ -1,5 +1,5 @@ name: urbit-king -version: 1.0 +version: 1.1 license: MIT license-file: LICENSE data-files: diff --git a/pkg/urbit/version b/pkg/urbit/version index 9f8e9b69a3..b123147e2a 100644 --- a/pkg/urbit/version +++ b/pkg/urbit/version @@ -1 +1 @@ -1.0 \ No newline at end of file +1.1 \ No newline at end of file From 1042422bbe8bafb49eda7a94f1cfdcaf89a25a9c Mon Sep 17 00:00:00 2001 From: pilfer-pandex <47340789+pilfer-pandex@users.noreply.github.com> Date: Fri, 29 Jan 2021 14:14:57 -0800 Subject: [PATCH 27/27] king: address joe's comments again --- pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs | 9 --------- pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs index 148d935d0a..5f3fd11eaa 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Pier/Types.hs @@ -45,15 +45,6 @@ instance Show Nock where -------------------------------------------------------------------------------- --- A Pill is a pair of [pil_p pil_q], where pil_p is cued and pil_q is an --- optional set of userspace ovums. --- --- The cued pil_p is a trel of [mot tag dat], where mot is 0 (version number?), --- tag is a cord about the type of pill, and dat is the traditional trel of --- [pBootForumlas pKernelOvums pUserspaceOvums]. --- --- So what's with pil_q? It looks like it is search for the %into. - data Pill = PillIvory [Noun] | PillPill diff --git a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs index a15095042d..005f822324 100644 --- a/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs +++ b/pkg/hs/urbit-noun-core/lib/Urbit/Noun/Mug.hs @@ -35,4 +35,4 @@ mum syd fal key = go syd 0 ham = shiftR haz 31 `xor` (haz .&. 0x7fff_ffff) in if ham /= 0 then ham - else go (syd + 1) (i + 1) \ No newline at end of file + else go (syd + 1) (i + 1)