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

feat: check chain metadata #6146

Merged

Conversation

SWvheerden
Copy link
Collaborator

Description

Checks chain metadata for correctness

Motivation and Context

The base node makes certain logic desisions based on what the chain meta data is, but no where do we make checks to ensure that the data is valid inside of this.

How Has This Been Tested?

unit tests

@SWvheerden SWvheerden requested a review from a team as a code owner February 13, 2024 14:24
Copy link

Test Results (CI)

1 270 tests   1 270 ✅  10m 55s ⏱️
   39 suites      0 💤
    1 files        0 ❌

Results for commit 74f03e8.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Feb 13, 2024
Copy link

Test Results (Integration tests)

29 tests   29 ✅  12m 24s ⏱️
11 suites   0 💤
 2 files     0 ❌

Results for commit 74f03e8.

Copy link
Contributor

@brianp brianp left a comment

Choose a reason for hiding this comment

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

utAck

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Feb 16, 2024
@SWvheerden SWvheerden merged commit 8a16f7b into tari-project:development Feb 16, 2024
13 of 14 checks passed
@SWvheerden SWvheerden deleted the sw_check_chain_meta_data branch February 16, 2024 10:09
Comment on lines +75 to +77
if chain_meta_data.accumulated_difficulty == 0.into() {
return Err(ChainMetaDataError::AccumulatedDifficultyZero);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

We could check U256::MAX as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what do you want to check, u256::max is a valid difficulty, 0 is not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants