Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert changed const in peertest utils and fix light client update validation test #1520

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethportal-peertest/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where
Fut: Future<Output = Result<O>>,
{
// If content is absent an error will be returned.
for counter in 0..10 {
for counter in 0..60 {
let result = f().await;
match result {
Ok(val) => return val,
Expand Down
7 changes: 4 additions & 3 deletions trin-beacon/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ mod tests {

assert!(result.valid_for_storing);

// Expect error because the finalized slot does not match the content key finalized slot
// Expect error because the content key finalized slot is greaten than the light client
// update finalized slot
Comment on lines +444 to +445
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Expect error because the content key finalized slot is greaten than the light client
// update finalized slot
// Expect error because the content key finalized slot is greater than the light client
// update finalized slot

But I don't think it's worth kicking off the tests again, since I'm waiting to run the deploy until this PR gets into master.

let invalid_content_key =
BeaconContentKey::LightClientFinalityUpdate(LightClientFinalityUpdateKey {
finalized_slot: 0,
finalized_slot: 17748599031001599584 + 1,
});
let result = validator
.validate_content(&invalid_content_key, &content)
Expand All @@ -453,7 +454,7 @@ mod tests {

assert_eq!(
result.to_string(),
"Light client finality update finalized slot does not match the content key finalized slot: 17748599031001599584 != 0"
"Light client finality update finalized slot should be equal or greater than content key finalized slot: 17748599031001599584 < 17748599031001599585"
);

// Expect error because the light client finality update is not from the recent fork
Expand Down
Loading