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

bug: gas_limit lower than intrinsic gas should not increase sender nonce #956

Open
enitrat opened this issue Feb 6, 2024 · 1 comment
Open
Labels
blocked Cannot be solved atm

Comments

@enitrat
Copy link
Collaborator

enitrat commented Feb 6, 2024

Bug Report

Kakarot version

In Geth https://github.com/ethereum/go-ethereum/blob/16ce7bf50fa71c907d1dc6504ed32a9161e71351/core/state_transition.go#L432-L436 the nonce of the sender is only increased after a check that the gas_limit of the tx is higher than the intrinsic gas. Otherwise, the execution of transaction doesn't even begin and the nonce is not increased.

Globally, in these following cases, the validation should fail and the nonce should not be increased:

	// 1. the nonce of the message caller is correct
	// 2. caller has enough balance to cover transaction fee(gaslimit * gasprice)
	// 3. the amount of gas required is available in the block
	// 4. the purchased gas is enough to cover intrinsic usage
	// 5. there is no overflow when calculating intrinsic gas
	// 6. caller has enough balance to cover asset transfer for **topmost** call
@enitrat
Copy link
Collaborator Author

enitrat commented Feb 13, 2024

What has been done for now:

  • Emitted a special error message, returned as return data
  • This message is handled by the EF-Test runner to validate tests, even though the nonce is increased.

@enitrat enitrat added the blocked Cannot be solved atm label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Cannot be solved atm
Projects
Status: 🆕 Backlog
Development

No branches or pull requests

1 participant