Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 1149c41

Browse files
authored
Add docs note for Geth v1.9.12 eth_call change (#3467)
* Note geth `eth_call` breaking change * Note geth `web3-eth-contract` myMethod call breaking change
1 parent a510a00 commit 1149c41

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ Released with 1.0.0-beta.37 code base.
156156
- Removed old bower and meteor artifacts
157157
- Moved logo assets to own folder
158158
- Moved github assets to own folder
159-
- Remove @types/node from (non-dev) dependency tree (#3965, #3227)
159+
- Remove @types/node from (non-dev) dependency tree (#3965, #3227)
160+
- *Please note*: Geth [v1.9.12](https://github.com/ethereum/go-ethereum/releases/tag/v1.9.12) contains a breaking change for `eth_call` that will not default to your first account anymore if `from` is not set. If a sender is not explicitly defined, the `eth_call` will be executed from `address(0)`. (#3467)
161+
- This was done to avoid the same input behaving differently in different environments. You should never do `eth_call` without explicitly setting a sender.
162+
- This means that if you're calling `view` methods that refer to a `msg.sender` without explicitly setting a `from` address in your request options, you may see unexpected behavior.
163+
- In `web3.js`, the `from` address can be specified on a per-call basis or by setting the `defaultAccount` property.
160164

161165
### Fixed
162166

docs/web3-eth-contract.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,14 +745,14 @@ methods.myMethod.call
745745
746746
myContract.methods.myMethod([param1[, param2[, ...]]]).call(options[, callback])
747747
748-
Will call a "constant" method and execute its smart contract method in the EVM without sending any transaction. Note calling can not alter the smart contract state.
748+
Will call a "constant" method and execute its smart contract method in the EVM without sending any transaction. Note calling cannot alter the smart contract state.
749749

750750
----------
751751
Parameters
752752
----------
753753

754754
1. ``options`` - ``Object`` (optional): The options used for calling.
755-
* ``from`` - ``String`` (optional): The address the call "transaction" should be made from.
755+
* ``from`` - ``String`` (optional): The address the call "transaction" should be made from. For calls the ``from`` property is optional however it is highly recommended to explicitly set it or it may default to `address(0)` depending on your node or provider.
756756
* ``gasPrice`` - ``String`` (optional): The gas price in wei to use for this call "transaction".
757757
* ``gas`` - ``Number`` (optional): The maximum gas provided for this call "transaction" (gas limit).
758758
2. ``callback`` - ``Function`` (optional): This callback will be fired with the result of the smart contract method execution as the second argument, or with an error object as the first argument.

docs/web3-eth.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ Executes a message call transaction, which is directly executed in the VM of the
16001600
Parameters
16011601
----------
16021602

1603-
1. ``Object`` - A transaction object see :ref:`web3.eth.sendTransaction <eth-sendtransaction-return>`, with the difference that for calls the ``from`` property is optional as well.
1603+
1. ``Object`` - A transaction object, see :ref:`web3.eth.sendTransaction <eth-sendtransaction-return>`. For calls the ``from`` property is optional however it is highly recommended to explicitly set it or it may default to `address(0)` depending on your node or provider.
16041604
2. ``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`web3.eth.defaultBlock <eth-defaultblock>`. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used.
16051605
3. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.
16061606

0 commit comments

Comments
 (0)