github.com/ethereum/go-ethereum@v1.14.4-0.20240516095835-473ee8fc07a3/core/txpool/blobpool/interface.go (about) 1 // Copyright 2023 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package blobpool 18 19 import ( 20 "github.com/ethereum/go-ethereum/common" 21 "github.com/ethereum/go-ethereum/core/state" 22 "github.com/ethereum/go-ethereum/core/types" 23 "github.com/ethereum/go-ethereum/params" 24 ) 25 26 // BlockChain defines the minimal set of methods needed to back a blob pool with 27 // a chain. Exists to allow mocking the live chain out of tests. 28 type BlockChain interface { 29 // Config retrieves the chain's fork configuration. 30 Config() *params.ChainConfig 31 32 // CurrentBlock returns the current head of the chain. 33 CurrentBlock() *types.Header 34 35 // CurrentFinalBlock returns the current block below which blobs should not 36 // be maintained anymore for reorg purposes. 37 CurrentFinalBlock() *types.Header 38 39 // GetBlock retrieves a specific block, used during pool resets. 40 GetBlock(hash common.Hash, number uint64) *types.Block 41 42 // StateAt returns a state database for a given root hash (generally the head). 43 StateAt(root common.Hash) (*state.StateDB, error) 44 }