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

Update eth_call handling of account balance #1834

Merged
merged 5 commits into from
Jan 27, 2021

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Jan 25, 2021

When calling eth_call by default account balances will be ignored when
executing the call. If the user wants the gas balance to be a
consideration in the call a new strict param in the call params can be
set to true, which will enforce the balance rules. This is the same
behavior as is observed in eth_estimateGas.

Addresses #502

Signed-off-by: Danno Ferrin danno.ferrin@gmail.com

Changelog

When calling `eth_call` by default account balances will be ignored when
executing the call. If the user wants the gas balance to be a
consideration in the call a new `strict` param in the call params can be
set to true, which will enforce the balance rules.  This is the same
behavior as is observed in `eth_estimateGas`.

Addresses hyperledger#502

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
@@ -5,6 +5,7 @@
### 21.2 Breaking Changes
* `--skip-pow-validation-enabled` is now an error with `block import --format JSON`. This is because the JSON format doesn't include the nonce so the proof of work must be calculated.
* `eth_call` will not return a JSON-RPC result if the call fails, but will return an error instead. If it was for a revert the revert reason will be included.
* `eth_call` will not fail for account balance issues by default. An parameter `"strict": true` can be added to the call parameters (with `to` and `from`) to enforce balance checks.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/An param/A param

@shemnon shemnon added the doc-change-required Indicates an issue or PR that requires doc to be updated label Jan 27, 2021
@shemnon
Copy link
Contributor Author

shemnon commented Jan 27, 2021

Doc change is to note something like "When using eth_call the balance of the from account does not cause the transaction to fail for lack of balance. This is done by setting the balance of the account to a very large amount of ether. If you want the transaction to fail for insufficient funds you can add "strict": true to the call parameters."

@shemnon shemnon enabled auto-merge (squash) January 27, 2021 04:50
@shemnon shemnon merged commit e7a5b1c into hyperledger:master Jan 27, 2021
@shemnon shemnon deleted the ethCallBalance branch February 26, 2022 18:42
@bgravenorst bgravenorst removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Mar 4, 2022
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
When calling `eth_call` by default account balances will be ignored when
executing the call. If the user wants the gas balance to be a
consideration in the call a new `strict` param in the call params can be
set to true, which will enforce the balance rules.  This is the same
behavior as is observed in `eth_estimateGas`.

Addresses hyperledger#502

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
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.

4 participants