Commit graph

507 commits

Author SHA1 Message Date
Daniel Liu
3a505d50b0
fix(eth): initialize engine with finalized chain config, fix #2138 (#2180)
Reorder initialization in eth.New so the effective chain config is resolved and persisted via core.SetupGenesisBlock before creating the consensus engine.

Background:
- On first sync from genesis, LoadChainConfig could return a stored/incomplete config (notably with XDPoS.V2 unset in legacy testnet setups).
- Creating XDPoS before finalizing genesis config could trigger mainnet V2 fallback and log/behavior mismatches around SwitchBlock.

What changed:
- Replace early LoadChainConfig usage with SetupGenesisBlock in eth.New.
- Keep ConfigCompatError semantics consistent with core/blockchain initialization: fail only on non-compat errors.
- Initialize consensus engine after finalized chainConfig is available.

Result:
- Consensus engine now starts with finalized network config on first boot.
- Avoids incorrect V2 fallback parameters (e.g. wrong SwitchBlock) during initial testnet sync.

Tests:
- Added regression tests in eth/backend_test.go to cover legacy missing-V2 repair and SetupGenesisBlock idempotency.
2026-03-17 13:21:17 +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
d8fd0923a9
refactor(miner): polish miner configuration #19480 (#2135)
Miner configuration is unified under [Eth.Miner] (GasCeil/GasPrice/Etherbase/ExtraData), replacing legacy top-level [Eth] miner keys.

Operational impact: existing config files using [Eth].GasPrice/[Eth].Etherbase/[Eth].ExtraData must be migrated before upgrade.

Behavior update: gasprice=0 remains valid; only negative gas prices are sanitized at startup.

Default change: XDCGenesisGasLimit is reduced to 42,000,000 and now feeds miner default GasCeil (including default --miner-gaslimit), so nodes relying on defaults should review capacity expectations.
2026-03-10 18:51:36 +05:30
Daniel Liu
9d6e8fc83f
refactor(core/txpool/legacypool): use uint256.Int instead of big.Int #28606 (#2134) 2026-03-10 18:50:40 +05:30
Daniel Liu
85f2bebfd1
refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +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
292c0506c0
core/txpool, eth: refactor function IsSigner (#1889) 2025-12-25 09:27:37 +05:30
Daniel Liu
aa8c43caf3
core/txpool: make tx validation reusable across packages/pools #27429 (#1873) 2025-12-23 16:28:30 +05:30
Daniel Liu
999ded17da
all: change chain head markers from block to header #26777 (#1846) 2025-12-16 07:36:51 +04:00
wit liu
d6309612fc
all: fix unnecessary whitespace (#1800) 2025-12-08 15:07:11 +05:30
Daniel Liu
c922f26d0c
all: replace strings.Split with more efficient strings.SplitSeq (#1698) 2025-12-07 15:42:23 +05:30
Daniel Liu
b2664ec363
cmd, core, eth: disable prefetch by default, fix #1718 (#1719) 2025-11-16 11:22:48 +05:30
Daniel Liu
de9ed732e2
cmd, eth: implement flag delete-all-bad-blocks (#1770) 2025-11-15 16:50:52 +05:30
Daniel Liu
6d7c36bb8f
all: upgrade package version #30638 (#1745) 2025-11-15 16:46:54 +05:30
Wanwiset Peerapatanapokin
44b7ea8081
consensus: add isEpochSwitch check to IsSigner, close XFN-90 (#1654)
use current header to check IsSigner instead of parent header
2025-11-10 21:54:51 +04:00
Daniel Liu
3efe26df08
all: refactor so NewBlock, WithBody take types.Body #29482 (#1605) 2025-10-08 13:12:35 +08:00
Daniel Liu
af69d382ff
eth/tracers: various fixes #30540 (#1491)
Breaking changes:

- The ChainConfig was exposed to tracers via VMContext passed in
`OnTxStart`. This is unnecessary specially looking through the lens of
live tracers as chain config remains the same throughout the lifetime of
the program. It was there so that native API-invoked tracers could
access it. So instead we moved it to the constructor of API tracers.

Non-breaking:

- Change the default config of the tracers to be `{}` instead of nil.
This way an extra nil check can be avoided.

Refactoring:

- Rename `supply` struct to `supplyTracer`.
- Un-export some hook definitions.

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 09:04:38 +08:00
Daniel Liu
c9f2b73861
cmd, eth: rename config and flag to VMTraceJsonConfig #29573 (#1490) 2025-09-13 10:52:31 +08:00
wit765
12eab8e785
all: rename ChainId to ChainID #16853 (#1456)
Co-authored-by: wit <wit765765346@gmail>
2025-09-09 22:54:34 +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
6f36533962
all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
JukLee0ira
5ad950ea51
all: Remove concept of public/private API definitions #25053 (#1141) 2025-06-24 15:15:25 +08:00
Daniel Liu
93c2745b7b
all: disable recording preimage of trie keys #21402 (#1054) 2025-06-17 13:10:47 +08:00
Daniel Liu
1d3e5cb455 core: prefetch next block state concurrently #19328 2025-04-28 16:57:56 +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
Daniel Liu
94b3ca1eeb
all: remove version field #25096 (#970) 2025-04-24 18:55:15 +08:00
Daniel Liu
4fb622bfd0
all: remove public field from rpc.API #25059 (#969) 2025-04-24 18:53:59 +08:00
JukLee0ira
63b04b4114
eth: some typo mistake (#16802) (#948) 2025-04-21 16:36:20 +08:00
Daniel Liu
b9a6c8c32d
cmd, core, eth, trie: add trie read caching layer (#18087) (#946) 2025-04-16 17:27:43 +08:00
JukLee0ira
b1e08e6642
all: refactor package node #21105 (#923) 2025-04-10 18:52:49 +08:00
Daniel Liu
a4c7d7f458 all: clean duplicate constants in package common 2025-04-07 16:43:01 +08:00
Daniel Liu
2697703c0f core, eth, params: make indexer configurable (#17188) 2025-03-10 15:41:53 +08:00
Daniel Liu
66e73ad32e cmd, les: remove light client code (#28586) 2025-03-10 15:40:07 +08:00
Daniel Liu
f039b26e7a light: CHT and bloom trie indexers working in light mode (#16534) 2025-03-06 15:30:48 +08:00
Daniel Liu
588dcd35ce cmd, common, core, eth: optimize rollback by flag 2025-03-01 11:34:32 +08:00
Daniel Liu
2a2711ad64 cmd, common, eth: copy constants after get chain id 2025-02-18 15:16:55 +08:00
Daniel Liu
ff987140dc eth: set networkID to chainId by default (#28250) 2025-02-17 09:17:31 +08:00
Daniel Liu
d8fb27b987 all: clean up and properly abstract database accesses (#19021) 2025-02-11 18:28:50 +08:00
Daniel Liu
bb8324357c params: log chain config a bit saner (#24904) 2025-02-05 18:10:06 +08:00
Daniel Liu
92f0d07e6d core: remove unnecessary fields in log (#17106 #19182) 2025-01-24 15:52:43 +08:00
Daniel Liu
97c50f97bb all: add read-only option to database 2025-01-24 14:24:39 +08:00
JukLee0ira
653b59710e core/rawdb: separate raw database access to own package (#16666 #19345) 2025-01-22 15:19:39 +08:00
Daniel Liu
240757a1ce all: remove empty function SaveData() 2024-12-28 09:04:02 +08:00
Daniel Liu
de7203ac88 eth/gasprice: remove default from config (#30080) 2024-11-13 09:30:55 +08:00
Daniel Liu
8b2e8d9b3a all: refactor txpool into it's own package in prep for 4844 (#26038) 2024-11-01 11:36:53 +08:00
Daniel Liu
fbecb8c5a5 all: fix staticcheck warning ST1006: don't use generic name self
The name of a method’s receiver should be a reflection of its identity;
often a one or two letter abbreviation of its type suffices (such as
“c” or “cl” for “Client”). Don’t use generic names such as “me”, “this”
or “self”, identifiers typical of object-oriented languages that place
more emphasis on methods as opposed to functions. The name need not be
as descriptive as that of a method argument, as its role is obvious and
serves no documentary purpose. It can be very short as it will appear
on almost every line of every method of the type; familiarity admits
brevity. Be consistent, too: if you call the receiver “c” in one method,
don’t call it “cl” in another.
2024-10-25 21:30:54 +08:00
Daniel Liu
a79411fa06 all: fix staticcheck warning ST1005: incorrectly formatted error string 2024-10-24 09:48:20 +08:00
wanwiset25
cb792ef34f Revert EIP-2464 2024-08-24 02:31:27 +07:00