Skip to content

Conversation

georgeee
Copy link
Member

@georgeee georgeee commented Oct 9, 2025

When running a test network withjust genesis ledger defined and doing fork config export during the first epoch, exported epoch ledgers (staking and next) will point to the same value and the node will fail to start because of trying to initiate epoch ledger DB from the same directory.

This PR fixes this issue in Mina node, and also ensures that when genesis ledger app generates a config, it won't show different SHA hashes for the same ledger.

Commits:

  • Fix issue with the same epoch ledger being used twice
  • Fix: Reuse epoch ledger tar when staking and next have same hash

Explain how you tested your changes:

  • tested as part of HF integaration test

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? None

When both staking and next epoch ledgers have the same merkle root,
reuse the staking ledger tar file instead of generating it twice.
This prevents different s3_data_hash values caused by different
tar creation timestamps, even though the ledger content is identical.
@georgeee georgeee requested a review from a team as a code owner October 9, 2025 20:14
@georgeee
Copy link
Member Author

georgeee commented Oct 9, 2025

!ci-build-me

@georgeee
Copy link
Member Author

georgeee commented Oct 9, 2025

!ci-bypass-changelog

Deferred.Or_error.return
( Some
{ Consensus.Genesis_epoch_data.Data.ledger =
staking.ledger
Copy link
Member

@glyh glyh Oct 13, 2025

Choose a reason for hiding this comment

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

I'm a bit concerned about this branch. We never assume ledgers to be shared between 2 "holders", AFAIK. Would there be some mutation/destroy of the ledgers on one end, causing the other end to panic?

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