Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions docs/public-networks/how-to/send-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In production environments avoid exposing your private keys by creating signed t

:::

## `eth_call` vs `eth_sendRawTransaction`
## `eth_call` vs. `eth_sendRawTransaction`

You can interact with contracts using [`eth_call`](../reference/api/index.md#eth_call) or [`eth_sendRawTransaction`](../reference/api/index.md#eth_sendrawtransaction). The table below compares the characteristics of both calls.

Expand All @@ -44,17 +44,23 @@ You can interact with contracts using [`eth_call`](../reference/api/index.md#eth
| Synchronous | Asynchronous |
| Returns the value of a contract function available immediately | Returns transaction hash only. A block might not include all possible transactions (for example, if the gas price is too low). |

## Override state values
## Override state values

Use [`eth_call`](../reference/api/index.md#eth_call) to override an account with temporary state values before
making the call. This allows you to make temporary state changes without affecting the actual
blockchain state, and provides the following benefits:
Use methods that accept the [state override object](../reference/api/objects.md#state-override-object) to override an account with temporary state values before
executing a call. State overrides allow you to make temporary state changes without affecting the actual blockchain state, and provide the following benefits:

- Minimizes the amount of contract code required to be deployed onchain. Code that returns
internal state or performs predefined validations can be kept offchain and provided to the node on demand.
- Extends and invokes custom methods on deployed contracts for analysis and debugging, avoiding
the need to reconstruct the entire state in a sandbox, and allowing selective state or code
overrides to observe execution changes.
- Minimize the amount of contract code that must be deployed onchain. Code that returns internal
state or performs predefined validations can be kept offchain and supplied to the node on demand.
- Extend and invoke custom methods on deployed contracts for analysis and debugging without
reconstructing the entire state in a sandbox, allowing selective state or code overrides
to observe execution changes.

The following methods support the [state override object](../reference/api/objects.md#state-override-object):

- [`eth_call`](../reference/api/index.md#eth_call)
- [`eth_estimateGas`](../reference/api/index.md#eth_estimategas)
- [`eth_simulateV1`](../reference/api/index.md#eth_simulatev1)
- [`debug_traceCall`](../reference/api/index.md#debug_tracecall) (via the `stateOverrides` options wrapper)

## Use wallets for key management

Expand Down
16 changes: 9 additions & 7 deletions docs/public-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,10 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","param

Performs an [`eth_call`](#eth_call) within the execution environment of a given block, using the final state of its parent block as the base, and provides a detailed trace of the executed opcodes.

Each `options` entry specifies a state that will be temporarily overridden before executing the call.
This allows you to test, analyze, and debug smart contracts more efficiently by allowing
temporary state changes without affecting the actual blockchain state.

#### Parameters

- `call`: _object_ - [transaction call object](objects.md#transaction-call-object)
Expand All @@ -2022,13 +2026,11 @@ Performs an [`eth_call`](#eth_call) within the execution environment of a given
`pending` returns the same value as `latest`.
:::

- `options`: _object_ - request options object with the following fields (all optional and default to `false`):

- `disableStorage`: _boolean_ - `true` disables storage capture.

- `disableMemory`: _boolean_ - `true` disables memory capture.

- `disableStack` : _boolean_ - `true` disables stack capture.
- `options`: _object_ - request options object with the following fields (all booleans default to `false`):
- `disableStorage`: _boolean_ - (optional) `true` disables storage capture.
- `disableMemory`: _boolean_ - (optional) `true` disables memory capture.
- `disableStack` : _boolean_ - (optional) `true` disables stack capture.
- `stateOverrides`: _object_ - (optional) [address-to-state mapping](./objects.md#state-override-object).

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/public-networks/reference/api/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Returned by [`debug_storageRangeAt`](index.md#debug_storagerangeat).

## State override object

Parameter for [`eth_call`](./index.md#eth_call), [`eth_estimateGas`](./index.md#eth_estimategas), and [`eth_simulateV1`](index.md#eth_simulatev1).
Parameter for [`eth_call`](./index.md#eth_call), [`eth_estimateGas`](./index.md#eth_estimategas), [`eth_simulateV1`](index.md#eth_simulatev1), and [`debug_traceCall`](./index.md#debug_traceCall).
Override an account with the following state values temporarily before making the call. This allows you
to make ephemeral state changes, for the purposes of transaction simulation, without affecting the actual
blockchain state.
Expand Down
Loading