Introduce a new simulated backend implementation under ethclient/simulated and migrate bind-facing wrappers/tests to use it.
Key changes:
- Add the new backend entry points and behavior in ethclient/simulated, including chain control helpers used by tests (commit/rollback/fork/time adjustment).
- Update legacy bind wrappers in accounts/abi/bind/backends to delegate to the new simulated backend while preserving old APIs.
- Align bind v2/backend and utility tests to the new simulated backend client surface and transaction flow.
- Refresh abigen/bind tests and shared interfaces impacted by the backend migration.
Compatibility notes:
- Keep backward-compatible wrapper constructors for existing contract test code.
- Preserve legacy transaction paths in tests while supporting EIP-1559-aware flows where applicable.
Validation:
- Verified affected packages compile and pass tests.
- Verified repository-wide go test ./... passes after follow-up compatibility fixes.
Adds ethclient support for the eth_simulateV1 RPC method, which allows
simulating transactions on top of a base state without making changes to
the blockchain.
---------
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
There is no need to depend on the old context package now that the
minimum Go version is 1.7. The move to "context" eliminates our weird
vendoring setup. Some vendored code still uses golang.org/x/net/context
and it is now vendored in the normal way.
This change triggered new vet checks around context.WithTimeout which
didn't fire with golang.org/x/net/context.
This significantly reduces the dependency closure of ethclient, which no
longer depends on core/vm as of this change.
All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too,
the constructor simply returned a literal.
ethclient now returns ethereum.NotFound if the server returns null and
no error while accessing blockchain data.
The light client cannot provide arbitrary transactions. The change to
split transaction access into its own interface emphasizes that
transactions should not be relied on and recommends use of logs.