Commit graph

801 commits

Author SHA1 Message Date
Jared Wasinger
2e84d09c1c improve --experimental.bal flag description 2025-10-17 13:31:48 +08:00
Jared Wasinger
b33cf06ce7 all: add block access list construction via flag --experimentalbal. When enabled, post-Cancun blocks which lack access lists will have them constructed on execution during import. When importing blocks which contain access lists, transaction execution and state root calculation is performed in parallel. 2025-10-17 13:28:04 +08:00
aodhgan
ff54ca02de
internal/ethapi: add eth_SendRawTransactionSync (#32830)
New RPC method eth_sendRawTransactionSync(rawTx, timeoutMs?) that
submits a signed tx and blocks until a receipt is available or a timeout
elapses.

Two CLI flags to tune server-side limits:

--rpc.txsync.defaulttimeout (default wait window)

--rpc.txsync.maxtimeout (upper bound; requests are clamped)

closes https://github.com/ethereum/go-ethereum/issues/32094

---------

Co-authored-by: aodhgan <gawnieg@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-16 17:34:47 +02:00
cui
7d8ccddaac
all: refactor to use builtin max/min (#32694)
Replaces the last few instances of `math.Max` and `math.Min` with go builtins.
2025-09-25 07:05:27 -06:00
lightclient
965ffff9ac
all: add bpo1 and bpo2 overrides (#32737)
This adds overrides to the cli for BPO1 and BPO2.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-09-25 10:21:41 +02:00
rjl493456442
aa37bd063d
cmd, tests: fix snapshot dump and export-preimages (#32650)
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
Address #32646
2025-09-22 14:48:18 +08:00
Klimov Sergei
b9e2eb5944
beacon/config: fix LoadForks with non-string values (#32609)
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
Fixes a crash when loading the beacon chain config if new fields like
`BLOB_SCHEDULE: []` are present.
Previously, the config loader assumed all values were strings, causing
errors such as:

```
Fatal: Could not load beacon chain config '/network-configs/config.yaml': failed to parse beacon chain config file: yaml: unmarshal errors:
line 242: cannot unmarshal !!seq into string
```

This PR updates the parsing logic to handle non-string values correctly
and adds explicit validation for fork fields.
2025-09-19 01:30:00 +02:00
Long Vu
dce511c1e5
eth/filters, cmd: add config of eth_getLogs address limit (#32327)
Add cli configurable limit for the number of addresses allowed in
eth_getLogs filter criteria:
https://github.com/ethereum/go-ethereum/issues/32264
 
 Key changes:
- Added --rpc.getlogmaxaddrs CLI flag (default: 1000) to configure the
maximum number of addresses
- Updated ethconfig.Config with FilterMaxAddresses field for
configuration management
- Modified filter system to use the configurable limit instead of the
hardcoded maxAddresses constant
- Enhanced test coverage with new test cases for address limit
validation
- Removed hardcoded validation from JSON unmarshaling, moving it to
runtime validation

Please notice that I remove the check at FilterCriteria UnmarshalJSON
because the runtime config can not pass into this validation.

Please help review this change!

---------

Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-19 00:53:40 +02:00
Guillaume Ballet
2d3704c4d8
core/stateless: add vmwitnessstats cli flag to report leaf stats + log to console (#32619)
The format that is currently reported by the chain isn't very useful, as
it gives an average for ALL the nodes, and not only the leaves, which
skews the results.

Also, until now there was no way to activate the reporting of errors.

We also decided that metrics weren't the right tool to report this data,
so we decided to dump it to the console if the flag is enabled. A better
system should be built, but for now, printing to the logs does the job.
2025-09-17 15:06:39 +02:00
Delweng
c4ec4504bb
core/state: state size tracking (#32362)
Add state size tracking and retrieve api, start geth with `--state.size-tracking`, 
the initial bootstrap is required (around 1h on mainnet), after the bootstrap, 
use `debug_stateSize()` RPC to retrieve the state size:

```
> debug.stateSize()
{
  accountBytes: "0x39681967b",
  accountTrienodeBytes: "0xc57939f0c",
  accountTrienodes: "0x198b36ac",
  accounts: "0x129da14a",
  blockNumber: "0x1635e90",
  contractCodeBytes: "0x2b63ef481",
  contractCodes: "0x1c7b45",
  stateRoot: "0x9c36a3ec3745d72eea8700bd27b90dcaa66de0494b187c5600750044151e620a",
  storageBytes: "0x18a6e7d3f1",
  storageTrienodeBytes: "0x2e7f53fae6",
  storageTrienodes: "0x6e49a234",
  storages: "0x517859c5"
}
```

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-09-08 14:00:23 +08:00
Delweng
8ce2047348
cmd/geth: set trie journal for pathdb (#32531)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
As in #32060 we introduced the file based journal path, for the other
sub command(eg: snapshot, db), we should also pass the directory to the
triedb, else the subcommand(eg: `geth snapshot`) failed to run:

```bash
geth snapshot verify-state --datadir /geth-data
...
INFO [09-02|02:12:29.493] Allocated cache and file handles         database=/geth-data/geth/chaindata cache=512.00MiB handles=524,288
INFO [09-02|02:12:32.746] Opened ancient database                  database=/geth-data/geth/chaindata/ancient/chain readonly=true
INFO [09-02|02:12:32.746] Opened Era store                         datadir=/geth-data/geth/chaindata/ancient/chain/era
INFO [09-02|02:12:32.758] State scheme set to already existing     scheme=path
INFO [09-02|02:12:32.760] Load database journal from disk
INFO [09-02|02:12:32.764] Failed to load journal, discard it       err="journal not found"
INFO [09-02|02:12:32.789] Opened ancient database                  database=/geth-data/geth/chaindata/ancient/state readonly=true
INFO [09-02|02:12:32.790] Initialized path database                readonly=true triecache=0.00B statecache=0.00B buffer=0.00B history="entire chain"
ERROR[09-02|02:12:32.791] Failed to verify state                   root=c5458d..4cc785 err="unknown layer: c5458d476da0136a67ef24a93b909aa5c29efa5c5b885dbd1fbaed4e784cc785"
```
2025-09-05 10:59:11 +08:00
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