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

add voluntary exit to lodestar-cli #1986

Merged
merged 26 commits into from
Feb 11, 2021
Merged

add voluntary exit to lodestar-cli #1986

merged 26 commits into from
Feb 11, 2021

Conversation

3xtr4t3rr3str14l
Copy link
Contributor

@3xtr4t3rr3str14l 3xtr4t3rr3str14l commented Jan 22, 2021

solution for #1970
currently testing with an active pyrmont validator to see if/when it proposes a block. after the validator has done this and maybe after it has ran for a good while, i'll perform voluntary exit as a test for this PR

i also added a check for the publish voluntary exit gossip call to check and make sure we have gossip peers in the voluntary exit topic before sending a voluntary exit so it will error if we have no relevant peers. depending on how the team likes the design of this particular case, i may try to apply it to other parts of gossip and try to add some code to track peers by topic

@codeclimate
Copy link

codeclimate bot commented Jan 22, 2021

Code Climate has analyzed commit 265930d and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

View more on Code Climate.

@github-actions github-actions bot added the scope-networking All issues related to networking, gossip, and libp2p. label Feb 5, 2021
@3xtr4t3rr3str14l 3xtr4t3rr3str14l marked this pull request as ready for review February 5, 2021 00:52
@3xtr4t3rr3str14l 3xtr4t3rr3str14l changed the title WIP: add voluntary exit to lodestar-cli add voluntary exit to lodestar-cli Feb 5, 2021
@3xtr4t3rr3str14l
Copy link
Contributor Author

was able to successfully perform a voluntary exit for this validator (https://pyrmont.beaconcha.in/validator/b6e9b6ba69fbd330993b8167c2e1daf4dd04eaa6670a21e776ddc4dec3cc2cedd50bd5c3d7a134d91447ad905f1c1cce#attestations) so this PR is ready for review

packages/lodestar-validator/src/validator.ts Outdated Show resolved Hide resolved
packages/lodestar-validator/src/validator.ts Outdated Show resolved Hide resolved
packages/lodestar-validator/src/validator.ts Outdated Show resolved Hide resolved
};

const state: BeaconState = this.config.types.BeaconState.tree.defaultValue();
state.fork = (await this.apiClient.beacon.state.getFork("head")) || state.fork;
Copy link
Member

Choose a reason for hiding this comment

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

you should fetch https://ethereum.github.io/eth2.0-APIs/#/Config/getForkSchedule and pick fork version based on voluntary exit epoch (if you wanna schedule exit in the future you need to use future fork version). I think it's fine to use (fallback) to (this.apiClient.beacon.state.getFork("head")) if nothing is scheduled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

working on this api implementation here: #2036

packages/lodestar-validator/src/validator.ts Outdated Show resolved Hide resolved
packages/lodestar-validator/src/validator.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-networking All issues related to networking, gossip, and libp2p.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants