Skip to content

added initial draft for upgrade to mesa#1133

Open
dkijania wants to merge 7 commits intomainfrom
dkijania/upgrade-to-mesa
Open

added initial draft for upgrade to mesa#1133
dkijania wants to merge 7 commits intomainfrom
dkijania/upgrade-to-mesa

Conversation

@dkijania
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs2 Ready Ready Preview, Comment Mar 20, 2026 4:56pm

Request Review


Below we presents details what was changed in the archive node database schema between Berkeley and Mesa version.

**Zkapp_state_nullable additional Columns **
Copy link
Member

Choose a reason for hiding this comment

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

This is not complete. we also updated the non-nullable table.


```

**Version table**
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. if you look at current codebase.

- Operators shall import the SQL dump file provided by o1Labs to a freshly created database.
- Operators should direct their Mesa archive process to the newly created database.

**Please note:** both the _trustless_ and _trustful_ migration processes will discard all Mainnet blocks that are not canonical. If you wish to preserve the entire block history, i.e. including non-canonical blocks, you should maintain the Mainnet archive node database for posterior querying needs.
Copy link
Member

Choose a reason for hiding this comment

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

Is this still true?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, good catch

hide_title: true
description: Post-Upgrade Flags and Configurations for Mainnet
keywords:
- Berkeley
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be Berkeley or Mesa?


# Post-Upgrade Flags and Configurations for Mainnet

Please refer to the Berkeley node release notes [here](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be Berkeley?

title: Requirements
sidebar_label: Requirements
hide_title: true
description: Berkeley upgrade is a major upgrade that requires all nodes in a network to upgrade to a newer version. It is not backward compatible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mesa?

hide_title: true
description: Berkeley upgrade is a major upgrade that requires all nodes in a network to upgrade to a newer version. It is not backward compatible.
keywords:
- Berkeley
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mesa


:::caution

If you have `mina-generate-keypair` installed, you will need to first `sudo apt remove mina-generate-keypair` before installing `mina-mainnet=3.1.0-ae112d3`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this the right version?

1. Trustless migration:
- Perform the archive node upgrade. Since Mainnet is a long-lived network, the upgrade process is a very fast operation and boils down to running the upgrade script against your archive. It should not take more than 1 minute, depending on your server specification and infrastructure.
- For more information on the archive node upgrade process, please refer to the [Archive Upgrade](/mesa-upgrade/archive-upgrade) section.
2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
Copy link
Collaborator

Choose a reason for hiding this comment

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

version will need to change

- Perform the archive node upgrade. Since Mainnet is a long-lived network, the upgrade process is a very fast operation and boils down to running the upgrade script against your archive. It should not take more than 1 minute, depending on your server specification and infrastructure.
- For more information on the archive node upgrade process, please refer to the [Archive Upgrade](/mesa-upgrade/archive-upgrade) section.
2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
3. Provision servers that meet the minimum hardware requirements, primarily the new 32GB RAM requirement.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ram requirement is not new

### Exchanges
1. Make sure to test your system integration with Mesa's new features. Pay special attention to:
- If you rely on the archive node SQL database tables, please review the schema changes in Appendix 1 of this document.
2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Version needs to change

## Upgrade

- Starting at the _stop-network-slot_ the network will not produce nor accept new blocks, resulting in halting the network. During the upgrade period, o1Labs will use automated tooling to export the network state based on the block at the slot just before the _stop-transaction-slot_. The exported state will then be baked into the new Mesa build, which will be used to initiate the upgraded network. It is during the upgrade windows that the Mesa network infrastructure will be bootstrapped, and seed nodes will become available. o1Labs will also finalize the archive node migration and publish the PostgreSQL database dumps for import by the archive node operators who wish to bootstrap their archives in a trustful manner.
- There is a tool available to validate that the Mesa node was built from the pre-upgrade network state. To validate, follow the instructions provided in this [location](https://github.com/MinaProtocol/mina/blob/berkeley/docs/upgrading-to-berkeley.md)
Copy link
Collaborator

Choose a reason for hiding this comment

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

link needs to change

## Post-Upgrade
- At approximately 1 hour after the publishing of the Mesa node release, at a predefined slot (Mesa genesis timestamp), block production will start, and the network is successfully upgraded.
- Node operators can monitor their nodes and provide feedback to the technical team in case of any issues. Builders can start deploying zkApps.
- **Please note:** The Node Status service will not be enabled by default in the Mesa release. If you wish to provide Node Status and Error metrics and reports to Mina Foundation, helping monitor the network in the initial phase, please use the following flags when running your nodes:
Copy link
Collaborator

Choose a reason for hiding this comment

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

errors should be reported to us, not to MF

dkijania and others added 6 commits March 15, 2026 20:46
Delete legacy docs paths (docs/berkeley-upgrade/, docs/mesa-upgrade/)
that have been superseded by the unified docs/network-upgrades/ structure.
Update docusaurus config, dependencies, and checklist styles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restructure the Mesa upgrade index page with:
- End-to-end upgrade timeline with visual overview and milestone table
- Per-phase breakdowns (pre-upgrade, state finalization, upgrade, post-upgrade)
  with actor-specific action tables
- Collapsible role-based timeline views with schedule images
- Upgrade mode summary (automode vs manual) with dispatcher limitation notes
- Six collapsible walk-through examples covering all roles:
  - Block Producer automode (Debian), manual (Docker), manual (Debian)
  - Archive Node / Explorer operator
  - zkApp Developer
  - Exchange operator
- Quick reference table linking each operator type to relevant pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the automode and manual upgrade mechanisms in depth:
- Dispatcher limitations: only supports daemon subcommand, explained
  why (no config dir context for non-daemon commands), with guidance
  to use mina-berkeley/mina-mesa binaries directly
- Automode restart mechanism: daemon exits with code 0, requires
  process manager restart (systemd/Docker/k8s) and persistent
  filesystem for the activated marker file
- Correct activation file path: auto-fork-mesa-mainnet/activated
- Professional SVG flowcharts replacing ASCII timelines for both
  automode and manual upgrade flows
- Kubernetes/Helm-specific guidance on PersistentVolumeClaim vs
  emptyDir and restart policies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the flag-heavy post-upgrade page with an actionable guide:
- Tabbed per-role verification steps (Block Producer, SNARK, Archive,
  Rosetta, Exchange) with concrete commands
- Merged the standalone validation page into an in-depth validation
  section covering daemon, archive toolbox, Rosetta CLI, and
  network-level checks
- Flags and configurations moved to a collapsed reference section
  with a note that they are unchanged from Berkeley
- Node Status service opt-in instructions for network monitoring

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make the Archive Upgrade a sidebar category with the Archive Replayer
as its child page. Add a bridging section in archive-upgrade.mdx that
introduces the replayer as an ongoing verification tool (not limited
to upgrade time). Update replayer description to emphasize its role
as a continuous archive integrity tool. Remove standalone validation
page from sidebar (merged into post-upgrade).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move Berkeley upgrade documentation to docs/network-upgrades/berkeley/
and add the network-upgrades landing page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

docker run --name mina -d \
-v mina-config:/root/.mina-config \
minaprotocol/mina-daemon:4.0.0-bullseye-mainnet \
Copy link
Member

@glyh glyh Mar 17, 2026

Choose a reason for hiding this comment

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

Why is the pre-fork image 4.0.0? Shouldn't it be tagged 3.x.x, pointing to the RC?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh right, stop slot release would still have 3.xx


### Archive Node Operator

Archive nodes do **not** support automode — they always require manual steps. You also need to handle the database migration.
Copy link
Member

Choose a reason for hiding this comment

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

I thought what we said is just upgrade the schema prefork and run post-fork archive and everything should work as expected, does that changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will reword it, yes. Let's avoid using migration term, it's just simple upgrade

```bash
# Pre-Upgrade: install both automode packages
sudo apt-get update
sudo apt-get install mina-mainnet-prefork-mesa=4.0.0 mina-mainnet-postfork-mesa=4.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as Corvo's, I think pre-fork shoudl be 3.X.X


<ul className="checklist">
<li>Chosen an <a href="/network-upgrades/mesa/upgrade-modes">upgrade mode</a>: automode (recommended) or manual</li>
<li>Upgraded node to the current stable version (3.3.0)</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably won't be it. I think it's already not it, right?


<ul className="checklist">
<li>Chosen an <a href="/network-upgrades/mesa/upgrade-modes">upgrade mode</a>: automode (recommended) or manual</li>
<li>Upgraded node to the current stable version (3.3.0)</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

#### Software Upgrade

<ul className="checklist">
<li>Upgraded node to the current stable version (3.3.0)</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

#### Software Upgrade

<ul className="checklist">
<li>Upgraded node to the current stable version (3.3.0)</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

<details>
<summary><b>Example: zkApp Developer</b></summary>

**Frank** maintains a zkApp deployed on mainnet. His contract uses on-chain state and he wants to take advantage of Mesa's expanded 31-field state.
Copy link
Collaborator

Choose a reason for hiding this comment

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

32-field

He verifies that:
- His existing zkApp (compiled for Berkeley) still works unchanged on the preflight Mesa network
- Transactions deploy and execute correctly
- If he plans to use the expanded state fields (9–31), his new contract version compiles and deploys on preflight
Copy link
Collaborator

Choose a reason for hiding this comment

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

8-31, no?

Copy link
Member

Choose a reason for hiding this comment

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

yes, 8~31.


**Hours before the fork (State Finalization)** — Frank does **nothing**. His deployed zkApp keeps running on the Berkeley chain. No transactions can be submitted during this phase anyway.

**Fork day (Upgrade)** — Frank does **nothing**. His existing zkApp state carries over to the Mesa chain automatically. All account state (including zkApp state fields 1–8) is preserved exactly as-is.
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it 1-8 or 0-7?

Copy link
Member

Choose a reason for hiding this comment

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

0~7.

zkapp deploy --network mainnet
```

If his zkApp does not need the new state fields, no redeployment is needed — it continues to work on Mesa without changes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this true? don't all apps need to be redeployed?

```bash
sudo systemctl stop mina
sudo apt-get update
sudo apt-get install mina-mainnet-mesa=<mesa-version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we know what this is at this point?
I've seen in a few places

sudo systemctl stop mina

sudo apt-get update
sudo apt-get install mina-mainnet-mesa=<mesa-version>
Copy link
Member

@glyh glyh Mar 20, 2026

Choose a reason for hiding this comment

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

The tagging scheme is a bit confusing to me. Why is it necessary to have a -mesa in the package name? Isn't 4.x.x enough to indicate this is a mesa package?


```bash
sudo apt-get update
sudo apt-get install mina-mainnet-prefork-mesa=4.0.0 mina-mainnet-postfork-mesa=4.0.0
Copy link

Choose a reason for hiding this comment

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

Pre-fork package version incorrectly set to 4.0.0 instead of 3.3.0 (Berkeley version)

Fix on Vercel


### Expanded zkApp State

Mesa extends the on-chain state available to zkApps from 8 fields to 31 fields per account. This significantly increases the data capacity available to smart contracts, enabling more complex application logic without off-chain workarounds.
Copy link

Choose a reason for hiding this comment

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

Field count documentation incorrectly states 31 fields total when Mesa actually extends to 32 fields (element0 through element31)

Fix on Vercel

```bash
# Pre-Upgrade: install both automode packages
sudo apt-get update
sudo apt-get install mina-mainnet-prefork-mesa=4.0.0 mina-mainnet-postfork-mesa=4.0.0
Copy link

Choose a reason for hiding this comment

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

Pre-fork Mesa package incorrectly specified as 4.0.0 instead of 3.3.0 (pre-fork stable version)

Fix on Vercel

sudo systemctl stop mina

sudo apt-get update
sudo apt-get install mina-mainnet-mesa=<mesa-version>
Copy link

Choose a reason for hiding this comment

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

Suggested change
sudo apt-get install mina-mainnet-mesa=<mesa-version>
sudo apt-get install mina-mainnet-mesa=4.0.0

Debian example uses placeholder <mesa-version> while Docker example uses concrete version 4.0.0-bullseye-mesa, causing inconsistency in documentation examples

Fix on Vercel

|--|--|--|--|--|
| Mina Daemon Node | 32 GB RAM | 8 core processor with BMI2 and AVX CPU instruction set are required | 64 GB | 1 Mbps Internet Connection |
| SNARK Coordinator | 32 GB RAM | 8 core processor | 64 GB | 1 Mbps Internet Connection |
| SNARK Worker | 32 GB RAM | 4 core/8 threads per worker with BMI2 and AVX CPU instruction set are required | 64 GB | 1 Mbps Internet Connection |
Copy link
Member

Choose a reason for hiding this comment

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

32GB ram and 64GB storage per worker seems a bit high.

| SNARK Worker | 32 GB RAM | 4 core/8 threads per worker with BMI2 and AVX CPU instruction set are required | 64 GB | 1 Mbps Internet Connection |
| Archive Node | 32 GB RAM | 8 core processor | 64 GB | 1 Mbps Internet Connection |
| Rosetta API standalone Docker image | 32 GB RAM | 8 core processor | 64 GB | 1 Mbps Internet Connection |
| Mina Seed Node | 64 GB RAM | 8 core processor | 64 GB | 1 Mbps Internet Connection |
Copy link
Member

Choose a reason for hiding this comment

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

To add to Chrstian's comment, it doesn't make sense to me for any node other than archive to have a 64GB storage requirement -- There's nothing growing linearly, and should not be, right?

I guess, logs could grow, but still 64GB seems too big.


:::caution

If you have `mina-generate-keypair` installed, you will need to first `sudo apt remove mina-generate-keypair` before installing `mina-mainnet=4.0.0`.
Copy link
Member

Choose a reason for hiding this comment

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

Why installing new package couldn't auto remove the old?

@@ -0,0 +1,305 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

Do people actually care this doc?


During the Pre-Upgrade phase, node operators prepare their infrastructure for the Mesa hard fork. Select your role below and work through each item on the checklist.

## Readiness Checklist
Copy link
Member

Choose a reason for hiding this comment

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

Could we point most of this list to other parts of the doc, in case people need more information?

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.

5 participants