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

feat(tools/benchmark): introduce benchmark module #22778

Merged
merged 30 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f4834de
initial x/benchmark
kocubinski Dec 4, 2024
e4331b5
build works
kocubinski Dec 5, 2024
9a846dc
fix import
kocubinski Dec 5, 2024
e605381
add provider
kocubinski Dec 5, 2024
747802c
do not test migrations for x/benchmark
kocubinski Dec 5, 2024
07d3c37
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 5, 2024
c481721
cleaner filter
kocubinski Dec 5, 2024
4b0dbdc
Add README and CHANGELOG
kocubinski Dec 5, 2024
ca47403
mv x/benchmark -> tools/
kocubinski Dec 5, 2024
554408d
fix proto gen
kocubinski Dec 5, 2024
f9c3575
go mod tidy all
kocubinski Dec 5, 2024
611e9d1
add CI entries
kocubinski Dec 5, 2024
ba608a3
fix(confix): correctly distinguish server/v2 config
kocubinski Dec 5, 2024
777966e
Merge branch 'kocu/server-v2-config' into kocu/x-benchmark-v2
kocubinski Dec 5, 2024
c18378d
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 8, 2024
f2e9c0d
improve rate logging
kocubinski Dec 8, 2024
5d0e511
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 10, 2024
0693d8c
go mod tidy all
kocubinski Dec 10, 2024
91d4291
add comments, some review fixes
kocubinski Dec 11, 2024
1d25773
fix init genesis order
kocubinski Dec 11, 2024
616b952
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 11, 2024
7a086b1
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 11, 2024
256ca93
a store/v1 replace directive is required
kocubinski Dec 11, 2024
a9f1534
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 11, 2024
9b504b8
lint fixes
kocubinski Dec 11, 2024
1384bc6
fix gosec linter error in simd/testnet
kocubinski Dec 12, 2024
1ee54b5
lint fix
kocubinski Dec 12, 2024
dc7ce93
update x/crypto
kocubinski Dec 12, 2024
381cabf
broadcast async
kocubinski Dec 12, 2024
9d555d3
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocu/x-bench…
kocubinski Dec 12, 2024
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,608 changes: 1,608 additions & 0 deletions api/cosmos/benchmark/module/v1/module.pulsar.go

Large diffs are not rendered by default.

928 changes: 928 additions & 0 deletions api/cosmos/benchmark/v1/benchmark.pulsar.go

Large diffs are not rendered by default.

1,256 changes: 1,256 additions & 0 deletions api/cosmos/benchmark/v1/tx.pulsar.go

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions api/cosmos/benchmark/v1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scripts/init-simapp-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $SIMD_BIN config set client chain-id simapp-v2-chain
$SIMD_BIN config set client keyring-backend test
$SIMD_BIN config set client keyring-default-keyname alice
$SIMD_BIN config set app rest.enable true
$SIMD_BIN config set app telemetry.prometheus-retention-time 600
$SIMD_BIN keys add alice --indiscreet
$SIMD_BIN keys add bob --indiscreet
$SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain
Expand Down
17 changes: 17 additions & 0 deletions simapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1"
bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1"
benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1"
kocubinski marked this conversation as resolved.
Show resolved Hide resolved
circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1"
consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1"
distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1"
Expand Down Expand Up @@ -39,6 +40,7 @@ import (
_ "cosmossdk.io/x/bank/v2" // import for side-effects
bankv2types "cosmossdk.io/x/bank/v2/types"
bankmodulev2 "cosmossdk.io/x/bank/v2/types/module"
benchmark "cosmossdk.io/x/benchmark/module"
_ "cosmossdk.io/x/circuit" // import for side-effects
circuittypes "cosmossdk.io/x/circuit/types"
_ "cosmossdk.io/x/consensus" // import for side-effects
Expand Down Expand Up @@ -174,6 +176,7 @@ var (
circuittypes.ModuleName,
pooltypes.ModuleName,
epochstypes.ModuleName,
benchmark.ModuleName,
},
// When ExportGenesis is not specified, the export genesis module order
// is equal to the init genesis order
Expand Down Expand Up @@ -296,6 +299,20 @@ var (
Name: bankv2types.ModuleName,
Config: appconfig.WrapAny(&bankmodulev2.Module{}),
},
{
Name: benchmark.ModuleName,
Config: appconfig.WrapAny(&benchmarkmodulev1.Module{
GenesisParams: &benchmarkmodulev1.GeneratorParams{
Seed: 34,
BucketCount: 2,
GenesisCount: 500_000,
KeyMean: 64,
KeyStdDev: 12,
ValueMean: 1024,
ValueStdDev: 256,
},
}),
},
},
})
)
2 changes: 2 additions & 0 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ require (

require (
cosmossdk.io/indexer/postgres v0.0.0-20241128094659-bd76b47e1d8b
cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000
github.com/jackc/pgx/v5 v5.7.1
)

Expand Down Expand Up @@ -260,6 +261,7 @@ replace (
cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig
cosmossdk.io/x/authz => ../x/authz
cosmossdk.io/x/bank => ../x/bank
cosmossdk.io/x/benchmark => ../x/benchmark
cosmossdk.io/x/circuit => ../x/circuit
cosmossdk.io/x/consensus => ../x/consensus
cosmossdk.io/x/distribution => ../x/distribution
Expand Down
19 changes: 18 additions & 1 deletion simapp/v2/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1"
bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1"
benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1"
circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1"
consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1"
distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1"
Expand Down Expand Up @@ -39,6 +40,7 @@ import (
_ "cosmossdk.io/x/bank/v2" // import for side-effects
bankv2types "cosmossdk.io/x/bank/v2/types"
bankmodulev2 "cosmossdk.io/x/bank/v2/types/module"
benchmark "cosmossdk.io/x/benchmark/module"
_ "cosmossdk.io/x/circuit" // import for side-effects
circuittypes "cosmossdk.io/x/circuit/types"
_ "cosmossdk.io/x/consensus" // import for side-effects
Expand Down Expand Up @@ -173,6 +175,7 @@ var (
circuittypes.ModuleName,
pooltypes.ModuleName,
epochstypes.ModuleName,
benchmark.ModuleName,
},
// When ExportGenesis is not specified, the export genesis module order
// is equal to the init genesis order
Expand All @@ -181,7 +184,7 @@ var (
// OrderMigrations: []string{},
// TODO GasConfig was added to the config in runtimev2. Where/how was it set in v1?
GasConfig: &runtimev2.GasConfig{
ValidateTxGasLimit: 100_000,
ValidateTxGasLimit: 10_000_000,
kocubinski marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

should leave a comment that is this for testing only. Lots of teams copy our code without double checking it

QueryGasLimit: 100_000,
SimulationGasLimit: 100_000,
},
Expand Down Expand Up @@ -301,6 +304,20 @@ var (
Name: bankv2types.ModuleName,
Config: appconfig.WrapAny(&bankmodulev2.Module{}),
},
{
Name: benchmark.ModuleName,
Config: appconfig.WrapAny(&benchmarkmodulev1.Module{
GenesisParams: &benchmarkmodulev1.GeneratorParams{
Seed: 34,
BucketCount: 2,
GenesisCount: 5_000_000,
KeyMean: 64,
KeyStdDev: 12,
ValueMean: 1024,
ValueStdDev: 256,
},
}),
},
},
})
)
2 changes: 2 additions & 0 deletions simapp/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ require (
cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000
cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000
cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000
cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000
)

require (
Expand Down Expand Up @@ -259,6 +260,7 @@ replace (
cosmossdk.io/x/accounts/defaults/multisig => ../../x/accounts/defaults/multisig
cosmossdk.io/x/authz => ../../x/authz
cosmossdk.io/x/bank => ../../x/bank
cosmossdk.io/x/benchmark => ../../x/benchmark
cosmossdk.io/x/circuit => ../../x/circuit
cosmossdk.io/x/consensus => ../../x/consensus
cosmossdk.io/x/distribution => ../../x/distribution
Expand Down
2 changes: 2 additions & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ require (
cosmossdk.io/indexer/postgres v0.1.0 // indirect
cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect
cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 // indirect
cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 // indirect
cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect
cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
Expand Down Expand Up @@ -264,6 +265,7 @@ replace (
cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig
cosmossdk.io/x/authz => ../x/authz
cosmossdk.io/x/bank => ../x/bank
cosmossdk.io/x/benchmark => ../x/benchmark
cosmossdk.io/x/circuit => ../x/circuit
cosmossdk.io/x/consensus => ../x/consensus
cosmossdk.io/x/distribution => ../x/distribution
Expand Down
Loading
Loading