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

eth2util/keystore: conform to EIP2335 #622

Merged
merged 8 commits into from
May 26, 2022

Conversation

xenowits
Copy link
Contributor

Refactor keystore to adhere to EIP2335 spec

category: refactor
ticket: #567

@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #622 (41d340f) into main (8fa8a02) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 41d340f differs from pull request most recent head 89f58a4. Consider uploading reports for the commit 89f58a4 to get more accurate results

@@           Coverage Diff           @@
##             main     #622   +/-   ##
=======================================
  Coverage   56.69%   56.69%           
=======================================
  Files          96       96           
  Lines        9100     9096    -4     
=======================================
- Hits         5159     5157    -2     
+ Misses       3197     3196    -1     
+ Partials      744      743    -1     
Impacted Files Coverage Δ
eth2util/keystore/keystore.go 49.55% <100.00%> (-1.73%) ⬇️
core/qbft/qbft.go 82.13% <0.00%> (+0.43%) ⬆️

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 8fa8a02...89f58a4. Read the comment docs.

}, nil
}

// decrypt returns the secret from the encrypted (empty password) keystore.
func decrypt(store keystore, password string) (*bls_sig.SecretKey, error) {
// Ugly way to check if the untyped store.Crypto field contains a "scrypt" kdf function.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need to specify cipher when you are decrypting

@corverroos corverroos changed the title refactor: conform keystores to EIP2335 eth2util/keystore: conform to EIP2335 May 26, 2022
Pubkey: hex.EncodeToString(pubKeyBytes),
Name: encryptor.Name(),
Crypto: fields,
Description: "",
Copy link
Contributor

Choose a reason for hiding this comment

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

add comment why empty maybe? (note you do not need to put empty since that is the default)

@xenowits xenowits added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 26, 2022
@obol-bulldozer obol-bulldozer bot merged commit 74cb492 into main May 26, 2022
@obol-bulldozer obol-bulldozer bot deleted the xenowits/eip2335-keystores branch May 26, 2022 15:21
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.

None yet

2 participants