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

Add decorator to all "invalid" test cases #3741

Merged
merged 1 commit into from
May 6, 2024

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented May 2, 2024

Fix #3739

I think they all miss the decorator like #3728.

  • Check if each case failed at the position we expected.

Copy link
Contributor

@fradamt fradamt left a comment

Choose a reason for hiding this comment

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

Yes, the issue is that with the mainnet preset we would need 0.5M validators in order to have a nonzero consolidation churn limit. For some reason I didn't add the decorators to most of the invalid tests...

@hwwhww
Copy link
Contributor Author

hwwhww commented May 3, 2024

I verified where these test cases fail:

test case failed at
test_invalid_source_equals_target assert consolidation.source_index != consolidation.target_index
test_invalid_exceed_pending_consolidations_limit assert len(state.pending_consolidations) < PENDING_CONSOLIDATIONS_LIMIT
test_invalid_not_enough_consolidation_churn_available assert get_consolidation_churn_limit(state) > MIN_ACTIVATION_BALANCE
test_invalid_exited_source assert source_validator.exit_epoch == FAR_FUTURE_EPOCH
test_invalid_exited_target assert target_validator.exit_epoch == FAR_FUTURE_EPOCH
test_invalid_inactive_source assert is_active_validator(source_validator, current_epoch)
test_invalid_inactive_target assert is_active_validator(target_validator, current_epoch)
test_invalid_no_execution_withdrawal_credential assert has_execution_withdrawal_credential(source_validator)
test_invalid_different_credentials assert source_validator.withdrawal_credentials[12:] == target_validator.withdrawal_credentials[12:]
test_invalid_source_signature assert bls.FastAggregateVerify(pubkeys, signing_root, signed_consolidation.signature)
test_invalid_target_signature assert bls.FastAggregateVerify(pubkeys, signing_root, signed_consolidation.signature)
test_invalid_before_specified_epoch assert current_epoch >= consolidation.epoch

Looks all correct now.

@hwwhww hwwhww merged commit bbb506e into dev May 6, 2024
28 checks passed
@hwwhww hwwhww deleted the fix-test_process_consolidation branch May 6, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidation operation reference tests on mainnet invalid for the wrong reasons
2 participants