diff --git a/Makefile b/Makefile index 4b6076abe..c8db38f6f 100644 --- a/Makefile +++ b/Makefile @@ -421,6 +421,12 @@ test_load_relays_stress_localnet: test_e2e_env warn_message_local_stress_test ## -tags=load,test -run LoadRelays --log-level=debug --timeout=30m \ --manifest ./load-testing/loadtest_manifest_localnet.yaml +.PHONY: test_load_relays_stress_localnet_single_supplier +test_load_relays_stress_localnet_single_supplier: test_e2e_env warn_message_local_stress_test ## Run the stress test for E2E relays on LocalNet using exclusively one supplier. + go test -v -count=1 ./load-testing/tests/... \ + -tags=load,test -run TestLoadRelaysSingleSupplier --log-level=debug --timeout=30m \ + --manifest ./load-testing/loadtest_manifest_localnet_single_supplier.yaml + .PHONY: test_verbose test_verbose: check_go_version ## Run all go tests verbosely go test -count=1 -v -race -tags test ./... diff --git a/docusaurus/docs/develop/developer_guide/quickstart.md b/docusaurus/docs/develop/developer_guide/quickstart.md index 13a899e29..007aa9018 100644 --- a/docusaurus/docs/develop/developer_guide/quickstart.md +++ b/docusaurus/docs/develop/developer_guide/quickstart.md @@ -433,7 +433,7 @@ The following is an example config to get you started: ```bash cat <> shannon_relayminer_config.yaml default_signing_key_names: [ "shannon_supplier" ] -smt_store_path: smt_stores +smt_store_path: $HOME/.poktroll/smt metrics: enabled: true addr: :9999 # you may need to change the metrics server port due to port conflicts. diff --git a/docusaurus/docs/operate/testing/load_testing_devnet.md b/docusaurus/docs/operate/testing/load_testing_devnet.md index faf2429a0..8e9207647 100644 --- a/docusaurus/docs/operate/testing/load_testing_devnet.md +++ b/docusaurus/docs/operate/testing/load_testing_devnet.md @@ -11,7 +11,7 @@ A guide on how to perform load testing on DevNets. - [Prerequisites](#prerequisites) - [1. Create and configure the DevNet](#1-create-and-configure-the-devnet) - [2. Stake the necessary actors](#2-stake-the-necessary-actors) - - [3. Configure the load testing manifest](#3-configure-the-load-testing-manifest) + - [3. Configure the load test manifest](#3-configure-the-load-test-manifest) - [Full example](#full-example) ## Overview @@ -90,7 +90,7 @@ service_id: "anvil" # The address of the account that will be used to fund the application accounts # so that they can stake on the network. # TODO_TECHDEBT(@bryanchriswhite, #512): Replace with faucet address. -funding_account_address: pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw # address for pnf account +funding_account_address: pokt1awtlw5sjmw2f5lgj8ekdkaqezphgz88rdk93sk # address for faucet account # In non-ephemeral chains, the gateways are identified by their addresses. gateways: diff --git a/go.mod b/go.mod index 65fdb00a4..5efd46e79 100644 --- a/go.mod +++ b/go.mod @@ -2,19 +2,18 @@ module github.com/pokt-network/poktroll go 1.22.2 -replace ( - // DEVELOPER_TIP: Uncomment to use a local copy of shannon-sdk for development purposes. - // github.com/pokt-network/shannon-sdk => ../shannon-sdk +// replace ( +// DEVELOPER_TIP: Uncomment to use a local copy of shannon-sdk for development purposes. +// github.com/pokt-network/shannon-sdk => ../shannon-sdk - // DEVELOPER_TIP: Uncomment to use a local copy of smt for development purposes. - // github.com/pokt-network/smt => ../smt +// DEVELOPER_TIP: Uncomment to use a local copy of smt for development purposes. +// github.com/pokt-network/smt => ../smt +// github.com/pokt-network/smt/kvstore/badger => ../smt/kvstore/badger +// github.com/pokt-network/smt/kvstore/pebble => ../smt/kvstore/pebble +// ) - // fix upstream GHSA-h395-qcrw-5vmq vulnerability. - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 - - // replace broken goleveldb - github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 -) +// replace broken goleveldb +replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 require ( cosmossdk.io/api v0.7.5 @@ -57,8 +56,8 @@ require ( // repo is the first obvious idea, but has to be carefully considered, automated, and is not // a hard blocker. github.com/pokt-network/shannon-sdk v0.0.0-20240814144717-dfa95b525d46 - github.com/pokt-network/smt v0.12.0 - github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b + github.com/pokt-network/smt v0.13.0 + github.com/pokt-network/smt/kvstore/pebble v0.0.0-20240822175047-21ea8639c188 github.com/prometheus/client_golang v1.19.0 github.com/regen-network/gocuke v1.1.0 github.com/rs/zerolog v1.32.0 @@ -71,6 +70,7 @@ require ( golang.org/x/crypto v0.25.0 golang.org/x/exp v0.0.0-20240707233637-46b078467d37 golang.org/x/sync v0.7.0 + golang.org/x/text v0.16.0 golang.org/x/tools v0.23.0 google.golang.org/genproto/googleapis/api v0.0.0-20240709173604-40e1e62336c5 google.golang.org/grpc v1.65.0 @@ -79,8 +79,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -require golang.org/x/text v0.16.0 - require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 // indirect buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.2-20240710174705-f2077dee5ad4.1 // indirect @@ -119,9 +117,10 @@ require ( github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/apd/v3 v3.2.1 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect @@ -145,7 +144,6 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.6.0 // indirect @@ -179,7 +177,6 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/cel-go v0.20.1 // indirect - github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-containerregistry v0.20.0 // indirect github.com/google/orderedcode v0.0.1 // indirect diff --git a/go.sum b/go.sum index 3f11a2b38..144e24f53 100644 --- a/go.sum +++ b/go.sum @@ -304,6 +304,8 @@ github.com/bufbuild/protovalidate-go v0.6.3 h1:wxQyzW035zM16Binbaz/nWAzS12dRIXhZ github.com/bufbuild/protovalidate-go v0.6.3/go.mod h1:J4PtwP9Z2YAGgB0+o+tTWEDtLtXvz/gfhFZD8pbzM/U= github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU= github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -317,6 +319,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= @@ -349,12 +353,14 @@ github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065na github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -435,8 +441,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 h1:yy45brf1ktmnkTCZlHynP1gRlVwZ9g19oz5D9wG81v4= -github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581/go.mod h1:T/uWAYxrXdaXw64ihI++9RMbKTCpKd/yE9+saARew7k= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= @@ -510,8 +514,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -544,7 +549,7 @@ github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/Nu github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -559,6 +564,8 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -631,8 +638,6 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= -github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= -github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -834,6 +839,8 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -996,10 +1003,10 @@ github.com/pokt-network/ring-go v0.1.0 h1:hF7mDR4VVCIqqDAsrloP8azM9y1mprc99YgnTj github.com/pokt-network/ring-go v0.1.0/go.mod h1:8NHPH7H3EwrPX3XHfpyRI6bz4gApkE3+fd0XZRbMWP0= github.com/pokt-network/shannon-sdk v0.0.0-20240814144717-dfa95b525d46 h1:rkJa3LGPN+f/k2Vv9t09UWtgbpkMA0NLHRZDiGKPqo4= github.com/pokt-network/shannon-sdk v0.0.0-20240814144717-dfa95b525d46/go.mod h1:Jql/lobckajY8BVHDRkQPf6zYraompTK1et78jKVi68= -github.com/pokt-network/smt v0.12.0 h1:uqru/0ykC4LnBoMacakobNOd1iRK69PlohqjMtLmYNA= -github.com/pokt-network/smt v0.12.0/go.mod h1:S4Ho4OPkK2v2vUCHNtA49XDjqUC/OFYpBbynRVYmxvA= -github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b h1:TjfgV3vgW0zW47Br/OgUXD4M8iyR74EYanbFfN4ed8o= -github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b/go.mod h1:GbzcG5ebj8twKmBL1VzdPM4NS44okwYXBfQaVXT+6yU= +github.com/pokt-network/smt v0.13.0 h1:C2F8FlJh34aU+DVeRU/Bt8BOkFXn4QjWMK+nbT9PUj4= +github.com/pokt-network/smt v0.13.0/go.mod h1:S4Ho4OPkK2v2vUCHNtA49XDjqUC/OFYpBbynRVYmxvA= +github.com/pokt-network/smt/kvstore/pebble v0.0.0-20240822175047-21ea8639c188 h1:QK1WmFKQ/OzNVob/br55Brh+EFbWhcdq41WGC8UMihM= +github.com/pokt-network/smt/kvstore/pebble v0.0.0-20240822175047-21ea8639c188/go.mod h1:CZlY7W+7LU5hMFoTb9PmyL4wu/i41t3+gVMvDePxAmo= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1134,6 +1141,8 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -1215,6 +1224,8 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/load-testing/loadtest_manifest_example.yaml b/load-testing/loadtest_manifest_example.yaml index 2e3612388..51c820e87 100644 --- a/load-testing/loadtest_manifest_example.yaml +++ b/load-testing/loadtest_manifest_example.yaml @@ -11,7 +11,7 @@ service_id: "anvil" # The address of the account that will be used to fund the the application accounts # so that they can stake on the network. -funding_account_address: pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw # address for pnf account +funding_account_address: pokt1awtlw5sjmw2f5lgj8ekdkaqezphgz88rdk93sk # address for faucet account # In non-ephemeral chains, the gateways are identified by their address. gateways: diff --git a/load-testing/loadtest_manifest_localnet.yaml b/load-testing/loadtest_manifest_localnet.yaml index f8216e408..5e5d87423 100644 --- a/load-testing/loadtest_manifest_localnet.yaml +++ b/load-testing/loadtest_manifest_localnet.yaml @@ -8,7 +8,7 @@ service_id: anvil # The address of the account that will be used to fund the the application, # gateway and supplier accounts so that they can stake on the network. -funding_account_address: pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw # address for pnf account +funding_account_address: pokt1awtlw5sjmw2f5lgj8ekdkaqezphgz88rdk93sk # address for faucet account # List of pre-provisioned suppliers used for load testing. # These suppliers will be progressively staked during the load test, according diff --git a/load-testing/loadtest_manifest_localnet_single_supplier.yaml b/load-testing/loadtest_manifest_localnet_single_supplier.yaml new file mode 100644 index 000000000..013aa3d9e --- /dev/null +++ b/load-testing/loadtest_manifest_localnet_single_supplier.yaml @@ -0,0 +1,51 @@ +# NB: The number of pre-provisioned **LocalNet** actors are managed in +# 'localnet_config.yaml' by the respective actors `count` property. + +is_ephemeral_chain: true # This should be `true` for LocalNet as it is an ephemeral network + +# The service ID to use for the load test. +service_id: anvil + +# The address of the account that will be used to fund the the application, +# gateway and supplier accounts so that they can stake on the network. +funding_account_address: pokt1awtlw5sjmw2f5lgj8ekdkaqezphgz88rdk93sk # address for faucet account + +# List of pre-provisioned suppliers used for load testing. +# These suppliers will be progressively staked during the load test, according +# to the test plan that is being executed. +# +# When running on **LocalNet**, the number of the suppliers defined below should match +# the `relayminers.count` in your `localnet_config.yaml`. +suppliers: + # The supplier address that is available in the load test's environment keyring, + # used to identify the supplier and sign relays and transactions with. + # It must be the address corresponding to the provided signing_key_name in the + # `relay_miner_config.yaml` file. + + # RelayMiner 1; http://localhost:10350/r/relayminer1/overview + - address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj + # The advertised URL used by the supplier when it submits a stake message on-chain. + exposed_url: http://relayminer1:8545 + +# List of pre-provisioned gateways used for load testing. +# These gateways will be progressively staked and delegated to during the load test. +# +# When running on LocalNet, the number of the gateways defined below should match +# the `gateways.count` in your `localnet_config.yaml`. +gateways: + # The gateway address that is available in the load test's environment keyring, + # used to identify the gateway and sign relays and transactions with. + # It must be the address corresponding to the provided signing_key_name in the + # `appgate_server_config.yaml` file. + + # Gateway 1; http://localhost:10350/r/gateway1/overview + - address: pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4 + exposed_url: http://localhost:42079 # The gateway url that the user sends relays to (e.g. curl) + + # Gateway 2; http://localhost:10350/r/gateway2/overview + - address: pokt15w3fhfyc0lttv7r585e2ncpf6t2kl9uh8rsnyz + exposed_url: http://localhost:42080 + + # Gateway 3; http://localhost:10350/r/gateway3/overview + - address: pokt1zhmkkd0rh788mc9prfq0m2h88t9ge0j83gnxya + exposed_url: http://localhost:42081 diff --git a/load-testing/tests/relays_stress.feature b/load-testing/tests/relays_stress.feature index 20872b737..5aa3f63a0 100644 --- a/load-testing/tests/relays_stress.feature +++ b/load-testing/tests/relays_stress.feature @@ -10,8 +10,8 @@ Feature: Loading gateway server with relays | supplier | 1 | And more actors are staked as follows: | actor | actor inc amount | blocks per inc | max actors | - | application | 4 | 4 | 12 | - | gateway | 1 | 4 | 3 | - | supplier | 1 | 4 | 3 | + | application | 4 | 10 | 12 | + | gateway | 1 | 10 | 3 | + | supplier | 1 | 10 | 3 | When a load of concurrent relay requests are sent from the applications Then the correct pairs count of claim and proof messages should be committed on-chain \ No newline at end of file diff --git a/load-testing/tests/relays_stress_single_suppier.feature b/load-testing/tests/relays_stress_single_suppier.feature new file mode 100644 index 000000000..253b82615 --- /dev/null +++ b/load-testing/tests/relays_stress_single_suppier.feature @@ -0,0 +1,17 @@ +Feature: Loading gateway server with relays + + Scenario: Incrementing the number of relays and actors + Given localnet is running + And a rate of "1" relay requests per second is sent per application + And the following initial actors are staked: + | actor | count | + | application | 4 | + | gateway | 1 | + | supplier | 1 | + And more actors are staked as follows: + | actor | actor inc amount | blocks per inc | max actors | + | application | 4 | 10 | 12 | + | gateway | 1 | 10 | 3 | + | supplier | 1 | 10 | 1 | + When a load of concurrent relay requests are sent from the applications + Then the correct pairs count of claim and proof messages should be committed on-chain \ No newline at end of file diff --git a/load-testing/tests/relays_stress_test.go b/load-testing/tests/relays_stress_test.go index 944f81707..59f74c530 100644 --- a/load-testing/tests/relays_stress_test.go +++ b/load-testing/tests/relays_stress_test.go @@ -270,6 +270,10 @@ func TestLoadRelays(t *testing.T) { gocuke.NewRunner(t, &relaysSuite{}).Path(filepath.Join(".", "relays_stress.feature")).Run() } +func TestLoadRelaysSingleSupplier(t *testing.T) { + gocuke.NewRunner(t, &relaysSuite{}).Path(filepath.Join(".", "relays_stress_single_suppier.feature")).Run() +} + func (s *relaysSuite) LocalnetIsRunning() { s.ctx, s.cancelCtx = context.WithCancel(context.Background()) diff --git a/localnet/kubernetes/values-relayminer-common.yaml b/localnet/kubernetes/values-relayminer-common.yaml index 579e5802a..207c636b2 100644 --- a/localnet/kubernetes/values-relayminer-common.yaml +++ b/localnet/kubernetes/values-relayminer-common.yaml @@ -1,5 +1,5 @@ config: - smt_store_path: smt_stores + smt_store_path: /root/.poktroll/smt metrics: enabled: true addr: :9090 diff --git a/localnet/poktrolld/config/relayminer_config.yaml b/localnet/poktrolld/config/relayminer_config.yaml index 236425e1e..1b9895122 100644 --- a/localnet/poktrolld/config/relayminer_config.yaml +++ b/localnet/poktrolld/config/relayminer_config.yaml @@ -1,5 +1,5 @@ signing_key_name: supplier1 -smt_store_path: smt_stores +smt_store_path: /root/.poktroll/smt metrics: enabled: true addr: :9090 diff --git a/pkg/client/supplier/client_test.go b/pkg/client/supplier/client_test.go index 09aa0dffb..3eed55b5e 100644 --- a/pkg/client/supplier/client_test.go +++ b/pkg/client/supplier/client_test.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/depinject" "github.com/golang/mock/gomock" "github.com/pokt-network/smt" - "github.com/pokt-network/smt/kvstore/badger" + "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/pkg/client/keyring" @@ -175,7 +175,7 @@ func TestSupplierClient_SubmitProof(t *testing.T) { }, } - kvStore, err := badger.NewKVStore("") + kvStore, err := pebble.NewKVStore("") require.NoError(t, err) // Generating an ephemeral tree & spec just so we can submit diff --git a/pkg/relayer/session/sessiontree.go b/pkg/relayer/session/sessiontree.go index 843186b0d..d7d6a9fe8 100644 --- a/pkg/relayer/session/sessiontree.go +++ b/pkg/relayer/session/sessiontree.go @@ -9,7 +9,7 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" - "github.com/pokt-network/smt/kvstore/badger" + "github.com/pokt-network/smt/kvstore/pebble" "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/pkg/relayer" @@ -51,7 +51,7 @@ type sessionTree struct { proofBz []byte // treeStore is the KVStore used to store the SMST. - treeStore badger.BadgerKVStore + treeStore pebble.PebbleKVStore // storePath is the path to the KVStore used to store the SMST. // It is created from the storePrefix and the session.sessionId. @@ -72,14 +72,18 @@ func NewSessionTree( ) (relayer.SessionTree, error) { // Join the storePrefix and the session.sessionId and supplier's operator address to // create a unique storePath. - storePath := filepath.Join(storesDirectory, sessionHeader.SessionId, "_", supplierOperatorAddress.String()) + + // TODO_IMPROVE(#621): instead of creating a new KV store for each session, it will be more beneficial to + // use one key store. KV databases are often optimized for writing into one database. They keys can + // use supplier address and session id as prefix. The current approach might not be RAM/IO efficient. + storePath := filepath.Join(storesDirectory, supplierOperatorAddress.String(), sessionHeader.SessionId) // Make sure storePath does not exist when creating a new SessionTree if _, err := os.Stat(storePath); err != nil && !os.IsNotExist(err) { return nil, ErrSessionTreeStorePathExists.Wrapf("storePath: %q", storePath) } - treeStore, err := badger.NewKVStore(storePath) + treeStore, err := pebble.NewKVStore(storePath) if err != nil { return nil, err } @@ -157,7 +161,7 @@ func (st *sessionTree) ProveClosest(path []byte) (proof *smt.SparseMerkleClosest } // Restore the KVStore from disk since it has been closed after the claim has been generated. - st.treeStore, err = badger.NewKVStore(st.storePath) + st.treeStore, err = pebble.NewKVStore(st.storePath) if err != nil { return nil, err } @@ -240,9 +244,9 @@ func (st *sessionTree) Delete() error { st.isClaiming = false - if err := st.treeStore.ClearAll(); err != nil { - return err - } + // NB: We used to call `st.treeStore.ClearAll()` here. + // This was intentionally removed to lower the IO load. + // When the database is closed, it is deleted it from disk right away. if err := st.treeStore.Stop(); err != nil { return err diff --git a/tests/integration/tokenomics/relay_mining_difficulty_test.go b/tests/integration/tokenomics/relay_mining_difficulty_test.go index 9a6dda60e..3b3a2d876 100644 --- a/tests/integration/tokenomics/relay_mining_difficulty_test.go +++ b/tests/integration/tokenomics/relay_mining_difficulty_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/pokt-network/smt" - "github.com/pokt-network/smt/kvstore/badger" + "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" @@ -175,7 +175,7 @@ func prepareSMST( // Generating an ephemeral tree & spec just so we can submit // a proof of the right size. // TODO_TECHDEBT(#446): Centralize the configuration for the SMT spec. - kvStore, err := badger.NewKVStore("") + kvStore, err := pebble.NewKVStore("") require.NoError(t, err) // NB: A signed mined relay is a MinedRelay type with the appropriate