span

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainSpanner

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

func NewChainSpanner

func NewChainSpanner(validatorSet abi.ABI, chainConfig *chain.Config) *ChainSpanner

func (*ChainSpanner) CommitSpan

func (c *ChainSpanner) CommitSpan(heimdallSpan HeimdallSpan, syscall consensus.SystemCall) error

func (*ChainSpanner) GetCurrentSpan

func (c *ChainSpanner) GetCurrentSpan(syscall consensus.SystemCall) (*Span, error)

GetCurrentSpan get current span from contract

func (*ChainSpanner) GetCurrentValidators

func (c *ChainSpanner) GetCurrentValidators(blockNumber uint64, signer libcommon.Address, getSpanForBlock func(blockNum uint64) (*HeimdallSpan, error)) ([]*valset.Validator, error)

type HeimdallSpan

type HeimdallSpan struct {
	Span
	ValidatorSet      valset.ValidatorSet `json:"validator_set" yaml:"validator_set"`
	SelectedProducers []valset.Validator  `json:"selected_producers" yaml:"selected_producers"`
	ChainID           string              `json:"bor_chain_id" yaml:"bor_chain_id"`
}

HeimdallSpan represents span from heimdall APIs

func (*HeimdallSpan) Less

func (hs *HeimdallSpan) Less(other btree.Item) bool

type Span

type Span struct {
	ID         uint64 `json:"span_id" yaml:"span_id"`
	StartBlock uint64 `json:"start_block" yaml:"start_block"`
	EndBlock   uint64 `json:"end_block" yaml:"end_block"`
}

Span represents a current bor span

Jump to

Keyboard shortcuts

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