diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index 30ccd55d8639..864280a7c5c4 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -2,12 +2,12 @@ module cosmossdk.io/runtime/v2 go 1.23 -// server v2 integration -replace ( - cosmossdk.io/server/v2/appmanager => ../../server/v2/appmanager - cosmossdk.io/server/v2/stf => ../../server/v2/stf - cosmossdk.io/store/v2 => ../../store/v2 -) +// server v2 integration (uncomment during development, but comment before release) +// replace ( +// cosmossdk.io/server/v2/appmanager => ../../server/v2/appmanager +// cosmossdk.io/server/v2/stf => ../../server/v2/stf +// cosmossdk.io/store/v2 => ../../store/v2 +// ) require ( cosmossdk.io/api v0.8.0-rc.1 @@ -15,9 +15,9 @@ require ( cosmossdk.io/depinject v1.1.0 cosmossdk.io/log v1.5.0 cosmossdk.io/schema v1.0.0 - cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 - cosmossdk.io/server/v2/stf v0.0.0-00010101000000-000000000000 - cosmossdk.io/store/v2 v2.0.0-00010101000000-000000000000 + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 + cosmossdk.io/server/v2/stf v1.0.0-beta.1 + cosmossdk.io/store/v2 v2.0.0-beta.1 cosmossdk.io/x/tx v1.0.0-alpha.3 github.com/cosmos/gogoproto v1.7.0 github.com/stretchr/testify v1.10.0 diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index 09abd49cc750..95972eec1666 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -16,6 +16,12 @@ cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 h1:EISWki+z9SDAt3OJnUl2y5Ow4qjOb+epYjLb1C7CN/E= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= +cosmossdk.io/server/v2/stf v1.0.0-beta.1 h1:s+nRgjhKVC08/qpr51eFVodLhyyQ9ASvJBanLBfQVNI= +cosmossdk.io/server/v2/stf v1.0.0-beta.1/go.mod h1:nfjihbofEF2GGadkYSFmgy5tqrAnSrmGcXUDZmmWyi8= +cosmossdk.io/store/v2 v2.0.0-beta.1 h1:p1fdZ9uNijhpXZXdqs0QS6NmXNDVPNyT4DHV4yQnF64= +cosmossdk.io/store/v2 v2.0.0-beta.1/go.mod h1:qHQmf/9mnsXwo/Ypp2u2Zs6BmkYcx1R/Jrpyn9Ro13A= cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ= cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= diff --git a/server/v2/CHANGELOG.md b/server/v2/CHANGELOG.md new file mode 100644 index 000000000000..f5663b4f8b21 --- /dev/null +++ b/server/v2/CHANGELOG.md @@ -0,0 +1,27 @@ + + +# Changelog + +## [Unreleased] + +## [v2.0.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/server/v2.0.0-beta.1) + +Initial tag of `cosmossdk.io/server/v2`. diff --git a/server/v2/api/telemetry/config.go b/server/v2/api/telemetry/config.go index 277b030c8a33..ac203cbb7f56 100644 --- a/server/v2/api/telemetry/config.go +++ b/server/v2/api/telemetry/config.go @@ -59,3 +59,20 @@ type Config struct { // Datadog. Only utilized if MetricsSink is set to "dogstatsd". DatadogHostname string `mapstructure:"datadog-hostname" toml:"data-dog-hostname" comment:"DatadogHostname defines the hostname to use when emitting metrics to Datadog. Only utilized if MetricsSink is set to \"dogstatsd\"."` } + +// CfgOption is a function that allows to overwrite the default server configuration. +type CfgOption func(*Config) + +// OverwriteDefaultConfig overwrites the default config with the new config. +func OverwriteDefaultConfig(newCfg *Config) CfgOption { + return func(cfg *Config) { + *cfg = *newCfg + } +} + +// Disable the telemetry server by default (default enabled). +func Disable() CfgOption { + return func(cfg *Config) { + cfg.Enable = false + } +} diff --git a/server/v2/api/telemetry/server.go b/server/v2/api/telemetry/server.go index 1236f9112ba0..62649c98861b 100644 --- a/server/v2/api/telemetry/server.go +++ b/server/v2/api/telemetry/server.go @@ -21,14 +21,15 @@ var ( const ServerName = "telemetry" type Server[T transaction.Tx] struct { - logger log.Logger - config *Config - server *http.Server - metrics *Metrics + logger log.Logger + config *Config + cfgOptions []CfgOption + server *http.Server + metrics *Metrics } // New creates a new telemetry server. -func New[T transaction.Tx](cfg server.ConfigMap, logger log.Logger, enableTelemetry func()) (*Server[T], error) { +func New[T transaction.Tx](cfg server.ConfigMap, logger log.Logger, enableTelemetry func(), cfgOptions ...CfgOption) (*Server[T], error) { srv := &Server[T]{} serverCfg := srv.Config().(*Config) if len(cfg) > 0 { @@ -37,6 +38,7 @@ func New[T transaction.Tx](cfg server.ConfigMap, logger log.Logger, enableTeleme } } srv.config = serverCfg + srv.cfgOptions = cfgOptions srv.logger = logger.With(log.ModuleKey, srv.Name()) if enableTelemetry == nil { @@ -66,6 +68,15 @@ func New[T transaction.Tx](cfg server.ConfigMap, logger log.Logger, enableTeleme return srv, nil } +// NewWithConfigOptions creates a new telemetry server with the provided config options. +// It is *not* a fully functional server (since it has been created without dependencies) +// The returned server should only be used to get and set configuration. +func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *Server[T] { + return &Server[T]{ + cfgOptions: opts, + } +} + // Name returns the server name. func (s *Server[T]) Name() string { return ServerName @@ -73,7 +84,13 @@ func (s *Server[T]) Name() string { func (s *Server[T]) Config() any { if s.config == nil || s.config.Address == "" { - return DefaultConfig() + cfg := DefaultConfig() + // overwrite the default config with the provided options + for _, opt := range s.cfgOptions { + opt(cfg) + } + + return cfg } return s.config diff --git a/server/v2/appmanager/CHANGELOG.md b/server/v2/appmanager/CHANGELOG.md new file mode 100644 index 000000000000..7724ac8eba9a --- /dev/null +++ b/server/v2/appmanager/CHANGELOG.md @@ -0,0 +1,27 @@ + + +# Changelog + +## [Unreleased] + +## [v1.0.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/server/v2/appmanager%2Fv1.0.0-beta.1) + +Initial tag of `cosmossdk.io/server/v2/appmanager`. diff --git a/server/v2/cometbft/CHANGELOG.md b/server/v2/cometbft/CHANGELOG.md new file mode 100644 index 000000000000..845c29b0dc08 --- /dev/null +++ b/server/v2/cometbft/CHANGELOG.md @@ -0,0 +1,27 @@ + + +# Changelog + +## [Unreleased] + +## [v1.0.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/server/v2/cometbft%2Fv1.0.0-beta.1) + +Initial tag of `cosmossdk.io/server/v2/cometbft`. diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 2cb6b2b15652..b76cf511ea79 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -21,10 +21,10 @@ require ( cosmossdk.io/errors/v2 v2.0.0 cosmossdk.io/log v1.5.0 cosmossdk.io/schema v1.0.0 - cosmossdk.io/server/v2 v2.0.0-00010101000000-000000000000 - cosmossdk.io/server/v2/appmanager v0.0.0-20240802110823-cffeedff643d - cosmossdk.io/server/v2/stf v0.0.0-20240708142107-25e99c54bac1 - cosmossdk.io/store/v2 v2.0.0-00010101000000-000000000000 + cosmossdk.io/server/v2 v2.0.0-beta.1 + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 + cosmossdk.io/server/v2/stf v1.0.0-beta.1 + cosmossdk.io/store/v2 v2.0.0-beta.1 cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 github.com/cometbft/cometbft v1.0.0 github.com/cometbft/cometbft/api v1.0.0 diff --git a/server/v2/go.mod b/server/v2/go.mod index 5d66e2e20e16..6816b30ee2c8 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -2,20 +2,19 @@ module cosmossdk.io/server/v2 go 1.23 -replace ( - cosmossdk.io/server/v2/appmanager => ./appmanager - cosmossdk.io/server/v2/stf => ./stf - cosmossdk.io/store/v2 => ../../store/v2 - cosmossdk.io/store/v2/db => ../../store/v2/db -) +// server v2 integration (uncomment during development, but comment before release) +// replace ( +// cosmossdk.io/server/v2/appmanager => ./appmanager +// cosmossdk.io/store/v2 => ../../store/v2 +// ) require ( cosmossdk.io/api v0.8.0-rc.1 cosmossdk.io/core v1.0.0-alpha.6 cosmossdk.io/core/testing v0.0.1 cosmossdk.io/log v1.5.0 - cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 - cosmossdk.io/store/v2 v2.0.0-00010101000000-000000000000 + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 + cosmossdk.io/store/v2 v2.0.0-beta.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogogateway v1.2.0 github.com/cosmos/gogoproto v1.7.0 diff --git a/server/v2/go.sum b/server/v2/go.sum index 171655ba2a89..85bda6f5dd8c 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -12,6 +12,10 @@ cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 h1:EISWki+z9SDAt3OJnUl2y5Ow4qjOb+epYjLb1C7CN/E= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= +cosmossdk.io/store/v2 v2.0.0-beta.1 h1:p1fdZ9uNijhpXZXdqs0QS6NmXNDVPNyT4DHV4yQnF64= +cosmossdk.io/store/v2 v2.0.0-beta.1/go.mod h1:qHQmf/9mnsXwo/Ypp2u2Zs6BmkYcx1R/Jrpyn9Ro13A= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= diff --git a/server/v2/stf/CHANGELOG.md b/server/v2/stf/CHANGELOG.md new file mode 100644 index 000000000000..cdf472391f7e --- /dev/null +++ b/server/v2/stf/CHANGELOG.md @@ -0,0 +1,27 @@ + + +# Changelog + +## [Unreleased] + +## [v1.0.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/server/v2/stf%2Fv1.0.0-beta.1) + +Initial tag of `cosmossdk.io/server/v2/stf`. diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 8e62fd71d471..08fe8b53438f 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -7,14 +7,19 @@ require ( cosmossdk.io/client/v2 v2.0.0-beta.6 cosmossdk.io/core v1.0.0-alpha.6 cosmossdk.io/depinject v1.1.0 + cosmossdk.io/indexer/postgres v0.1.0 cosmossdk.io/log v1.5.0 cosmossdk.io/math v1.4.0 cosmossdk.io/runtime/v2 v2.0.0-00010101000000-000000000000 - cosmossdk.io/server/v2 v2.0.0-20240718121635-a877e3e8048a + cosmossdk.io/server/v2 v2.0.0-beta.1 cosmossdk.io/server/v2/cometbft v0.0.0-20241015140036-ee3d320eaa55 cosmossdk.io/store/v2 v2.0.0 + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e + 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/authz v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f @@ -34,6 +39,7 @@ require ( github.com/cometbft/cometbft v1.0.0 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.53.0 + github.com/jackc/pgx/v5 v5.7.1 github.com/spf13/cast v1.7.1 // indirect github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 @@ -42,15 +48,6 @@ require ( google.golang.org/protobuf v1.36.0 ) -require ( - cosmossdk.io/indexer/postgres v0.1.0 - cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 - 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 - github.com/jackc/pgx/v5 v5.7.1 -) - require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 // indirect @@ -65,8 +62,8 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0 // indirect cosmossdk.io/schema v1.0.0 // indirect - cosmossdk.io/server/v2/appmanager v0.0.0-20240802110823-cffeedff643d // indirect - cosmossdk.io/server/v2/stf v0.0.0-20240708142107-25e99c54bac1 // indirect + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 // indirect + cosmossdk.io/server/v2/stf v1.0.0-beta.1 // indirect cosmossdk.io/store v1.10.0-rc.1 // indirect cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/simapp/v2/simdv2/cmd/testnet.go b/simapp/v2/simdv2/cmd/testnet.go index 657d37f0f532..9453a117b54f 100644 --- a/simapp/v2/simdv2/cmd/testnet.go +++ b/simapp/v2/simdv2/cmd/testnet.go @@ -22,6 +22,7 @@ import ( "cosmossdk.io/server/v2/api/grpc" "cosmossdk.io/server/v2/api/grpcgateway" "cosmossdk.io/server/v2/api/rest" + "cosmossdk.io/server/v2/api/telemetry" "cosmossdk.io/server/v2/cometbft" "cosmossdk.io/server/v2/store" banktypes "cosmossdk.io/x/bank/types" @@ -183,10 +184,11 @@ func initTestnetFiles[T transaction.Tx]( genFiles []string ) const ( - rpcPort = 26657 - apiPort = 1317 - grpcPort = 9090 - restPort = 8080 + rpcPort = 26657 + apiPort = 1317 + grpcPort = 9090 + restPort = 8080 + telemetryPort = 7180 ) p2pPortStart := 26656 @@ -197,6 +199,7 @@ func initTestnetFiles[T transaction.Tx]( grpcConfig := grpc.DefaultConfig() grpcgatewayConfig := grpcgateway.DefaultConfig() restConfig := rest.DefaultConfig() + telemetryConfig := telemetry.DefaultConfig() if args.singleMachine { portOffset = i @@ -221,6 +224,11 @@ func initTestnetFiles[T transaction.Tx]( Enable: true, Address: fmt.Sprintf("127.0.0.1:%d", restPort+portOffset), } + + telemetryConfig = &telemetry.Config{ + Enable: true, + Address: fmt.Sprintf("127.0.0.1:%d", telemetryPort+portOffset), + } } nodeDirName := fmt.Sprintf("%s%d", args.nodeDirPrefix, i) @@ -356,7 +364,8 @@ func initTestnetFiles[T transaction.Tx]( grpcServer := grpc.NewWithConfigOptions[T](grpc.OverwriteDefaultConfig(grpcConfig)) grpcgatewayServer := grpcgateway.NewWithConfigOptions[T](grpcgateway.OverwriteDefaultConfig(grpcgatewayConfig)) restServer := rest.NewWithConfigOptions[T](rest.OverwriteDefaultConfig(restConfig)) - server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer, grpcgatewayServer, restServer) + telemetryServer := telemetry.NewWithConfigOptions[T](telemetry.OverwriteDefaultConfig(telemetryConfig)) + server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer, grpcgatewayServer, restServer, telemetryServer) err = server.WriteConfig(filepath.Join(nodeDir, "config")) if err != nil { return err diff --git a/store/v2/CHANGELOG.md b/store/v2/CHANGELOG.md index 00e9ec02ae68..ccc53fee4ded 100644 --- a/store/v2/CHANGELOG.md +++ b/store/v2/CHANGELOG.md @@ -25,14 +25,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -### Features +## [v2.0.0-beta.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store/v2.0.0-beta.1) -* [#17294](https://github.com/cosmos/cosmos-sdk/pull/17294) Add snapshot manager Close method. - -### Improvements - -* [#17158](https://github.com/cosmos/cosmos-sdk/pull/17158) Start the goroutine after need to create a snapshot. - -### Bug fixes - -* [#18651](https://github.com/cosmos/cosmos-sdk/pull/18651) Propagate iavl.MutableTree.Remove errors firstly to the caller instead of returning a synthesized error firstly. +Initial tag of `cosmossdk.io/store/v2`. diff --git a/tests/go.mod b/tests/go.mod index 948f6bf35031..12bbc8a43f30 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -32,8 +32,8 @@ require ( require ( cosmossdk.io/core/testing v0.0.1 cosmossdk.io/runtime/v2 v2.0.0-20240911143651-72620a577660 - cosmossdk.io/server/v2/stf v0.0.0-00010101000000-000000000000 - cosmossdk.io/store/v2 v2.0.0-00010101000000-000000000000 + cosmossdk.io/server/v2/stf v1.0.0-beta.1 + cosmossdk.io/store/v2 v2.0.0-beta.1 cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 @@ -70,7 +70,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0 // indirect cosmossdk.io/schema v1.0.0 // indirect - cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect