You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend eth_call RPC to include a state_overrides parameter for more flexible contract testing.
Rationale
This allows end users to specify a temporary state against which testing their contract deployment or interaction. This override should be temporary and should not affect the actual state of the blockchain. This ensures that developers can run these simulations without unintentionally altering the state of the blockchain.
This helps developer with smart contract debugging and analysis.
It can potentially reduce the amount of code deployed on-chain. Code that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node on-demand.
Design
Additional state override struct :
struct StateOverride {
pub balance: Option<U256>,
pub nonce: Option<U256>,
pub code: Option<Bytes>, // code of the contract, if any
pub state: Option<BTreeMap<H256, H256>>, // state of the contract
pub state_diff: Option<BTreeMap<H256, H256>>, // the difference in state from the original
}
Summary
Extend
eth_call
RPC to include astate_overrides
parameter for more flexible contract testing.Rationale
This allows end users to specify a temporary state against which testing their contract deployment or interaction. This override should be temporary and should not affect the actual state of the blockchain. This ensures that developers can run these simulations without unintentionally altering the state of the blockchain.
This helps developer with smart contract debugging and analysis.
It can potentially reduce the amount of code deployed on-chain. Code that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node on-demand.
Design
Additional state override struct :
RPC
eth_call
example :The balance of the
from
address is set to "0xde0b6b3a7640000" for the context of this callRef : https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth
The text was updated successfully, but these errors were encountered: