mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-28 02:03:32 +00:00
Fix test review issues
- Remove wrong latest_message assertions from payload attestation test (on_payload_attestation writes to PTC bitfields, not vote tracker) - Fix corrupted comment: "votes.gloas_enabled() to the genesis block" → "votes to the genesis block" - Fix http_api test fallback string: "n/a" → "irrelevant" to match production code - Add issue link to #[ignore] test - Add comment explaining head_payload_status as u8 cast
This commit is contained in:
@@ -3176,7 +3176,7 @@ impl ApiTester {
|
||||
.execution_status()
|
||||
.ok()
|
||||
.map(|status| status.to_string())
|
||||
.unwrap_or_else(|| "n/a".to_string()),
|
||||
.unwrap_or_else(|| "irrelevant".to_string()),
|
||||
best_child: node
|
||||
.best_child()
|
||||
.and_then(|index| expected_proto_array.nodes.get(index))
|
||||
|
||||
@@ -1285,7 +1285,7 @@ where
|
||||
// 2. Ignore all attestations to the zero hash.
|
||||
//
|
||||
// (1) becomes weird once we hit finality and fork choice drops the genesis block. (2) is
|
||||
// fine because votes.gloas_enabled() to the genesis block are not useful; all validators implicitly attest
|
||||
// fine because votes to the genesis block are not useful; all validators implicitly attest
|
||||
// to genesis just by being present in the chain.
|
||||
if attestation.data().beacon_block_root == Hash256::zero() {
|
||||
return Ok(());
|
||||
|
||||
@@ -172,7 +172,8 @@ impl ForkChoiceTest {
|
||||
self
|
||||
}
|
||||
|
||||
/// Inspect the queued payload attestations in fork choice.
|
||||
// TODO(gloas): add inspect_queued_payload_attestations when payload
|
||||
// attestation queueing tests are implemented.
|
||||
#[allow(dead_code)]
|
||||
pub fn inspect_queued_payload_attestations<F>(self, mut func: F) -> Self
|
||||
where
|
||||
@@ -971,6 +972,8 @@ async fn invalid_attestation_future_block() {
|
||||
/// `validate_on_attestation`, which requires a block to exist at a GLOAS-enabled slot.
|
||||
/// Currently the mock execution layer cannot produce Gloas blocks (no
|
||||
/// `signed_execution_payload_bid` support).
|
||||
/// TODO(gloas): un-ignore once mock EL supports Gloas blocks.
|
||||
/// https://github.com/sigp/lighthouse/issues/9025
|
||||
#[ignore]
|
||||
#[tokio::test]
|
||||
async fn invalid_attestation_payload_during_same_slot() {
|
||||
@@ -1045,14 +1048,6 @@ async fn payload_attestation_for_previous_slot_is_accepted_at_next_slot() {
|
||||
"payload attestation at slot S should be accepted at S+1, got: {:?}",
|
||||
result
|
||||
);
|
||||
|
||||
let latest_message = chain
|
||||
.canonical_head
|
||||
.fork_choice_read_lock()
|
||||
.latest_message(0)
|
||||
.expect("latest message should exist");
|
||||
assert_eq!(latest_message.slot, current_slot);
|
||||
assert!(latest_message.payload_present);
|
||||
}
|
||||
|
||||
/// Gossip payload attestations must be for the current slot. A payload attestation for slot S
|
||||
|
||||
@@ -1039,11 +1039,9 @@ impl<E: EthSpec> Tester<E> {
|
||||
|
||||
pub fn check_head_payload_status(&self, expected_status: u8) -> Result<(), Error> {
|
||||
let head = self.find_head()?;
|
||||
check_equal(
|
||||
"head_payload_status",
|
||||
head.head_payload_status() as u8,
|
||||
expected_status,
|
||||
)
|
||||
// PayloadStatus repr: Empty=0, Full=1, Pending=2 (matches spec constants).
|
||||
let actual = head.head_payload_status() as u8;
|
||||
check_equal("head_payload_status", actual, expected_status)
|
||||
}
|
||||
|
||||
pub fn check_should_override_fcu(
|
||||
|
||||
Reference in New Issue
Block a user