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

feat: support electra devnet-1 #6892

Merged
merged 10 commits into from
Jun 25, 2024
Merged

feat: support electra devnet-1 #6892

merged 10 commits into from
Jun 25, 2024

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Jun 17, 2024

Bump spec test version to v1.5.0-alpha.3.

Fix everything to make it pass:

Misc:

  • Add getForkSeqFromEpoch to better convert epoch to ForkSeq

if (i === indices.length) {
// Spec does not have this condition to end infinite loop. Spec test won't pass if we
// only loop the validator indices once. Electra spec test requires MAX_ITERATION_OVER_VALIDATORS >= 6
if (i === indices.length * MAX_ITERATION_OVER_VALIDATORS) {
Copy link
Contributor Author

@ensi321 ensi321 Jun 18, 2024

Choose a reason for hiding this comment

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

In the original spec, this loop is infinite where as Lodestar has a early return statement to return -1 after looping through the validator set once.

Lodestar will return -1 for proposer index when the validator set is small. This phenomenon is surfaced during spec testing. Tests will fail unless we loop the validator set at least 6 times.

As a workaround, I have introduced MAX_ITERATION_OVER_VALIDATORS to relax the early return condition, but would also consider to remove it entirely to align with the spec here

If someone can point out the original intention of this early return statement, please shed some light cc @wemeetagain

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's not correct to do early return after an iteration, the same validator index could have different randByte value after each iteration
this could be read as an improvement we made compared to spec, but it's important to be spec compliant first
suggest removing this condition completely

@ensi321 ensi321 marked this pull request as ready for review June 21, 2024 18:26
@ensi321 ensi321 requested a review from a team as a code owner June 21, 2024 18:26
Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lgtm

@g11tech g11tech merged commit 8e9edb4 into electra-fork Jun 25, 2024
13 of 18 checks passed
@g11tech g11tech deleted the nc/devnet-1 branch June 25, 2024 09:48
g11tech pushed a commit that referenced this pull request Jun 25, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Jun 25, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Jul 1, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Jul 30, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Jul 31, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Aug 2, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Aug 9, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Aug 9, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Aug 23, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
g11tech pushed a commit that referenced this pull request Aug 27, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
philknows pushed a commit that referenced this pull request Sep 3, 2024
* Update spec test version

* Use new max effective balance

* Relax loop breaking condition for `computeProposerIndex`

* fix remaining

* check-types & lint

* Skip invalid test

* Fix rebase + lint

* Remove early return statement in `computeProposers`

* Address comment

* Address comment
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.22.0 🎉

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.

4 participants