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

Add a GraphQL query to generate a config file for a hard fork. #13787

Merged

Conversation

Sventimir
Copy link
Member

@Sventimir Sventimir commented Jul 31, 2023

Motivation:
we're going to perform a hard fork shortly. A necessary step in this activity is transferring the state of the blockchain from the old mainnet to a fresh blockchain, which becomes the new mainnet. We can do this using a config file, which contains the genesis ledger state.

Explain your changes:

  • Add a GraphQL query, which responds with the node's configuration file updated with the state of the staged ledger. This configuration file can then be taken (almost) as is and used to start a new network, which will be direct continuation of the current one. Only problem remaining is that the genesis_ledger_timestamp is not being updated, because I don't yet know how to update it at this point. This is something to decide upon: how to automatically compute the genesis timestamp for the ledger.

Explain how you tested your changes:

  • I performed a manual hard fork process using this command. I started a sandbox network using the generated config file and demonstarted that I'm able to produce blocks in that network and send payments. This required manually adding a fake account to the config and setting it as everyone's delegate. This manual change will of course not be included in a real-life hard fork.
  • Automated integration tests will follow shortly.

Changes required on Berkeley to parse this config file are pull-requested in #13768 .

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? List them

The config gets updated with the state of the best staged ledger,
so that it may serve as config file for a new network being a
direct continuation of the current one. This will be useful
for performing a hard fork in a controlled and automatic manner.
@Sventimir
Copy link
Member Author

!ci-build-me

@Sventimir
Copy link
Member Author

!ci-build-me

src/lib/mina_graphql/mina_graphql.ml Show resolved Hide resolved
?block_window_duration_ms ?transaction_capacity ?coinbase_amount
?supercharged_coinbase_factor ?account_creation_fee ?fork () =
{ level
; sub_windows_per_window = sub_window_per_window
Copy link
Member

Choose a reason for hiding this comment

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

Why this renaming? The original is more accurate

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely no reason. Removed in 074f6a7.

@Sventimir
Copy link
Member Author

!ci-build-me

@Sventimir
Copy link
Member Author

!ci-build-me

@Sventimir Sventimir merged commit 9bbd239 into MinaProtocol:compatible Aug 2, 2023
38 checks passed
@Sventimir Sventimir deleted the sventimir/ldeger_dump_tool branch August 2, 2023 07:56
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.

None yet

3 participants