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

app/eth2wrap: add lazy init #1760

Merged
merged 1 commit into from
Feb 3, 2023
Merged

app/eth2wrap: add lazy init #1760

merged 1 commit into from
Feb 3, 2023

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented Feb 2, 2023

Wraps eth2clients in a "lazy loader", this allows charon to start even if one or more beacon nodes are down (as long as one is up and available).

category: feature
ticket: #1312

@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Base: 54.76% // Head: 54.26% // Decreases project coverage by -0.51% ⚠️

Coverage data is based on head (f26c24e) compared to base (ce70820).
Patch coverage: 16.94% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1760      +/-   ##
==========================================
- Coverage   54.76%   54.26%   -0.51%     
==========================================
  Files         163      165       +2     
  Lines       20917    21660     +743     
==========================================
+ Hits        11456    11753     +297     
- Misses       7929     8357     +428     
- Partials     1532     1550      +18     
Impacted Files Coverage Δ
app/eth2wrap/httpwrap.go 22.76% <0.00%> (ø)
app/eth2wrap/eth2wrap_gen.go 10.99% <6.66%> (-1.37%) ⬇️
app/eth2wrap/lazy.go 29.50% <29.50%> (ø)
app/eth2wrap/synthproposer.go 66.35% <66.66%> (-0.22%) ⬇️
app/eth2wrap/eth2wrap.go 51.21% <82.35%> (-0.66%) ⬇️
core/qbft/qbft.go 73.73% <0.00%> (-9.67%) ⬇️
app/app.go 59.20% <0.00%> (-3.77%) ⬇️
core/priority/prioritiser.go 60.37% <0.00%> (-1.42%) ⬇️
core/scheduler/scheduler.go 76.20% <0.00%> (-1.15%) ⬇️
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

require.NoError(t, err)
}

func TestLazy(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we also have a testcase in this test where we have 3 addresses with following testcases:

  • All disabled.
  • One enabled and two disabled
  • Two enabled and one disabled

This can replace above TestOneDown test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure this add a lot of value additional value, but you are welcome to add it if you want

func (l *lazy) Name() string {
cl, err := l.getClient()
if err != nil {
return ""
Copy link
Contributor

Choose a reason for hiding this comment

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

why not return an error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This implements the Client interface which doesn't return an error, so we can't return an error

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Feb 3, 2023
@obol-bulldozer obol-bulldozer bot merged commit 0be141a into main Feb 3, 2023
@obol-bulldozer obol-bulldozer bot deleted the corver/lazyeth2 branch February 3, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants