Skip to content

Conversation

ganeshvanahalli
Copy link
Contributor

This PR adds a way to validate genesis assertion on nitro init for chains with bold enabled. This validation can be enabled through the flag provided below. We validate the assertion found in parent chain by verifying that if the assertion is a null assertion then init data doesn't have any accounts, but if the assertion is a non-null assertion then we compare its AfterState globalState's blockHash with the genesis blockhash.

if --init.force is set, then in case of any failures in verification only error logs are printed out instead of stopping the node.

--init.validate-genesis-assertion

Resolves NIT-3559

Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 22.66%. Comparing base (6d29e7a) to head (7f5c6c8).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3570      +/-   ##
==========================================
- Coverage   22.67%   22.66%   -0.02%     
==========================================
  Files         388      388              
  Lines       58911    58912       +1     
==========================================
- Hits        13359    13352       -7     
- Misses      43512    43520       +8     
  Partials     2040     2040              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

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

This looks good to me, nice catch in checking if a chain has bold enabled using grace period blocks

@ganeshvanahalli ganeshvanahalli marked this pull request as ready for review September 4, 2025 07:14
@rauljordan rauljordan enabled auto-merge September 4, 2025 14:20
@rauljordan rauljordan merged commit 13a1574 into master Sep 8, 2025
19 checks passed
@rauljordan rauljordan deleted the test-genesisassertion-oninit branch September 8, 2025 19:21
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.

3 participants