diff --git a/pkg/fork/mock.go b/pkg/fork/mock.go index 93e5ab60a6..4407515de3 100644 --- a/pkg/fork/mock.go +++ b/pkg/fork/mock.go @@ -38,19 +38,20 @@ func (mockFork *MockFork) HasExpensiveForkBetween(parent, height abi.ChainEpoch) func (mockFork *MockFork) GetForkUpgrade() *config.ForkUpgradeConfig { return &config.ForkUpgradeConfig{ - UpgradeSmokeHeight: -1, - UpgradeBreezeHeight: -1, - UpgradeIgnitionHeight: -1, - UpgradeLiftoffHeight: -1, - UpgradeAssemblyHeight: -1, - UpgradeRefuelHeight: -1, - UpgradeTapeHeight: -1, - UpgradeKumquatHeight: -1, - BreezeGasTampingDuration: -1, - UpgradeCalicoHeight: -1, - UpgradePersianHeight: -1, - UpgradeOrangeHeight: -1, - UpgradeClausHeight: -1, + UpgradeSmokeHeight: -1, + UpgradeBreezeHeight: -1, + UpgradeIgnitionHeight: -1, + UpgradeLiftoffHeight: -1, + UpgradeAssemblyHeight: -1, + UpgradeRefuelHeight: -1, + UpgradeTapeHeight: -1, + UpgradeKumquatHeight: -1, + BreezeGasTampingDuration: -1, + UpgradeCalicoHeight: -1, + UpgradePersianHeight: -1, + UpgradeOrangeHeight: -1, + UpgradeClausHeight: -1, + UpgradeWatermelonFixHeight: -1, } } diff --git a/pkg/gen/genesis/genesis.go b/pkg/gen/genesis/genesis.go index 30f636ee2d..b67ba11a13 100644 --- a/pkg/gen/genesis/genesis.go +++ b/pkg/gen/genesis/genesis.go @@ -515,6 +515,7 @@ func VerifyPreSealedData(ctx context.Context, cs *chain.Store, stateroot cid.Cid Bsstore: cs.Blockstore(), SysCallsImpl: mkFakedSigSyscalls(syscalls), GasPriceSchedule: gasPriceSchedule, + Fork: fork.NewMockFork(), } vm, err := fvm.NewVM(ctx, vmopt) diff --git a/pkg/genesis/genesis.go b/pkg/genesis/genesis.go index 9e1aec794f..778cdf2a9f 100644 --- a/pkg/genesis/genesis.go +++ b/pkg/genesis/genesis.go @@ -69,13 +69,7 @@ func MakeGenesis(ctx context.Context, rep repo.Repo, outFile, genesisTemplate st template.Timestamp = uint64(constants.Clock.Now().Unix()) } - // TODO potentially replace this cached blockstore by a CBOR cache. - cbs, err := blockstoreutil.CachedBlockstore(ctx, bs, blockstoreutil.DefaultCacheOpts()) - if err != nil { - return nil, err - } - - b, err := genesis2.MakeGenesisBlock(context.TODO(), rep, cbs, template, para) + b, err := genesis2.MakeGenesisBlock(context.TODO(), rep, bs, template, para) if err != nil { return nil, fmt.Errorf("make genesis block: %w", err) } @@ -87,8 +81,8 @@ func MakeGenesis(ctx context.Context, rep repo.Repo, outFile, genesisTemplate st return nil, err } - offl := offline.Exchange(cbs) - blkserv := blockservice.New(cbs, offl) + offl := offline.Exchange(bs) + blkserv := blockservice.New(bs, offl) dserv := merkledag.NewDAGService(blkserv) if err := car.WriteCarWithWalker(context.TODO(), dserv, []cid.Cid{b.Genesis.Cid()}, f, gen.CarWalkFunc); err != nil { diff --git a/venus-shared/blockstore/blockstore.go b/venus-shared/blockstore/blockstore.go index 5e4700d6f0..15ddd789a7 100644 --- a/venus-shared/blockstore/blockstore.go +++ b/venus-shared/blockstore/blockstore.go @@ -76,22 +76,6 @@ var ( NewGCBlockstore = blockstore.NewGCBlockstore ) -func DefaultCacheOpts() CacheOpts { - return CacheOpts{ - HasBloomFilterSize: 0, - HasBloomFilterHashes: 0, - HasARCCacheSize: 512 << 10, - } -} - -func CachedBlockstore(ctx context.Context, bs blockstore.Blockstore, opts CacheOpts) (Blockstore, error) { - bsTmp, err := blockstore.CachedBlockstore(ctx, bs, opts) - if err != nil { - return nil, err - } - return WrapIDStore(bsTmp), nil -} - type adaptedBlockstore struct { blockstore.Blockstore }