Skip to content

Conversation

@JonathanOppenheimer
Copy link
Member

Why this should be merged

Previously upgradeAccount would naively assume that any upgrade.BalanceChange was positive, even though the underlying BalanceChange was a Big.Int, which can be negative. This meant that negative balance updates would be interpreted as positive updates, which is strange, and arguably incorrect behavior. This PR correctly implements the balance changing behavior, and adds checks to ensure account balances are not updated to non-sensical values. Closes #4719

How this was tested

I added a new test file, state_upgrade_test.go. This behavior was seemingly not tested prior.

Need to be documented?

I don't think so - we are not exposing any additional API methods, we're just fixing an existing one.

Need to update RELEASES.md?

No

@JonathanOppenheimer JonathanOppenheimer self-assigned this Dec 15, 2025
@JonathanOppenheimer JonathanOppenheimer requested a review from a team as a code owner December 15, 2025 17:36
@JonathanOppenheimer JonathanOppenheimer added the bug Something isn't working label Dec 15, 2025
@JonathanOppenheimer
Copy link
Member Author

Relevant comment: ava-labs/subnet-evm#1745 (comment)

@JonathanOppenheimer JonathanOppenheimer added evm Related to EVM functionality subnet-evm Related to the former subnet-evm standalone repository labels Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evm Related to EVM functionality subnet-evm Related to the former subnet-evm standalone repository

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Additional State Upgrade Config Validation

2 participants