Skip to content

Add new get_min_activation_balance helper function#5412

Open
jtraglia wants to merge 1 commit into
ethereum:masterfrom
jtraglia:get-min-activation-balance
Open

Add new get_min_activation_balance helper function#5412
jtraglia wants to merge 1 commit into
ethereum:masterfrom
jtraglia:get-min-activation-balance

Conversation

@jtraglia

@jtraglia jtraglia commented Jul 1, 2026

Copy link
Copy Markdown
Member

Technically, MAX_EFFECTIVE_BALANCE should not be used post-Electra. But there are many instances where it is used, so I thought I'd make a new helper function which replaces them. That way, we can mark MAX_EFFECTIVE_BALANCE as removed in Electra. This will be handled in a different PR.

@jtraglia jtraglia requested a review from jihoonsong July 1, 2026 18:55
@github-actions github-actions Bot added the testing CI, actions, tests, testing infra label Jul 1, 2026

@jihoonsong jihoonsong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good change. It seems there are some missing changes and I've had my agent to make some suggestion. Please take a look to see if these make sense.

max_effective_balance = spec.MAX_EFFECTIVE_BALANCE_ELECTRA
else:
max_effective_balance = spec.MAX_EFFECTIVE_BALANCE
max_effective_balance = get_min_activation_balance(spec)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the previous code delivers the intention better, which is setting the max effective balance.

@@ -114,7 +112,9 @@ def test_initialize_beacon_state_some_small_balances(spec):
# only main deposits participate to the active balance
# NOTE: they are pre-ELECTRA deposits with BLS_WITHDRAWAL_PREFIX,
# so `MAX_EFFECTIVE_BALANCE` is used

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a nit, a comment here became stale.

signed=True,
)

# Submit last pubkey deposit as MAX_EFFECTIVE_BALANCE - MIN_DEPOSIT_AMOUNT

@jihoonsong jihoonsong Jul 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is stale, too. Another option is not changing these tests as they're run in Phase0 only. But I'd vote for just updating comments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm yes, I shouldn't have touched anything that only executed in phase0. Let me look more into this.

@jtraglia

jtraglia commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Thank you for the review! I will look into fixing these soon. Should have something ready by Monday.

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

Labels

testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants