o1js icon indicating copy to clipboard operation
o1js copied to clipboard

[mina-signer] Invalid NetworkId for devnet environment

Open slnowak opened this issue 1 year ago • 5 comments

Looks like a few days ago, MINA changed their internal NetworkId:

{
    "code": 4,
    "message": "Network doesn't exist",
    "description": "The network doesn't exist.",
    "retriable": false,
    "details": {
        "body": [
            "Network_doesn't_exist",
            "mina:testnet",
            "mina:devnet"
        ],
        "error": "You are requesting the status for the network mina:testnet, but you are connected to the network mina:devnet\n"
    }
}

Therefore, I assume this export type NetworkId = 'mainnet' | 'testnet' | { custom: string }; should be changed to export type NetworkId = 'mainnet' | 'devnet' | { custom: string }; ?

slnowak avatar Dec 02 '24 11:12 slnowak

Thanks for bringing this up! I'll update that identifier in the SDK, but could you let me know what action you were taking to trigger this error?

hattyhattington17 avatar Dec 03 '24 15:12 hattyhattington17

The mina-signer type doesn't have anything to do with connecting to any network, so it must be something else that needs changing!

(mina-signer is just a signing library. and NetworkId just determines a 0 or 1 byte that becomes part of the signed message)

mitschabaude avatar Dec 03 '24 22:12 mitschabaude

Well, judging by the following commit, I was indeed right 😅 https://github.com/o1-labs/o1js/commit/d68b785fe7b240311b459c823c98f1aa9d2646a2

slnowak avatar Feb 24 '25 12:02 slnowak

Well, judging by the following commit, I was indeed right 😅 d68b785

nope, this was changed for cosmetic reasons, not because it caused the error you posted

mitschabaude avatar Feb 24 '25 13:02 mitschabaude

Ok, you're right - so under the hood it still applies 0/1, just the name changes. Indeed, if I use {custom: devnet}, then it doesn't sign properly.

slnowak avatar Feb 26 '25 09:02 slnowak