Skip to content

Commit b396144

Browse files
authored
Clarify that using block_identifier with .call() comes with its caveats (#2048)
* Clarify that using `block_identifier` with .call() comes with its caveats To manage the expectations of the client library users.
1 parent 5f83154 commit b396144

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/contracts.rst

+5
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,11 @@ Methods
827827
# You can check the state after your pending transactions (if supported by your node):
828828
>>> token_contract.functions.myBalance().call(block_identifier='pending')
829829
830+
Passing the ``block_identifier`` parameter for past block numbers requires that your Ethereum API node
831+
is running in the more expensive archive node mode. Normally synced Ethereum nodes will fail with
832+
a "missing trie node" error, because Ethereum node may have purged the past state from its database.
833+
`More information about archival nodes here <https://ethereum.stackexchange.com/a/84200/620>`_.
834+
830835
.. py:method:: ContractFunction.estimateGas(transaction, block_identifier=None)
831836
832837
Call a contract function, executing the transaction locally using the

newsfragments/2048.doc.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Clarify that a missing trie node error could occur when using ``block_identifier`` with ``.call()``
2+
on a node that isn't running in archive mode

0 commit comments

Comments
 (0)