-
Notifications
You must be signed in to change notification settings - Fork 998
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
The spec-test coverage hunt #1200
Comments
I can take the genesis task. |
@hwwhww Great! Steps to implement:
And then I'll write a small generator for it (really just a main file + a few calls + dependency to base-generator and eth2spec). And we can output it as test-vectors for clients, in addition to testing the spec :) |
I will start now, and go from top to bottom. If anyone wants to contribute, you are welcome, but let's avoid double work: go over the list in reverse. Or just share what you are working on, I'll monitor this issue. |
@protolambda Thanks for the guide! I opened a draft PR: #1202
|
# shorthand for decorating @with_state @spectest()
def spec_state_test(fn):
return with_state(bls_switch(spectest()(fn))) We just need |
Addressed in #1206 🎉, genesis tests on their way in a different PR :) |
The spec tests currently get clients to about ~72% coverage of their (optimized) spec code. I'm taking ZRNT (the Go-spec) as reference here, which is tested based on the same yaml spec tests.
Note that the spec itself has much more coverage (over 90%), since we have finalization tests which are not part of the spec-test-vectors (maybe later, or alternative more direct tests).
For full spec-test coverage, we need to cover the following remaining cases:
exceed max-operations:attestationsattester slashingsdepositsproposer slashingstransfersvoluntary exitsNeed for exceeding-max-operations tests is abstracted away with #1180, where the limit is naturally imposed by the SSZ data type. Yay. Just need SSZ spec-tests for limit-enforcement later.
attestations:
attester slashing
deposits
EFFECTIVE_BALANCE_INCREMENT
.eth1 data
transfers
BAD: duplicate transferTODO; need config change for this.deltas
matching penalties/rewardsmatching head: penalty, reward, none, bothmatching target: penalty, reward, none, bothmatching source: penalty, reward, none, bothproposer inclusion delayinactivity penaltycrosslink committee:penalty if not in committee, reward if in committeeno crosslink, empty participation, everyone penaltyPostponed to post-freeze. Due to the nesting of functions rewards computation, and multiple functions affecting the same state (balances), it's too time consuming to test right before freeze. But also not breaking or strictly limited by deadline, so we prioritize test-vector polishing and features (recent genesis rework, among others), for the best spec-freeze :)
epoch final updates:
justification/finalization
(picked up by @CarlBeek) Edit: postponed, difficult setup.sum(balances)
is enough to justify butsum(effective_balances)
is not. Ensure no justification.registry updates:
ActivationEligibilityEpoch == FAR_FUTURE_EPOCH && v.EffectiveBalance >= MAX_EFFECTIVE_BALANCE
)get_delayed_activation_exit_epoch
) Edit;test_activation
already covers it.process slashings:
genesis:
indexed attestations:
fork:
state has fork set, and fork slot has past. sig with new forkIrregular state transition. To be tested with future fork work.block processing:
BAD: block with old slot on state
BAD: block with invalid state root
resolve
test_empty_epoch_transition_not_finalizing
close PR skip transfer tests and enable the commented tests #1181, with updates from this PR + current state of ssz-list-limit checking making the 0 max hard to deal with, better for future point when transfers get enabled in a new configuration.
The text was updated successfully, but these errors were encountered: