Skip to content

Commit

Permalink
stmgr: call: use a buffered concurrent-access blockstore
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Mar 21, 2022
1 parent 3a62c8b commit 3a121f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"errors"
"fmt"

"github.com/filecoin-project/lotus/blockstore"

cbor "github.com/ipfs/go-ipld-cbor"

"github.com/filecoin-project/lotus/chain/state"
Expand Down Expand Up @@ -221,11 +223,12 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
return nil, err
}

buffStore := blockstore.NewTieredBstore(sm.cs.StateBlockstore(), blockstore.NewMemorySync())
vmopt := &vm.VMOpts{
StateBase: stateCid,
Epoch: vmHeight,
Rand: r,
Bstore: sm.cs.StateBlockstore(),
Bstore: buffStore,
Actors: sm.tsExec.NewActorRegistry(),
Syscalls: sm.Syscalls,
CircSupplyCalc: sm.GetVMCirculatingSupply,
Expand All @@ -252,7 +255,7 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
return nil, xerrors.Errorf("flushing vm: %w", err)
}

stTree, err := state.LoadStateTree(cbor.NewCborStore(sm.cs.StateBlockstore()), stateCid)
stTree, err := state.LoadStateTree(cbor.NewCborStore(buffStore), stateCid)
if err != nil {
return nil, xerrors.Errorf("loading state tree: %w", err)
}
Expand Down

0 comments on commit 3a121f9

Please sign in to comment.