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: support multi gRPC query clients serve with old binary (backport: #1603) #308

Open
wants to merge 5 commits into
base: release/v0.20.x-cronos
Choose a base branch
from

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Aug 7, 2023

for more info

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Comment on lines +334 to +336
for k, v := range data {
backupGRPCBlockAddressBlockRange[v] = k
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +17 to +23
for blocks, client := range b.backupQueryClients {
// b1-b2 -> g1
// b3-b4 -> g2
if int64(blocks[0]) <= height && int64(blocks[1]) >= height {
return client
}
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +198 to +204
for key, conn := range backupGRPCClientConns {
backend.backupQueryClients[key] = &rpctypes.QueryClient{
ServiceClient: tx.NewServiceClient(conn),
QueryClient: evmtypes.NewQueryClient(conn),
FeeMarket: feemarkettypes.NewQueryClient(conn),
}
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +474 to +492
for k, address := range grpcBlockAddresses {
grpcAddr, err := parseGrpcAddress(address)
if err != nil {
return err
}
c, err := grpc.Dial(
grpcAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(
grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()),
grpc.MaxCallRecvMsgSize(maxRecvMsgSize),
grpc.MaxCallSendMsgSize(maxSendMsgSize),
),
)
if err != nil {
return err
}
backupGRPCClientConns[k] = c
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 5
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #308 (9608ad8) into release/v0.20.x-cronos (0ea7b86) will decrease coverage by 0.14%.
Report is 2 commits behind head on release/v0.20.x-cronos.
The diff coverage is 38.28%.

Impacted file tree graph

@@                    Coverage Diff                     @@
##           release/v0.20.x-cronos     #308      +/-   ##
==========================================================
- Coverage                   52.56%   52.43%   -0.14%     
==========================================================
  Files                         113      113              
  Lines                       11073    11131      +58     
==========================================================
+ Hits                         5820     5836      +16     
- Misses                       5006     5045      +39     
- Partials                      247      250       +3     
Files Changed Coverage Δ
rpc/backend/call_tx.go 0.00% <0.00%> (ø)
rpc/backend/node_info.go 0.00% <0.00%> (ø)
rpc/backend/sign_tx.go 0.00% <ø> (ø)
rpc/namespaces/ethereum/eth/filters/api.go 0.00% <0.00%> (ø)
rpc/backend/tracing.go 1.44% <16.66%> (+1.44%) ⬆️
rpc/backend/backend.go 41.02% <30.00%> (-5.65%) ⬇️
x/evm/types/utils.go 62.16% <30.76%> (-10.57%) ⬇️
server/config/config.go 22.10% <40.00%> (-1.06%) ⬇️
rpc/backend/chain_info.go 9.40% <50.00%> (+0.82%) ⬆️
rpc/backend/account_info.go 76.97% <100.00%> (+0.30%) ⬆️
... and 1 more

@mmsqe mmsqe marked this pull request as ready for review August 7, 2023 02:29
@mmsqe mmsqe requested a review from yihuang August 7, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant