go-ethereum/tests
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
..
evm-benchmarks@d8b88f4046 tests: update evm-benchmarks (#26255) 2022-11-28 11:13:41 +01:00
fuzzers core/vm: update gascosts for BLS12-381 + use gnark instead of kilic (#29441) 2024-04-16 10:53:43 +02:00
solidity all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
testdata@faf33b4714 tests: update tests (#29730) 2024-05-13 21:34:29 +08:00
block_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
block_test_util.go beacon, core, eth, miner: integrate witnesses into production Geth (#30069) 2024-09-20 16:43:42 +03:00
difficulty_test.go params: remove `EIP150Hash` from chainconfig (#27087) 2023-04-18 03:49:09 -04:00
difficulty_test_util.go all: add whitespace linter (#25312) 2022-07-25 13:14:03 +03:00
gen_btheader.go build, tests: add execution-spec-tests (#26985) 2023-08-26 15:42:27 +02:00
gen_difficultytest.go all: simplify timestamps to uint64 (#19372) 2019-04-02 23:28:48 +03:00
gen_stenv.go tests: add currentExcessBlobGas to state tests (#28735) 2023-12-28 11:39:28 +01:00
gen_sttransaction.go tests: use 'sender' in state tests if present (#28023) 2023-08-29 04:36:10 +02:00
init.go all: implement EIP-6110, execution layer triggered deposits (#29431) 2024-09-04 14:33:51 +02:00
init_test.go all: fix mismatched names in comments (#29348) 2024-03-26 21:01:28 +01:00
rlp_test.go tests: get test name from testing.T (#22941) 2021-05-25 22:47:14 +02:00
rlp_test_util.go internal,tests: replace noarg fmt.Errorf with errors.New (#27335) 2023-05-25 02:54:28 -04:00
state_test.go tests: update tests (#29730) 2024-05-13 21:34:29 +08:00
state_test_util.go core/state: state reader abstraction (#29761) 2024-09-05 13:10:47 +03:00
transaction_test.go tests: fix TransactionTest to actually run (#30272) 2024-08-08 13:50:00 +02:00
transaction_test_util.go tests: fix TransactionTest to actually run (#30272) 2024-08-08 13:50:00 +02:00