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

Problem: backup grpc clients are not supported #475

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Apr 22, 2024

Closes: #XXX

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 +299 to +318
for k, address := range cfg.JSONRPC.BackupGRPCBlockAddressBlockRange {
grpcAddr, err := srv.ParseGRPCAddress(address)
if err != nil {
continue
}

conn, err := grpc.Dial(
grpcAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(
grpc.ForceCodec(codec.NewProtoCodec(interfaceRegistry).GRPCCodec()),
grpc.MaxCallRecvMsgSize(maxRecvMsgSize),
grpc.MaxCallSendMsgSize(maxSendMsgSize),
),
)
if err != nil {
continue
}
backupQueryClients[k] = queryClientFn(conn)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +419 to +421
for k, v := range data {
backupGRPCBlockAddressBlockRange[v] = k
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +232 to +237
for blocks, client := range k.backupQueryClients {
if int64(blocks[0]) <= height && int64(blocks[1]) >= height {
params, err := client.Params(c, req)
return params, err
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +41 to +46
for blocks, client := range k.backupQueryClients {
if int64(blocks[0]) <= height && int64(blocks[1]) >= height {
params, err := client.Params(c, req)
return params, err
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@mmsqe mmsqe marked this pull request as ready for review April 29, 2024 02:26
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 40.17094% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 62.64%. Comparing base (40463e8) to head (77853d6).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #475      +/-   ##
===========================================
- Coverage    62.93%   62.64%   -0.29%     
===========================================
  Files          126      126              
  Lines         9480     9541      +61     
===========================================
+ Hits          5966     5977      +11     
- Misses        2974     3021      +47     
- Partials       540      543       +3     
Files Coverage Δ
x/evm/keeper/keeper.go 85.96% <100.00%> (+0.12%) ⬆️
x/feemarket/keeper/keeper.go 53.57% <100.00%> (+1.71%) ⬆️
x/evm/keeper/grpc_query.go 77.59% <40.00%> (-0.96%) ⬇️
x/feemarket/keeper/grpc_query.go 0.00% <0.00%> (ø)
app/app.go 73.83% <16.66%> (-3.12%) ⬇️
server/config/config.go 33.72% <42.00%> (-1.72%) ⬇️

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