-
Notifications
You must be signed in to change notification settings - Fork 175
Update docs to reflect all MESA and o1js 3.0 changes #1166
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
Open
Shigoto-dev19
wants to merge
7
commits into
main
Choose a base branch
from
shigoto/mesa-update-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
97bc077
Add Mesa upgrade overview and update docs for MIPs 7-9
Shigoto-dev19 1dcdc8e
Document MIP-6 slot time reduction and update slot references across …
Shigoto-dev19 e61440c
Update block rewards and delegation latency for MIP-6
Shigoto-dev19 342a59e
Update remaining "eight" on-chain state references to 32 for MIP-7
Shigoto-dev19 d87649b
Fix MIP-9 account update limits and remaining MIP-6/MIP-7 references
Shigoto-dev19 6ab475b
Trigger Vercel rebuild
Shigoto-dev19 5c03380
Merge remote-tracking branch 'origin/main' into shigoto/mesa-update-docs
Shigoto-dev19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| --- | ||
| title: Mesa Upgrade Overview | ||
| sidebar_label: Overview | ||
| description: Overview of the Mesa upgrade for the Mina network, including MIP-6 (slot time reduction), MIP-7 (expanded on-chain state), MIP-8 (actions and events), and MIP-9 (account update limits). | ||
| keywords: | ||
| - Mesa upgrade | ||
| - MIP-6 | ||
| - MIP-7 | ||
| - MIP-8 | ||
| - MIP-9 | ||
| - slot time | ||
| - on-chain state | ||
| - account updates | ||
| - actions | ||
| - events | ||
| - hardfork | ||
| - mina upgrade | ||
| --- | ||
|
|
||
| # Mesa Upgrade Overview | ||
|
|
||
| The Mesa upgrade is Mina Protocol's hard fork that bundles four Mina Improvement Proposals (MIPs 6-9). These proposals were approved through an on-chain community vote. | ||
|
|
||
| This page summarizes the key changes that affect zkApp developers. | ||
|
|
||
| ## MIP-6: Slot Time Reduction | ||
|
|
||
| The slot duration has been halved, increasing block production frequency and reducing transaction inclusion latency. | ||
|
|
||
| ### Before Mesa | ||
|
|
||
| | Parameter | Value | | ||
| | ------------- | -------------------- | | ||
| | Slot duration | 180 seconds (3 min) | | ||
|
|
||
| ### After Mesa | ||
|
|
||
| | Parameter | Value | | ||
| | ------------- | -------------------- | | ||
| | Slot duration | 90 seconds (1.5 min) | | ||
|
|
||
| The 50% reduction in slot time means blocks are produced twice as frequently, which roughly halves the time it takes for transactions to be included in a block. | ||
|
|
||
| :::note | ||
|
|
||
| The reduced slot time does not mean every transaction is included within 90 seconds. Transaction inclusion latency ranges from roughly 40 to 600 seconds, which is approximately half the previous range. The slot duration defines the block production window, not a guarantee on individual transaction confirmation time. | ||
|
|
||
| ::: | ||
|
|
||
| ## MIP-7: Expanded On-Chain State | ||
|
|
||
| Each zkApp account's on-chain state has been expanded from **8 fields to 32 fields** (each field is ~32 bytes). | ||
|
|
||
| ### Before Mesa | ||
|
|
||
| - zkApp accounts could store at most **8 field elements** of on-chain state. | ||
| - Developers frequently needed workarounds for storage-constrained applications: packing multiple values into a single field, splitting state across multiple zkApp accounts, or pushing state off-chain. | ||
|
|
||
| ### After Mesa | ||
|
|
||
| - zkApp accounts can store up to **32 field elements** of on-chain state. | ||
| - This enables simpler zkApps as you get more storage for metadata and avoid the complicated workarounds that add dev overhead and circuit constraints, although it wouldn't completely remove the need for the workarounds mentioned above if you need to store more than 32 states. | ||
|
|
||
| For more details on on-chain state, see [Smart Contracts](/zkapps/writing-a-zkapp/introduction-to-zkapps/smart-contracts#on-chain-state) and [On-Chain Values](/zkapps/writing-a-zkapp/feature-overview/on-chain-values). | ||
|
|
||
| ## MIP-8: Increased Actions and Events Capacity | ||
|
|
||
| The per-transaction capacity for both actions and events has been significantly increased. | ||
|
|
||
| ### Before Mesa | ||
|
|
||
| | Limit | Value | | ||
| | ----------------------------------------- | ----- | | ||
| | Max event field elements per transaction | 100 | | ||
| | Max action field elements per transaction | 100 | | ||
|
|
||
| ### After Mesa | ||
|
|
||
| | Limit | Value | | ||
| | ----------------------------------------- | ----- | | ||
| | Max event field elements per transaction | 1,024 | | ||
| | Max action field elements per transaction | 1,024 | | ||
|
|
||
| This 10x increase allows zkApps to emit richer, more expressive events and actions within a single transaction. Applications that need to log detailed state transitions or dispatch complex actions benefit from the expanded capacity. | ||
|
|
||
| For more details on actions and events, see [Events](/zkapps/writing-a-zkapp/feature-overview/events), [Actions & Reducer](/zkapps/writing-a-zkapp/feature-overview/actions-and-reducer), and [How to Fetch Events and Actions](/zkapps/writing-a-zkapp/feature-overview/fetch-events-and-actions). | ||
|
|
||
| ## MIP-9: Increased Account Update Limits | ||
|
|
||
| The transaction cost model for account updates has been simplified and the limits increased. | ||
|
|
||
| ### Before Mesa | ||
|
|
||
| Transactions used a **cost-based model** where each type of account update segment had a fractional cost, and the total cost of all segments had to stay within a limit of 69.45 cost units: | ||
|
|
||
| | Segment Type | Cost per Segment | | ||
| | -------------------------- | ---------------- | | ||
| | Proof-based update | 10.26 | | ||
| | Signed pair update | 10.08 | | ||
| | Signed single update | 9.14 | | ||
| | **Transaction cost limit** | **69.45** | | ||
|
|
||
| This yielded approximately **6 proof-based** or **7 signature-based** account updates per transaction. | ||
|
|
||
| ### After Mesa | ||
|
|
||
| Mesa replaces the cost-based model with a simpler **segment-count model**. Each segment counts as 1 unit regardless of type, with a maximum of **16 segments per transaction**: | ||
|
|
||
| | Segment Type | Cost per Segment | | ||
| | -------------------------------- | ---------------- | | ||
| | Proof-based update | 1 | | ||
| | Signed pair update | 1 | | ||
| | Signed single update | 1 | | ||
| | **Max segments per transaction** | **16** | | ||
|
|
||
| This means: | ||
|
|
||
| - **Up to 15 proof-based account updates** per transaction (previously ~5) | ||
| - **Up to 16 signed-single account updates** per transaction (including fee payer) | ||
| - **Up to 32 signature-based account updates** if all are paired (16 pairs, one including the fee payer) | ||
| - Any combination where `proof_segments + signed_single_segments + signed_pair_segments <= 16` | ||
|
|
||
| This enables fitting more account updates into one transaction, whether by multiple calls or interactions with zkApps, or more logic in your zkApp including cross-calls with other zkApps within one zkApp method. | ||
|
|
||
| :::note | ||
|
|
||
| In practice, each zkApp method call generates one proof-based account update. The highest total number of account updates in a single transaction would be 31: 1 proof segment for the method call plus 15 signed-pair segments (each containing 2 updates = 30 signed updates). | ||
|
|
||
| The actual number of max account updates varies depending on the combination of segments used. | ||
|
|
||
| ::: | ||
|
|
||
| For more details on account updates, see [Tutorial 10: Account Updates](/zkapps/tutorials/account-updates). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Yasin's message on Telegram
Should we say something about this here or because it is temporary there's no need?
I am referring to the "halving time" here concretely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid point; because it's temporary I think we should keep it in mind as part of the changes to apply at merging time.