Documentation
¶
Index ¶
- Constants
- Variables
- type BeaconBlockBodyLH
- func (b *BeaconBlockBodyLH) ByteLength(spec *common.Spec) uint64
- func (b *BeaconBlockBodyLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (b *BeaconBlockBodyLH) FixedLength(*common.Spec) uint64
- func (b *BeaconBlockBodyLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root
- func (b *BeaconBlockBodyLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type BeaconBlockLH
- func (b *BeaconBlockLH) ByteLength(spec *common.Spec) uint64
- func (b *BeaconBlockLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (b *BeaconBlockLH) FixedLength(*common.Spec) uint64
- func (b *BeaconBlockLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root
- func (b *BeaconBlockLH) Header(spec *common.Spec) *common.BeaconBlockHeader
- func (b *BeaconBlockLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type BlockData
- type BlocksImporter
- type BoundedIndicesFetcher
- type Command
- type IndexData
- type PerfComputer
- type RandaoComputer
- type Server
- type SignedBeaconBlockLH
- func (b *SignedBeaconBlockLH) ByteLength(spec *common.Spec) uint64
- func (b *SignedBeaconBlockLH) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (b *SignedBeaconBlockLH) Envelope(spec *common.Spec, digest common.ForkDigest) *common.BeaconBlockEnvelope
- func (b *SignedBeaconBlockLH) FixedLength(*common.Spec) uint64
- func (b *SignedBeaconBlockLH) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root
- func (b *SignedBeaconBlockLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- func (b *SignedBeaconBlockLH) SignedHeader(spec *common.Spec) *common.SignedBeaconBlockHeader
- type SystemInitializer
- type Tile
- type TileProcessor
- type ValidatorPerformance
Constants ¶
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" )
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" )
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" )
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 ¶
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 (*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 (*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 (*BlocksImporter) Close ¶ added in v0.0.3
func (s *BlocksImporter) Close() error
type BoundedIndicesFetcher ¶ added in v0.0.3
type BoundedIndicesFetcher struct {
// contains filtered or unexported fields
}
func NewBoundedIndicesFetcher ¶ added in v0.0.3
func (*BoundedIndicesFetcher) Close ¶ added in v0.0.3
func (s *BoundedIndicesFetcher) Close() error
type PerfComputer ¶ added in v0.0.3
type PerfComputer struct {
// contains filtered or unexported fields
}
func NewPerfComputer ¶ added in v0.0.3
func (*PerfComputer) Close ¶ added in v0.0.3
func (s *PerfComputer) Close() error
type RandaoComputer ¶ added in v0.0.3
type RandaoComputer struct {
// contains filtered or unexported fields
}
func NewRandaoComputer ¶ added in v0.0.3
func (*RandaoComputer) Close ¶ added in v0.0.3
func (s *RandaoComputer) Close() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) WallClockSlot ¶
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 (b *SignedBeaconBlockLH) Envelope(spec *common.Spec, digest common.ForkDigest) *common.BeaconBlockEnvelope
func (*SignedBeaconBlockLH) FixedLength ¶
func (b *SignedBeaconBlockLH) FixedLength(*common.Spec) uint64
func (*SignedBeaconBlockLH) HashTreeRoot ¶
func (*SignedBeaconBlockLH) Serialize ¶
func (b *SignedBeaconBlockLH) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
func (*SignedBeaconBlockLH) SignedHeader ¶
func (b *SignedBeaconBlockLH) SignedHeader(spec *common.Spec) *common.SignedBeaconBlockHeader
type SystemInitializer ¶ added in v0.0.3
type SystemInitializer struct {
// contains filtered or unexported fields
}
func NewSystemInitializer ¶ added in v0.0.3
func (*SystemInitializer) Close ¶ added in v0.0.3
func (s *SystemInitializer) Close() 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 ¶
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 ¶
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 ¶
ColorModel returns the Image's color model.
type TileProcessor ¶ added in v0.0.3
type TileProcessor struct {
// contains filtered or unexported fields
}
func NewTileProcessor ¶ added in v0.0.3
func (*TileProcessor) Close ¶ added in v0.0.3
func (s *TileProcessor) Close() 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 )