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

core: Check gasBailout before deducting balance in trace_call (#11813) #11866

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

somnathb1
Copy link
Contributor

@somnathb1 somnathb1 commented Sep 4, 2024

Existing behaviour:

  • Add up the possible value that user must pay beforehand to buy gas
  • Deduct that amount from the sender's account in intraBlockState, but:
  • Don't deduct the gas value amount if the user doesn't have enough, and gasBailout is set

New behaviour:

  • Don't check if sender's balance is enough to pay gas value amount, nor deduct it, if gasBailout is set

More rationale
This would mean the sender's account would show "balance": "=" in trace_call rpc method, that is, no change, if gas is the only thing the user pays for. This is fine because the gas price can fluctuate in a real transaction. This also removes the inconsistency of sometimes having to bother deducting the amount if it is less than sender's balance, thereby causing a bug/inconsistency.(#11813)

**Existing behaviour:**
- Add up the possible value that user must pay beforehand to buy gas
- Deduct that amount from the sender's account in `intraBlockState`,
but:
- Don't deduct the gas value amount if the user doesn't have enough, and
`gasBailout` is set

**New behaviour:**
- Don't check if sender's balance is enough to pay gas value amount, nor
deduct it, if `gasBailout` is set

**More rationale**
This would mean the sender's account would show `"balance": "="` in
`trace_call` rpc method, that is, no change, if gas is the only thing
the user pays for. This is fine because the gas price can fluctuate in a
real transaction. This also removes the inconsistency of sometimes
having to bother deducting the amount if it is less than sender's
balance, thereby causing a bug/inconsistency.
@somnathb1
Copy link
Contributor Author

Cherry pick from release/2.60

@yperbasis yperbasis added this to the v2.60.7-fixes milestone Sep 4, 2024
@somnathb1 somnathb1 enabled auto-merge (squash) September 4, 2024 13:28
@somnathb1 somnathb1 merged commit 4085099 into main Sep 4, 2024
10 checks passed
@somnathb1 somnathb1 deleted the fix_trace_call branch September 4, 2024 13:40
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.

2 participants