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: replace manifest with lock #562

Merged
merged 3 commits into from
May 19, 2022
Merged

app: replace manifest with lock #562

merged 3 commits into from
May 19, 2022

Conversation

corverroos
Copy link
Contributor

Replaces the manifest with cluster lock.

category: refactor
ticket: #527

}

func writeLock(_ clusterConfig, _ []tbls.TSS, _ []p2p.Peer) error {
// TODO(corver): Create lock file.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xenowits this is for you #528

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #562 (404754a) into main (111fd0b) will decrease coverage by 0.62%.
The diff coverage is 44.00%.

❗ Current head 404754a differs from pull request most recent head d9e6558. Consider uploading reports for the commit d9e6558 to get more accurate results

@@            Coverage Diff             @@
##             main     #562      +/-   ##
==========================================
- Coverage   55.19%   54.56%   -0.63%     
==========================================
  Files          92       90       -2     
  Lines        8664     8523     -141     
==========================================
- Hits         4782     4651     -131     
  Misses       3241     3241              
+ Partials      641      631      -10     
Impacted Files Coverage Δ
cluster/definition.go 58.62% <0.00%> (-3.58%) ⬇️
cluster/distvalidator.go 71.42% <0.00%> (-16.81%) ⬇️
cluster/test_cluster.go 0.00% <0.00%> (ø)
app/app.go 62.10% <65.78%> (-1.21%) ⬇️
cmd/createcluster.go 55.49% <66.66%> (+2.52%) ⬆️
app/disk.go 57.14% <71.42%> (ø)
cmd/run.go 100.00% <100.00%> (ø)
eth2util/deposit/deposit.go 58.55% <0.00%> (-1.10%) ⬇️
core/qbft/qbft.go 82.13% <0.00%> (-0.44%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 111fd0b...d9e6558. Read the comment docs.

t.Helper()

r, err := p2p.DecodeENR(record)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest a more descriptive name than 'r'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think short names for are fine is the scope is super small


for _, p := range manifest.Peers {
enrStr, err := p2p.EncodeENR(p.ENR)
for _, o := range lock.Operators {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps operator instead of "o"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think short names for are fine is the scope is super small

}

// PublicShare returns a peer's threshold BLS public share.
func (v DistValidator) PublicShare(peerIdx int) (*bls_sig.PublicKey, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we have this method perhaps we don't need PubShares to be public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is a DTO/value so fields are public

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 19, 2022
@obol-bulldozer obol-bulldozer bot merged commit fa5d640 into main May 19, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/runlock branch May 19, 2022 13:29
if err != nil {
return err
}

pubkey, err := tblsconv.KeyToETH2(dv.PublicKey())
pk, err := tblsconv.KeyToETH2(pubkey)
Copy link
Contributor

Choose a reason for hiding this comment

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

should colocate this pk. code may be confusing because there are two pubkeys: pubkey and pk.

pk, err := tblsconv.KeyToETH2(pubkey)
if err != nil {
   return err
}

pubkeys = append(pubkeys, pk)

Copy link
Contributor

Choose a reason for hiding this comment

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

think about what makes them different and name them with longer identifiers that represent that

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.

4 participants