Commit graph

89 commits

Author SHA1 Message Date
Daniel Liu
3fad5e1ab4
refactor(ethclient): implement new sim backend #28202 (#2062)
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.
2026-03-06 11:09:10 +05:30
Daniel Liu
b991bd8aa7
test(ethclient): port ethclient tests from upstream (#2060) 2026-03-01 22:45:01 +04:00
Daniel Liu
01aafc93bf
fix(ethclient): use common.Hash to debug_traceTransaction #32404 (#2048) 2026-02-28 16:59:32 +04:00
Daniel Liu
fe317dc94c
feat(ethclient): add tracing API methods #31510 (#2050)
Added methods `TraceCallWithCallTracer` and `TraceTransactionWithCallTracer`.

Fixes #28182

---------

Co-authored-by: Ragnar <rodiondenmark@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2026-02-28 16:59:14 +04:00
Daniel Liu
44b4a51ed4
feat(ethclient): add support for eth_simulateV1 #32856 (#1992)
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>
2026-02-05 11:46:44 +05:30
Daniel Liu
060a0e4810
ethclient: omit nil address/topics from filter args #33464 (#1942) 2026-01-19 14:20:01 +05:30
Daniel Liu
5f911680c0
ethclient: restore BlockReceipts support for BlockNumberOrHash objects #33242 (#1941) 2026-01-16 17:23:11 +05:30
Daniel Liu
3af629078a
internal/ethapi: eth_simulateV1 #27720 (#1606) 2025-11-08 16:09:18 +05:30
Daniel Liu
13ed19bcf2
all: remove XDCx and XDCxlending public API, close XFN-74 XFN-134 (#1675)
* internal: remove XDCx public API

* XDCx, XDCxlending: remove api

* ethclient: remove SendOrderTransaction and SendLendingTransaction

* XDCx, XDCxlending: remove unused variables and function

* eth, internal/ethapi: remove function `OrderStats()`
2025-11-04 11:19:16 +05:30
Daniel Liu
8ca35720cd
ethclient: fix variable shadowing in FeeHistory(), close XFN-129 (#1720) 2025-11-04 11:18:28 +05:30
Daniel Liu
3efe26df08
all: refactor so NewBlock, WithBody take types.Body #29482 (#1605) 2025-10-08 13:12:35 +08:00
Daniel Liu
cb80dbe4f6
internal/ethapi: add block overrides to eth_call #26414 (#1332) 2025-09-09 14:39:59 +08:00
wit765
81f84b79ce
ethclient/gethclient: remove unused function GetProof (#1448)
Co-authored-by: Wit Liu <wit765765346@gmail>
2025-09-08 14:39:41 +08:00
Daniel Liu
b856f98b47
ethclient/gethclient: use common.Hash to debug_traceTransaction #32404 (#1401) 2025-08-31 15:55:06 +08:00
Daniel Liu
dc2a0c1b86
ethclient/gethclient: add method TraceBlock #32092 (#1399) 2025-08-31 15:48:35 +08:00
Daniel Liu
905cbd63df
ethclient/gethclient: add method TraceTransaction #31288 (#1398) 2025-08-31 15:43:31 +08:00
Daniel Liu
76dd02eed4
ethclient: fix retrieval of pending block #31504 (#1397) 2025-08-31 15:42:53 +08:00
Daniel Liu
db50cdd311
ethclient: add EstimateGasAt[Hash] functions #27508 (#1396) 2025-08-28 19:00:44 +08:00
Daniel Liu
8679a9fc4f
ethclient: add BlobBaseFee method #31290 (#1395) 2025-08-28 19:00:09 +08:00
Daniel Liu
bd1d41d3bc
ethclient: enhance the description of using block number tags #30984 (#1394) 2025-08-28 18:59:31 +08:00
Daniel Liu
47520a1316
ethclient: add RevertErrorData function #30669 (#1393) 2025-08-28 18:58:46 +08:00
Daniel Liu
0662224c31
ethclient: support networkID in hex format #30263 (#1392)
Some chains’ network IDs use hexadecimal such as Optimism ("0xa" instead
of "10"), so when converting the string to big.Int, we cannot specify
base 10; otherwise, it will encounter errors with hexadecimal network
IDs.

Co-authored-by: Zhihao Lin <3955922+kkqy@users.noreply.github.com>
2025-08-28 18:58:05 +08:00
Daniel Liu
9fcb8f6a37
ethclient: replace noarg fmt.Errorf with errors.New #27334 (#1385) 2025-08-28 18:55:20 +08:00
Daniel Liu
f49d90eb69
ethclient: simplify error handling in TransactionReceipt #28748 (#1384) 2025-08-28 18:54:48 +08:00
Daniel Liu
cb338be877
ethclient: allow calling contracts at a specific block hash #28084 (#1383) 2025-08-26 15:14:06 +08:00
Daniel Liu
c332874737
ethclient: fix BlockReceipts parameter encoding #28087 (#1382)
Co-authored-by: Andryanau Kanstantsin <andrianov.dev@yandex.by>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-08-26 15:13:20 +08:00
Daniel Liu
3fcd30adfe
ethclient: use 'input', not 'data' as field for transaction input #28078 (#1381)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-08-26 15:12:41 +08:00
Daniel Liu
17e6757daa
ethclient: acquire the rpc.Client #27246 (#1379)
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-08-26 15:09:41 +08:00
Daniel Liu
8bc1887564
ethclient/gethclient: add block overrides to eth_call #26414 (#1377) 2025-08-22 16:48:17 +08:00
Daniel Liu
5311a890fa
ethclient: ensure returned subscription is nil on error #26976 (#1376)
Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2025-08-22 16:47:37 +08:00
Daniel Liu
0e6d2f4b94
ethclient: fix panic when requesting missing blocks #26817 (#1375) 2025-08-22 16:46:55 +08:00
Daniel Liu
9acddd1792
ethclient/gethclient: ensure getProof keys parameter is not null #26409 (#1374) 2025-08-22 16:46:18 +08:00
Daniel Liu
cf6c595dd0
eth/filters, ethclient/gethclient: add fullTx option to pending tx filter #25186 #26189 (#1372)
* eth/filters, ethclient/gethclient: add fullTx option to pending tx filter #25186

This PR adds a way to subscribe to the _full_ pending transactions, as opposed to just being notified about hashes.

In use cases where client subscribes to newPendingTransactions and gets txhashes only to then request the actual transaction, the caller can now shortcut that flow and obtain the transactions directly.

Co-authored-by: Felix Lange <fjl@twurst.com>

* ethclient: docs, fix misleading comment #26189

---------

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-08-22 16:44:51 +08:00
Daniel Liu
fc9c5bebe7
ethclient/gethclient: fix bugs in override object encoding #25616 (#1371) 2025-08-22 16:44:06 +08:00
Daniel Liu
aa88fe1d86
ethclient: add PeerCount method #24849 (#1370) 2025-08-22 16:43:26 +08:00
Daniel Liu
1bf181eda6
ethclient: return storage proofs in GetProof #24697 (#1369) 2025-08-22 16:42:46 +08:00
Daniel Liu
34073a1925
ethclient: add CallContractAtHash #24355 (#1368) 2025-08-22 16:42:06 +08:00
Daniel Liu
cf714776ba
ethclient: fix unmarshaling of ethereum.SyncProgress #24199 (#1367) 2025-08-22 16:41:28 +08:00
Daniel Liu
b96310ebe7
ethclient: fix tx sender cache miss detection #23877 (#1366) 2025-08-21 13:43:52 +08:00
Daniel Liu
992e931623
ethclient: add BlockNumber method #21500 #21565 (#1365) 2025-08-21 13:43:12 +08:00
Daniel Liu
f214dd6d51
ethclient: serialize negative block number as "pending" #21177 (#1364) 2025-08-21 13:42:29 +08:00
Daniel Liu
917baceda8
ethclient, internal/ethapi: add support for EIP-695 (eth_chainId) #19694 #23778 (#1362)
* ethclient, internal/ethapi: add support for EIP-695 (eth_chainId) #19694

* ethclient: fix typo #23778
2025-08-21 13:40:35 +08:00
Daniel Liu
e6f85271a3
ethclient: ensure tx json is not nil before accessing it #19653 (#1359) 2025-08-20 14:49:43 +08:00
Daniel Liu
9ad6312396
ethclient: fix RPC parse error of Parity response #16924 (#1358) 2025-08-20 14:37:33 +08:00
Daniel Liu
df837a0c8b
ethclient: add DialContext and Close #16318 (#1357) 2025-08-20 14:36:52 +08:00
Daniel Liu
71608abda8
ethclient: fix parity compatibility on newHeads #16454 (#1356) 2025-08-20 14:36:01 +08:00
Daniel Liu
9d24f95126
ethclient: include block hash from FilterQuery #17996 (#1354) 2025-08-20 14:33:49 +08:00
Daniel Liu
b628212d8e
rpc: change BlockNumber constant values to match ethclient #27219 (#992) 2025-04-28 10:59:34 +08:00
Daniel Liu
df87605355 api/bind: add CallOpts.BlockHash to allow calling contracts at a specific block hash (#28084)
* api/bind: Add CallOpts.BlockHash to allow calling contracts at a specific block hash.

* ethclient: Add BalanceAtHash, NonceAtHash and StorageAtHash functions
2025-01-24 16:54:12 +08:00
Daniel Liu
28739d7863 common: remove usage of deprecated function (#21610) 2024-12-28 09:06:30 +08:00