Skip to content

EIP-7251: Fix off-by-one in churn computations#3682

Merged
ralexstokes merged 1 commit into
ethereum:devfrom
mkalinin:fix-churn-updates
Apr 17, 2024
Merged

EIP-7251: Fix off-by-one in churn computations#3682
ralexstokes merged 1 commit into
ethereum:devfrom
mkalinin:fix-churn-updates

Conversation

@mkalinin
Copy link
Copy Markdown
Contributor

Resolves #3677

This PR refactors churn computations and resolves the above issue. Ideally, we would have one method handling computation for both churns if a number of parameters involved in the computation were lower, it is just ugly to pass four params to a method with four lines of code and would hinder readability IMO.

@mkalinin mkalinin requested a review from ralexstokes April 17, 2024 12:35
@fradamt
Copy link
Copy Markdown
Contributor

fradamt commented Apr 17, 2024

lgtm

@hwwhww hwwhww changed the title Fix off-by-one in churn computations EIP-7251: Fix off-by-one in churn computations Apr 17, 2024
Copy link
Copy Markdown
Member

@ralexstokes ralexstokes 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!

I like that we are getting rid of divmod as that felt a bit more pythonic to me than we really want in the specs generally

and I do think we should refactor into one common compute_epoch_and_balance_to_process or something but we can do that later

@ralexstokes ralexstokes merged commit da0667b into ethereum:dev Apr 17, 2024
@ralexstokes ralexstokes mentioned this pull request Apr 17, 2024
13 tasks
@mkalinin
Copy link
Copy Markdown
Contributor Author

and I do think we should refactor into one common compute_epoch_and_balance_to_process or something but we can do that later

I attempted to do that but the call to such method looks really cumbersome because of a number of params passed onto it

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EIP-7251: update exit churn logic

3 participants