-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Conversation
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
🎉 This PR is included in v1.22.0 🎉 |
Bump spec test version to
v1.5.0-alpha.3
.Fix everything to make it pass:
computeProposers
is now fork aware to useMAX_EFFECTIVE_BALANCE_ELECTRA
to determine post-electraepoch_processing.test.ts
andoperations.test.ts
to correctly run associated test casesincorrect_not_enough_consolidation_churn_available
test as it passes in an invalid beacon state. This test will also be rewritten in the next release. See Updatetest_incorrect_not_enough_consolidation_churn_available
and add assertions to test cases ethereum/consensus-specs#3814Misc:
getForkSeqFromEpoch
to better convert epoch toForkSeq