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

Simplify logic in calculating proposer score #2753

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

realbigsean
Copy link
Contributor

The call to get_ancestor when checking if the proposer score should be calculated in get_latest_attesting_balance seems to be unnecessary so I removed it here.

Copy link
Contributor

@adiasg adiasg left a comment

Choose a reason for hiding this comment

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

Looks good!

@djrtwo djrtwo merged commit 37eae2a into ethereum:dev Dec 1, 2021
@@ -182,14 +182,12 @@ def get_latest_attesting_balance(store: Store, root: Root) -> Gwei:
and get_ancestor(store, store.latest_messages[i].root, store.blocks[root].slot) == root)
))
proposer_score = Gwei(0)
if store.proposer_boost_root != Root():
block = store.blocks[root]
if get_ancestor(store, root, block.slot) == store.proposer_boost_root:
Copy link
Contributor

Choose a reason for hiding this comment

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

This line should have been

if get_ancestor(store, store.proposer_boost_root, store.blocks[root].slot) == root:

@adiasg
Copy link
Contributor

adiasg commented Dec 2, 2021

While the simplifying changes in this PR were sound for the underlying logic in the spec, the underlying logic itself was incorrect (see above comment).
New changes in #2760 remove the simplification & fix the spec logic (as pointed out in #2757).

Thanks @realbigsean for both this PR and #2757!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants