Commit graph

595 commits

Author SHA1 Message Date
Chen Kai
80ef312cb4
Merge branch 'ethereum:master' into portal 2024-10-23 23:59:22 +08: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
Chen Kai
c5236fc9a9
Merge branch 'ethereum:master' into portal 2024-10-17 14:40:34 +08: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
Rafael Sampaio
33843613e0 code cleanup and improved variable names 2024-10-15 17:41:29 -03:00
Rafael Sampaio
eca301a9b1 move logformat flag to portal network namespace 2024-10-15 16:29:45 -03:00
Rafael Sampaio
1865b12357 add flag to format logs 2024-10-15 16:21:05 -03:00
Chen Kai
1446e66d30 Merge branch 'gethmaster' into selfportal 2024-10-09 10:36:11 +08:00
Rafael Sampaio
d831ad6c25 reuse of geth flags and related code 2024-10-05 11:50:15 +08:00
Rafael Sampaio
8054d16b26 implementation of metrics influx, influxV2 and local web server 2024-10-05 11:50:15 +08:00
Rafael Sampaio
52c2bfb5b3 add stun server for ip discovery and flag stun 2024-10-03 23:44:13 -03:00
Sina M
40fd887df6
internal/ethapi: remove td field from block (#30386)
implement https://github.com/ethereum/execution-apis/pull/570
2024-10-01 11:36:56 +02:00
Ng Wei Han
db6ae7fa12
cmd/geth: remove deprecated lightchaindata db (#30527)
This PR removes the dependencies on `lightchaindata` db as the light
protocol has been deprecated and removed from the codebase.
2024-09-30 19:32:39 +03:00
Chen Kai
80d0a8bc17 Merge branch 'gethmaster' into selfportal 2024-09-30 15:01:29 +08:00
zhiqiangxu
118c84af57
cmd/utils: fix setEtherbase (#30488)
Make `setEtherbase` fall thorugh and handle `miner.pending.feeRecipient` after showing deprecation-warning for `miner.etherbase`-flag.
2024-09-23 09:17:18 +02:00
Péter Szilágyi
9326a118c7
beacon, core, eth, miner: integrate witnesses into production Geth (#30069)
This PR integrates witness-enabled block production, witness-creating
payload execution and stateless cross-validation into the `engine` API.
The purpose of the PR is to enable the following use-cases (for API
details, please see next section):

- Cross validating locally created blocks:
- Call `forkchoiceUpdatedWithWitness` instead of `forkchoiceUpdated` to
trigger witness creation too.
- Call `getPayload` as before to retrieve the new block and also the
above created witness.
- Call `executeStatelessPayload` against another client to
cross-validate the block.

- Cross validating locally processed blocks:
- Call `newPayloadWithWitness` instead of `newPayload` to trigger
witness creation too.
- Call `executeStatelessPayload` against another client to
cross-validate the block.

- Block production for stateless clients (local or MEV builders):
- Call `forkchoiceUpdatedWithWitness` instead of `forkchoiceUpdated` to
trigger witness creation too.
- Call `getPayload` as before to retrieve the new block and also the
above created witness.
- Propagate witnesses across the consensus libp2p network for stateless
Ethereum.

- Stateless validator validation:
- Call `executeStatelessPayload` with the propagated witness to
statelessly validate the block.

*Note, the various `WithWitness` methods could also *just be* an
additional boolean flag on the base methods, but this PR wanted to keep
the methods separate until a final consensus is reached on how to
integrate in production.*

---

The following `engine` API types are introduced:

```go
// StatelessPayloadStatusV1 is the result of a stateless payload execution.
type StatelessPayloadStatusV1 struct {
	Status          string      `json:"status"`
	StateRoot       common.Hash `json:"stateRoot"`
	ReceiptsRoot    common.Hash `json:"receiptsRoot"`
	ValidationError *string     `json:"validationError"`
}
```

- Add `forkchoiceUpdatedWithWitnessV1,2,3` with same params and returns
as `forkchoiceUpdatedV1,2,3`, but triggering a stateless witness
building if block production is requested.
- Extend `getPayloadV2,3` to return `executionPayloadEnvelope` with an
additional `witness` field of type `bytes` iff created via
`forkchoiceUpdatedWithWitnessV2,3`.
- Add `newPayloadWithWitnessV1,2,3,4` with same params and returns as
`newPayloadV1,2,3,4`, but triggering a stateless witness creation during
payload execution to allow cross validating it.
- Extend `payloadStatusV1` with a `witness` field of type `bytes` if
returned by `newPayloadWithWitnessV1,2,3,4`.
- Add `executeStatelessPayloadV1,2,3,4` with same base params as
`newPayloadV1,2,3,4` and one more additional param (`witness`) of type
`bytes`. The method returns `statelessPayloadStatusV1`, which mirrors
`payloadStatusV1` but replaces `latestValidHash` with `stateRoot` and
`receiptRoot`.
2024-09-20 16:43:42 +03:00
Marius van der Wijden
b0b67be0a2
all: remove forkchoicer and reorgNeeded (#29179)
This PR changes how sidechains are handled. 

Before the merge, it was possible to import a chain with lower td and not set it as canonical. After the merge, we expect every chain that we get via InsertChain to be canonical. Non-canonical blocks can still be inserted
with InsertBlockWIthoutSetHead.

If during the InsertChain, the existing chain is not canonical anymore, we mark it as a sidechain and send the SideChainEvents normally.
2024-09-04 15:03:06 +02:00
fearlessfe
d4d644c13c feat: refactor protocolId 2024-08-28 23:46:52 +08:00
lightclient
00294e9d28
cmd/utils,p2p: enable discv5 by default (#30327) 2024-08-20 16:02:54 +02:00
stevemilk
3c37db7989
all: clean up goerli flag and config (#30289)
Co-authored-by: lightclient <lightclient@protonmail.com>
2024-08-20 15:59:48 +02:00
Chen Kai
5bf4c2b2a9
Merge branch 'ethereum:master' into portal 2024-07-24 22:22:46 +08:00
minh-bq
35b4183caa
cmd/utils: allow configurating blob pool from flags (#30203)
Currently, we have 3 flags to configure blob pool. However, we don't
read these flags and set the blob pool configuration in eth config
accordingly. This commit adds a function to check if these flags are
provided and set blob pool configuration based on them.
2024-07-23 14:44:01 +02:00
Chen Kai
839a7877a8
Merge branch 'ethereum:master' into portal 2024-07-16 18:05:47 +08:00
Jeremy Schlatter
169aa91449
cmd/utils: fix typo in flag description (#30127) 2024-07-15 11:36:21 +02:00
Chen Kai
f8c05e17eb feat:add default bootnodes
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-06-18 19:51:30 +08:00
Chen Kai
6088495691 fix:merge geth p2p change
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-06-17 20:28:49 +08:00
Chen Kai
4641a25656 fix:change nat default any
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-06-13 15:45:35 +08:00
fearlessfe
42e6f336a4 feat: change document 2024-06-12 11:02:05 +08:00
jwasinger
85587d5ef2
cmd, core: prefetch reads too from tries if requested (#29807)
* cmd/utils, consensus/beacon, core/state: when configured via stub  flag: prefetch all reads from account/storage tries, terminate prefetcher synchronously.

* cmd, core/state: fix nil panic, fix error handling, prefetch nosnap too

* core/state: expand prefetcher metrics for reads and writes separately

* cmd/utils, eth: fix noop collect witness flag

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-06-11 11:10:07 +03:00
fearlessfe
1ed713ad1e feat: nat 2024-06-05 12:53:19 +08:00
thinkAfCod
b12bed8bde fix: cache node id and add logs
fix: cache node info
2024-05-19 00:07:37 +08:00
fearlessfe
bb0714d9a5 fix: panic 2024-05-06 23:53:09 +08:00
Chen Kai
e660629a78
Merge branch 'ethereum:master' into portal 2024-05-03 11:39:35 +08:00
felipe
c04b8e6d74
cmd/utils: require TTD and difficulty to be zero at genesis for dev mode (#29579) 2024-04-30 11:22:57 +02:00
fearlessfe
7a9af4697e feat: add web3_clientVersion rpc method 2024-04-25 13:04:55 +08:00
Chen Kai
5a6fe46250
Merge branch 'ethereum:master' into portal 2024-04-24 15:47:45 +08:00
Chris Ziogas
882d1e22f6
cmd/geth, cmd/utils: rename config and flag to VMTraceJsonConfig (#29573)
renames the yaml config field VMTraceConfig to VMTraceJsonConfig, in order to be consistent with the renaming of the CLI flag.
2024-04-24 07:53:16 +02:00
Chen Kai
3850aa6522
Merge branch 'ethereum:master' into portal 2024-04-22 17:19:34 +08:00
Felix Lange
82b0dec713
eth/filters: remove support for pending logs (#29574)
This change removes support for subscribing to pending logs. 

"Pending logs" were always an odd feature, because it can never be fully reliable. When support for it was added many years ago, the intention was for this to be used by wallet apps to show the 'potential future token balance' of accounts, i.e. as a way of notifying the user of incoming transfers before they were mined. In order to generate the pending logs, the node must pick a subset of all public mempool transactions, execute them in the EVM, and then dispatch the resulting logs to API consumers.
2024-04-22 10:31:17 +02:00
fearlessfe
9c0a5ccb74 feat: beacon start up 2024-04-17 18:29:33 +08:00
fearlessfe
5dc91e20ba feat: refactor start ip 2024-04-17 18:29:33 +08:00
Chen Kai
9ff196c88b
Merge branch 'ethereum:master' into portal 2024-04-17 12:04:14 +08:00
Chris Ziogas
72f69366de
c.d/utils: rename vmtrace.config to vmtrace.jsonconfig (#29554)
rename vmtrace.config to vmtrace.jsonconfig

for consinstency with t8ntool trace.jsonconfig
2024-04-16 15:31:19 +03:00
Chen Kai
56462f1df9
Merge branch 'ethereum:master' into portal 2024-04-15 15:20:58 +08:00
Abirdcfly
b179b7b8e7
all: remove duplicate word in comments (#29531)
This change removes some duplicate words in in comments
2024-04-15 08:34:31 +02:00
Chen Kai
e3c91b3fc5
Merge branch 'ethereum:master' into portal 2024-03-23 11:56:06 +08:00
Sina M
064f37d6f6
eth/tracers: live chain tracing with hooks (#29189)
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: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2024-03-22 18:53:53 +01:00
fearlessfe
0200913250 fix: add flags and change default http addr 2024-03-22 10:20:49 +08:00
fearlessfe
0b6714dea0 feat: remove flags for hive test 2024-03-19 19:40:32 +08:00
fearlessfe
afeaa102b4 feat: change flag name 2024-03-19 19:40:32 +08:00