Commit graph

790 commits

Author SHA1 Message Date
rjl493456442
a7aed7bd6f
cmd, eth, internal: introduce debug_sync (#32177)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Alternative implementation of https://github.com/ethereum/go-ethereum/pull/32159
2025-07-28 14:57:45 +08:00
Delweng
17903fedf0
triedb/pathdb: introduce file-based state journal (#32060)
Introduce file-based state journal in path database, fixing
the Pebble restriction when the journal size exceeds 4GB.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-07-15 11:45:20 +08:00
maskpp
bd5b55e6a9
cmd/utils: add the missing check for the HoodiFlag in blsync (#32179)
Hoodi network flag should be exclusive to other network flags for both blysnc standalone and integrated mode.
2025-07-09 10:49:06 -06:00
rjl493456442
e71487b033
cmd, eth/catalyst: exit geth only if exitWhenSynced is specified (#32149)
This pull request modifies the behavior of `--synctarget` to terminate
the node only when `--exitWhenSynced` is explicitly specified.
2025-07-08 15:51:08 +08:00
rjl493456442
dd7d144745
cmd/utils: update flag description of gcmode (#32145) 2025-07-04 12:17:44 +02:00
Zhou
f786b2a767
cmd/utils: show full deprecated flags (#32141)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This is a follow up PR after #32128 , Seems I've missed to add
--txlookuplimit as hidden. In hte meanwhile, I also add the other 
deprecated flags into the output of `show-deprecated-flags`
2025-07-04 09:40:16 +08:00
Zhou
97645caf80
cmd/utils, internal/debug: hide the deprecated flags (#32128)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
Some of the flags were deprecated, so try to hide them in the help
message. And move the `--vmodule` and `--logjson` flags to the
DeprecatedCategory.
2025-07-03 13:23:00 +08:00
Delweng
8e17b371fd
all: replace override.prague with osaka (#32093)
replace `--override.prague` with `--override.osaka`

Signed-off-by: jsvisa <delweng@gmail.com>
2025-06-27 15:18:05 +08:00
lightclient
429e821fa2
cmd/utils: fix formatting for beacon flag errors to fit Fatalf form (#32090)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Noticed that the errors for the blsync flags were not formatted
correctly for `Fatalf(..)`.
2025-06-25 10:42:45 +08:00
rjl493456442
9c5c0e37bf
core/rawdb, triedb/pathdb: implement history indexer (#31156)
This pull request is part-1 for shipping the core part of archive node
in PBSS mode.
2025-06-24 14:36:12 +02:00
rjl493456442
ac50181b74
core: consolidate BlockChain constructor options (#31925)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
In this pull request, the original `CacheConfig` has been renamed to `BlockChainConfig`.

Over time, more fields have been added to `CacheConfig` to support
blockchain configuration. Such as `ChainHistoryMode`, which clearly extends
beyond just caching concerns.

Additionally, adding new parameters to the blockchain constructor has
become increasingly complicated, since it’s initialized across multiple
places in the codebase. A natural solution is to consolidate these arguments 
into a dedicated configuration struct.

As a result, the existing `CacheConfig` has been redefined as `BlockChainConfig`.
Some parameters, such as `VmConfig`, `TxLookupLimit`, and `ChainOverrides`
have been moved into `BlockChainConfig`. Besides, a few fields in `BlockChainConfig`
were renamed, specifically:

- `TrieCleanNoPrefetch` -> `NoPrefetch`
- `TrieDirtyDisabled` -> `ArchiveMode`

Notably, this change won't affect the command line flags or the toml
configuration file. It's just an internal refactoring and fully backward-compatible.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-19 12:21:15 +02:00
Joe Chen
35c5b4fafd
cmd/utils: update SepoliaFlag usage (#31961)
The Sepolia testnet has transitioned to pos following The Merge.
2025-06-04 15:07:15 +02:00
Sina M
a7d9b52eaf
core/rawdb: integrate eradb backend for RPC (#31604)
This implements a backing store for chain history based on era1 files.
The new store is integrated with the freezer. Queries for blocks and receipts
below the current freezer tail are handled by the era store.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-06-03 10:47:38 +02:00
Arya Nair
d821f7f297
cmd/geth, cmd/utils: log prefunded account/key in ephemeral development mode (#31898)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR modifies the disclaimer/banner that is printed when starting up
Geth in dev mode:
* if the client is spun up in ephemeral dev mode with a keystore
override, the address of the first (prefunded) account is printed.
* if the client is spun up in ephemeral mode without a keystore
override, the genesis allocation contains a single static prefunded EOA
account. It's address and private key are logged.
* the banner is printed at the end of client initialization to make it
more prominent. Previously, it was logged towards the beginning of
client initialization and subsequent logging from startup filled the
terminal, pushing it out of view of the user.

Other change is that we now use a static prefunded dev account instead
of generating a random one when instantiating a new dev mode chain.

This is an example of what the banner looks like:
```
WARN [05-28|23:05:16.475] You are running Geth in --dev mode. Please note the following:
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]   1. This mode is only intended for fast, iterative development without assumptions on
WARN [05-28|23:05:16.475]      security or persistence.
WARN [05-28|23:05:16.475]   2. The database is created in memory unless specified otherwise. Therefore, shutting down
WARN [05-28|23:05:16.475]      your computer or losing power will wipe your entire block data and chain state for
WARN [05-28|23:05:16.475]      your dev environment.
WARN [05-28|23:05:16.475]   3. A random, pre-allocated developer account will be available and unlocked as
WARN [05-28|23:05:16.475]      eth.coinbase, which can be used for testing. The random dev account is temporary,
WARN [05-28|23:05:16.475]      stored on a ramdisk, and will be lost if your machine is restarted.
WARN [05-28|23:05:16.475]   4. Mining is enabled by default. However, the client will only seal blocks if transactions
WARN [05-28|23:05:16.475]      are pending in the mempool. The miner's minimum accepted gas price is 1.
WARN [05-28|23:05:16.475]   5. Networking is disabled; there is no listen-address, the maximum number of peers is set
WARN [05-28|23:05:16.475]      to 0, and discovery is disabled.
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]  Running in ephemeral mode.  The following account has been prefunded in the genesis:
WARN [05-28|23:05:16.475] 
WARN [05-28|23:05:16.475]        Account
WARN [05-28|23:05:16.475]        ------------------
WARN [05-28|23:05:16.475]        0x71562b71999873db5b286df957af199ec94617f7 (10^49 ETH)
WARN [05-28|23:05:16.475]  
WARN [05-28|23:05:16.475]        Private Key
WARN [05-28|23:05:16.475]        ------------------
WARN [05-28|23:05:16.475]        0xb71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291
WARN [05-28|23:05:16.475] 
```

closes #31796

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2025-05-29 12:20:39 +08:00
Csaba Kiraly
e79177d1bc
cmd/utils: remove duplicate code for influxDB tags (#31854)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
remove duplicate code

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-05-19 12:56:12 +02:00
Marius van der Wijden
7e79254605
eth/protocols/eth: implement eth/69 (#29158)
This PR implements eth/69. This protocol version drops the bloom filter
from receipts messages, reducing the amount of data needed for a sync
by ~530GB (2.3B txs * 256 byte) uncompressed. Compressed this will
be reduced to ~100GB

The new version also changes the Status message and introduces the
BlockRangeUpdate message to relay information about the available history
range.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-05-16 17:10:47 +02:00
Sina M
57e985ecab
cmd/utils: remove deprecated LES flags (#31838)
They were not widely used in users setups.
2025-05-16 10:20:36 +02:00
maskpp
52dbd206bb
cmd/utils: always record preimages in dev mode (#31821)
Fix a todo: force-enable this in --dev mode

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2025-05-15 15:32:20 +08:00
jwasinger
51b34efebc
cmd/utils: don't allow network ID override if a preset network is specified (#31630) 2025-05-06 12:40:03 +08:00
Marius van der Wijden
947fd3a834
crypto/kzg4844: add ComputeCells functionality (#31378)
For PeerDAS, we need to compute cell proofs. Both ckzg and gokzg support
computing these cell proofs.
This PR does the following:

- Update the go-kzg library from "github.com/crate-crypto/go-kzg-4844"
to "github.com/crate-crypto/go-eth-kzg" which will be the new upstream
for go-kzg moving forward
- Update ckzg from v1.0.0 to v2.0.1 and switch to /v2
- Updates the trusted setup to contain the g1 points both in lagrange
and monomial form
- Expose `ComputeCells` to compute the cell proofs
2025-04-29 14:42:17 +02:00
Felföldi Zsolt
9f83e9e673
beacon/blsync: add checkpoint import/export file feature (#31469)
This PR adds a new `--beacon.checkpoint.file` config flag to geth and
blsync which specifies a checkpoint import/export file. If a file with
an existing checkpoint is specified, it is used for initialization
instead of the hardcoded one (except when `--beacon.checkpoint` is also
specified simultaneously). Whenever the client encounters a new valid
finality update with a suitable finalized beacon block root at an epoch
boundary, it saves the block root in hex format to the checkpoint file.
2025-04-03 16:04:11 +02:00
rjl493456442
90d44e715d
core, eth/downloader: implement pruning mode sync (#31414)
This pull request introduces new sync logic for pruning mode. The downloader will now skip
insertion of block bodies and receipts before the configured history cutoff point.

Originally, in snap sync, the header chain and other components (bodies and receipts) were
inserted separately. However, in Proof-of-Stake, this separation is unnecessary since the
sync target is already verified by the CL.

To simplify the process, this pull request modifies `InsertReceiptChain` to insert headers
along with block bodies and receipts together. Besides, `InsertReceiptChain` doesn't have
the notion of reorg, as the common ancestor is always be found before the sync and extra
side chain is truncated at the beginning if they fall in the ancient store. The stale
canonical chain flags will always be rewritten by the new chain. Explicit reorg logic is
no longer required in `InsertReceiptChain`.
2025-04-03 15:16:35 +02:00
Delweng
4add312c8a
cmd: apply snapshot cache flag in the MakeChain (#31534) 2025-04-01 20:10:22 +08:00
Shude Li
4ff5093df1
all: use fmt.Appendf instead of fmt.Sprintf where possible (#31301) 2025-03-25 14:53:02 +01:00
maskpp
8e3cd41b04
cmd/utils: force hash scheme for archive mode (#31439) 2025-03-20 13:14:13 +08:00
Delweng
dba58830e9
cmd: set name to chaindata for all the opened db (#31352)
When I'm running `geth import --metrics`, the metrics is different to
normal `geth --metrics`, so the grafana dashboard needs to be updated,
eg: `eth_db_chaindata_disk_read` vs `disk_read`.

So I think we should always set the name to `eth/db/chaindata` for more
convenient.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2025-03-18 21:32:29 +08:00
Marius van der Wijden
668118bfe1
params: add hoodi testnet definition (#31406)
Adds support for the new hoodi testnet. Hoodi is meant for stakers to test
their setup. For more info please refer to https://hoodi.ethpandaops.io/.
2025-03-18 12:07:49 +01:00
Felföldi Zsolt
d85f796356
eth/filters: implement log filter using new log index (#31080)
This PR is #2 of a 3-part series that implements the new log index
intended to replace core/bloombits.
Based on https://github.com/ethereum/go-ethereum/pull/31079
Replaces https://github.com/ethereum/go-ethereum/pull/30370

This part replaces the old bloombits based log search logic in
`eth/filters` to use the new `core/filtermaps` logic.

FilterMaps data structure explanation:
https://gist.github.com/zsfelfoldi/a60795f9da7ae6422f28c7a34e02a07e

Log index generator code overview:
https://gist.github.com/zsfelfoldi/97105dff0b1a4f5ed557924a24b9b9e7

Search pattern matcher code overview:
https://gist.github.com/zsfelfoldi/5981735641c956afb18065e84f8aff34

Note that the possibility of a tree hashing scheme and remote proof
protocol are mentioned in the documents above but they are not exactly
specified yet. These specs are WIP and will be finalized after the local
log indexer/filter code is finalized and merged.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-03-17 18:59:04 +01:00
Shude Li
1cdf4d6da7
eth/catalyst: set FeeRecipient in dev mode (#31316)
this adds 2 features to improve `geth --dev` experience.

1. we don't need to use `dev_SetFeeRecipient` to set initial coinbase
address. it was a pain.
2. we don't need to unlock keystore if we don't use it. we had it
because of clique.
2025-03-17 09:32:44 +01:00
Vladimir Támara Patiño
7d99f7df00
cmd/utils: fix geth test issue on OpenBSD (#31357) 2025-03-15 18:35:10 +01:00
Felix Lange
1ca2da81e6
eth/ethconfig: add HistoryMode (#31365)
Here I am adding a config option and geth flag (`--history.chain`) for
configuring history pruning. There are two options available:

- `--history.chain all` is the default and will keep all history like
before.
- `--history.chain postmerge` will configure the history cutoff point to
the merge block.

The option doesn't actually do anything right now, but we need it as a
precursor for other history pruning changes.
2025-03-13 11:43:00 +01:00
Delweng
915d9d9de5
cmd: ctrl-c to halt the whole import process (#31360)
When I press Ctrl-C during the import of multiple files, the import
process will still attempt to import the subsequent files. However, in
normal circumstances, users would expect the import to stop immediately
upon pressing Ctrl-C.

And because the current file was not finished importing, subsequent
import tasks often fail due to an `unknown ancestor` error.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-03-12 12:20:40 +01:00
lightclient
4cdd7c8631
cmd,eth,les: replace Cancun override flag with Prague (#31341)
It's that time of the cycle, should have this ready to go for mainnet
Prague release.
2025-03-10 07:10:16 -06:00
Felföldi Zsolt
939a804146
cmd/workload: RPC workload tests for filters and history (#31189)
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-02-27 00:07:14 +01:00
levisyin
d103f179b9
build: replace tenv linter with usetesting (#31172) 2025-02-21 13:36:18 +01:00
piersy
68d477670c
utils: clarify description for history.state flag (#31164) 2025-02-18 13:50:19 +08:00
Ryan Tinianov
9b9e7ccacf
all: add build tags for wasip1 (#31090) 2025-01-30 16:58:53 +01:00
Péter Szilágyi
39638c81c5
all: nuke total difficulty (#30744)
The total difficulty is the sum of all block difficulties from genesis
to a certain block. This value was used in PoW for deciding which chain
is heavier, and thus which chain to select. Since PoS has a different
fork selection algorithm, all blocks since the merge have a difficulty
of 0, and all total difficulties are the same for the past 2 years.

Whilst the TDs are mostly useless nowadays, there was never really a
reason to mess around removing them since they are so tiny. This
reasoning changes when we go down the path of pruned chain history. In
order to reconstruct any TD, we **must** retrieve all the headers from
chain head to genesis and then iterate all the difficulties to compute
the TD.

In a world where we completely prune past chain segments (bodies,
receipts, headers), it is not possible to reconstruct the TD at all. In
a world where we still keep chain headers and prune only the rest,
reconstructing it possible as long as we process (or download) the chain
forward from genesis, but trying to snap sync the head first and
backfill later hits the same issue, the TD becomes impossible to
calculate until genesis is backfilled.

All in all, the TD is a messy out-of-state, out-of-consensus computed
field that is overall useless nowadays, but code relying on it forces
the client into certain modes of operation and prevents other modes or
other optimizations. This PR completely nukes out the TD from the node.
It doesn't compute it, it doesn't operate on it, it's as if it didn't
even exist.

Caveats:

- Whenever we have APIs that return TD (devp2p handshake, tracer, etc.)
we return a TD of 0.
- For era files, we recompute the TD during export time (fairly quick)
to retain the format content.
- It is not possible to "verify" the merge point (i.e. with TD gone, TTD
is useless). Since we're not verifying PoW any more, just blindly trust
it, not verifying but blindly trusting the many year old merge point
seems just the same trust model.
- Our tests still need to be able to generate pre and post merge blocks,
so they need a new way to split the merge without TTD. The PR introduces
a settable ttdBlock field on the consensus object which is used by tests
as the block where originally the TTD happened. This is not needed for
live nodes, we never want to generate old blocks.
- One merge transition consensus test was disabled. With a
non-operational TD, testing how the client reacts to TTD is useless, it
cannot react.

Questions:

- Should we also drop total terminal difficulty from the genesis json?
It's a number we cannot react on any more, so maybe it would be cleaner
to get rid of even more concepts.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-01-28 18:55:41 +01:00
zhen peng
75526bb8e0
p2p/nat: add stun protocol (#31064)
This implements a basic mechanism to query the node's external IP using
a STUN server. There is a built-in list of public STUN servers for convenience.
The new detection mechanism must be selected explicitly using `--nat=stun` 
and is not enabled by default in Geth.

Fixes #30881

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-24 16:16:02 +01:00
rjl493456442
37c0e6992e
cmd, core, miner: rework genesis setup (#30907)
This pull request refactors the genesis setup function, the major
changes are highlighted here:

**(a) Triedb is opened in verkle mode if `EnableVerkleAtGenesis` is
configured in chainConfig or the database has been initialized previously with
`EnableVerkleAtGenesis` configured**.

A new config field `EnableVerkleAtGenesis` has been added in the
chainConfig. This field must be configured with True if Geth wants to initialize 
the genesis in Verkle mode.

In the verkle devnet-7, the verkle transition is activated at genesis.
Therefore, the verkle rules should be used since the genesis. In production
networks (mainnet and public testnets), verkle activation always occurs after
the genesis block. Therefore, this flag is only made for devnet and should be
deprecated later. Besides, verkle transition at non-genesis block hasn't been
implemented yet, it should be done in the following PRs.

**(b) The genesis initialization condition has been simplified**
There is a special mode supported by the Geth is that: Geth can be
initialized with an existing chain segment, which can fasten the node sync
process by retaining the chain freezer folder.

Originally, if the triedb is regarded as uninitialized and the genesis block can
be found in the chain freezer, the genesis block along with genesis state will be
committed. This condition has been simplified to checking the presence of chain
config in key-value store. The existence of chain config can represent the genesis
has been committed.
2025-01-14 11:49:30 +01:00
Martin HS
9045b79bc2
metrics, cmd/geth: change init-process of metrics (#30814)
This PR modifies how the metrics library handles `Enabled`: previously,
the package `init` decided whether to serve real metrics or just
dummy-types.

This has several drawbacks: 
- During pkg init, we need to determine whether metrics are enabled or
not. So we first hacked in a check if certain geth-specific
commandline-flags were enabled. Then we added a similar check for
geth-env-vars. Then we almost added a very elaborate check for
toml-config-file, plus toml parsing.

- Using "real" types and dummy types interchangeably means that
everything is hidden behind interfaces. This has a performance penalty,
and also it just adds a lot of code.

This PR removes the interface stuff, uses concrete types, and allows for
the setting of Enabled to happen later. It is still assumed that
`metrics.Enable()` is invoked early on.

The somewhat 'heavy' operations, such as ticking meters and exp-decay,
now checks the enable-flag to prevent resource leak.

The change may be large, but it's mostly pretty trivial, and from the
last time I gutted the metrics, I ensured that we have fairly good test
coverage.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-10 13:27:29 +01:00
Felix Lange
4afab7ef76
eth/downloader: move SyncMode to package eth/ethconfig (#30847)
Lots of packages depend on eth/downloader just for the SyncMode type.
Since we have a dedicated package for eth protocol configuration, it
makes more sense to define SyncMode there, turning eth/downloader into
more of a leaf package.
2024-12-03 09:30:26 +01:00
Martin HS
a5f0001845
cmd/geth: remove unlock commandline flag (#30737)
This is one further step towards removing account management from
`geth`. This PR deprecates the flag `unlock`, and makes the flag moot:
unlock via geth is no longer possible.
2024-11-15 10:15:15 +01:00
Felföldi Zsolt
7cbce8ed58
beacon/blsync: remove cli dependencies (#30720)
This PR moves chain config related code (config file processing, fork
logic, network defaults) from `beacon/types` and `beacon/blsync` into
`beacon/params` while the command line flag logic of the chain config is
moved into `cmd/utils`, thereby removing the cli dependencies from
package `beacon` and its sub-packages.
2024-11-08 15:21:00 +01:00
Marius van der Wijden
9c08631bb0
cmd/utils: change blssync.JWTSecretFlag to DirectoryFlag (#30729)
closes https://github.com/ethereum/go-ethereum/issues/30304

We already use `DirectoryFlag` for `authrpc.jwtsecret` which expands the
tilde, so this should work out of the box
2024-11-06 18:24:55 +01:00
Martin HS
f3b4bbbaf3
all: remove personal RPC namespace (#30704)
This PR is a first step towards removing account management from geth,
and contains a lot of the user-facing changes.

With this PR, the `personal` namespace disappears. **Note**: `personal`
namespace has been deprecated for quite some time (since
https://github.com/ethereum/go-ethereum/pull/26390 1 year and 8 months
ago), and users who have wanted to use it has been forced to used the
flag `--rpc.enabledeprecatedpersonal`. So I think it's fairly
non-controversial to drop it at this point.

Specifically, this means: 

- Account/wallet listing
  -`personal.getListAccounts`  
  -`personal.listAccounts`     
  -`personal.getListWallets`   
  -`personal.listWallets`      
- Lock/unlock
  -`personal.lockAccount`      
  -`personal.openWallet`       
  -`personal.unlockAccount`
- Sign ops
  -`personal.sign`             
  -`personal.sendTransaction`  
  -`personal.signTransaction`  
- Imports / inits
  -`personal.deriveAccount`    
  -`personal.importRawKey`     
  -`personal.initializeWallet` 
  -`personal.newAccount`       
  -`personal.unpair` 
- Other: 
  -`personal.ecRecover`        


The underlying keystores and account managent code is still in place,
which means that `geth --dev` still works as expected, so that e.g. the
example below still works:

```
> eth.sendTransaction({data:"0x6060", value: 1, from:eth.accounts[0]})
```	

Also, `ethkey` and `clef` are untouched. 

With the removal of `personal`, as far as I know we have no more API
methods which contain credentials, and if we want to implement
logging-capabilities of RPC ingress payload, it would be possible after
this.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-10-31 19:53:35 +01:00
Péter Szilágyi
a1d049c1c4
internal/flags: remove low-use type TextMarshalerFlag (#30707)
Currently we have a custom TextMarshalerFlag. It's a nice idea, allowing
anything implementing text marshaller to be used as a flag. That said,
we only ever used it in one place because it's not that obvious how to
use and it needs some boilerplate on the type itself too, apart of the
heavy boilerplate got the custom flag.

All in all there's no *need* to drop this feature just now, but while
porting the cmds over to cli @v3, all other custom flags worker
perfectly, whereas this one started crashing deep inside the cli
package. The flag handling in v3 got rebuild on generics and there are a
number of new methods needed; and my guess is that maybe one of them
doesn't work like this flag currently is designed too.

We could definitely try and redesign this flag for cli v3... but all
that effort and boilerplate just to use it for 1 flag in 1 location,
seems not worth it. So for now I'm suggesting removing it and maybe
reconsider a similar feature in cli v3 with however it will work.
2024-10-31 19:52:39 +01:00
Péter Szilágyi
5230b06d51
cmd/utils, eth/ethconfig: remove some ancient leftover flag (#30705)
This is a flag leftover from the swarm era. No need to deprecate it,
it's been useless/dead forever now.
2024-10-31 16:03:47 +01:00
jwasinger
478012ab23
all: remove TerminalTotalDifficultyPassed (#30609)
rebased https://github.com/ethereum/go-ethereum/pull/29766 . The
downstream branch appears to have been deleted and I don't have perms to
push to that fork.

`TerminalTotalDifficultyPassed` is removed. `TerminalTotalDifficulty`
must now be non-nil, and it is expected that networks are already
merged: we can only import PoW/Clique chains, not produce blocks on
them.

---------

Co-authored-by: stevemilk <wangpeculiar@gmail.com>
2024-10-23 08:26:18 +02:00
Sina M
978ca5fc5e
eth/tracers: various fixes (#30540)
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.
2024-10-17 06:51:47 +02:00