diff --git a/pkg/relayer/interface.go b/pkg/relayer/interface.go index f822ab2b7..89b1da09c 100644 --- a/pkg/relayer/interface.go +++ b/pkg/relayer/interface.go @@ -75,6 +75,11 @@ type RelayServer interface { // RelayerSessionsManager is responsible for managing the relayer's session lifecycles. // It handles the creation and retrieval of SMSTs (trees) for a given session, as // well as the respective and subsequent claim creation and proof submission. +// This is largely accomplished by pipelining observables of relays and sessions +// through a series of map operations. +// +// TODO_TECHDEBT: add architecture diagrams covering observable flows throughout +// the relayer package. type RelayerSessionsManager interface { // IncludeRelays receives an observable of relays that should be included // in their respective session's SMST (tree). diff --git a/pkg/relayer/miner/miner.go b/pkg/relayer/miner/miner.go index 6e750688a..948076c61 100644 --- a/pkg/relayer/miner/miner.go +++ b/pkg/relayer/miner/miner.go @@ -1,19 +1,3 @@ -// Package miner encapsulates the responsibilities of the relayer miner interface: -// 1. Mining relays: Served relays are hashed and difficulty is checked. -// Those with sufficient difficulty are added to the session SMST (tree) -// to be applicable for relay volume. -// 2. Creating claims: The session SMST is flushed and an on-chain -// claim is created to the amount of work done by committing -// the tree's root. -// 3. Submitting proofs: A pseudo-random branch from the session SMST -// is "requested" (through on-chain mechanisms) and the necessary proof -// is submitted on-chain. -// -// This is largely accomplished by pipelining observables of relays and sessions -// through a series of map operations. -// -// TODO_TECHDEBT: add architecture diagrams covering observable flows throughout -// the miner package. package miner import ( @@ -43,7 +27,9 @@ var ( defaultRelayDifficulty = 0 ) -// miner implements the relayer.Miner interface. +// Miner is responsible for observing servedRelayObs, hashing and checking the +// difficulty of each, finally publishing those with sufficient difficulty to +// minedRelayObs as they are applicable for relay volume. type miner struct { hasherConstructor func() hash.Hash relayDifficulty int