From d0a7868a7480be9db75f8b56ccc30fe8ceca4b7c Mon Sep 17 00:00:00 2001 From: Lazar <12626340+Lazar955@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:43:50 +0100 Subject: [PATCH] enable iavl cache (#33) --- container/container.go | 8 ++++---- harness/babylonclient.go | 12 ++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/container/container.go b/container/container.go index f1ead10..eb626a2 100644 --- a/container/container.go +++ b/container/container.go @@ -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()), @@ -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", ), diff --git a/harness/babylonclient.go b/harness/babylonclient.go index 99b4be6..6e8b7e4 100644 --- a/harness/babylonclient.go +++ b/harness/babylonclient.go @@ -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( @@ -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 @@ -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 } @@ -122,9 +117,6 @@ func New( return &Client{ queryClient, cp, - cfg.Timeout, - zapLogger, - cfg, }, nil }