 
 (defn seal-resource-loop [sync seal-tail exhaust-head]
   (loop []
-    (when-let [result (<!! seal-tail)]
-      (seal-resource
-       sync
-       (:seal? result) (:seal-node result)
-       (:exhaust-node result) exhaust-head)
-      (recur))))
+    (when (<!! seal-tail)
+      (let [offset (extensions/next-offset sync :seal-log)
+            result (extensions/log-entry-at sync :seal-log offset)]
+        (seal-resource
+         sync
+         (:seal? result) (:seal-node result)
+         (:exhaust-node result) exhaust-head)
+        (extensions/checkpoint sync :seal-log offset)
+        (recur)))))
 
 (defn completion-ch-loop
   [sync sync-ch complete-tail offer-head complete-head]


(defn evict-ch-loop [sync sync-ch evict-tail offer-head shutdown-head]
  (loop []
    (when-let [node (<!! evict-tail)]
      (evict-peer sync sync-ch node)
      (>!! shutdown-head node)
      (>!! offer-head node)
      (recur))))

(defn offer-ch-loop
  [sync sync-ch revoke-delay offer-tail ack-head exhaust-head complete-head revoke-head]
  (loop []
    (when-let [event (<!! offer-tail)]
      (offer-task sync sync-ch
                  #(>!! ack-head %)
                  #(>!! exhaust-head %)
                  #(>!! complete-head %)
                  #(thread (<!! (timeout revoke-delay))
                           (>!! revoke-head %)))
      (recur))))

(defn offer-revoke-ch-loop [sync sync-ch offer-revoke-tail evict-head]
  (loop []
    (when-let [{:keys [peer-node ack-node]} (<!! offer-revoke-tail)]
      (revoke-offer sync sync-ch peer-node ack-node #(>!! evict-head %))
      (recur))))

(defn exhaust-queue-loop [sync sync-ch exhaust-tail seal-head]
  (loop []

          (>!! offer-head true))
        (recur)))))

;;; todo - create log entry to lead into this loop
(defn dead-peer-ch-loop [sync sync-ch dead-tail evict-head offer-head]
  (loop []
    (when (<!! dead-tail)
      (let [offset (extensions/next-offset sync :death-log)
            peer-node (extensions/log-entry-at sync :death-log offset)]
        (when (mark-peer-death sync sync-ch peer-node)
          (extensions/create sync :evict-log peer-node)
          (extensions/create sync :offer-log peer-node)
          (extensions/checkpoint sync :death-log offset)
          (>!! evict-head peer-node)
          (>!! offer-head peer-node))
        (recur)))))

(defn planning-ch-loop [sync queue planning-tail offer-head]
  (loop []
