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

only add the coinbase to the witness if the block reward > 0 #332

Merged

Conversation

gballet
Copy link
Owner

@gballet gballet commented Jan 16, 2024

This PR moves the "touching" of the coinbase from Finalize to the state transition proper, so that the value is only added to the witness in case that coinbase is non-zero. This is only an issue in testnets, but it makes sense to activate that as it is confusing to testnet developers.

Comment on lines -366 to -370
state.Witness().TouchAddressOnWriteAndComputeGas(header.Coinbase[:], uint256.Int{}, utils.VersionLeafKey)
state.Witness().TouchAddressOnWriteAndComputeGas(header.Coinbase[:], uint256.Int{}, utils.BalanceLeafKey)
state.Witness().TouchAddressOnWriteAndComputeGas(header.Coinbase[:], uint256.Int{}, utils.NonceLeafKey)
state.Witness().TouchAddressOnWriteAndComputeGas(header.Coinbase[:], uint256.Int{}, utils.CodeKeccakLeafKey)
state.Witness().TouchAddressOnWriteAndComputeGas(header.Coinbase[:], uint256.Int{}, utils.CodeSizeLeafKey)
Copy link
Owner Author

Choose a reason for hiding this comment

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

move this to where the fee is calculated, so that we can check if it is 0

@gballet gballet marked this pull request as ready for review January 26, 2024 10:29
@gballet gballet added this to the verkle-gen-devnet-3 milestone Jan 26, 2024
@gballet gballet merged commit 2a753ab into kaustinen-with-shapella Jan 26, 2024
2 of 3 checks passed
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.

1 participant