Skip to content

fix randomness for parent block hash in toolkit#878

Open
justinfrevert wants to merge 7 commits intomainfrom
fix/PM-20205-toolkit-parent-block-hash-randomness
Open

fix randomness for parent block hash in toolkit#878
justinfrevert wants to merge 7 commits intomainfrom
fix/PM-20205-toolkit-parent-block-hash-randomness

Conversation

@justinfrevert
Copy link
Contributor

Overview

Improve rng used when there is no seed for parent block hash initialization.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@justinfrevert justinfrevert requested a review from a team as a code owner March 6, 2026 15:05
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

kics-logo

KICS version: v2.1.19

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 47
LOW LOW 3
INFO INFO 59
TRACE TRACE 0
TOTAL TOTAL 109
Metric Values
Files scanned placeholder 26
Files parsed placeholder 26
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 11


super::make_block_context(timestamp, Default::default(), timestamp)
let mut parent_hash_bytes = [0u8; 32];
rand::rngs::OsRng.fill_bytes(&mut parent_hash_bytes);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way for tests that this can be deterministic?

Copy link
Contributor

Choose a reason for hiding this comment

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

also is there any test coverage for this?

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