yolo

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyBlock is a:
	// 3 byte prefix for keying beacon block roots, followed by:
	// 8 byte big-endian slot number
	//
	// The value is a SSZ-encoded beacon block (no compression).
	// Depending on the slot, different block types may be encoded:
	// phase.SignedBeaconBlock
	// altair.SignedBeaconBlock
	// SignedBeaconBlockLH (bellatrix, blinded execution payload, aka just the execution payload header)
	//
	// Some blocks may be missing.
	KeyBlock string = "blk"

	// KeyBlockRoot is a:
	// 3 byte prefix for keying beacon block roots, followed by:
	// 8 byte big-endian slot number
	//
	// The value is the canonical beacon block root, bytes32
	//
	// Roots are repeated in gap slots
	KeyBlockRoot string = "blr"
)
View Source
const (
	// KeyPerf is a:
	// 3 byte prefix for per-epoch performance keying, followed by:
	// 8 byte big-endian epoch value. (big endian to make db byte-prefix iteration and range-slices follow epoch order)
	//
	// The epoch key represents the boundary when the data became available.
	// I.e. epoch == 2 means that 0 == prev and 1 == current were processed.
	//
	// Values under this key are snappy block-compressed.
	//
	// The value is a []ValidatorPerformance
	KeyPerf string = "prf"
)
View Source
const (
	// KeyRandaoMix is a:
	// 3 byte prefix for keying randao mixes, followed by:
	// 8 byte big-endian epoch number
	//
	// The epoch number represents the epoch that the mix was completed at.
	// I.e. block 1,2,3...31 randao reveals are mixed into the mix at epoch 1.
	// The mix at epoch 0 is not stored, but instead loaded as special genesis mix value.
	//
	// The value is a 32 byte mix, XOR'ing all past randao inputs together, as defined in the consensus spec.
	KeyRandaoMix string = "rnd"
)
View Source
const (
	// KeyTile is a:
	// 3 byte prefix for tile keying, followed by:
	// 1 byte tile type
	// 1 byte zoom.
	// 4 byte big endian X
	// 4 byte big endian Y
	//
	// Note: the X is first, so the DB range iterate can range over epochs at zoom 0.
	//
	// Values under this key are snappy block-compressed.
	//
	// The uncompressed value is 4 squares of tileSize x tileSize, one for R, one for G, B, and A
	// The squares encode column by column.
	//
	// We can encode tiles in with R, G, B, A grouped together separately.
	// And implement the image.Image interface to map back to an image.
	// This way we compress better, and don't store as much alpha-channel data.
	KeyTile string = "til"
)

Variables

View Source
var ErrBlockNotFound = errors.New("block not found")

Functions

This section is empty.

Types

type BeaconBlockBodyLH

type BeaconBlockBodyLH struct {
	RandaoReveal common.BLSSignature `json:"randao_reveal" yaml:"randao_reveal"`
	Eth1Data     common.Eth1Data     `json:"eth1_data" yaml:"eth1_data"`
	Graffiti     common.Root         `json:"graffiti" yaml:"graffiti"`

	ProposerSlashings phase0.ProposerSlashings `json:"proposer_slashings" yaml:"proposer_slashings"`
	AttesterSlashings phase0.AttesterSlashings `json:"attester_slashings" yaml:"attester_slashings"`
	Attestations      phase0.Attestations      `json:"attestations" yaml:"attestations"`
	Deposits          phase0.Deposits          `json:"deposits" yaml:"deposits"`
	VoluntaryExits    phase0.VoluntaryExits    `json:"voluntary_exits" yaml:"voluntary_exits"`

	SyncAggregate altair.SyncAggregate `json:"sync_aggregate" yaml:"sync_aggregate"`

	// header only
	ExecutionPayload common.ExecutionPayloadHeader `json:"execution_payload" yaml:"execution_payload"`
}

func (*BeaconBlockBodyLH) ByteLength

func (b *BeaconBlockBodyLH) ByteLength(spec *common.Spec) uint64

func (*BeaconBlockBodyLH) Deserialize

func (b *BeaconBlockBodyLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconBlockBodyLH) FixedLength

func (b *BeaconBlockBodyLH) FixedLength(*common.Spec) uint64

func (*BeaconBlockBodyLH) HashTreeRoot

func (b *BeaconBlockBodyLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconBlockBodyLH) Serialize

func (b *BeaconBlockBodyLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type BeaconBlockLH

type BeaconBlockLH struct {
	Slot          common.Slot           `json:"slot" yaml:"slot"`
	ProposerIndex common.ValidatorIndex `json:"proposer_index" yaml:"proposer_index"`
	ParentRoot    common.Root           `json:"parent_root" yaml:"parent_root"`
	StateRoot     common.Root           `json:"state_root" yaml:"state_root"`
	Body          BeaconBlockBodyLH     `json:"body" yaml:"body"`
}

func (*BeaconBlockLH) ByteLength

func (b *BeaconBlockLH) ByteLength(spec *common.Spec) uint64

func (*BeaconBlockLH) Deserialize

func (b *BeaconBlockLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconBlockLH) FixedLength

func (b *BeaconBlockLH) FixedLength(*common.Spec) uint64

func (*BeaconBlockLH) HashTreeRoot

func (b *BeaconBlockLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconBlockLH) Header

func (b *BeaconBlockLH) Header(spec *common.Spec) *common.BeaconBlockHeader

func (*BeaconBlockLH) Serialize

func (b *BeaconBlockLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type BlockData

type BlockData struct {
	Slot         common.Slot
	StateRoot    common.Root
	Attestations phase0.Attestations
	RandaoReveal common.BLSSignature
}

type BlocksImporter added in v0.0.3

type BlocksImporter struct {
	// contains filtered or unexported fields
}

func NewBlocksImporter added in v0.0.3

func NewBlocksImporter(ctx *cli.Context, log log.Logger) (*BlocksImporter, error)

func (*BlocksImporter) Close added in v0.0.3

func (s *BlocksImporter) Close() error

func (*BlocksImporter) Run added in v0.0.3

func (s *BlocksImporter) Run(ctx context.Context) error

type BoundedIndicesFetcher added in v0.0.3

type BoundedIndicesFetcher struct {
	// contains filtered or unexported fields
}

func NewBoundedIndicesFetcher added in v0.0.3

func NewBoundedIndicesFetcher(ctx *cli.Context, log log.Logger) (*BoundedIndicesFetcher, error)

func (*BoundedIndicesFetcher) Close added in v0.0.3

func (s *BoundedIndicesFetcher) Close() error

func (*BoundedIndicesFetcher) Run added in v0.0.3

type Command added in v0.0.3

type Command interface {
	io.Closer
	Run(ctx context.Context) error
}

type IndexData

type IndexData struct {
	Title string
	API   string
}

IndexData is the Go html template input for index.html

type PerfComputer added in v0.0.3

type PerfComputer struct {
	// contains filtered or unexported fields
}

func NewPerfComputer added in v0.0.3

func NewPerfComputer(ctx *cli.Context, log log.Logger) (*PerfComputer, error)

func (*PerfComputer) Close added in v0.0.3

func (s *PerfComputer) Close() error

func (*PerfComputer) Run added in v0.0.3

func (s *PerfComputer) Run(ctx context.Context) error

type RandaoComputer added in v0.0.3

type RandaoComputer struct {
	// contains filtered or unexported fields
}

func NewRandaoComputer added in v0.0.3

func NewRandaoComputer(ctx *cli.Context, log log.Logger) (*RandaoComputer, error)

func (*RandaoComputer) Close added in v0.0.3

func (s *RandaoComputer) Close() error

func (*RandaoComputer) Run added in v0.0.3

func (s *RandaoComputer) Run(ctx context.Context) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx *cli.Context, log log.Logger) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) WallClockSlot

func (s *Server) WallClockSlot() common.Slot

type SignedBeaconBlockLH

type SignedBeaconBlockLH struct {
	Message   BeaconBlockLH       `json:"message" yaml:"message"`
	Signature common.BLSSignature `json:"signature" yaml:"signature"`
}

func (*SignedBeaconBlockLH) ByteLength

func (b *SignedBeaconBlockLH) ByteLength(spec *common.Spec) uint64

func (*SignedBeaconBlockLH) Deserialize

func (b *SignedBeaconBlockLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*SignedBeaconBlockLH) Envelope

func (*SignedBeaconBlockLH) FixedLength

func (b *SignedBeaconBlockLH) FixedLength(*common.Spec) uint64

func (*SignedBeaconBlockLH) HashTreeRoot

func (b *SignedBeaconBlockLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*SignedBeaconBlockLH) Serialize

func (b *SignedBeaconBlockLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (*SignedBeaconBlockLH) SignedHeader

type SystemInitializer added in v0.0.3

type SystemInitializer struct {
	// contains filtered or unexported fields
}

func NewSystemInitializer added in v0.0.3

func NewSystemInitializer(ctx *cli.Context, log log.Logger) (*SystemInitializer, error)

func (*SystemInitializer) Close added in v0.0.3

func (s *SystemInitializer) Close() error

func (*SystemInitializer) Run added in v0.0.3

func (s *SystemInitializer) Run(ctx context.Context) error

type Tile

type Tile struct {
	R []byte
	G []byte
	B []byte
	A []byte
	// added to x lookups
	OffsetX int
	// added to y lookups
	OffsetY int
	// Shifts x and y by given amount to create zoomed image effect,
	// while really serving the same tile.
	// This is useful to zoom in more than 1:1 pixel definition,
	// enlarging tiles without image scaling artifacts on client side.
	Scale uint8
}

Tile represents an image tile, as stored in the DB. R,G,B,A are slices stored next to eachother, since they compress better individually.

Each color slice encodes column by column first, since correlation is larger per-column, for better compression. I.e. values 0,1,2,3,4...tilesize-1 all correspond to column 0 (X == 0).

func (*Tile) At

func (t *Tile) At(x, y int) color.Color

At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.

func (*Tile) Bounds

func (t *Tile) Bounds() image.Rectangle

Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).

func (*Tile) ColorModel

func (t *Tile) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*Tile) Opaque

func (t *Tile) Opaque() bool

func (*Tile) RGBAAt

func (t *Tile) RGBAAt(x, y int) color.RGBA

type TileProcessor added in v0.0.3

type TileProcessor struct {
	// contains filtered or unexported fields
}

func NewTileProcessor added in v0.0.3

func NewTileProcessor(ctx *cli.Context, log log.Logger) (*TileProcessor, error)

func (*TileProcessor) Close added in v0.0.3

func (s *TileProcessor) Close() error

func (*TileProcessor) Run added in v0.0.3

func (s *TileProcessor) Run(ctx context.Context) error

type ValidatorPerformance

type ValidatorPerformance uint32
const (
	// and the next 64 values (6 bits). Always non-zero
	InclusionDistance ValidatorPerformance = 0x00_00_01_00

	InclusionDistanceMask = 0x00_00_ff_00

	// source is always correct, or wouldn't be included on-chain
	TargetCorrect ValidatorPerformance = 0x00_ff_00_00

	// up to 64, or 0xff if unknown
	HeadDistance ValidatorPerformance = 0x01_00_00_00

	ValidatorExists ValidatorPerformance = 0x00_00_00_01
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL