Skip to content

Commit

Permalink
Revert "DVT-1057 replace block data structure with LRU cache to fix m…
Browse files Browse the repository at this point in the history
…emory leak (#148)"

This reverts commit 95faa01.
  • Loading branch information
praetoriansentry authored Nov 13, 2023
1 parent 95faa01 commit 54ab8c8
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 270 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ You can then generate some load to make sure that blocks with transactions are b
$ polycli loadtest --verbosity 700 --chain-id 1337 --concurrency 1 --requests 1000 --rate-limit 5 --mode c --rpc-url http://127.0.0.1:8545
```

## Monitor Debug
`polycli monitor --rpc-url http://34.117.145.249:80 -v 700 &> log.txt`

# Contributing

- If you add a new loadtest mode, don't forget to update the loadtest mode string by running the following command: `cd cmd/loadtest && stringer -type=loadTestMode`. You can install [stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer) with `go install golang.org/x/tools/cmd/stringer@latest`.
Expand Down
13 changes: 3 additions & 10 deletions cmd/monitor/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ var (
usage string

// flags
rpcUrl string
batchSizeValue string
blockCacheLimit int
intervalStr string
rpcUrl string
batchSizeValue string
intervalStr string
)

// MonitorCmd represents the monitor command
Expand All @@ -38,7 +37,6 @@ var MonitorCmd = &cobra.Command{
func init() {
MonitorCmd.PersistentFlags().StringVarP(&rpcUrl, "rpc-url", "r", "http://localhost:8545", "The RPC endpoint url")
MonitorCmd.PersistentFlags().StringVarP(&batchSizeValue, "batch-size", "b", "auto", "Number of requests per batch")
MonitorCmd.PersistentFlags().IntVarP(&blockCacheLimit, "cache-limit", "c", 100, "Number of cached blocks for the LRU block data structure (Min 100)")
MonitorCmd.PersistentFlags().StringVarP(&intervalStr, "interval", "i", "5s", "Amount of time between batch block rpc calls")
}

Expand Down Expand Up @@ -68,10 +66,5 @@ func checkFlags() (err error) {
}
}

// Check batch-size flag.
if blockCacheLimit < 100 {
return fmt.Errorf("block-cache can't be less than 100")
}

return nil
}
Loading

0 comments on commit 54ab8c8

Please sign in to comment.