Skip to content

Commit

Permalink
added more descriptions for constants and base structs
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Jun 18, 2024
1 parent 7418103 commit 0ee2588
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions zetaclient/chains/base/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ import (
)

const (
// EnvVarLatestBlock is the environment variable to indicate latest block height
// EnvVarLatestBlock is the environment variable that forces the observer to scan from the latest block
EnvVarLatestBlock = "latest"

// DefaultBlockCacheSize is the default size of the block cache
// DefaultBlockCacheSize is the default number of blocks that the observer will keep in cache for performance (without RPC calls)
// Cached blocks can be used to get block information and verify transactions
DefaultBlockCacheSize = 1000

// DefaultHeadersCacheSize is the default size of the headers cache
// DefaultHeadersCacheSize is the default number of headers that the observer will keep in cache for performance (without RPC calls)
// Cached headers can be used to get header information
DefaultHeadersCacheSize = 1000
)

// Observer is the base observer.
// Observer is the base structure for chain observers, grouping the common logic for each chain observer client.
// The common logic includes: chain, chainParams, contexts, zetacore client, tss, lastBlock, db, metrics, loggers etc.
type Observer struct {
// chain contains static information about the observed chain
chain chains.Chain
Expand Down
3 changes: 2 additions & 1 deletion zetaclient/chains/base/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
"github.com/zeta-chain/zetacore/zetaclient/metrics"
)

// Signer is the base signer
// Signer is the base structure for grouping the common logic between chain signers.
// The common logic includes: chain, chainParams, contexts, tss, metrics, loggers etc.
type Signer struct {
// chain contains static information about the external chain
chain chains.Chain
Expand Down

0 comments on commit 0ee2588

Please sign in to comment.