Skip to content

Commit

Permalink
chore: tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Nov 10, 2023
1 parent 394575b commit 1eae9d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
5 changes: 5 additions & 0 deletions pkg/relayer/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
20 changes: 3 additions & 17 deletions pkg/relayer/miner/miner.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1eae9d2

Please sign in to comment.