Versions in this module Expand all Collapse all v1 v1.2.2 Apr 7, 2024 Changes in this version + const MaxHeaderLimit + const SplicingSymbol + const StoreCacheSize + var ErrInvalidDumpMagic = errors.New("invalid dump magic") + func CalcBaseFee(config *ethparams.ChainConfig, parent *Header) *big.Int + func MakeGlobalEthash(dir string) + func VerifyEip1559Header(config *ethparams.ChainConfig, parent, header *Header) error + func VerifySeal(header *Header) error + type Cache struct + Cache *golru.Cache + type Config struct + CacheDir string + CachesInMem int + CachesLockMmap bool + CachesOnDisk int + DatasetDir string + DatasetsInMem int + DatasetsLockMmap bool + DatasetsOnDisk int + Log log.Logger + PowMode Mode + type Ethash struct + func New(config Config) *Ethash + func (ethash *Ethash) SealHash(header *Header) (hash common.Hash) + type Header struct + BaseFee *big.Int + Bloom types.Bloom + Coinbase common.Address + Difficulty *big.Int + Extra []byte + GasLimit uint64 + GasUsed uint64 + MixDigest common.Hash + Nonce types.BlockNonce + Number *big.Int + ParentHash common.Hash + ReceiptHash common.Hash + Root common.Hash + Time uint64 + TxHash common.Hash + UncleHash common.Hash + func (eh *Header) Hash() common.Hash + type HeaderStore struct + CurHash common.Hash + CurNumber uint64 + func NewHeaderStore() *HeaderStore + func (hs *HeaderStore) CurrentHash() common.Hash + func (hs *HeaderStore) CurrentNumber() uint64 + func (hs *HeaderStore) DeleteCanonicalHash(number uint64, db types.StateDB) + func (hs *HeaderStore) GetCurrentNumberAndHash(db types.StateDB) (uint64, common.Hash, error) + func (hs *HeaderStore) GetHashByNumber(db types.StateDB, number uint64) (common.Hash, error) + func (hs *HeaderStore) GetHeader(hash common.Hash, number uint64, db types.StateDB) *Header + func (hs *HeaderStore) GetHeaderByNumber(number uint64, db types.StateDB) *Header + func (hs *HeaderStore) GetTd(hash common.Hash, number uint64, db types.StateDB) *big.Int + func (hs *HeaderStore) HasHeader(hash common.Hash, number uint64, db types.StateDB) bool + func (hs *HeaderStore) InsertHeaders(db types.StateDB, ethHeaders []byte) ([]*params.NumberHash, error) + func (hs *HeaderStore) Load(state types.StateDB) (err error) + func (hs *HeaderStore) LoadCanonicalHash(number uint64, db types.StateDB) (lh common.Hash, err error) + func (hs *HeaderStore) LoadHeader(number uint64, db types.StateDB) (lh *LightHeader, err error) + func (hs *HeaderStore) ReadCanonicalHash(number uint64, db types.StateDB) common.Hash + func (hs *HeaderStore) ResetHeaderStore(state types.StateDB, ethHeaders []byte, td *big.Int) error + func (hs *HeaderStore) Store(state types.StateDB) error + func (hs *HeaderStore) StoreCanonicalHash(state types.StateDB, number uint64, hash *common.Hash) error + func (hs *HeaderStore) StoreHeader(state types.StateDB, number uint64, header *LightHeader) error + func (hs *HeaderStore) WriteCanonicalHash(hash common.Hash, number uint64, db types.StateDB) + func (hs *HeaderStore) WriteHeaderAndTd(hash common.Hash, number uint64, td *big.Int, header *Header, db types.StateDB) error + func (hs *HeaderStore) WriteHeaders(db types.StateDB, ethHeaders []byte) (*headerWriteResult, error) + type LightHeader struct + Headers map[string][]byte + TDs map[string]*big.Int + func (lh *LightHeader) DecodeRLP(s *rlp.Stream) error + func (lh *LightHeader) EncodeRLP(w io.Writer) error + type Mode uint + const ModeNormal + const ModeTest + type TxProve struct + BlockNumber uint64 + Prove light.NodeList + Receipt *ethtypes.Receipt + TxIndex uint + type Validate struct + func (v *Validate) ValidateHeaderChain(db types.StateDB, headers []byte, chainType chains.ChainType) (int, error) + func (v *Validate) VerifyHeaders(hs *HeaderStore, headers []*Header, chainType chains.ChainType, ...) (chan<- struct{}, <-chan error) + type Verify struct + func (v *Verify) Verify(db types.StateDB, routerContractAddr common.Address, txProveBytes []byte) (logs []byte, err error) + type WriteStatus byte + const CanonStatTy + const NonStatTy + const SideStatTy