Permit a null LVH from an INVALID response to newPayload (#4037)

## Issue Addressed

NA

## Proposed Changes

As discovered in #4034, Lighthouse is not accepting `latest_valid_hash == None` in an `INVALID` response to `newPayload`. The `null`/`None` response *was* illegal at one point, however it was added in https://github.com/ethereum/execution-apis/pull/254.

This PR brings Lighthouse in line with the standard and should fix the root cause of what #4034 patched around.

## Additional Info

NA
This commit is contained in:
Paul Hauner
2023-03-03 04:12:50 +00:00
parent 2b6348781a
commit cac3a66be4
5 changed files with 81 additions and 54 deletions

View File

@@ -7,7 +7,7 @@ use std::{env, fs::File};
use tempfile::TempDir;
use unused_port::unused_tcp_port;
// const GETH_BRANCH: &str = "master";
const GETH_BRANCH: &str = "master";
const GETH_REPO_URL: &str = "https://github.com/ethereum/go-ethereum";
pub fn build_result(repo_dir: &Path) -> Output {
@@ -27,9 +27,7 @@ pub fn build(execution_clients_dir: &Path) {
}
// Get the latest tag on the branch
// TODO: Update when version is corrected
// let last_release = build_utils::get_latest_release(&repo_dir, GETH_BRANCH).unwrap();
let last_release = "v1.11.1";
let last_release = build_utils::get_latest_release(&repo_dir, GETH_BRANCH).unwrap();
build_utils::checkout(&repo_dir, dbg!(&last_release)).unwrap();
// Build geth

View File

@@ -427,7 +427,16 @@ impl<E: GenericExecutionEngine> TestRig<E> {
.notify_new_payload(&invalid_payload)
.await
.unwrap();
assert!(matches!(status, PayloadStatus::InvalidBlockHash { .. }));
assert!(matches!(
status,
PayloadStatus::InvalidBlockHash { .. }
// Geth is returning `INVALID` with a `null` LVH to indicate it
// does not know the invalid ancestor.
| PayloadStatus::Invalid {
latest_valid_hash: None,
..
}
));
/*
* Execution Engine A: