Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final release nits #301

Merged
merged 6 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func (h *Handler) WatchChain(hideTxs bool, getParser func(string, uint32, ids.ID
window.Update(&tpsWindow, window.WindowSliceSize-consts.Uint64Len, uint64(len(blk.Txs)))
runningDuration := time.Since(start)
tpsDivisor := math.Min(window.WindowSize, runningDuration.Seconds())
// TODO: add block size in KB
utils.Outf(
"{{green}}height:{{/}}%d {{green}}txs:{{/}}%d {{green}}units:{{/}}%d {{green}}root:{{/}}%s {{green}}TPS:{{/}}%.2f {{green}}split:{{/}}%dms\n",
blk.Hght,
Expand Down
6 changes: 3 additions & 3 deletions cli/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func (h *Handler) GeneratePrometheus(prometheusFile string, prometheusData strin

// Create Prometheus YAML
var prometheusConfig PrometheusConfig
prometheusConfig.Global.ScrapeInterval = "15s"
prometheusConfig.Global.EvaluationInterval = "15s"
prometheusConfig.Global.ScrapeInterval = "5s"
prometheusConfig.Global.EvaluationInterval = "5s"
prometheusConfig.ScrapeConfigs = []*PrometheusScrapeConfig{
{
JobName: "prometheus",
Expand Down Expand Up @@ -85,7 +85,7 @@ func (h *Handler) GeneratePrometheus(prometheusFile string, prometheusData strin
if i == 0 {
appendChar = "?"
}
dashboard = fmt.Sprintf("%s%sg%d.expr=%s&g%d.tab=0", dashboard, appendChar, i, url.QueryEscape(panel), i)
dashboard = fmt.Sprintf("%s%sg%d.expr=%s&g%d.tab=0&g%d.step_input=1&g%d.range_input=5m", dashboard, appendChar, i, url.QueryEscape(panel), i, i, i)
}
utils.Outf("{{orange}}pre-built dashboard:{{/}} %s\n", dashboard)

Expand Down
1 change: 1 addition & 0 deletions cli/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (*Handler) PromptInt(
}

func (*Handler) PromptChoice(label string, max int) (int, error) {
// TODO: auto-select if only 1 option provided
promptText := promptui.Prompt{
Label: label,
Validate: func(input string) error {
Expand Down
7 changes: 5 additions & 2 deletions cli/spam.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import (
"syscall"
"time"

"golang.org/x/sync/errgroup"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/hypersdk/chain"
"github.com/ava-labs/hypersdk/consts"
"github.com/ava-labs/hypersdk/crypto"
"github.com/ava-labs/hypersdk/pubsub"
"github.com/ava-labs/hypersdk/rpc"
"github.com/ava-labs/hypersdk/utils"
"github.com/neilotoole/errgroup"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hilarious mixup

)

const (
Expand Down Expand Up @@ -287,17 +288,19 @@ func (h *Handler) Spam(
for k := 0; k < numTxsPerAccount; k++ {
recipient, err := getNextRecipient(randomRecipient, i, accounts)
if err != nil {
utils.Outf("{{orange}}failed to get next recipient:{{/}} %v\n", err)
return err
}
v := selected[recipient] + 1
selected[recipient] = v
_, tx, fees, err := issuer.c.GenerateTransactionManual(parser, nil, getTransfer(recipient, uint64(v)), factory, unitPrice)
if err != nil {
utils.Outf("{{orange}}failed to generate:{{/}} %v\n", err)
utils.Outf("{{orange}}failed to generate tx:{{/}} %v\n", err)
continue
}
transferFee = fees
if err := issuer.d.RegisterTx(tx); err != nil {
utils.Outf("{{orange}}failed to register tx:{{/}} %v\n", err)
continue
}
balance -= (fees + uint64(v))
Expand Down
16 changes: 8 additions & 8 deletions examples/morpheusvm/cmd/morpheus-cli/cmd/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ var generatePrometheusCmd = &cobra.Command{
panels = append(panels, fmt.Sprintf("avalanche_%s_blks_processing", chainID))
utils.Outf("{{yellow}}blocks processing:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_accepted_count[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_accepted_count[5s])/5", chainID))
utils.Outf("{{yellow}}blocks accepted per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_rejected_count[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_rejected_count[5s])/5", chainID))
utils.Outf("{{yellow}}blocks rejected per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_vm_txs_accepted[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_vm_txs_accepted[5s])/5", chainID))
utils.Outf("{{yellow}}transactions per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_operations[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_operations[5s])/5", chainID))
utils.Outf("{{yellow}}state operations per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_changes[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_changes[5s])/5", chainID))
utils.Outf("{{yellow}}state changes per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_root_calculated_sum[30s])/1000000/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_root_calculated_sum[5s])/1000000/5", chainID))
utils.Outf("{{yellow}}root calcuation wait (ms/s):{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_wait_signatures_sum[30s])/1000000/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_wait_signatures_sum[5s])/1000000/5", chainID))
utils.Outf("{{yellow}}signature verification wait (ms/s):{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("avalanche_%s_vm_hypersdk_chain_mempool_size", chainID))
Expand All @@ -54,7 +54,7 @@ var generatePrometheusCmd = &cobra.Command{
panels = append(panels, "avalanche_resource_tracker_cpu_usage")
utils.Outf("{{yellow}}CPU usage:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_handler_chits_sum[30s])/1000000/30 + increase(avalanche_%s_handler_notify_sum[30s])/1000000/30 + increase(avalanche_%s_handler_get_sum[30s])/1000000/30 + increase(avalanche_%s_handler_push_query_sum[30s])/1000000/30 + increase(avalanche_%s_handler_put_sum[30s])/1000000/30 + increase(avalanche_%s_handler_pull_query_sum[30s])/1000000/30 + increase(avalanche_%s_handler_query_failed_sum[30s])/1000000/30", chainID, chainID, chainID, chainID, chainID, chainID, chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_handler_chits_sum[5s])/1000000/5 + increase(avalanche_%s_handler_notify_sum[5s])/1000000/5 + increase(avalanche_%s_handler_get_sum[5s])/1000000/5 + increase(avalanche_%s_handler_push_query_sum[5s])/1000000/5 + increase(avalanche_%s_handler_put_sum[5s])/1000000/5 + increase(avalanche_%s_handler_pull_query_sum[5s])/1000000/5 + increase(avalanche_%s_handler_query_failed_sum[5s])/1000000/5", chainID, chainID, chainID, chainID, chainID, chainID, chainID))
utils.Outf("{{yellow}}consensus engine processing (ms/s):{{/}} %s\n", panels[len(panels)-1])

return panels
Expand Down
1 change: 1 addition & 0 deletions examples/morpheusvm/demo.pk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2;�N�_�ړO-Ν-"i,/<�R�M߯�}� )|)� X����񓍈���gH2=�/�
Expand Down
2 changes: 2 additions & 0 deletions examples/morpheusvm/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ cat <<EOF > ${TMPDIR}/morpheusvm.config
"mempoolPayerSize": 10000000,
"mempoolExemptPayers":["morpheus1rvzhmceq997zntgvravfagsks6w0ryud3rylh4cdvayry0dl97nsp30ucp"],
"parallelism": 5,
"verifySignatures":true,
"storeTransactions":true,
"streamingBacklogSize": 10000000,
"gossipMaxSize": 32768,
"gossipProposerDepth": 1,
Expand Down
4 changes: 3 additions & 1 deletion examples/morpheusvm/tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ var _ = ginkgo.BeforeSuite(func() {
"consensus-on-accept-gossip-validator-size":"10",
"consensus-on-accept-gossip-peer-size":"10",
"network-compression-type":"zstd",
"consensus-app-concurrency":"512"
"consensus-app-concurrency":"512",
"profile-continuous-enabled":true,
"profile-continuous-freq":"1m"
}`),
)
cancel()
Expand Down
6 changes: 6 additions & 0 deletions examples/tokenvm/DEVNETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,9 @@ If you get the following error, make sure to install `gcc` before running
# github.com/supranational/blst/bindings/go
../../../go/pkg/mod/github.com/supranational/blst@v0.3.11-0.20220920110316-f72618070295/bindings/go/rb_tree.go:130:18: undefined: Message
```

### `bad CPU type in executable: /tmp/prometheus`
Make sure to install Rosetta 2 if you have an aarch64 Mac:
```
softwareupdate --install-rosetta
```
16 changes: 8 additions & 8 deletions examples/tokenvm/cmd/token-cli/cmd/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ var generatePrometheusCmd = &cobra.Command{
panels = append(panels, fmt.Sprintf("avalanche_%s_blks_processing", chainID))
utils.Outf("{{yellow}}blocks processing:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_accepted_count[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_accepted_count[5s])/5", chainID))
utils.Outf("{{yellow}}blocks accepted per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_rejected_count[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_blks_rejected_count[5s])/5", chainID))
utils.Outf("{{yellow}}blocks rejected per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_vm_txs_accepted[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_vm_txs_accepted[5s])/5", chainID))
utils.Outf("{{yellow}}transactions per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_operations[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_operations[5s])/5", chainID))
utils.Outf("{{yellow}}state operations per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_changes[30s])/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_state_changes[5s])/5", chainID))
utils.Outf("{{yellow}}state changes per second:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_root_calculated_sum[30s])/1000000/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_root_calculated_sum[5s])/1000000/5", chainID))
utils.Outf("{{yellow}}root calcuation wait (ms/s):{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_wait_signatures_sum[30s])/1000000/30", chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_vm_hypersdk_chain_wait_signatures_sum[5s])/1000000/5", chainID))
utils.Outf("{{yellow}}signature verification wait (ms/s):{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("avalanche_%s_vm_hypersdk_chain_mempool_size", chainID))
Expand All @@ -54,7 +54,7 @@ var generatePrometheusCmd = &cobra.Command{
panels = append(panels, "avalanche_resource_tracker_cpu_usage")
utils.Outf("{{yellow}}CPU usage:{{/}} %s\n", panels[len(panels)-1])

panels = append(panels, fmt.Sprintf("increase(avalanche_%s_handler_chits_sum[30s])/1000000/30 + increase(avalanche_%s_handler_notify_sum[30s])/1000000/30 + increase(avalanche_%s_handler_get_sum[30s])/1000000/30 + increase(avalanche_%s_handler_push_query_sum[30s])/1000000/30 + increase(avalanche_%s_handler_put_sum[30s])/1000000/30 + increase(avalanche_%s_handler_pull_query_sum[30s])/1000000/30 + increase(avalanche_%s_handler_query_failed_sum[30s])/1000000/30", chainID, chainID, chainID, chainID, chainID, chainID, chainID))
panels = append(panels, fmt.Sprintf("increase(avalanche_%s_handler_chits_sum[5s])/1000000/5 + increase(avalanche_%s_handler_notify_sum[5s])/1000000/5 + increase(avalanche_%s_handler_get_sum[5s])/1000000/5 + increase(avalanche_%s_handler_push_query_sum[5s])/1000000/5 + increase(avalanche_%s_handler_put_sum[5s])/1000000/5 + increase(avalanche_%s_handler_pull_query_sum[5s])/1000000/5 + increase(avalanche_%s_handler_query_failed_sum[5s])/1000000/5", chainID, chainID, chainID, chainID, chainID, chainID, chainID))
utils.Outf("{{yellow}}consensus engine processing (ms/s):{{/}} %s\n", panels[len(panels)-1])

return panels
Expand Down
2 changes: 2 additions & 0 deletions examples/tokenvm/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ cat <<EOF > ${TMPDIR}/tokenvm.config
"mempoolPayerSize": 10000000,
"mempoolExemptPayers":["token1rvzhmceq997zntgvravfagsks6w0ryud3rylh4cdvayry0dl97nsjzf3yp"],
"parallelism": 5,
"verifySignatures":true,
"storeTransactions":true,
"streamingBacklogSize": 10000000,
"gossipMaxSize": 32768,
"gossipProposerDepth": 1,
Expand Down
6 changes: 4 additions & 2 deletions examples/tokenvm/tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ var _ = ginkgo.BeforeSuite(func() {
"throttler-outbound-at-large-alloc-size":"10737418240",
"consensus-on-accept-gossip-validator-size":"10",
"consensus-on-accept-gossip-peer-size":"10",
"network-compression-type":"none",
"consensus-app-concurrency":"512"
"network-compression-type":"zstd",
"consensus-app-concurrency":"512",
"profile-continuous-enabled":true,
"profile-continuous-freq":"1m"
}`),
)
cancel()
Expand Down