From ff63ffd1aa1c000619912f284c42b6f848c497c0 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Wed, 17 Nov 2021 10:03:15 -0800 Subject: [PATCH] azimuth: stop processing state in %watch Also reprocess state in +on-load for ships which currently have unprocessed state. --- pkg/arvo/app/azimuth.hoon | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/pkg/arvo/app/azimuth.hoon b/pkg/arvo/app/azimuth.hoon index ef8a26ba6..634505fde 100644 --- a/pkg/arvo/app/azimuth.hoon +++ b/pkg/arvo/app/azimuth.hoon @@ -24,7 +24,7 @@ =, jael |% +$ app-state - $: %1 + $: %2 url=@ta =net whos=(set ship) @@ -83,13 +83,32 @@ |^ =+ !<(old-state=app-states old) =? old-state ?=(%0 -.old-state) - ^- app-state =, old-state [%1 url net whos nas own *sponsors logs] - ?> ?=(%1 -.old-state) - `this(state old-state) + =^ cards-1 old-state + ?. ?=(%1 -.old-state) + `old-state + %- %- slog :_ ~ + leaf+"azimuth: loading snapshot with {<(lent logs.old-state)>} events" + =. +.state +.old-state + =^ cards state + (%*(run-logs do nas.state *^state:naive) logs.state) + [(jael-update:do (to-udiffs:do cards)) state] + ?> ?=(%2 -.old-state) + [cards-1 this(state old-state)] :: - ++ app-states $%(state-0 app-state) + ++ app-states $%(state-0 state-1 app-state) + :: + +$ state-1 + $: %1 + url=@ta + =net + whos=(set ship) + nas=^state:naive + own=owners + spo=sponsors + logs=(list =event-log:rpc:ethereum) + == :: ++ state-0 $: %0 @@ -147,10 +166,7 @@ spo.state ~ logs.state ?:(?=(%default net.poke) snap ~) == - %- %- slog :_ ~ - leaf+"azimuth: loading snapshot with {<(lent logs.state)>} events" - =^ snap-cards state (run-logs:do logs.state) - [(weld (jael-update:do (to-udiffs:do snap-cards)) start:do) this] + [start:do this] == :: ++ on-watch