@@ -18,9 +18,9 @@ import (
1818 "github.com/onflow/flow-go/follower/database"
1919 "github.com/onflow/flow-go/state/protocol/datastore"
2020 "github.com/onflow/flow-go/state/protocol/protocol_state"
21+ "github.com/onflow/flow-go/storage/operation/pebbleimpl"
2122
2223 "github.com/dapperlabs/testingdock"
23- badgerv2 "github.com/dgraph-io/badger/v2"
2424 "github.com/docker/docker/api/types"
2525 "github.com/docker/docker/api/types/container"
2626 dockercontainer "github.com/docker/docker/api/types/container"
@@ -56,7 +56,6 @@ import (
5656 "github.com/onflow/flow-go/state/protocol/inmem"
5757 "github.com/onflow/flow-go/state/protocol/protocol_state/kvstore"
5858 "github.com/onflow/flow-go/storage"
59- badgerstorage "github.com/onflow/flow-go/storage/badger"
6059 "github.com/onflow/flow-go/utils/io"
6160 "github.com/onflow/flow-go/utils/unittest"
6261)
@@ -674,7 +673,6 @@ func (net *FlowNetwork) addConsensusFollower(t *testing.T, rootProtocolSnapshotP
674673 tmpdir := makeTempSubDir (t , net .baseTempdir , "flow-consensus-follower" )
675674
676675 // create a directory for the follower database
677- dataDir := makeDir (t , tmpdir , DefaultFlowDBDir )
678676 pebbleDir := makeDir (t , tmpdir , DefaultFlowPebbleDBDir )
679677
680678 pebbleDB , _ , err := database .InitPebbleDB (net .log , pebbleDir )
@@ -690,23 +688,13 @@ func (net *FlowNetwork) addConsensusFollower(t *testing.T, rootProtocolSnapshotP
690688 require .NoError (t , err )
691689
692690 // consensus follower
693- dbOpts := badgerv2 .
694- DefaultOptions (dataDir ).
695- WithKeepL0InMemory (true ).
696- WithValueLogFileSize (128 << 23 ).
697- WithValueLogMaxEntries (100000 ) // Default is 1000000
698- badgerDB , err := badgerstorage .InitPublic (dbOpts )
699- require .NoError (t , err )
700691 lockManager := storage .NewTestingLockManager ()
701692
702693 bindAddr := gonet .JoinHostPort ("localhost" , testingdock .RandomPort (t ))
694+ protocolDB := pebbleimpl .ToDB (pebbleDB )
703695 opts := append (
704696 followerConf .Opts ,
705- consensus_follower .WithDB (badgerDB ),
706- // this is required, otherwise consensus follower will create a pebble db at the default
707- // path /data/protocol-pebble, which is outside of the tmpdir, and will run into permission
708- // denied error.
709- consensus_follower .WithPebbleDB (pebbleDB ),
697+ consensus_follower .WithProtocolDB (protocolDB ),
710698 consensus_follower .WithBootstrapDir (followerBootstrapDir ),
711699 // each consenesus follower will have a different lock manager singleton
712700 consensus_follower .WithLockManager (lockManager ),
0 commit comments