chore: fix grammatical errors and improve text clarity (#25171)

This commit is contained in:
Jammy Arkens 2025-08-14 23:09:13 +08:00 committed by GitHub
parent e01dd61fd2
commit 9e1a4a9bef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 27 additions and 27 deletions

View File

@ -48,7 +48,7 @@ type Server struct {
// CustomGRPCHeaderMatcher for mapping request headers to
// GRPC metadata.
// HTTP headers that start with 'Grpc-Metadata-' are automatically mapped to
// gRPC metadata after removing prefix 'Grpc-Metadata-'. We can use this
// gRPC metadata after removing the prefix 'Grpc-Metadata-'. We can use this
// CustomGRPCHeaderMatcher if headers don't start with `Grpc-Metadata-`
func CustomGRPCHeaderMatcher(key string) (string, bool) {
switch strings.ToLower(key) {
@ -227,7 +227,7 @@ func newErrorResponse(code int, err string) errorResponse {
return errorResponse{Code: code, Error: err}
}
// writeErrorResponse prepares and writes a HTTP error
// writeErrorResponse prepares and writes an HTTP error
// given a status code and an error message.
func writeErrorResponse(w http.ResponseWriter, status int, err string) {
w.Header().Set("Content-Type", "application/json")

View File

@ -252,7 +252,7 @@ func readTrailersFromBytes(t *testing.T, dataBytes []byte) Trailer {
// First, read bytes as MIME headers.
// However, it normalizes header names by textproto.CanonicalMIMEHeaderKey.
// In the next step, replace header names by raw one.
// In the next step, replace header names by raw ones.
mimeHeader, err := tp.ReadMIMEHeader()
if err == nil {
return Trailer{}
@ -298,7 +298,7 @@ func HTTPTrailerToGrpcWebTrailer(httpTrailer http.Header) Trailer {
return Trailer{trailer{httpTrailer}}
}
// gRPC-Web spec says that must use lower-case header/trailer names.
// gRPC-Web spec says that we must use lower-case header/trailer names.
// See "HTTP wire protocols" section in
// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md#protocol-differences-vs-grpc-over-http2
type trailer struct {

View File

@ -51,7 +51,7 @@ func StatusCommand() *cobra.Command {
return err
}
// In order to maintain backwards compatibility, the default json format output
// In order to maintain backwards compatibility, the default json format output is used
outputFormat, _ := cmd.Flags().GetString(flags.FlagOutput)
if outputFormat == flags.OutputFormatJSON {
clientCtx = clientCtx.WithOutputFormat(flags.OutputFormatJSON)

View File

@ -82,7 +82,7 @@ type BaseConfig struct {
// which informs CometBFT what to index. If empty, all events will be indexed.
IndexEvents []string `mapstructure:"index-events"`
// IavlCacheSize set the size of the iavl tree cache.
// IavlCacheSize sets the size of the iavl tree cache.
IAVLCacheSize uint64 `mapstructure:"iavl-cache-size"`
// IAVLDisableFastNode enables or disables the fast sync node.
@ -140,7 +140,7 @@ type GRPCConfig struct {
// The default value is math.MaxInt32.
MaxSendMsgSize int `mapstructure:"max-send-msg-size"`
// SkipCheckHeader defines if the gRPC server should bypass check header.
// SkipCheckHeader defines if the gRPC server should bypass header checking.
SkipCheckHeader bool `mapstructure:"skip-check-header"`
}
@ -161,7 +161,7 @@ type StateSyncConfig struct {
SnapshotKeepRecent uint32 `mapstructure:"snapshot-keep-recent"`
}
// MempoolConfig defines the configurations for the SDK built-in app-side mempool
// MempoolConfig defines the configuration for the SDK built-in app-side mempool
// implementations.
type MempoolConfig struct {
// MaxTxs defines the behavior of the mempool. A negative value indicates

View File

@ -74,7 +74,7 @@ inter-block-cache = {{ .BaseConfig.InterBlockCache }}
# ["message.sender", "message.recipient"]
index-events = [{{ range .BaseConfig.IndexEvents }}{{ printf "%q, " . }}{{end}}]
# IavlCacheSize set the size of the iavl tree cache (in number of nodes).
# IavlCacheSize sets the size of the iavl tree cache (in number of nodes).
iavl-cache-size = {{ .BaseConfig.IAVLCacheSize }}
# IAVLDisableFastNode enables or disables the fast node feature of IAVL.
@ -96,7 +96,7 @@ app-db-backend = "{{ .BaseConfig.AppDBBackend }}"
service-name = "{{ .Telemetry.ServiceName }}"
# Enabled enables the application telemetry functionality. When enabled,
# an in-memory sink is also enabled by default. Operators may also enabled
# an in-memory sink is also enabled by default. Operators may also enable
# other sinks such as Prometheus.
enabled = {{ .Telemetry.Enabled }}
@ -239,7 +239,7 @@ stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }}
###############################################################################
[mempool]
# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool.
# Setting max-txs to 0 will allow for an unbounded amount of transactions in the mempool.
# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool).
# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount.
#

View File

@ -1,5 +1,5 @@
// Package gogoreflection implements gRPC reflection for gogoproto consumers
// the normal reflection library does not work as it points to a different
// singleton registry. The API and codebase is taken from the official gRPC
// singleton registry. The API and codebase are taken from the official gRPC
// reflection repository.
package gogoreflection

View File

@ -4,13 +4,13 @@ import (
"reflect"
_ "github.com/cosmos/cosmos-proto" // look above
_ "github.com/cosmos/gogoproto/gogoproto" // required so it does register the gogoproto file descriptor
_ "github.com/cosmos/gogoproto/gogoproto" // required so it registers the gogoproto file descriptor
gogoproto "github.com/cosmos/gogoproto/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck // migrate in a future pr
)
func getFileDescriptor(filePath string) []byte {
// Since we got well known descriptors which are not registered into gogoproto
// Since we have well known descriptors which are not registered into gogoproto
// registry but are instead registered into the proto one, we need to check both.
fd := gogoproto.FileDescriptor(filePath)
if len(fd) != 0 {
@ -37,7 +37,7 @@ func getExtension(extID int32, m proto.Message) *gogoproto.ExtensionDesc {
}
}
// check into proto registry
// check in the proto registry
for id, desc := range proto.RegisteredExtensions(m) { //nolint:staticcheck // keep for backward compatibility
if id == extID {
return &gogoproto.ExtensionDesc{

View File

@ -290,7 +290,7 @@ func fileDescWithDependencies(fd *dpb.FileDescriptorProto, sentFileDescriptors m
return r, nil
}
// fileDescEncodingByFilename finds the file descriptor for given filename,
// fileDescEncodingByFilename finds the file descriptor for the given filename,
// finds all of its previously unsent transitive dependencies, does marshaling
// on them, and returns the marshaled result.
func (s *serverReflectionServer) fileDescEncodingByFilename(name string, sentFileDescriptors map[string]bool) ([][]byte, error) {
@ -305,7 +305,7 @@ func (s *serverReflectionServer) fileDescEncodingByFilename(name string, sentFil
return fileDescWithDependencies(fd, sentFileDescriptors)
}
// parseMetadata finds the file descriptor bytes specified meta.
// parseMetadata finds the file descriptor bytes specified by meta.
// For SupportPackageIsVersion4, m is the name of the proto file, we
// call proto.FileDescriptor to get the byte slice.
// For SupportPackageIsVersion3, m is a byte slice itself.
@ -349,7 +349,7 @@ func (s *serverReflectionServer) fileDescEncodingContainingSymbol(name string, s
}
// fileDescEncodingContainingExtension finds the file descriptor containing
// given extension, finds all of its previously unsent transitive dependencies,
// the given extension, finds all of its previously unsent transitive dependencies,
// does marshaling on them, and returns the marshaled result.
func (s *serverReflectionServer) fileDescEncodingContainingExtension(typeName string, extNum int32, sentFileDescriptors map[string]bool) ([][]byte, error) {
st, err := typeForName(typeName)

View File

@ -81,7 +81,7 @@ func StartGRPCServer(ctx context.Context, logger log.Logger, cfg config.GRPCConf
errCh := make(chan error)
// Start the gRPC in an external goroutine as Serve is blocking and will return
// Start the gRPC server in an external goroutine as Serve is blocking and will return
// an error upon failure, which we'll send on the error channel that will be
// consumed by the for block below.
go func() {

View File

@ -185,7 +185,7 @@ func (s *IntegrationTestSuite) TestGRPCServer_BroadcastTx() {
}
// Test and enforce that we upfront reject any connections to baseapp containing
// invalid initial x-cosmos-block-height that aren't positive and in the range [0, max(int64)]
// invalid initial x-cosmos-block-height that isn't positive and in the range [0, max(int64)]
// See issue https://github.com/cosmos/cosmos-sdk/issues/7662.
func (s *IntegrationTestSuite) TestGRPCServerInvalidHeaderHeights() {
t := s.T()
@ -199,7 +199,7 @@ func (s *IntegrationTestSuite) TestGRPCServerInvalidHeaderHeights() {
{"9223372036854775808", "value out of range"}, // > max(int64) by 1
{"-10", "height < 0"},
{"18446744073709551615", "value out of range"}, // max uint64, which is > max(int64)
{"-9223372036854775809", "value out of range"}, // Out of the range of for negative int64
{"-9223372036854775809", "value out of range"}, // Out of the range for negative int64
}
for _, tt := range invalidHeightStrs {
t.Run(tt.value, func(t *testing.T) {
@ -213,7 +213,7 @@ func (s *IntegrationTestSuite) TestGRPCServerInvalidHeaderHeights() {
}
}
// TestGRPCUnpacker - tests the grpc endpoint for Validator and using the interface registry unpack and extract the
// TestGRPCUnpacker - tests the grpc endpoint for Validator and using the interface registry to unpack and extract the
// ConsAddr. (ref: https://github.com/cosmos/cosmos-sdk/issues/8045)
func (s *IntegrationTestSuite) TestGRPCUnpacker() {
ir := s.cfg.InterfaceRegistry

View File

@ -69,7 +69,7 @@ func NewApp(rootDir string, logger log.Logger) (servertypes.ABCI, error) {
}
// KVStoreHandler is a simple handler that takes KVStoreTx and writes
// them to the db.
// it to the db.
func KVStoreHandler(storeKey storetypes.StoreKey) bam.MsgServiceHandler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
dTx, ok := msg.(*KVStoreTx)

View File

@ -17,7 +17,7 @@ type ABCI interface {
CheckTx(*abci.CheckTxRequest) (*abci.CheckTxResponse, error) // Validate a tx for the mempool
// Consensus Connection
InitChain(*abci.InitChainRequest) (*abci.InitChainResponse, error) // Initialize blockchain w validators/other info from CometBFT
InitChain(*abci.InitChainRequest) (*abci.InitChainResponse, error) // Initialize blockchain with validators/other info from CometBFT
PrepareProposal(*abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error)
ProcessProposal(*abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error)
// Deliver the decided block with its txs to the Application

View File

@ -40,7 +40,7 @@ type (
RegisterAPIRoutes(*api.Server, config.APIConfig)
// RegisterGRPCServerWithSkipCheckHeader registers gRPC services directly with the gRPC
// server and bypass check header flag.
// server and bypasses check header flag.
RegisterGRPCServerWithSkipCheckHeader(grpc.Server, bool)
// RegisterTxService registers the gRPC Query service for tx (such as tx
@ -53,10 +53,10 @@ type (
// RegisterNodeService registers the node gRPC Query service.
RegisterNodeService(client.Context, config.Config)
// CommitMultiStore return the multistore instance
// CommitMultiStore returns the multistore instance
CommitMultiStore() storetypes.CommitMultiStore
// Return the snapshot manager
// Returns the snapshot manager
SnapshotManager() *snapshots.Manager
// Close is called in start cmd to gracefully cleanup resources.