Skip to content

Commit

Permalink
enable iavl cache (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 authored Nov 21, 2024
1 parent ed6f917 commit d0a7868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
8 changes: 4 additions & 4 deletions container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ func (m *Manager) RunBabylondResource(
"--covenant-quorum=1 --covenant-pks=%s "+
"--min-signed-per-window=0 && "+ // never jail sluggish fps
"chmod -R 777 /home && "+
"sed -i -e 's/iavl-cache-size = 781250/iavl-cache-size = 0/' /home/node0/babylond/config/app.toml && "+ // disable the cache otherwise we go OOM
"sed -i -e 's/iavl-disable-fastnode = false/iavl-disable-fastnode = true/' /home/node0/babylond/config/app.toml && "+
"sed -i -e 's/iavl-cache-size = 781250/iavl-cache-size = 50000/' /home/node0/babylond/config/app.toml && "+ // disable the cache otherwise we go OOM
//"sed -i -e 's/iavl-disable-fastnode = false/iavl-disable-fastnode = true/' /home/node0/babylond/config/app.toml && "+
`sed -i -e 's/timeout_commit = "5s"/timeout_commit = "2s"/' /home/node0/babylond/config/config.toml &&`+
"babylond start --home=/home/node0/babylond --rpc.pprof_laddr=0.0.0.0:6060",
epochInterval, slashingPkScript, baseHeaderHex, bbn.NewBIP340PubKeyFromBTCPK(CovenantPubKey).MarshalHex()),
Expand Down Expand Up @@ -279,8 +279,8 @@ func (m *Manager) RunBabylondResource(
cmd2 := []string{
"sh", "-c", fmt.Sprintf(
"chmod -R 777 /home && ls -la &&" +
"sed -i -e 's/iavl-cache-size = 781250/iavl-cache-size = 0/' /home/node1/babylond/config/app.toml && " + // disable the cache otherwise we go OOM
"sed -i -e 's/iavl-disable-fastnode = false/iavl-disable-fastnode = true/' /home/node1/babylond/config/app.toml && " +
"sed -i -e 's/iavl-cache-size = 781250/iavl-cache-size = 50000/' /home/node1/babylond/config/app.toml && " + // disable the cache otherwise we go OOM
//"sed -i -e 's/iavl-disable-fastnode = false/iavl-disable-fastnode = true/' /home/node1/babylond/config/app.toml && " +
`sed -i -e 's/timeout_commit = "5s"/timeout_commit = "2s"/' /home/node1/babylond/config/config.toml &&` +
"babylond start --home=/home/node1/babylond --rpc.pprof_laddr=0.0.0.0:6060",
),
Expand Down
12 changes: 2 additions & 10 deletions harness/babylonclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ func getEncodingConfig() *params.EncodingConfig {

type Client struct {
*query.QueryClient

provider *cosmos.CosmosProvider
timeout time.Duration
logger *zap.Logger
cfg *config.BabylonConfig
}

func New(
Expand Down Expand Up @@ -85,7 +81,7 @@ func New(
}

cp := provider.(*cosmos.CosmosProvider)
cp.PCfg.KeyDirectory = cfg.KeyDirectory
//cp.PCfg.KeyDirectory = cfg.KeyDirectory

// Create tmp Babylon0 app to retrieve and register codecs
// Need to override this manually as otherwise option from config is ignored
Expand All @@ -101,8 +97,7 @@ func New(
// NOTE: this will create a RPC client. The RPC client will be used for
// submitting txs and making ad hoc queries. It won't create WebSocket
// connection with Babylon0 node
err = cp.Init(ctx)
if err != nil {
if err = cp.Init(ctx); err != nil {
return nil, err
}

Expand All @@ -122,9 +117,6 @@ func New(
return &Client{
queryClient,
cp,
cfg.Timeout,
zapLogger,
cfg,
}, nil
}

Expand Down

0 comments on commit d0a7868

Please sign in to comment.