Commit graph

126 commits

Author SHA1 Message Date
Daniel Liu
8be617c17a
fix(core/txpool): fix nonce assignment in local tracker #31496 (#2183) 2026-03-18 11:41:47 +05:30
Daniel Liu
ec0f96d538
feat(core/txpool,eth): align local tx tracking with geth #31202 #31618 (#2181)
Implements ethereum/go-ethereum PR #31202 and #31618.

When local tracking is enabled:
- EthAPIBackend.SendTx tracks transactions after pool submission and keeps tracking temporary rejects so they can be retried by the local tracker.
- TxPool.AddLocal tracks accepted submissions and temporary rejects for local re-journal/re-submit flows, while preserving the original txpool error return to the caller.

This avoids persisting permanently invalid transactions while preserving retry signals for transient failures without masking submission outcomes in caller workflows.

Also included:
- classify temporary rejection reasons in core/txpool/locals
- expose SubPool.ValidateTxBasics and align LegacyPool implementation
- split low-tip rejection into ErrTxGasPriceTooLow
- simplify local tracker integration in txpool
- update txpool and eth tests for accepted vs retryable local tracking behavior

Refs: ethereum/go-ethereum#31202
Refs: ethereum/go-ethereum#31618
2026-03-18 09:54:40 +05:30
Daniel Liu
13548d5d9e
refactor(core/txpool): remove locals-tracking from pools #30559 (#2176) 2026-03-17 12:24:20 +05:30
Daniel Liu
bfe9a3e714
refactor(eth): remove duplicated chain config source #19344 (#2177)
Drop Ethereum.chainConfig and consistently read chain configuration from blockchain.Config() to avoid dual sources of truth.

Changes include API/backend call sites and DebugAPI constructor cleanup. No functional behavior change is intended.
2026-03-17 12:02:42 +05:30
Daniel Liu
7d67a4ead4
refactor(txpool,eth,miner): use pending filter struct #29026 (#2160)
Introduce txpool.PendingFilter and migrate Pending(...) signatures from positional params to a typed struct.

- Add core/txpool.PendingFilter with MinTip/BaseFee fields for cheap call-site filtering
- Update txpool subpool interface and all call sites in eth/miner to pass the filter struct
- Keep behavior unchanged for empty filter (equivalent to previous nil,nil usage)
- Refresh legacypool tests to use the new API shape

This is a refactor-only change intended to improve API clarity and future extensibility without changing consensus or RPC semantics.
2026-03-11 08:58:07 +05:30
Daniel Liu
b5eec529d0
perf(core/txpool): pre-filter dynamic fees during pending tx retrieval #29005 (#2137)
Introduce dynamic-fee pre-filtering in txpool pending retrieval to reduce
allocations and downstream processing work during mining and tx propagation.

What changed:
- Change the `Pending` API from `Pending(enforceTips bool)` to
  `Pending(minTip *uint256.Int, baseFee *uint256.Int)` in txpool interfaces.
- Implement pre-filtering in `legacypool.Pending` by comparing effective tip
  against the provided `minTip/baseFee` for non-local, non-special txs.
- Update call sites to the new API:
  - miner work assembly (`miner/worker.go`)
  - tx sync (`eth/sync.go`)
  - pool transaction retrieval (`eth/api_backend.go`)
  - protocol/test interfaces (`eth/protocol.go`, `eth/helper_test.go`).

Tests:
- Add targeted coverage for pending filtering semantics in
  `core/txpool/legacypool/legacypool_test.go`, including:
  - minTip threshold boundary behavior
  - baseFee-aware effective tip filtering
  - local/special transaction exemption behavior
  - dynamic-fee boundary behavior when baseFee is nil.

Impact:
- Preserves existing behavior while making pending selection cheaper for
  downstream consumers.
- Improves confidence in edge-case behavior through dedicated tests.
2026-03-11 08:42:09 +05:30
Daniel Liu
d4a6f43ef2
refactor(core/txpool): migrate tx subscription to SubscribeTransactions #28243 (#2125)
* refactor(txpool): remove wrapper type #27841

Partial backport of ethereum/go-ethereum PR #27841, limited to txpool wrapper removal.

- Migrate txpool interfaces/call sites from `*txpool.Transaction` to `*types.Transaction`
- Update eth/miner/contracts paths and related tests accordingly
- No intended behavior change

Blob sidecar validation/handling changes from upstream are not included here.

* refactor(core/txpool): migrate tx subscription to SubscribeTransactions #28243

Replace the old SubscribeNewTxsEvent-style plumbing with the new
SubscribeTransactions(ch, reorgs) interface across txpool, eth protocol
manager, API backend, miner worker, and test helpers.

Key changes:
- Extend txpool/subpool tx subscription interface with a reorgs flag
- Route eth tx announcement path to reorgs=false (new tx announcements only)
- Route API/miner subscriptions to reorgs=true
- Move subscription-scope cleanup to TxPool.Close()
- Add Gas field to LazyTransaction in legacy pending view

Note:
LegacyPool currently cannot strictly separate newly seen and resurrected txs,
so the reorgs flag is accepted for API compatibility and future blob-subpool
integration.
2026-03-10 18:44:38 +05:30
Daniel Liu
2611f1dd9a
fix(all): fix typo foudation (#2063) 2026-02-28 18:00:55 +04:00
Daniel Liu
cfca45a7eb
refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
Daniel Liu
3e1f75eafb
core, eth, miner: 4844 blob transaction pool #26940 (#1911) 2026-01-19 11:24:01 +05:30
Daniel Liu
3e68f0e1d8
cmd/utils, eth: rename ApiBackend to APIBackend (#1955) 2026-01-16 17:27:48 +05:30
Daniel Liu
b3d354a897
all: move main transaction pool into a subpool #27463 (#1890) 2026-01-05 15:43:50 +05:30
Daniel Liu
999ded17da
all: change chain head markers from block to header #26777 (#1846) 2025-12-16 07:36:51 +04:00
Daniel Liu
94d0fceffe
all: use FinalizedBlockNumber instead of CommittedBlockNumber (#1847) 2025-12-11 16:19:51 +05:30
Daniel Liu
6235de71ba
all: rework statedb utils (#1785) 2025-11-18 11:26:28 +05:30
Daniel Liu
a75a1467ab
eth, internal/ethapi: remove order tx pool API (#1743) 2025-11-15 16:45:05 +05:30
Daniel Liu
f24e68b015
consensus/XDPoS, eth: fix potential rpc.BlockNumber overflow, close XFN-69 (#1735) 2025-11-15 16:44:08 +05:30
Daniel Liu
d5a03ab9e9
core, eth: fix overuse Of log.Crit, close XFN-102 (#1648)
* core: fix overuse Of `log.Crit`, close XFN-102

* eth: fix overuse Of `log.Crit`, close XFN-102
2025-11-14 16:28:36 +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
165d0f0838
eth: fix wrong judgement condition, close XFN-73 (#1686) 2025-11-03 12:48:51 +05:30
Daniel Liu
df9623dbe9
eth: split api.go into namespace based files #27263 (#1601) 2025-10-30 21:27:14 +05:30
wit liu
79460e4bfb
all: fix whitespace error of golangci-lint, remove extra empty lines (#1624) 2025-10-19 14:42:12 +08:00
Daniel Liu
956767a41e
consensus/XDPoS: remove unused parameters in BlockConsensusVersion, close XFN-02 (#1613) 2025-10-08 13:19:45 +08:00
Daniel Liu
a311f01c7a
eth, internal: add getHeaderBy* APIs #19669 (#1597) 2025-10-08 12:52:56 +08:00
Daniel Liu
0ece8529c4
cmd, eth, internal/ethapi: allow for flag configured timeouts for eth_call #23645 (#1593) 2025-09-26 19:01:02 +08:00
wit liu
a5d03e4a8a
all: fix inconsistent receiver name (#1494)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:15:23 +08:00
Daniel Liu
ad9003c41e
eth/tracers: live chain tracing with hooks #29189 (#1352)
Here we add a Go API for running tracing plugins within the main block import process.

As an advanced user of geth, you can now create a Go file in eth/tracers/live/, and within
that file register your custom tracer implementation. Then recompile geth and select your tracer
on the command line. Hooks defined in the tracer will run whenever a block is processed.

The hook system is defined in package core/tracing. It uses a struct with callbacks, instead of
requiring an interface, for several reasons:

- We plan to keep this API stable long-term. The core/tracing hook API does not depend on
  on deep geth internals.
- There are a lot of hooks, and tracers will only need some of them. Using a struct allows you
   to implement only the hooks you want to actually use.

All existing tracers in eth/tracers/native have been rewritten to use the new hook system.

This change breaks compatibility with the vm.EVMLogger interface that we used to have.
If you are a user of vm.EVMLogger, please migrate to core/tracing, and sorry for breaking
your stuff. But we just couldn't have both the old and new tracing APIs coexist in the EVM.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2025-09-09 17:30:56 +08:00
Daniel Liu
cb80dbe4f6
internal/ethapi: add block overrides to eth_call #26414 (#1332) 2025-09-09 14:39:59 +08:00
Daniel Liu
be61f66cb2
core/types: remove message #25977 (#1322) 2025-09-09 11:23:47 +08:00
Daniel Liu
afc20286fb
eth: add request cancellation checks #26320 (#1314)
This ensures that RPC method handlers will react to a timeout or
cancelled request soon after the event occurs.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 10:18:10 +08:00
Daniel Liu
98be4bb911
eth: rework chain tracer #25143 #25715 #29162 (#1294) 2025-09-09 00:06:07 +08:00
Daniel Liu
9425af8b7c
eth: make traceChain avoid OOM on long-running tracing #23736 (#1263) 2025-08-28 18:52:32 +08:00
Daniel Liu
17bfe7af44
eth: add error when accessing missing block state #18346 (#1355) 2025-08-20 14:35:07 +08:00
Daniel Liu
34020969ff
all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
Daniel Liu
36374be05f
eth/tracers: move tracing APIs into eth/tracers #22161 #22473 (#1252) 2025-08-08 10:25:43 +08:00
JukLee0ira
b4308ba733
internal/ethapi: disable sending of non eip155 replay protected tx #22339 (#971)
* internal/ethapi: disable sending of non eip155 replay protected tx #22339

* eth: optimize the initialization logic of EthAPIBackend

* fix
2025-04-25 11:55:52 +08:00
JukLee0ira
b1e08e6642
all: refactor package node #21105 (#923) 2025-04-10 18:52:49 +08:00
Daniel Liu
3e4a13d038 rpc: accept finalized as block number 2025-03-19 17:47:52 +08:00
Daniel Liu
0dd3d532fc eth: add eth_blobBaseFee RPC (#29140) 2025-02-10 10:59:45 +08:00
Daniel Liu
419f81f022 eth/gasprice: change feehistory input type from int to uint64 (#26922) 2024-11-01 11:36:53 +08:00
Daniel Liu
a294c2080d all: fix null effectiveGasPrice 2024-11-01 11:36:53 +08:00
Daniel Liu
e5fb0b4d73 core: remove unused error from TxPool.Pending (#23720) 2024-11-01 11:36:53 +08:00
Daniel Liu
7500b0ac95 Use hexutil.Uint for blockCount parameter and oldestBlock result value in feeHistory method (#23239) 2024-11-01 11:36:52 +08:00
Daniel Liu
5b01b23af6 internal: get pending and queued transaction by address (#22992) 2024-11-01 11:36:52 +08:00
Daniel Liu
26fe46c008 eth/gasprice: implement feeHistory API (#23033) 2024-11-01 11:36:52 +08:00
Daniel Liu
5a31888b19 core, eth, miner: enforce configured mining reward post 1559 too (#22995) 2024-11-01 11:36:52 +08:00
Daniel Liu
bfd1c0c9e0 core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964) 2024-11-01 11:36:52 +08:00
Daniel Liu
c36642a0e1 all: fix staticcheck warning ST1008: error should be last return value 2024-10-31 09:51:47 +08:00
liam.icheng.lai
59a7eb1f9f resolve conflict from master 2024-10-30 16:47:26 -07:00
Daniel Liu
a5bc0baba9 all: fix staticcheck warning ST1019: import package twice 2024-10-28 17:45:19 +08:00