func NewPruner(db ethdb.Database, genesisRoot, root common.Hash, datadir string, bloomSize uint64) (*Pruner, error) {
	snaptree, err := snapshot.New(db, trie.NewDatabase(db), 256, root, false, false, false)
	if err != nil {
		return nil, err  
	}
	if bloomSize < 256 {
		log.Warn("Sanitizing bloomfilter size", "provided(MB)", bloomSize, "updated(MB)", 256)
		bloomSize = 256
	}
	stateBloom, err := newStateBloomWithSize(bloomSize)
	if err != nil {
		return nil, err
	}
	return &Pruner{
		db:          db,
		stateBloom:  stateBloom,
		datadir:     datadir,
		root:        root,
		genesisRoot: genesisRoot,
		snaptree:    snaptree,
	}, nil
}
NewPruner creates the pruner instance.
package evmpruner
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"math"
	"os"
	"path/filepath"
	"strings"
	"time"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/state"
	"github.com/ethereum/go-ethereum/core/state/snapshot"
	"github.com/ethereum/go-ethereum/crypto"
	"github.com/ethereum/go-ethereum/ethdb"
	"github.com/ethereum/go-ethereum/log"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/ethereum/go-ethereum/trie"
)
const (
	stateBloomFilePrefix = "statebloom"
	stateBloomFileSuffix = "bf.gz"
	stateBloomFileTempSuffix = ".tmp"
	rangeCompactionThreshold = 100000
)
var (
	emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
	emptyCode = crypto.Keccak256(nil)
)
type Pruner struct {
	db          ethdb.Database
	stateBloom  *stateBloom
	datadir     string
	root        common.Hash
	genesisRoot common.Hash
	snaptree    *snapshot.Tree
}