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

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

somnathb1
Copy link
Contributor

@somnathb1 somnathb1 commented Aug 30, 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.

@somnathb1 somnathb1 linked an issue Aug 30, 2024 that may be closed by this pull request
@somnathb1 somnathb1 merged commit 2769237 into release/2.60 Sep 4, 2024
6 checks passed
@somnathb1 somnathb1 deleted the som/fix_trace_call branch September 4, 2024 12:58
somnathb1 added a commit that referenced this pull request 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.
somnathb1 added a commit that referenced this pull request Sep 4, 2024
…) (#11866)

**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)
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.

Incorrect balance stateDiff for trace_call
2 participants