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

[Access] Refactor Access RPC engines to support a single gRPC port #4217 #4411

Merged

Conversation

UlyanaAndrukhiv
Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv commented Jun 1, 2023

#4217

Context

This pull request

  • creates a new grpcserver module which includes a GrpcServer and a GrpcServerBuilder for it. GrpcServer defines a grpc server that starts once and uses in different Engines
  • refactored the Access RPC engine and state stream engine setup using the same grps server. Also small refactored Observer node's engine setup
  • refactored tests according to new changes

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

Overall, I really like this approach. Added a few comments on specifics, but you're on the right track.

engine/access/state_stream/engine.go Show resolved Hide resolved
module/grpcserver/server.go Outdated Show resolved Hide resolved
module/grpcserver/server.go Outdated Show resolved Hide resolved
module/grpcserver/server.go Outdated Show resolved Hide resolved
module/grpcserver/server.go Outdated Show resolved Hide resolved
cmd/access/node_builder/access_node_builder.go Outdated Show resolved Hide resolved
cmd/access/node_builder/access_node_builder.go Outdated Show resolved Hide resolved
cmd/access/node_builder/access_node_builder.go Outdated Show resolved Hide resolved
engine/access/rpc/engine.go Show resolved Hide resolved
engine/access/state_stream/engine.go Outdated Show resolved Hide resolved
@UlyanaAndrukhiv UlyanaAndrukhiv marked this pull request as ready for review June 9, 2023 09:11
Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

thanks for making all those changes. It's coming together.

Can you also add an integration test that verifies both continue to work when configured
configured on the AccessAPI and ExecutionDataAPI on the same port

cmd/observer/node_builder/observer_builder.go Outdated Show resolved Hide resolved
engine/access/rest_api_test.go Show resolved Hide resolved
engine/access/rpc/engine.go Show resolved Hide resolved
engine/access/rpc/rate_limit_test.go Outdated Show resolved Hide resolved
engine/access/secure_grpcr_test.go Outdated Show resolved Hide resolved
engine/access/state_stream/engine.go Show resolved Hide resolved
module/grpcserver/server.go Outdated Show resolved Hide resolved
module/grpcserver/server_builder.go Show resolved Hide resolved
module/grpcserver/server_builder.go Show resolved Hide resolved
@@ -612,8 +617,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionDataRequester() *FlowAccessN
node.RootChainID,
builder.executionDataConfig.InitialBlockHeight,
highestAvailableHeight,
builder.apiRatelimits,
builder.apiBurstlimits,
builder.unsecureGrpcServer,
Copy link
Contributor

Choose a reason for hiding this comment

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

previously, this could be configured on a separate port. Please keep that functionality, but add support for configuring it on the same port.

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Merging #4411 (d6eb702) into master (ca27c87) will decrease coverage by 0.83%.
The diff coverage is 65.00%.

@@            Coverage Diff             @@
##           master    #4411      +/-   ##
==========================================
- Coverage   54.48%   53.66%   -0.83%     
==========================================
  Files         914      750     -164     
  Lines       85356    72536   -12820     
==========================================
- Hits        46505    38924    -7581     
+ Misses      35262    30743    -4519     
+ Partials     3589     2869     -720     
Flag Coverage Δ
unittests 53.66% <65.00%> (-0.83%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
engine/access/state_stream/engine.go 0.00% <0.00%> (ø)
engine/access/rpc/engine_builder.go 56.52% <66.66%> (ø)
engine/access/rpc/engine.go 54.23% <100.00%> (-4.84%) ⬇️

... and 177 files with indirect coverage changes

Copy link
Member

@durkmurder durkmurder left a comment

Choose a reason for hiding this comment

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

Some stylistic comments, otherwise good job!

@durkmurder
Copy link
Member

bors merge

bors bot added a commit that referenced this pull request Jul 21, 2023
4411:  [Access] Refactor Access RPC engines to support a single gRPC port #4217 r=durkmurder a=UlyanaAndrukhiv

#4217

### Context

This pull request 
* creates a new grpcserver module which includes a GrpcServer and a GrpcServerBuilder for it. GrpcServer defines a grpc server that starts once and uses in different Engines
* refactored the Access RPC engine and state stream engine setup using the same grps server. Also small refactored Observer node's engine setup
* refactored tests according to new changes

Co-authored-by: UlyanaAndrukhiv <u.andrukhiv@gmail.com>
Co-authored-by: Uliana Andrukhiv <u.andrukhiv@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2023

@durkmurder
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2023
4411:  [Access] Refactor Access RPC engines to support a single gRPC port #4217 r=durkmurder a=UlyanaAndrukhiv

#4217

### Context

This pull request 
* creates a new grpcserver module which includes a GrpcServer and a GrpcServerBuilder for it. GrpcServer defines a grpc server that starts once and uses in different Engines
* refactored the Access RPC engine and state stream engine setup using the same grps server. Also small refactored Observer node's engine setup
* refactored tests according to new changes

Co-authored-by: UlyanaAndrukhiv <u.andrukhiv@gmail.com>
Co-authored-by: Uliana Andrukhiv <u.andrukhiv@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2023

@durkmurder
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2023
4411:  [Access] Refactor Access RPC engines to support a single gRPC port #4217 r=durkmurder a=UlyanaAndrukhiv

#4217

### Context

This pull request 
* creates a new grpcserver module which includes a GrpcServer and a GrpcServerBuilder for it. GrpcServer defines a grpc server that starts once and uses in different Engines
* refactored the Access RPC engine and state stream engine setup using the same grps server. Also small refactored Observer node's engine setup
* refactored tests according to new changes

Co-authored-by: UlyanaAndrukhiv <u.andrukhiv@gmail.com>
Co-authored-by: Uliana Andrukhiv <u.andrukhiv@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2023

@durkmurder
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2023
4411:  [Access] Refactor Access RPC engines to support a single gRPC port #4217 r=durkmurder a=UlyanaAndrukhiv

#4217

### Context

This pull request 
* creates a new grpcserver module which includes a GrpcServer and a GrpcServerBuilder for it. GrpcServer defines a grpc server that starts once and uses in different Engines
* refactored the Access RPC engine and state stream engine setup using the same grps server. Also small refactored Observer node's engine setup
* refactored tests according to new changes

Co-authored-by: UlyanaAndrukhiv <u.andrukhiv@gmail.com>
Co-authored-by: Uliana Andrukhiv <u.andrukhiv@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2023

@durkmurder durkmurder merged commit 3f3c15f into onflow:master Jul 21, 2023
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.

4 participants