Commit graph

2027 commits

Author SHA1 Message Date
Daniel Liu
640d448491
cmd/XDC, metrics/prometheus: fix staticcheck QF1012 (#1713) 2025-12-07 16:03:06 +05:30
Daniel Liu
eaaeea0cad
all: use slices.Sort() to sort strings (#1712) 2025-12-07 15:49:13 +05:30
Daniel Liu
c922f26d0c
all: replace strings.Split with more efficient strings.SplitSeq (#1698) 2025-12-07 15:42:23 +05:30
wit liu
fd78323211
cmd/utils: deprecate flag enable-0x-prefix (#1829) 2025-12-07 15:36:52 +05:30
wit liu
fac866138b
cmd/utils: fix disabling cache preimages through config file #33330 (#1837) 2025-12-04 10:32:10 +05:30
Daniel Liu
07328dcec4
core, eth, trie: abstract node scheme #25532 (#1123)
This PR introduces a node scheme abstraction. The interface is only implemented by `hashScheme` at the moment, but will be extended by `pathScheme` very soon.

Apart from that, a few changes are also included which is worth mentioning:

-  port the changes in the stacktrie, tracking the path prefix of nodes during commit
-  use ethdb.Database for constructing trie.Database. This is not necessary right now, but it is required for path-based used to open reverse diff freezer

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-11-17 11:25:08 +05:30
wit liu
39eb15531d
all: fix whitespace error of golangci-lint, remove extra empty lines (#1676) 2025-11-17 11:16:09 +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
71e8e27f84
all: remove mongodb support in XDCx (#1679)
* all: remove SDK node

* cmd: remove XDCXDBEngineFlag

* cmd: remove XDCXDBConnectionUrlFlag

* cmd, XDCx: remove XDCXDBReplicaSetNameFlag

* XDCx: remove ConnectionUrl

* all: remove mongodb support

* cmd: remove XDCXEnabledFlag
2025-11-15 16:50:02 +05:30
Daniel Liu
4716dc11af
cmd, internal: move func CheckExclusive() to package flags #31189 (#1747) 2025-11-15 16:47:38 +05:30
Daniel Liu
6d7c36bb8f
all: upgrade package version #30638 (#1745) 2025-11-15 16:46:54 +05:30
Daniel Liu
eef5242fa3
all: pre-allocate memory for slices and maps, close XFN-148 (#1714) 2025-11-14 20:13:36 +05:30
Daniel Liu
f65ecda9f1
cmd/puppeth: improve code (#1716) 2025-11-14 20:11:45 +05:30
Daniel Liu
28a4f25166
cmd, core, eth, trie: track deleted nodes #22225 #25757 (#1120)
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-11-12 13:32:22 +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
d451580b37
miner, XDPoS, XDC: close chanels by owner, close XFN-41 (#1641) 2025-11-03 14:52:31 +05:30
wit liu
6a1fa08d02
all: refactor to use builtin max/min #32694 (#1596) 2025-10-08 12:52:22 +08:00
wit liu
11e82672fe
cmd: fix lint error mirror (#1575) 2025-10-08 12:25:59 +08:00
Daniel Liu
5e9db6066d
console: add note about typing exit to exit #23602 (#1532)
* add explicit note about typing exit in console

* Add note about typing exit as alternative

Co-authored-by: Thad Guidry <thadguidry@gmail.com>
2025-10-08 12:22:52 +08:00
wit liu
cd74961cda
cmd: fix ineffectual assignment (#1563) 2025-09-27 10:40:38 +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
Daniel Liu
294591e67e
all: remove duplicate word in comments (#1570) 2025-09-24 07:57:33 +08:00
wit liu
2b658e7934
core: fix unnecessary conversion (#1565) 2025-09-24 07:55:14 +08:00
Daniel Liu
6c73723f47
cmd, console: drop geth js command #25000 (#1534) 2025-09-24 07:47:21 +08:00
Daniel Liu
db0cd1581f
console: don't exit on ctrl-c, only on ctrl-d #21660 (#1531)
* add interrupt counter

* remove interrupt counter, allow ctrl-C to clear ONLY, ctrl-D will terminate console, stop node

* format

* add instructions to exit

* fix tests

Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
2025-09-24 07:46:25 +08:00
Daniel Liu
22dc136ffe
cmd: replace passPHRASE with passWORD in any user interactions #19932 (#1535) 2025-09-21 19:31:00 +08:00
Daniel Liu
8615067df1
cmd, console, internal: support interrupting the js console #23387 (#1533) 2025-09-21 19:23:41 +08:00
Daniel Liu
5ad87e559f
cmd, console: password input fixes #20960 (#1524) 2025-09-21 18:59:34 +08:00
Wanwiset Peerapatanapokin
1f6bd2bae5
Merge pull request #1280 from XinFinOrg/XDPoSv2-privatenet-improve-genesis
Improve genesis for easy privatechain deployment
2025-09-20 19:03:52 +04:00
wanwiset25
30e1a9a7fd fix 2025-09-20 17:56:20 +04: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
wit liu
99e2885b03
all: fix misspell (#1510)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:27:52 +08:00
wit liu
4a6fccaf69
all: fix whitespace (#1506)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:23:06 +08:00
wanwiset25
ae696dc547 func CopyConstants choose local chain if unknown chainID 2025-09-14 15:21:26 +04:00
wanwiset25
a1e5a98377 update validator initial configs 2025-09-14 15:19:19 +04:00
wanwiset25
069cd8ebce fix wrong storage in genesis due to rlp changed behavior (EIP-2718) 2025-09-14 15:19:19 +04:00
wanwiset25
4df9699821 genesis wizard accept file input 2025-09-14 15:19:19 +04: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
7d4d81f586
eth/tracers, core/vm: remove time from trace output and tracing interface #26291 (#1311)
This removes the 'time' field from logs, as well as from the tracer interface. This change makes the trace output deterministic.  If a tracer needs the time they can measure it themselves. No need for evm to do this.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-09 09:26:10 +08:00
Daniel Liu
05a9e91898
cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416)
This PR implements a new version of the abigen utility (v2) which exists
along with the pre-existing v1 version.

Abigen is a utility command provided by go-ethereum that, given a
solidity contract ABI definition, will generate Go code to transact/call
the contract methods, converting the method parameters/results and
structures defined in the contract into corresponding Go types. This is
useful for preventing the need to write custom boilerplate code for
contract interactions.

Methods in the generated bindings perform encoding between Go types and
Solidity ABI-encoded packed bytecode, as well as some action (e.g.
`eth_call` or creating and submitting a transaction). This limits the
flexibility of how the generated bindings can be used, and prevents
easily adding new functionality, as it will make the generated bindings
larger for each feature added.

Abigen v2 was conceived of by the observation that the only
functionality that generated Go bindings ought to perform is conversion
between Go types and ABI-encoded packed data. Go-ethereum already
provides various APIs which in conjunction with conversion methods
generated in v2 bindings can cover all functionality currently provided
by v1, and facilitate all other previously-desired use-cases.

To generate contract bindings using abigen v2, invoke the `abigen`
command with the `--v2` flag. The functionality of all other flags is
preserved between the v2 and v1 versions.

The execution of `abigen --v2` generates Go code containing methods
which convert between Go types and corresponding ABI-encoded data
expected by the contract. For each input-accepting contract method and
the constructor, a "packing" method is generated in the binding which
converts from Go types to the corresponding packed solidity expected by
the contract. If a method returns output, an "unpacking" method is
generated to convert this output from ABI-encoded data to the
corresponding Go types.

For contracts which emit events, an unpacking method is defined for each
event to unpack the corresponding raw log to the Go type that it
represents.

Likewise, where custom errors are defined by contracts, an unpack method
is generated to unpack raw error data into a Go type.

For a smooth user-experience, abigen v2 comes with a number of utility
functions to be used in conjunction with the generated bindings for
performing common contract interaction use-cases. These include:

* filtering for historical logs of a given topic
* watching the chain for emission of logs with a given topic
* contract deployment methods
* Call/Transact methods

https://geth.ethereum.org will be updated to include a new tutorial page
for abigen v2 with full code examples. The page currently exists in a
PR: https://github.com/ethereum/go-ethereum/pull/31390 .

There are also extensive examples of interactions with contract bindings
in [test
cases](cc855c7ede/accounts/abi/bind/v2/lib_test.go)
provided with this PR.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-03 15:47:12 +08:00
Daniel Liu
e2edc41b50
all: mv loggers to eth/tracers #23892 (#1269) 2025-09-03 15:35:28 +08:00
Daniel Liu
031ea75eca
eth/tracers: package restructuring #23857 (#1266) 2025-08-29 05:26:36 +08:00
Daniel Liu
6f36533962
all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
Daniel Liu
516883d14c
all: snapshot dump + unify with trie dump #22795 (#1205) 2025-08-22 16:39:28 +08:00
Daniel Liu
4ec6e8cd58
cmd, node, p2p: implement whitelist and blacklist for peers (#1331) 2025-08-20 15:14:56 +08:00
Daniel Liu
36374be05f
eth/tracers: move tracing APIs into eth/tracers #22161 #22473 (#1252) 2025-08-08 10:25:43 +08:00
Daniel Liu
390ea247d3
cmd/XDC: fixes db unavailability for chain commands #21415 (#1204) 2025-07-28 16:56:37 +08:00