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

Refactor handleValidatorExitCommand #3344

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

EmilIvanichkovv
Copy link
Contributor

Make validator exit command work both with JSON-RPC and REST APIs
Fix problem with specifying rest-url using localhost
Change back exit error messages in state_transition_block

@github-actions
Copy link

github-actions bot commented Jan 31, 2022

Unit Test Results

     12 files  ±0     806 suites  ±0   31m 13s ⏱️ - 1m 42s
1 652 tests ±0  1 604 ✔️ ±0    48 💤 ±0  0 ±0 
9 665 runs  ±0  9 561 ✔️ ±0  104 💤 ±0  0 ±0 

Results for commit 3733edb. ± Comparison against base commit 3df9ffc.

♻️ This comment has been updated with latest results.

proc restValidatorExit(config: BeaconNodeConf) {.async.} =
let
address = if isNone(config.restUrlForExit):
resolveTAddress("127.0.0.1:47000")[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the right default port (5052). The code here should really use the DefaultEth2RestPort constant from the spec/network module.

quiting = "q"
confirmation = "I understand the implications of submitting a voluntary exit"

proc askForExitConfirmation(): string =
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you have the enum above, why don't you use it as the return value of this function?

Make `validator exit command` work both with `JSON-RPC` and `REST` APIs
Fix problem with specifying rest-url using `localhost`
Change back exit error messages in `state_transition_block`
@arnetheduck
Copy link
Member

At some point, we should move this code to a separate module - trusted node sync started this transformation, and now that this command becomes long with multiple options etc, a new module that handles it would be appropriate. it's not a blocker for the PR, but certainly a nice-to-have

@zah zah merged commit 336403d into status-im:unstable Jan 31, 2022
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.

3 participants