-
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
Clean up verify_indexed_attestation #1028
Conversation
Cosmetic changes: * Add 4 lines of comments (now every statement has a comment) * Avoid unnecessary `assert` (the end goal for me is for `assert`s to be exclusive to the operation processing helpers). * Merge `return`s into one (increase readability, reduce verbosity) * Use shorter-named `bit_0_indices` and `bit_1_indices` helper variables Substantive change: * Remove the condition that `len(0_indices) + len(1_indices) > 0`. This condition is redundant in the context of `process_attester_slashing` because of `slashed_any`. It is largely artificial in `process_attestation` where validators are incentivised to maximise new attestations.
aw, you skipped the This looks good to me. |
A bit torn on this. Can a validator then include any empty attestations in the extra attestations positions and unnecessarily bloat block size? Seems like it could become an unintended source of graffiti |
I've been thinking about this. It turns out there are other cheap ways to generate graffiti. For example, a block proposed can make
Bloating is negligible, or even zero since the default rational behaviour is probably to max out the number of attestations in a block to maximise revenue. And using |
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.
added back in the test_empty_aggregation_bitfield
test, but changed it to ensure it passes. It's a strange case and because we explicitly (at this time) want it to pass, it's good to have a test for it :)
Cosmetic changes:
assert
(the end goal for me is forassert
s to be exclusive to the operation processing helpers).return
s into one (increase readability, reduce verbosity)bit_0_indices
andbit_1_indices
helper variablesSubstantive change:
len(0_indices) + len(1_indices) > 0
. This condition is redundant in the context ofprocess_attester_slashing
because ofslashed_any
. It is artificial inprocess_attestation
where validators are incentivised to maximise new attestations.