Skip to content

Conversation

@Shigoto-dev19
Copy link
Contributor

Closes #2673.

Changes

  • Update Mina node, archive, and explorer endpoints to Mesa

    • GraphQL endpoint: https://plain-1-graphql.mina-mesa-network.gcp.o1test.net/graphql
    • Archive endpoint: http://mesa-archive-node-api.gcp.o1test.net
    • Explorer URL: https://mesa.minaexplorer.com (replacing both minascan.io/berkeley and berkeley.minaexplorer.com)
  • Default faucet network parameter changed from devnet to mesa

    • Note: we might need to change this again to devnet assuming that mesa would be the default devnet once the hardfork is applied.
  • Rename example files referencing Berkeley to Mesa

    • simple-zkapp-berkeley.ts -> simple-zkapp-mesa.ts
    • voting/run-berkeley.ts -> voting/run-mesa.ts
    • Note: the replacement here is straightforward but renaming the examples with live or devnet suffix might be more meaningful.
  • Replace berkeley hash option with network-agnostic legacy in mina-signer

    • hashPayment and hashStakeDelegation option changed from { berkeley?: boolean } to { legacy?: boolean }(inverted logic)
    • Migration: { berkeley: true } becomes { legacy: false }
    • This is a breaking change, but it will be handled alongside other breaking changes when the hard fork is applied
      Chose legacy over mesa because the flag controls V1 vs current hashing behavior, not anything network-specific; this is consistent with the existing sign-legacy.ts naming and avoids needing another rename for the next network.

TODO

  • Verify Mesa node and archive endpoints are still up-to-date at merge time (they may change before the hard fork)

Notes

  • Some examples require pre-funded keys to run. I've manually funded the hardcoded keys used in the examples have via the Mina faucet.

    • Note: each key was funded by 10 Mina which might be drained in the future and block CI.
  • Mina.faucet() is currently non-functional: the faucet endpoint (faucet.minaprotocol.com) is deployed behind Vercel, which intercepts programmatic fetch requests from Node.js with a 429 status and returns an HTML security checkpoint page instead of JSON. The o1js client code is correct; this is a server-side issue where Vercel's bot protection blocks automated/non-browser traffic before the request ever reaches the faucet API.

  • Some examples like the voting/run-mesa.ts example generate random keys and rely on Mina.faucet() at runtime, so it will not work until the faucet issue above is resolved.

@Shigoto-dev19 Shigoto-dev19 force-pushed the shigoto/refer-mesa-in-examples branch from 82041b5 to efb8bc5 Compare February 2, 2026 15:27
@Shigoto-dev19 Shigoto-dev19 requested a review from Trivo25 February 2, 2026 15:27
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funded the account used here: B62qjTDdVdxkkRNRbkpdq6D9RUvX2C7RUaW3voHMAjtmk6WLxuXHfS9.

See https://mesa.minaexplorer.com/transaction/5Jtpjt2hpHionPm3JCZ4Z7PS9qxE1jj2ZMLQEWN7TLNMQbj8iLBq

pendingTx.hash
}`
: `https://minascan.io/berkeley/tx/${pendingTx.hash}?type=zk-tx`)
: `https://mesa.minaexplorer.com/transaction/${pendingTx.hash}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mesa.minaexplorer.com is what works for Mesa Testnet for now; we might need to update this with another explorer in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funded both B62qqzhd5U54JafhR4CB8NLWQM8PRfiCZ4TuoTT5UQHzGwdR2f5RLnK & B62qnScMYfgSUWwtzB1r6fB8i23YFXgA25rzcSXVCtYVfUxLHkMLr3G.

See https://mesa.minaexplorer.com/transaction/5JtsqFPnq8sWdLtym1v4jCc2fPxnEu59aGLrQseFtykgvhCJoWsW & https://mesa.minaexplorer.com/transaction/5Jv8TG2DYsKbTMxVGVjT4x7QCXNavziSuZH1suRz2gwezRWCMxFw respectively.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funded B62qpfgnUm7zVqi8MJHNB2m37rtgMNDbFNhC2DpMmmVpQt8x6gKv9Ww.

See https://mesa.minaexplorer.com/transaction/5Jtq7XUPKR1uHfntmBd3cbaeNNT3J9D9pvyCHNsFzDFqQHK7LNSm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funded B62qn9f2eQdHyzX3SaqzZ2bPex5xD2vRTZtEb7D4yRVNo7Mm9tDdrrA.

See https://mesa.minaexplorer.com/transaction/5Jus3kzqXkGxfyqRjg38TkKga12gY2zeFuaNTmr3xCtxeKt8w9vD

Comment on lines +295 to +296
// the block time on mesa is currently longer than the average 1.5-3min, so its better to target a higher block time
// fetching an update every 20s is more than enough with a current block time of 1.5 min
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't change the comments and the poll configuration taking into consideration the network instability.

Comment on lines 54 to 56
* **Breaking change:** The `berkeley` option has been removed and replaced with `legacy`.
* - Old: `hashPayment(signed, { berkeley: true })` (use current hash)
* - New: `hashPayment(signed, { legacy: false })` (use current hash)
Copy link
Contributor Author

@Shigoto-dev19 Shigoto-dev19 Feb 2, 2026

Choose a reason for hiding this comment

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

I am not sure if the breaking change comments are necessary; I just added them as a notice especially regarding the inverted logic.

Copy link
Member

Choose a reason for hiding this comment

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

i dont think breaking change comments make sense since they are meta comments that only really matter if you look at transitions of versions rather than the code itself. the code itself is not breaking; its only the iteration of versions. if you use this function without having ever looked at the previous version you wouldn't know the difference, hence it's not breaking to you at all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed JSDoc comments in c09bcfb

hashPayment(
{ data, signature }: SignedLegacy<Json.Payment>,
options?: { berkeley?: boolean }
options?: { legacy?: boolean }
Copy link
Member

Choose a reason for hiding this comment

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

its a little bit confusing to swap the logic around and may be more disruptive than needed. why not just call it latest instead of legacy? that way we don't have any change in behaviour, it's not called berkeley anymore and it's set up properly for future hardforks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c09bcfb

const minaGraphQlEndpoint = useCustomLocalNetwork
? 'http://localhost:8080/graphql'
: 'https://api.minascan.io/node/devnet/v1/graphql';
: 'https://plain-1-graphql.mina-mesa-network.gcp.o1test.net/graphql';
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 our testnet mesa node endpoint - not a devnet endpoint - we will very likely shut down the testnet (or at least that endpoint) after mesa is complete. the old URL should still be valid since it's for the public devnet (which will fork as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I noted in the PR description too

archive: useCustomLocalNetwork
? 'http://localhost:8282'
: 'https://api.minascan.io/archive/devnet/v1/graphql',
: 'http://mesa-archive-node-api.gcp.o1test.net',
Copy link
Member

Choose a reason for hiding this comment

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

same

import { PublicKey, Types, fetchAccount, fetchLastBlock, setGraphqlEndpoints } from 'o1js';

setGraphqlEndpoints(['https://api.minascan.io/node/devnet/v1/graphql']);
setGraphqlEndpoints(['https://plain-1-graphql.mina-mesa-network.gcp.o1test.net/graphql']);
Copy link
Member

Choose a reason for hiding this comment

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

same as above - we should take note to change (and deploy the example) right after devnet forked

* Requests the [testnet faucet](https://faucet.minaprotocol.com/api/v1/faucet) to fund a public key.
*/
async function faucet(pub: PublicKey, network: string = 'devnet', headers?: HeadersInit) {
async function faucet(pub: PublicKey, network: string = 'mesa', headers?: HeadersInit) {
Copy link
Member

Choose a reason for hiding this comment

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

devnet and mesa are not the same thing. mesa is the name of a hardfork and devnet is the name of a network; mesa will be deployed to devnet so devnet should still be valid later since the network will continue to exists only with a different protocol version (mesa)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This answer the question in mind from what I noted in the PR description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in da16a24

@Trivo25
Copy link
Member

Trivo25 commented Feb 3, 2026

Mina.faucet() is currently non-functional: the faucet endpoint (faucet.minaprotocol.com) is deployed behind Vercel, which intercepts programmatic fetch requests from Node.js with a 429 status and returns an HTML security checkpoint page instead of JSON. The o1js client code is correct; this is a server-side issue where Vercel's bot protection blocks automated/non-browser traffic before the request ever reaches the faucet API.

Some examples like the voting/run-mesa.ts example generate random keys and rely on Mina.faucet() at runtime, so it will not work until the faucet issue above is resolved.

It worked in the past! please create an issue for that - this should be fixed

@Trivo25
Copy link
Member

Trivo25 commented Feb 3, 2026

Mina.faucet() is currently non-functional: the faucet endpoint (faucet.minaprotocol.com) is deployed behind Vercel, which intercepts programmatic fetch requests from Node.js with a 429 status and returns an HTML security checkpoint page instead of JSON. The o1js client code is correct; this is a server-side issue where Vercel's bot protection blocks automated/non-browser traffic before the request ever reaches the faucet API.

Some examples like the voting/run-mesa.ts example generate random keys and rely on Mina.faucet() at runtime, so it will not work until the faucet issue above is resolved.

It worked in the past! please create an issue for that - this should be fixed

Oh no, its not Vercel blocking it - we now require a zk captcha as part of the facuet because bots used to spam the faucet

@Shigoto-dev19
Copy link
Contributor Author

Mina.faucet() is currently non-functional: the faucet endpoint (faucet.minaprotocol.com) is deployed behind Vercel, which intercepts programmatic fetch requests from Node.js with a 429 status and returns an HTML security checkpoint page instead of JSON. The o1js client code is correct; this is a server-side issue where Vercel's bot protection blocks automated/non-browser traffic before the request ever reaches the faucet API.

Some examples like the voting/run-mesa.ts example generate random keys and rely on Mina.faucet() at runtime, so it will not work until the faucet issue above is resolved.

It worked in the past! please create an issue for that - this should be fixed

Oh no, its not Vercel blocking it - we now require a zk captcha as part of the facuet because bots used to spam the faucet

yes yes, it's about the captcha challenge.

@Shigoto-dev19
Copy link
Contributor Author

It worked in the past! please create an issue for that - this should be fixed

#2756

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.

Change examples referring to Berkeley to Mesa

3 participants