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

Validate AGG_SIG_UNSAFE messages to not end in one of the banned suffixes #554

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented May 31, 2024

as part of the condition parsing.

The message of AGG_SIG_UNSAFE conditions are not allowed to end with any of the suffixes used by AGG_SIG_* conditions (those suffixes are derived from ADDITIONAL_DATA, i.e. a unique identifier for the network).

This is currently validated in pkm_pairs() in chia-blockchain. This PR moves this validation into the condition parsing, to reject invalid conditions earlier. This requires ConsensusConstants to be passed in to run_block_generator and run_puzzle.

In chia-blockchain, the suffixes for the AGG_SIG_* conditions are computed on-the-fly. This patch also move the agg_sig_*_additional_data into ConsensusConstants instead.

@arvidn arvidn force-pushed the agg-sig-suffix branch 2 times, most recently from 8bf06b8 to c70b224 Compare May 31, 2024 19:10
Copy link

coveralls-official bot commented May 31, 2024

Pull Request Test Coverage Report for Build 9357723153

Details

  • 47 of 48 (97.92%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 82.929%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-consensus/src/gen/conditions.rs 33 34 97.06%
Totals Coverage Status
Change from base Build 9357418700: 0.05%
Covered Lines: 11664
Relevant Lines: 14065

💛 - Coveralls

@arvidn arvidn marked this pull request as ready for review June 3, 2024 12:20
@arvidn arvidn requested a review from Rigidity June 3, 2024 19:27
Rigidity
Rigidity previously approved these changes Jun 3, 2024
…ixes as part of the condition parsing. Also, move the agg_sig_*_additional_data into ConsensusConstants, rather than being computed on-the-fly. This also requires ConsensusConstants to be passed in to run_block_generator and run_puzzle
@arvidn arvidn merged commit a521169 into main Jun 4, 2024
65 checks passed
@arvidn arvidn deleted the agg-sig-suffix branch June 4, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants