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

Add REST implementation for Validator's WaitForChainStart #11654

Conversation

PatriceVignola
Copy link
Contributor

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This adds an implementation for the WaitForChainStart validator client method by caling the Beacon Node REST API instead of the gRPC one.

@PatriceVignola PatriceVignola requested a review from a team as a code owner November 12, 2022 01:00
validator/client/beacon-api/genesis.go Outdated Show resolved Hide resolved
validator/client/beacon-api/genesis.go Outdated Show resolved Hide resolved
@PatriceVignola PatriceVignola requested review from rkapka and removed request for saolyn, potuz and terencechain November 15, 2022 18:03
rkapka
rkapka previously approved these changes Nov 21, 2022
Copy link
Contributor

@rkapka rkapka left a comment

Choose a reason for hiding this comment

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

This is great! But the new waitForChainStart function doesn't have any tests. I think you should be able to write some with the help of https://pkg.go.dev/net/http/httptest for mocking.

Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

Please add more tests for the new functionality

validator/client/beacon-api/genesis.go Outdated Show resolved Hide resolved
validator/client/beacon-api/genesis.go Show resolved Hide resolved
validator/client/beacon-api/genesis.go Outdated Show resolved Hide resolved
@PatriceVignola PatriceVignola requested review from prestonvanloon and rkapka and removed request for prestonvanloon and rkapka November 21, 2022 19:24
@PatriceVignola PatriceVignola requested review from prestonvanloon and removed request for rkapka November 21, 2022 19:32
validator/client/beacon-api/BUILD.bazel Outdated Show resolved Hide resolved
validator/client/beacon-api/BUILD.bazel Outdated Show resolved Hide resolved
validator/client/beacon-api/BUILD.bazel Outdated Show resolved Hide resolved
validator/client/beacon-api/test_handlers.go Outdated Show resolved Hide resolved
Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

LGTM

"github.com/prysmaticlabs/prysm/v3/testing/assert"
)

func TestBeaconApiHelpers(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice! In my opinion, this is so much cleaner.

@prylabs-bulldozer prylabs-bulldozer bot merged commit 0d4b98c into prysmaticlabs:develop Nov 22, 2022
@PatriceVignola PatriceVignola deleted the user/pavignol/add-wait-for-chain-start-beacon-api branch November 23, 2022 07:37
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