Skip to content

Rename PartialPendingWithdrawal field index to validator_index#4043

Merged
jtraglia merged 5 commits intoethereum:devfrom
lucassaldanha:rename-pending-withdrawal-field
Dec 9, 2024
Merged

Rename PartialPendingWithdrawal field index to validator_index#4043
jtraglia merged 5 commits intoethereum:devfrom
lucassaldanha:rename-pending-withdrawal-field

Conversation

@lucassaldanha
Copy link
Contributor

TLDR

This PR changes PendingPartialWithdrawal.index to PendingPartialWithdrawal.validator_index. This makes it more aligned with Withdrawal and other places where we refer to ValidatorIndex as validator_index.

Justification

In Capella, we introduced Withdrawal with the following definition:

class Withdrawal(Container):
    index: WithdrawalIndex
    validator_index: ValidatorIndex
    address: ExecutionAddress
    amount: Gwei

And in Electra, we introduced PendingPartialWithdrawal as:

class PendingPartialWithdrawal(Container):
    index: ValidatorIndex
    amount: Gwei
    withdrawable_epoch: Epoch

The fact that we used Withdrawal.validator_index but PendingPartialWithdrawal.index is confusing. And can be misleading given we have Withdrawal.index with a complete different meaning.

Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

I totally support this change. Thank you! Just a couple nits.

@lucassaldanha lucassaldanha changed the title Rename PartialPendintWithdrawal field index to validator_index Rename PartialPendingWithdrawal field index to validator_index Dec 8, 2024
@jtraglia jtraglia mentioned this pull request Dec 9, 2024
13 tasks
Copy link
Member

@haxxpop haxxpop left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants