Update examples to reference Mesa instead of Berkeley - #2751
Update examples to reference Mesa instead of Berkeley#2751Shigoto-dev19 wants to merge 7 commits into
Conversation
82041b5 to
efb8bc5
Compare
There was a problem hiding this comment.
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}`) |
There was a problem hiding this comment.
mesa.minaexplorer.com is what works for Mesa Testnet for now; we might need to update this with another explorer in the future.
There was a problem hiding this comment.
Funded both B62qqzhd5U54JafhR4CB8NLWQM8PRfiCZ4TuoTT5UQHzGwdR2f5RLnK & B62qnScMYfgSUWwtzB1r6fB8i23YFXgA25rzcSXVCtYVfUxLHkMLr3G.
See https://mesa.minaexplorer.com/transaction/5JtsqFPnq8sWdLtym1v4jCc2fPxnEu59aGLrQseFtykgvhCJoWsW & https://mesa.minaexplorer.com/transaction/5Jv8TG2DYsKbTMxVGVjT4x7QCXNavziSuZH1suRz2gwezRWCMxFw respectively.
There was a problem hiding this comment.
Funded B62qpfgnUm7zVqi8MJHNB2m37rtgMNDbFNhC2DpMmmVpQt8x6gKv9Ww.
See https://mesa.minaexplorer.com/transaction/5Jtq7XUPKR1uHfntmBd3cbaeNNT3J9D9pvyCHNsFzDFqQHK7LNSm
There was a problem hiding this comment.
Funded B62qn9f2eQdHyzX3SaqzZ2bPex5xD2vRTZtEb7D4yRVNo7Mm9tDdrrA.
See https://mesa.minaexplorer.com/transaction/5Jus3kzqXkGxfyqRjg38TkKga12gY2zeFuaNTmr3xCtxeKt8w9vD
| // 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 |
There was a problem hiding this comment.
I didn't change the comments and the poll configuration taking into consideration the network instability.
| * **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) |
There was a problem hiding this comment.
I am not sure if the breaking change comments are necessary; I just added them as a notice especially regarding the inverted logic.
There was a problem hiding this comment.
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
| hashPayment( | ||
| { data, signature }: SignedLegacy<Json.Payment>, | ||
| options?: { berkeley?: boolean } | ||
| options?: { legacy?: boolean } |
There was a problem hiding this comment.
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
| 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'; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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', |
| 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']); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
This answer the question in mind from what I noted in the PR description.
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. |
|
|
What's the state of this PR? Should we spend some time on it this week? @Shigoto-dev19 @Trivo25 |
@querolita Mainly update Mesa node and archive endpoints to use public URLs instead of our Testnet ones. |
|
We should be able to just merge this into develop-3.0, as that branch will become our new main |
Closes #2673.
Changes
Update Mina node, archive, and explorer endpoints to Mesa
https://plain-1-graphql.mina-mesa-network.gcp.o1test.net/graphqlhttp://mesa-archive-node-api.gcp.o1test.nethttps://mesa.minaexplorer.com(replacing bothminascan.io/berkeleyandberkeley.minaexplorer.com)Default faucet network parameter changed from
devnettomesadevnetassuming thatmesawould be the default devnet once the hardfork is applied.Rename example files referencing Berkeley to Mesa
simple-zkapp-berkeley.ts->simple-zkapp-mesa.tsvoting/run-berkeley.ts->voting/run-mesa.tsliveordevnetsuffix might be more meaningful.Replace
berkeleyhash option with network-agnosticlegacyin mina-signerhashPaymentandhashStakeDelegationoption changed from{ berkeley?: boolean }to{ legacy?: boolean }(inverted logic){ berkeley: true }becomes{ legacy: false }Chose
legacyovermesabecause the flag controls V1 vs current hashing behavior, not anything network-specific; this is consistent with the existingsign-legacy.tsnaming and avoids needing another rename for the next network.TODO
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.
10Mina 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 a429status 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.tsexample generate random keys and rely onMina.faucet()at runtime, so it will not work until the faucet issue above is resolved.