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

fix: Node private key requires data directory #1938

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

nasdf
Copy link
Member

@nasdf nasdf commented Oct 6, 2023

Relevant issue(s)

N/A

Description

This PR adds an option to set the p2p host private key. When no key is set, a new one will be generated. This fixes various tests that had to manually set a data directory even in memory only mode.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

make test

Manually ran in both badger and memory mode to test key generation.

Specify the platform(s) on which this was tested:

  • MacOS

@nasdf nasdf added the area/config Related to configuration label Oct 6, 2023
@nasdf nasdf added this to the DefraDB v0.8 milestone Oct 6, 2023
@nasdf nasdf self-assigned this Oct 6, 2023
@nasdf nasdf requested review from a team and removed request for a team October 6, 2023 20:06
@nasdf nasdf marked this pull request as draft October 6, 2023 22:00
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Attention: 42 lines in your changes are missing coverage. Please review.

Comparison is base (56dceda) 74.62% compared to head (d37c787) 74.60%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1938      +/-   ##
===========================================
- Coverage    74.62%   74.60%   -0.02%     
===========================================
  Files          234      234              
  Lines        23114    23116       +2     
===========================================
- Hits         17248    17244       -4     
- Misses        4681     4696      +15     
+ Partials      1185     1176       -9     
Flag Coverage Δ
all-tests 74.60% <14.29%> (-0.02%) ⬇️

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

Files Coverage Δ
net/config.go 95.71% <100.00%> (-0.06%) ⬇️
net/node.go 91.80% <62.50%> (+4.53%) ⬆️
cli/start.go 23.51% <0.00%> (-0.77%) ⬇️
cli/utils.go 42.65% <0.00%> (-24.79%) ⬇️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@nasdf nasdf marked this pull request as ready for review October 9, 2023 16:24
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

LGTM, really good to get rid of that nastiness in the tests if nothing else :)

tests/integration/utils2.go Show resolved Hide resolved
@nasdf nasdf merged commit ce7d778 into sourcenetwork:develop Oct 10, 2023
29 checks passed
@nasdf nasdf deleted the nasdf/fix/node-private-key branch October 10, 2023 16:41
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

N/A

## Description

This PR adds an option to set the p2p host private key. When no key is
set, a new one will be generated. This fixes various tests that had to
manually set a data directory even in memory only mode.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make test`

Manually ran in both badger and memory mode to test key generation.

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Related to configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants