Skip to content

Mina Mainnet & Devnet Stable 4.0.4 Release

Latest

Choose a tag to compare

@dkijania dkijania released this 30 Oct 16:14
· 90 commits to compatible since this release
c9e2eac

🎉 The o1Labs team is proud to announce that the 4.0.4 Stable Release is now ready and available for Mainnet & Devnet! 🎉

4.0.4 is a stability and performance release for the Mesa networks. It fixes the most common ways a node could get stuck in bootstrap, makes block production and ledger sync faster, adds an independent check of every block's protocol state, stops the archive node's and Rosetta's database memory growth, and lets Rosetta report the balance of accounts that no block has touched since genesis. No protocol change is included: chain ids, verification keys and proofs are identical to 4.0.3.

If you run into any issues, please include Release: 4.0.4 in the name of any issues you create. Please report any issues you encounter here or join the discussion!

What's Included in 4.0.4?

Bootstrap and ledger sync

  • Stuck in bootstrap: a long-standing and common cause of nodes stalling in Bootstrap is fixed. If the network's snarked ledger changed while a starting node was downloading it, the download could stall, often for minutes and sometimes indefinitely, and the node needed a restart. This happened most on slow or busy connections. Nodes now switch to the new ledger at once and finish bootstrapping in their usual time.
  • Saved ledger from a lost fork: when the ledger on disk held accounts that the network's ledger does not (for example after the node ran on a fork that was later abandoned), the sync could never finish, or it could report success while the node still treated some removed accounts as present. The sync now removes those accounts.
  • Out-of-date answers: when the sync target changes and changes back, answers to queries asked before the change are now discarded quietly instead of interrupting the sync.
  • Faster sync: accounts that are unchanged in identity no longer have their index entries recomputed and rewritten, which removes one hash per account from the most expensive step of writing synced accounts.
  • Checks before write: accounts received during ledger sync are checked before they are written to the ledger.
  • Snarked ledger recovery: if an earlier recovery after a crash was itself interrupted, its leftovers could make every later recovery fail, so the node had to bootstrap. Recovery now always starts from a clean copy.

Block production and validation

  • Faster block production: when a block producer checks candidate transactions, it no longer does merkle hashing work on the throwaway ledger that it discards after the check. Checking each candidate is several times cheaper. The transactions in the block are unchanged.
  • Protocol state check: nodes now rebuild each incoming block's protocol state from its parent and its contents, and reject the block if anything differs. Only the values a block producer chooses (block creator, coinbase receiver, VRF output, timestamp and similar) are taken from the block.
  • Transaction hashing: hashing valid user commands no longer reads proofs from disk.
  • SNARK pool: the node no longer broadcasts an empty SNARK pool diff.

Networking

  • Fewer copies: each RPC message sent over a libp2p stream is no longer copied twice in full.
  • Banned peers: the libp2p helper now removes banned peers from its DHT and peer store.
  • Bitswap: the node no longer downloads the children of a malformed bitswap root.
  • libp2p helper lookup: on Linux the daemon and mina libp2p generate-keypair now find the libp2p helper (coda-libp2p_helper) in the directory of the mina binary, so a mina outside PATH can start its helper. mina libp2p generate-keypair and dump-keypair now print the error when the helper cannot start, instead of exiting with code 20 and no output.

GraphQL

  • bootstrapStatus: reports what a node is doing on its way to the chain: the current step (phase, for example SYNCING_ROOT_LEDGER or SYNCING_EPOCH_LEDGERS) and when it began, the number of attempts and why the last one failed, and the progress of each ledger sync (ledgerSyncs): accountsSettled out of numAccounts, and lastAcceptedAnswerAt. Use it to tell a stalled ledger sync from a slow one.
  • transactionPoolStatus: reports the number of commands in the transaction pool (size), the number it holds before it evicts the lowest-fee commands (maxSize), and the lowest fee per weight unit in the pool (minimumFeePerWeightUnit), which a new command must beat when the pool is full. Transaction submitters can poll it to slow down before their commands are evicted. mina-batch-txn now uses it.
  • scanState: reports, for each tree of the scan state, the free transaction slots and the base and merge SNARK jobs still to be done (the same numbers as the slots_available_*, base_snarks_required_* and merge_snarks_required_* Prometheus metrics), for the best tip or for any block in the transition frontier given its stateHash.

Archive node

  • PostgreSQL memory: the archive node now builds each database request once. Before, many requests were built again on every call, and PostgreSQL kept a new prepared statement for each one on every pooled connection, so the memory of long-lived database connections grew without limit. Stored data does not change.
  • genesis_accounts table: a new table keeps the state of every account in an era's genesis ledger. mina-archive-hardfork-toolbox populate-genesis-accounts fills it from a runtime config in seconds (see the upgrade steps below).
  • Older precomputed blocks: mina-archive-blocks, the archive RPC and GraphQL now read each precomputed block at the version it was written in, and archive it with the state hash and transaction hashes of that version's rules. mina-archive-blocks can archive version 3 blocks, written between the Berkeley and Mesa hard forks.
  • zkApp events and actions are now sent to the database as bound parameters, not as text in the SQL statement. Stored data does not change.

Rosetta

  • /search/transactions by account no longer scans every user command. It uses the user_commands indexes, and it no longer copies every canonical block for each request.
  • Database memory: the PostgreSQL memory growth fix of the archive node also applies to Rosetta.

Complete Changelog since 4.0.3:

4.0.3...4.0.4


Supported environments include Linux (Debian 12, Ubuntu 22.04 LTS & Ubuntu 24.04 LTS), and any host machine with Docker.

🚨NOTE - Ubuntu 20.04 (focal) and Debian 11 (bullseye) have reached EOL and are no longer supported. This release ships no packages or images for them.🚨


Upgrading the archive node

The daemon needs no extra step. For the archive node, the only schema change from 4.0.3 is the new genesis_accounts table.

  1. Run the 4.0.4 upgrade script against the archive database. The archive node can continue to run. The script is in the 4.0.4 archive package and image at /etc/mina/archive/upgrade.sql, and on GitHub: upgrade.sql.

    psql "postgres://USER:PASSWORD@HOST:5432/archive" -f /etc/mina/archive/upgrade.sql
    

    On a database that 4.0.3 already upgraded, the script prints Previous migration in progress/completed, reapplying and adds the table. On a 4.0.2 database it does the complete 4.0.3 upgrade too, so read the 4.0.3 upgrade steps first. The script can be run again with no effect.


Upgrading & Connecting to Mainnet

Debian Packages:

Debian Repository: First, set up and update the signed stable Debian Repository for your platform with the following commands:

sudo rm -f /etc/apt/sources.list.d/mina*.list
curl -fsSL https://stable.apt.packages.minaprotocol.com/repo-signing-key.asc | sudo gpg --dearmor -o /usr/share/keyrings/mina.gpg
echo "deb [signed-by=/usr/share/keyrings/mina.gpg] https://stable.apt.packages.minaprotocol.com $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/mina.list
sudo apt-get update

The unsigned packages.o1test.net repository is still supported and also carries 4.0.4. The signed repository is preferred, because apt verifies the package signatures. If you keep using packages.o1test.net, set it up with:

sudo rm -f /etc/apt/sources.list.d/mina*.list
echo "deb [trusted=yes] http://packages.o1test.net $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/mina.list
sudo apt-get update

Then, install the package(s) that you need:

Mina Daemon: sudo apt-get install --allow-downgrades -y mina-mainnet=4.0.4-c9e2eac

Mina Archive: sudo apt-get install --allow-downgrades -y mina-archive-mainnet=4.0.4-c9e2eac

Mina Rosetta: sudo apt-get install --allow-downgrades -y mina-rosetta-mainnet=4.0.4-c9e2eac

Mina Archive Schema: create_schema.sql

Config File: /var/lib/coda/config_c9e2eac5.json

Docker Images:

Every docker image is built for each of the supported platforms, replace CODENAME in the images below with your choice of jammy, noble, or bookworm to select the base docker image.

Mina Daemon: minaprotocol/mina-daemon:4.0.4-c9e2eac-CODENAME-mainnet

Mina Archive: minaprotocol/mina-archive:4.0.4-c9e2eac-CODENAME-mainnet

Mina Rosetta: minaprotocol/mina-rosetta:4.0.4-c9e2eac-CODENAME-mainnet

Step by Step Guide:

Docker only Make sure to run with:
--peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt or add PEER_LIST_URL=https://bootnodes.minaprotocol.com/networks/mainnet.txt to your .mina-env.

Run mina daemon with:

mina daemon --peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt

Check out our documentation for complete instructions on using this version to connect to Mainnet.

If you are running the correct version on the correct network MAINNET, mina client status will show:

Chain id:     0718f61ab88f9d0fa643ff4dc3a3d5998dd6d51a6008b2b0339b0dbb26133886
Git SHA-1:    c9e2eac5344da621828c1e96c074b8bdce665b51

Upgrading & Connecting to Devnet

Use the same Debian repository setup as above, then install:

Mina Daemon: sudo apt-get install --allow-downgrades -y mina-devnet=4.0.4-c9e2eac

Mina Archive: sudo apt-get install --allow-downgrades -y mina-archive-devnet=4.0.4-c9e2eac

Mina Rosetta: sudo apt-get install --allow-downgrades -y mina-rosetta-devnet=4.0.4-c9e2eac

Config File: /var/lib/coda/config_c9e2eac5.json

Docker Images:

Mina Daemon: minaprotocol/mina-daemon:4.0.4-c9e2eac-CODENAME-devnet

Mina Archive: minaprotocol/mina-archive:4.0.4-c9e2eac-CODENAME-devnet

Mina Rosetta: minaprotocol/mina-rosetta:4.0.4-c9e2eac-CODENAME-devnet

Run mina daemon with:

mina daemon --peer-list-url https://bootnodes.minaprotocol.com/networks/devnet.txt

If you are running the correct version on the correct network DEVNET, mina client status will show:

Chain id:     ebfce0d570bc22eb041e1a7b0a46bbc3ed5d0a1030ef2ab5e36eef908b93eba8
Git SHA-1:    c9e2eac5344da621828c1e96c074b8bdce665b51