go-ethereum/cmd/geth
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
..
testdata cmd/geth: update testdata (vulncheck) (#29714) 2024-05-28 14:16:45 +02:00
accountcmd_test.go cmd: run tests in parallel (#28546) 2023-11-20 10:52:14 +01:00
accountcmd.go cmd/geth: make account commands not require datadir lock (#27084) 2023-04-27 06:57:29 -04:00
attach_test.go all: fix mismatched names in comments (#29348) 2024-03-26 21:01:28 +01:00
chaincmd.go core/state: state reader abstraction (#29761) 2024-09-05 13:10:47 +03:00
config.go eth/ethconfig: remove LES server config (#30298) 2024-08-15 11:42:39 +02:00
consolecmd_test.go all: clean up goerli flag and config (#30289) 2024-08-20 15:59:48 +02:00
consolecmd.go cmd/geth: remove unused parameter (#29602) 2024-04-22 16:13:03 +08:00
dbcmd.go core/rawdb, triedb, cmd: create an isolated disk namespace for verkle (#30105) 2024-07-16 16:17:58 +03:00
exportcmd_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
genesis_test.go cmd/geth: fix failing test (#28322) 2023-10-12 09:54:00 +02:00
logging_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
logtestcmd_active.go cmd/geth, internal/debug: get rid of by-default log config (#28801) 2024-01-12 15:59:03 +02:00
logtestcmd_inactive.go cmd/geth: test for logging-output (#28373) 2023-10-25 17:57:12 +02:00
main.go beacon, core, eth, miner: integrate witnesses into production Geth (#30069) 2024-09-20 16:43:42 +03:00
misccmd.go all: remove ethash pow, only retain shims needed for consensus and tests (#27178) 2023-05-03 12:58:39 +03:00
run_test.go cmd, les, tests: remove light client code (#28586) 2023-11-23 16:28:26 +02:00
snapshot.go cmd/geth: remove unused param (#29952) 2024-06-08 13:04:16 +02:00
verkle.go cmd, core, params, trie: add verkle access witness gas charging (#29338) 2024-05-10 20:13:11 +02:00
version_check_test.go cmd: run tests in parallel (#28546) 2023-11-20 10:52:14 +01:00
version_check.go cmd: migrate to urfave/cli/v2 (#24751) 2022-06-27 18:22:36 +02:00