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 ¶
- Variables
- func CalcBaseFee(parent *eth.Header) *big.Int
- func GetCanonicalHeight(native *native.NativeService, chainID uint64) (height uint64, err error)
- func ParseValidators(validatorsBytes []byte) ([]ecommon.Address, error)
- func SealHash(header *eth.Header, chainID *big.Int) (hash ecommon.Hash)
- func VerifyEip1559Header(parent, header *eth.Header) error
- func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error
- type Context
- type ExtraInfo
- type GenesisHeader
- type Handler
- type HeaderWithChainID
- type HeaderWithDifficultySum
- type HeightAndValidators
Constants ¶
This section is empty.
Variables ¶
var (
GasLimitBoundDivisor uint64 = 256 // The bound divisor of the gas limit, used in update calculations.
)
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
CalcBaseFee calculates the basefee of the header.
func GetCanonicalHeight ¶
func GetCanonicalHeight(native *native.NativeService, chainID uint64) (height uint64, err error)
GetCanonicalHeight ...
func ParseValidators ¶
ParseValidators ...
func VerifyEip1559Header ¶ added in v1.7.3
VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, - gas limit check - basefee check
func VerifyGaslimit ¶ added in v1.7.3
VerifyGaslimit verifies the header gas limit according increase/decrease in relation to the parent gas limit.
Types ¶
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 (*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 ...