dblookupext

package
v1.999.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEpochByHash        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEpochByHash          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEpochByHash = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMiniblockMetadata        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMiniblockMetadata          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMiniblockMetadata = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthResultsHashesByTxHash        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowResultsHashesByTxHash          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupResultsHashesByTxHash = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrNotFoundInStorage = errors.New("not found in storage")

ErrNotFoundInStorage signals that an item was not found in storage

Functions

func NewHistoryRepository

func NewHistoryRepository(arguments HistoryRepositoryArguments) (*historyRepository, error)

NewHistoryRepository will create a new instance of HistoryRepository

Types

type BlockTracker

type BlockTracker interface {
	RegisterCrossNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedFromCrossHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterFinalMetachainHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	IsInterfaceNil() bool
}

BlockTracker defines the interface of the block tracker

type EpochByHash

type EpochByHash struct {
	Epoch uint32 `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
}

EpochByHash is used to store information about a hash to know which epoch it belongs to

func (*EpochByHash) Descriptor

func (*EpochByHash) Descriptor() ([]byte, []int)

func (*EpochByHash) Equal

func (this *EpochByHash) Equal(that interface{}) bool

func (*EpochByHash) GetEpoch

func (m *EpochByHash) GetEpoch() uint32

func (*EpochByHash) GoString

func (this *EpochByHash) GoString() string

func (*EpochByHash) Marshal

func (m *EpochByHash) Marshal() (dAtA []byte, err error)

func (*EpochByHash) MarshalTo

func (m *EpochByHash) MarshalTo(dAtA []byte) (int, error)

func (*EpochByHash) MarshalToSizedBuffer

func (m *EpochByHash) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EpochByHash) ProtoMessage

func (*EpochByHash) ProtoMessage()

func (*EpochByHash) Reset

func (m *EpochByHash) Reset()

func (*EpochByHash) Size

func (m *EpochByHash) Size() (n int)

func (*EpochByHash) String

func (this *EpochByHash) String() string

func (*EpochByHash) Unmarshal

func (m *EpochByHash) Unmarshal(dAtA []byte) error

func (*EpochByHash) XXX_DiscardUnknown

func (m *EpochByHash) XXX_DiscardUnknown()

func (*EpochByHash) XXX_Marshal

func (m *EpochByHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EpochByHash) XXX_Merge

func (m *EpochByHash) XXX_Merge(src proto.Message)

func (*EpochByHash) XXX_Size

func (m *EpochByHash) XXX_Size() int

func (*EpochByHash) XXX_Unmarshal

func (m *EpochByHash) XXX_Unmarshal(b []byte) error

type HistoryRepository

type HistoryRepository interface {
	RecordBlock(blockHeaderHash []byte,
		blockHeader data.HeaderHandler,
		blockBody data.BodyHandler,
		scrResultsFromPool map[string]data.TransactionHandler,
		receiptsFromPool map[string]data.TransactionHandler,
		createdIntraShardMiniBlocks []*block.MiniBlock,
		logs []*data.LogData) error
	OnNotarizedBlocks(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)
	GetMiniblockMetadataByTxHash(hash []byte) (*MiniblockMetadata, error)
	GetEpochByHash(hash []byte) (uint32, error)
	GetResultsHashesByTxHash(txHash []byte, epoch uint32) (*ResultsHashesByTxHash, error)
	RevertBlock(blockHeader data.HeaderHandler, blockBody data.BodyHandler) error
	GetESDTSupply(token string) (*esdtSupply.SupplyESDT, error)
	IsEnabled() bool
	IsInterfaceNil() bool
}

HistoryRepository provides methods needed for the history data processing

type HistoryRepositoryArguments

type HistoryRepositoryArguments struct {
	SelfShardID                 uint32
	MiniblocksMetadataStorer    storage.Storer
	MiniblockHashByTxHashStorer storage.Storer
	BlockHashByRound            storage.Storer
	Uint64ByteSliceConverter    typeConverters.Uint64ByteSliceConverter
	EpochByHashStorer           storage.Storer
	EventsHashesByTxHashStorer  storage.Storer
	Marshalizer                 marshal.Marshalizer
	Hasher                      hashing.Hasher
	ESDTSuppliesHandler         SuppliesHandler
}

HistoryRepositoryArguments is a structure that stores all components that are needed to a history processor

type HistoryRepositoryFactory

type HistoryRepositoryFactory interface {
	Create() (HistoryRepository, error)
	IsInterfaceNil() bool
}

HistoryRepositoryFactory can create new instances of HistoryRepository

type MiniblockMetadata

type MiniblockMetadata struct {
	SourceShardID                     uint32 `protobuf:"varint,1,opt,name=SourceShardID,proto3" json:"SourceShardID,omitempty"`
	DestinationShardID                uint32 `protobuf:"varint,2,opt,name=DestinationShardID,proto3" json:"DestinationShardID,omitempty"`
	Round                             uint64 `protobuf:"varint,3,opt,name=Round,proto3" json:"Round,omitempty"`
	HeaderNonce                       uint64 `protobuf:"varint,4,opt,name=HeaderNonce,proto3" json:"HeaderNonce,omitempty"`
	HeaderHash                        []byte `protobuf:"bytes,5,opt,name=HeaderHash,proto3" json:"HeaderHash,omitempty"`
	MiniblockHash                     []byte `protobuf:"bytes,6,opt,name=MiniblockHash,proto3" json:"MiniblockHash,omitempty"`
	DeprecatedStatus                  []byte `protobuf:"bytes,7,opt,name=DeprecatedStatus,proto3" json:"DeprecatedStatus,omitempty"` // Deprecated: Do not use.
	Epoch                             uint32 `protobuf:"varint,8,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	NotarizedAtSourceInMetaNonce      uint64 `protobuf:"varint,9,opt,name=NotarizedAtSourceInMetaNonce,proto3" json:"NotarizedAtSourceInMetaNonce,omitempty"`
	NotarizedAtDestinationInMetaNonce uint64 `protobuf:"varint,10,opt,name=NotarizedAtDestinationInMetaNonce,proto3" json:"NotarizedAtDestinationInMetaNonce,omitempty"`
	NotarizedAtSourceInMetaHash       []byte `protobuf:"bytes,11,opt,name=NotarizedAtSourceInMetaHash,proto3" json:"NotarizedAtSourceInMetaHash,omitempty"`
	NotarizedAtDestinationInMetaHash  []byte `protobuf:"bytes,12,opt,name=NotarizedAtDestinationInMetaHash,proto3" json:"NotarizedAtDestinationInMetaHash,omitempty"`
	Type                              int32  `protobuf:"varint,13,opt,name=Type,proto3" json:"Type,omitempty"`
}

MiniblockMetadata is used to store information about a history transaction

func (*MiniblockMetadata) Descriptor

func (*MiniblockMetadata) Descriptor() ([]byte, []int)

func (*MiniblockMetadata) Equal

func (this *MiniblockMetadata) Equal(that interface{}) bool

func (*MiniblockMetadata) GetDeprecatedStatus deprecated

func (m *MiniblockMetadata) GetDeprecatedStatus() []byte

Deprecated: Do not use.

func (*MiniblockMetadata) GetDestinationShardID

func (m *MiniblockMetadata) GetDestinationShardID() uint32

func (*MiniblockMetadata) GetEpoch

func (m *MiniblockMetadata) GetEpoch() uint32

func (*MiniblockMetadata) GetHeaderHash

func (m *MiniblockMetadata) GetHeaderHash() []byte

func (*MiniblockMetadata) GetHeaderNonce

func (m *MiniblockMetadata) GetHeaderNonce() uint64

func (*MiniblockMetadata) GetMiniblockHash

func (m *MiniblockMetadata) GetMiniblockHash() []byte

func (*MiniblockMetadata) GetNotarizedAtDestinationInMetaHash

func (m *MiniblockMetadata) GetNotarizedAtDestinationInMetaHash() []byte

func (*MiniblockMetadata) GetNotarizedAtDestinationInMetaNonce

func (m *MiniblockMetadata) GetNotarizedAtDestinationInMetaNonce() uint64

func (*MiniblockMetadata) GetNotarizedAtSourceInMetaHash

func (m *MiniblockMetadata) GetNotarizedAtSourceInMetaHash() []byte

func (*MiniblockMetadata) GetNotarizedAtSourceInMetaNonce

func (m *MiniblockMetadata) GetNotarizedAtSourceInMetaNonce() uint64

func (*MiniblockMetadata) GetRound

func (m *MiniblockMetadata) GetRound() uint64

func (*MiniblockMetadata) GetSourceShardID

func (m *MiniblockMetadata) GetSourceShardID() uint32

func (*MiniblockMetadata) GetType

func (m *MiniblockMetadata) GetType() int32

func (*MiniblockMetadata) GoString

func (this *MiniblockMetadata) GoString() string

func (*MiniblockMetadata) Marshal

func (m *MiniblockMetadata) Marshal() (dAtA []byte, err error)

func (*MiniblockMetadata) MarshalTo

func (m *MiniblockMetadata) MarshalTo(dAtA []byte) (int, error)

func (*MiniblockMetadata) MarshalToSizedBuffer

func (m *MiniblockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MiniblockMetadata) ProtoMessage

func (*MiniblockMetadata) ProtoMessage()

func (*MiniblockMetadata) Reset

func (m *MiniblockMetadata) Reset()

func (*MiniblockMetadata) Size

func (m *MiniblockMetadata) Size() (n int)

func (*MiniblockMetadata) String

func (this *MiniblockMetadata) String() string

func (*MiniblockMetadata) Unmarshal

func (m *MiniblockMetadata) Unmarshal(dAtA []byte) error

func (*MiniblockMetadata) XXX_DiscardUnknown

func (m *MiniblockMetadata) XXX_DiscardUnknown()

func (*MiniblockMetadata) XXX_Marshal

func (m *MiniblockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MiniblockMetadata) XXX_Merge

func (m *MiniblockMetadata) XXX_Merge(src proto.Message)

func (*MiniblockMetadata) XXX_Size

func (m *MiniblockMetadata) XXX_Size() int

func (*MiniblockMetadata) XXX_Unmarshal

func (m *MiniblockMetadata) XXX_Unmarshal(b []byte) error

type ResultsHashesByTxHash

type ResultsHashesByTxHash struct {
	ReceiptsHash            []byte                     `protobuf:"bytes,1,opt,name=ReceiptsHash,proto3" json:"ReceiptsHash,omitempty"`
	ScResultsHashesAndEpoch []*ScResultsHashesAndEpoch `protobuf:"bytes,2,rep,name=ScResultsHashesAndEpoch,proto3" json:"ScResultsHashesAndEpoch,omitempty"`
}

ResultsHashesByTxHash is used to store smart contract results hashes and receipt hash for a transaction hash

func (*ResultsHashesByTxHash) Descriptor

func (*ResultsHashesByTxHash) Descriptor() ([]byte, []int)

func (*ResultsHashesByTxHash) Equal

func (this *ResultsHashesByTxHash) Equal(that interface{}) bool

func (*ResultsHashesByTxHash) GetReceiptsHash

func (m *ResultsHashesByTxHash) GetReceiptsHash() []byte

func (*ResultsHashesByTxHash) GetScResultsHashesAndEpoch

func (m *ResultsHashesByTxHash) GetScResultsHashesAndEpoch() []*ScResultsHashesAndEpoch

func (*ResultsHashesByTxHash) GoString

func (this *ResultsHashesByTxHash) GoString() string

func (*ResultsHashesByTxHash) Marshal

func (m *ResultsHashesByTxHash) Marshal() (dAtA []byte, err error)

func (*ResultsHashesByTxHash) MarshalTo

func (m *ResultsHashesByTxHash) MarshalTo(dAtA []byte) (int, error)

func (*ResultsHashesByTxHash) MarshalToSizedBuffer

func (m *ResultsHashesByTxHash) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ResultsHashesByTxHash) ProtoMessage

func (*ResultsHashesByTxHash) ProtoMessage()

func (*ResultsHashesByTxHash) Reset

func (m *ResultsHashesByTxHash) Reset()

func (*ResultsHashesByTxHash) Size

func (m *ResultsHashesByTxHash) Size() (n int)

func (*ResultsHashesByTxHash) String

func (this *ResultsHashesByTxHash) String() string

func (*ResultsHashesByTxHash) Unmarshal

func (m *ResultsHashesByTxHash) Unmarshal(dAtA []byte) error

func (*ResultsHashesByTxHash) XXX_DiscardUnknown

func (m *ResultsHashesByTxHash) XXX_DiscardUnknown()

func (*ResultsHashesByTxHash) XXX_Marshal

func (m *ResultsHashesByTxHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResultsHashesByTxHash) XXX_Merge

func (m *ResultsHashesByTxHash) XXX_Merge(src proto.Message)

func (*ResultsHashesByTxHash) XXX_Size

func (m *ResultsHashesByTxHash) XXX_Size() int

func (*ResultsHashesByTxHash) XXX_Unmarshal

func (m *ResultsHashesByTxHash) XXX_Unmarshal(b []byte) error

type ScResultsHashesAndEpoch

type ScResultsHashesAndEpoch struct {
	Epoch           uint32   `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	ScResultsHashes [][]byte `protobuf:"bytes,2,rep,name=ScResultsHashes,proto3" json:"ScResultsHashes,omitempty"`
}

ScrHashesAndEpoch is used to store smart contract results and epoch

func (*ScResultsHashesAndEpoch) Descriptor

func (*ScResultsHashesAndEpoch) Descriptor() ([]byte, []int)

func (*ScResultsHashesAndEpoch) Equal

func (this *ScResultsHashesAndEpoch) Equal(that interface{}) bool

func (*ScResultsHashesAndEpoch) GetEpoch

func (m *ScResultsHashesAndEpoch) GetEpoch() uint32

func (*ScResultsHashesAndEpoch) GetScResultsHashes

func (m *ScResultsHashesAndEpoch) GetScResultsHashes() [][]byte

func (*ScResultsHashesAndEpoch) GoString

func (this *ScResultsHashesAndEpoch) GoString() string

func (*ScResultsHashesAndEpoch) Marshal

func (m *ScResultsHashesAndEpoch) Marshal() (dAtA []byte, err error)

func (*ScResultsHashesAndEpoch) MarshalTo

func (m *ScResultsHashesAndEpoch) MarshalTo(dAtA []byte) (int, error)

func (*ScResultsHashesAndEpoch) MarshalToSizedBuffer

func (m *ScResultsHashesAndEpoch) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ScResultsHashesAndEpoch) ProtoMessage

func (*ScResultsHashesAndEpoch) ProtoMessage()

func (*ScResultsHashesAndEpoch) Reset

func (m *ScResultsHashesAndEpoch) Reset()

func (*ScResultsHashesAndEpoch) Size

func (m *ScResultsHashesAndEpoch) Size() (n int)

func (*ScResultsHashesAndEpoch) String

func (this *ScResultsHashesAndEpoch) String() string

func (*ScResultsHashesAndEpoch) Unmarshal

func (m *ScResultsHashesAndEpoch) Unmarshal(dAtA []byte) error

func (*ScResultsHashesAndEpoch) XXX_DiscardUnknown

func (m *ScResultsHashesAndEpoch) XXX_DiscardUnknown()

func (*ScResultsHashesAndEpoch) XXX_Marshal

func (m *ScResultsHashesAndEpoch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ScResultsHashesAndEpoch) XXX_Merge

func (m *ScResultsHashesAndEpoch) XXX_Merge(src proto.Message)

func (*ScResultsHashesAndEpoch) XXX_Size

func (m *ScResultsHashesAndEpoch) XXX_Size() int

func (*ScResultsHashesAndEpoch) XXX_Unmarshal

func (m *ScResultsHashesAndEpoch) XXX_Unmarshal(b []byte) error

type SuppliesHandler

type SuppliesHandler interface {
	ProcessLogs(blockNonce uint64, logs []*data.LogData) error
	RevertChanges(header data.HeaderHandler, body data.BodyHandler) error
	GetESDTSupply(token string) (*esdtSupply.SupplyESDT, error)
	IsInterfaceNil() bool
}

SuppliesHandler defines the interface of a supplies processor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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