-
Notifications
You must be signed in to change notification settings - Fork 174
added initial draft for upgrade to mesa #1133
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
base: main
Are you sure you want to change the base?
Changes from all commits
020111d
6343e15
8a5b438
57c28dc
293e557
11cfab3
39713d5
4053337
ad4147c
13245c9
0e1afbb
61e3a02
2b89b55
22cd33a
3e81a76
8f9ead9
a82d565
d382e81
b30661e
ce05b32
24ca649
ee2fd66
c2f1f3d
7bcb533
2679659
0865036
325a92d
e436f70
4cf81ab
a72fe43
d6aeb93
c5fcc2e
47ddfe3
1cfdd2a
2aba2d9
7b75f1a
83038a4
c94bcf2
64d55fd
bf26f1b
b6f16fc
277af19
7b077b2
044b3dc
45ca377
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| title: Berkeley Upgrade | ||
| sidebar_label: Berkeley Upgrade | ||
| hide_title: true | ||
| description: Overview of the Berkeley network upgrade for Mina Protocol — the transition to the Berkeley proof system with zkApp support. | ||
| keywords: | ||
| - Berkeley | ||
| - upgrade | ||
| - hard fork | ||
| - zkApps | ||
| --- | ||
|
|
||
| # Berkeley Upgrade | ||
|
|
||
| The Berkeley upgrade was the most significant network upgrade in Mina's history, transitioning mainnet from the legacy proof system to the Berkeley proof system. It was completed in June 2024. | ||
|
|
||
| ## What Berkeley Introduced | ||
|
|
||
| ### zkApp Programmability | ||
|
|
||
| Berkeley brought full zkApp (zero-knowledge application) support to mainnet. Developers can deploy smart contracts that execute off-chain computation and generate zero-knowledge proofs verified on-chain, enabling privacy-preserving applications with minimal on-chain footprint. | ||
|
|
||
| ### Recursive Proofs | ||
|
|
||
| The upgrade enabled recursive proof composition, allowing proofs to verify other proofs. This is foundational to Mina's constant-size blockchain — the entire chain state can be verified with a single proof regardless of history length. | ||
|
|
||
| ### New Transaction Model | ||
|
|
||
| Berkeley introduced a new transaction format supporting zkApp commands alongside traditional payment and delegation transactions. This included on-chain state storage for smart contracts, events, and actions. | ||
|
|
||
| ### Archive Database Migration | ||
|
|
||
| The upgrade required a full archive database migration from the legacy schema to the Berkeley schema. This was the most operationally intensive part of the upgrade for archive node operators, taking up to 48 hours for the trustless migration path. | ||
|
|
||
| ## Upgrade Details | ||
|
|
||
| - **Release**: [3.0.0](https://github.com/MinaProtocol/mina/releases/tag/3.0.0) (Berkeley mainnet release) | ||
| - **Upgrade mode**: Manual only (automode was not available for Berkeley) | ||
| - **Archive migration**: Trustless (48h) or trustful (o1Labs database export) | ||
|
|
||
| For the operational details of the Berkeley upgrade, see the sub-pages below. These are preserved for historical reference. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how it's happening, but I think this page is being rendered in the breadcrumb path "Home > Network Upgrades > Mesa Upgrades > Appendix > Appendix" in the deployed docs I'm looking at. Maybe it's because the "Upgrade Modes - Details" and "Docker Compose Quickstart" are this page's siblings? Not critical, just a little weird. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| title: Archive Node Schema Changes | ||
| sidebar_label: Archive Node Schema Changes | ||
| hide_title: true | ||
| description: Reference of database schema changes applied to the Mina archive node during the Mesa hard fork — new columns, modified tables, and the SQL applied by the upgrade script. | ||
| keywords: | ||
| - Mesa | ||
| - upgrade | ||
| - appendix | ||
| - archive | ||
| - schema | ||
| - database | ||
| --- | ||
|
|
||
| # Archive Node Schema Changes | ||
|
|
||
| ## Upgrading archive nodes from Berkeley to Mesa | ||
|
|
||
| Below we present details of what changed in the archive node database schema between Berkeley and Mesa versions. | ||
|
|
||
| ### Extended zkApp State Fields | ||
|
|
||
| Both zkApp state tables have been modified to support additional state elements: | ||
|
|
||
| **zkapp_states_nullable table** | ||
| - Added columns `element8` through `element31` (nullable integer fields) | ||
| - Each new column references `zkapp_field(id)` | ||
| - These fields allow zkApps to store additional state information beyond the original 8 elements | ||
|
|
||
| ```sql | ||
| ALTER TABLE zkapp_states_nullable ADD COLUMN IF NOT EXISTS element8 INT REFERENCES zkapp_field(id); | ||
| ... | ||
| ALTER TABLE zkapp_states_nullable ADD COLUMN IF NOT EXISTS element31 INT REFERENCES zkapp_field(id); | ||
| ``` | ||
|
|
||
| **zkapp_states table** | ||
| - Added columns `element8` through `element31` (non-nullable integer fields) | ||
| - Each new column references `zkapp_field(id)` with a default value pointing to the zero field | ||
| - Unlike the nullable version, these fields are required and default to the zero field ID | ||
|
|
||
| ```sql | ||
| ALTER TABLE zkapp_states ADD COLUMN IF NOT EXISTS element8 INT DEFAULT <zero_field_id> NOT NULL REFERENCES zkapp_field(id); | ||
| ... | ||
| ALTER TABLE zkapp_states ADD COLUMN IF NOT EXISTS element31 INT DEFAULT <zero_field_id> NOT NULL REFERENCES zkapp_field(id); | ||
| ``` | ||
|
|
||
| This expansion allows zkApps to store up to 32 state elements instead of the previous 8, significantly increasing the state storage capacity for complex smart contracts. | ||
|
|
||
| ### Version Tracking | ||
|
|
||
| The upgrade introduces a new `version` table to keep track of the database schema version. The purpose of this table is to help with future database migrations. The table tracks which migration scripts were applied and when. | ||
|
|
||
| **version table** | ||
| ```sql | ||
| CREATE TABLE IF NOT EXISTS version ( | ||
| version_num INT PRIMARY KEY, | ||
| applied_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | ||
| ); | ||
| ``` | ||
|
|
||
| The version table provides: | ||
| - **Migration tracking**: Records which migrations have been applied | ||
| - **Timestamp tracking**: Shows when each migration was executed | ||
| - **Idempotency**: Prevents duplicate migration runs | ||
| - **Version identification**: Easily identify the current database schema version | ||
|
|
||
| The table is created if it does not exist already. Rollback and upgrade scripts will insert a new row with the version number and timestamp when the script was applied. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: Docker Compose Quickstart | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page is very confusing to me. Could this be sent to the Appendix as an item there? And where should there be links to this? Upgrade Steps? |
||
| sidebar_label: Docker Compose Quickstart | ||
| hide_title: true | ||
| description: Run a Mina node with automode enabled for the Mesa upgrade using Docker Compose. | ||
| keywords: | ||
| - Mesa | ||
| - Docker Compose | ||
| - automode | ||
| - quickstart | ||
| --- | ||
|
|
||
| # Docker Compose Quickstart | ||
|
|
||
| ```yaml | ||
| services: | ||
| mina_node: | ||
| image: 'minaprotocol/mina-daemon-auto-hardfork:<version>-noble-mainnet' | ||
| restart: always | ||
| environment: | ||
| MINA_CLIENT_TRUSTLIST: "0.0.0.0/0" | ||
| entrypoint: [] | ||
| command: > | ||
| bash -c ' | ||
| mina daemon \ | ||
| --peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt \ | ||
| --insecure-rest-server \ | ||
| --rest-port 3085 \ | ||
| --hardfork-handling migrate-exit | ||
| ' | ||
| volumes: | ||
| - './mina-config:/root/.mina-config' | ||
| ports: | ||
| - '3085:3085' | ||
| - '8302:8302' | ||
| ``` | ||
|
|
||
| Replace `<version>` with the published stop-slot release from the [Mina releases page](https://github.com/MinaProtocol/mina/releases). | ||
|
|
||
| :::tip Docker image tag | ||
| Use the stop-slot release image for your target network. For devnet, replace the image tag suffix `mainnet` with `devnet` and use the corresponding devnet release tag. | ||
| ::: | ||
|
|
||
| :::tip Peer list URL | ||
| The `--peer-list-url` above points to the mainnet bootnodes. For devnet, replace it with `https://bootnodes.minaprotocol.com/networks/devnet.txt`. | ||
| ::: | ||
|
|
||
| :::tip Additional environment variables | ||
| Add any extra configuration (e.g. `MINA_PRIVKEY_PASS`) under the `environment` section. | ||
| ::: | ||
|
|
||
| ## Switching back to normal Docker | ||
|
|
||
| After your node has completed the Mesa transition and you want to move off `mina-daemon-auto-hardfork`, update your Compose config as follows: | ||
|
|
||
| - Remove `--hardfork-handling migrate-exit`. | ||
| - Set the Docker image to the post-fork artifact, for example `minaprotocol/mina-daemon:<mesa-version>-noble-mainnet`. | ||
|
|
||
| ```bash | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| :::caution | ||
| `restart: always` and the persistent `mina-config` volume are required for automode. If the volume is wiped between restarts, the node cannot transition to Mesa. See [Upgrade Modes](/network-upgrades/mesa/upgrade-modes) for details. | ||
| ::: | ||
Uh oh!
There was an error while loading. Please reload this page.