heco

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: LGPL-3.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

* Copyright (C) 2021 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	GasLimitBoundDivisor uint64 = 256 // The bound divisor of the gas limit, used in update calculations.
)
View Source
var TestFlagNoCheckHecoHeaderSig bool

only for testing purpose to check if heco chain can be normal back after fork happens

Functions

func CalcBaseFee added in v1.7.3

func CalcBaseFee(parent *eth.Header) *big.Int

CalcBaseFee calculates the basefee of the header.

func GetCanonicalHeight

func GetCanonicalHeight(native *native.NativeService, chainID uint64) (height uint64, err error)

GetCanonicalHeight ...

func ParseValidators

func ParseValidators(validatorsBytes []byte) ([]ecommon.Address, error)

ParseValidators ...

func SealHash

func SealHash(header *eth.Header, chainID *big.Int) (hash ecommon.Hash)

SealHash returns the hash of a block prior to it being sealed.

func VerifyEip1559Header added in v1.7.3

func VerifyEip1559Header(parent, header *eth.Header) error

VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, - gas limit check - basefee check

func VerifyGaslimit added in v1.7.3

func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error

VerifyGaslimit verifies the header gas limit according increase/decrease in relation to the parent gas limit.

Types

type Context

type Context struct {
	ExtraInfo ExtraInfo
	ChainID   uint64
}

Context ...

type ExtraInfo

type ExtraInfo struct {
	ChainID *big.Int // chainId of heco chain, testnet: 256, mainnet: 128
	Period  uint64
}

ExtraInfo ...

type GenesisHeader

type GenesisHeader struct {
	Header         eth.Header
	PrevValidators []HeightAndValidators
}

GenesisHeader ...

type Handler

type Handler struct {
}

Handler ...

func NewHecoHandler

func NewHecoHandler() *Handler

NewHandler ...

func (*Handler) SyncBlockHeader

func (h *Handler) SyncBlockHeader(native *native.NativeService) error

SyncBlockHeader ... Will verify header coming from congress consensus https://github.com/HuobiGroup/huobi-eco-chain/tree/master/consensus/congress

func (*Handler) SyncCrossChainMsg

func (h *Handler) SyncCrossChainMsg(native *native.NativeService) error

SyncCrossChainMsg ...

func (*Handler) SyncGenesisHeader

func (h *Handler) SyncGenesisHeader(native *native.NativeService) (err error)

SyncGenesisHeader ...

type HeaderWithChainID

type HeaderWithChainID struct {
	Header  *HeaderWithDifficultySum
	ChainID uint64
}

HeaderWithChainID ...

type HeaderWithDifficultySum

type HeaderWithDifficultySum struct {
	Header          *eth.Header   `json:"header"`
	DifficultySum   *big.Int      `json:"difficultySum"`
	EpochParentHash *ecommon.Hash `json:"epochParentHash"`
}

HeaderWithDifficultySum ...

func GetCanonicalHeader

func GetCanonicalHeader(native *native.NativeService, chainID uint64, height uint64) (headerWithSum *HeaderWithDifficultySum, err error)

GetCanonicalHeader ...

type HeightAndValidators

type HeightAndValidators struct {
	Height     *big.Int
	Validators []ecommon.Address
	Hash       *ecommon.Hash
}

HeightAndValidators ...

Jump to

Keyboard shortcuts

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