Skip to content
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

Node crashes when receiving invalid zkapp command memo via GraphQL #16155

Open
2 tasks done
nholland94 opened this issue Sep 29, 2024 · 0 comments
Open
2 tasks done

Node crashes when receiving invalid zkapp command memo via GraphQL #16155

nholland94 opened this issue Sep 29, 2024 · 0 comments
Labels
bug mina-node Issues related to all types of mina node triage

Comments

@nholland94
Copy link
Member

Preliminary Checks

Description

The node crashes if the memo of a zkapp command submitted via GraphQL is too short but is still encoded in base58.

Steps to Reproduce

Send the following query to GraphQL. Note the invalid length of the memo base58 encoding.

{
  "query": "mutation MyMutation($input: SendZkappInput!) { sendZkapp(input: $input) { zkapp { hash id failureReason { failures } } } }",
  "variables": {
    "input": {
      "zkappCommand":
        {"feePayer":{"body":{"publicKey":"B62qiov6ybSM3VkZUM1ztDPXpKA7ckCqvr3UVbwBdcavHFYAJ4Tq2Pw","fee":"10000000000","validUntil":null,"nonce":"0"},"authorization":"7mX1yba8ThaEAE1FBn5mUriYmgL8SbTGike4TtdRKBor7ZwqdwSqPhrJMVSTwKHfmcvNYrwk6cfH7VhujerCNEnMm5Z3iGLh"},"accountUpdates":[{"body":{"publicKey":"B62qmae23p6MtSMaEobU46KjYPhGzVdTPFHXCEToa3E1hDyoLHFKSLq","tokenId":"wSHV2S4qX9jFsLjQo8r1BsMLH2ZRKsZx6EJd1sbozGPieEC4Jf","update":{"appState":[null,null,null,null,null,null,null,null],"delegate":null,"verificationKey":null,"permissions":null,"zkappUri":null,"tokenSymbol":null,"timing":null,"votingFor":null},"balanceChange":{"magnitude":"0","sgn":"Positive"},"incrementNonce":false,"events":[["42"]],"actions":[],"callData":"0","callDepth":0,"preconditions":{"network":{"snarkedLedgerHash":null,"blockchainLength":null,"minWindowDensity":null,"totalCurrency":null,"globalSlotSinceGenesis":null,"stakingEpochData":{"ledger":{"hash":null,"totalCurrency":null},"seed":null,"startCheckpoint":null,"lockCheckpoint":null,"epochLength":null},"nextEpochData":{"ledger":{"hash":null,"totalCurrency":null},"seed":null,"startCheckpoint":null,"lockCheckpoint":null,"epochLength":null}},"account":{"balance":null,"nonce":null,"receiptChainHash":null,"delegate":null,"state":[null,null,null,null,null,null,null,null],"actionState":null,"provedState":null,"isNew":null},"validWhile":null},"useFullCommitment":false,"implicitAccountCreationFee":false,"mayUseToken":{"parentsOwnToken":false,"inheritFromParent":false},"authorizationKind":{"isSigned":true,"isProved":false,"verificationKeyHash":"3392518251768960475377392625298437850623664973002200885669375116181514017494"}},"authorization":{"proof":null,"signature":"7mX8aYPY3ipXtMMqVTqX1XkZfjC221ca6Ym9krDsXraSLmPGarwD2B7Z9z1TsJanpSC7zp4prMAMq9HRRK5XsugTEmSRoaGN"}}],"memo":"3MNQE1X"}
    }
  }
}

Expected Result

GraphQL returns an error, the node does not crash.

Actual Result

The node crashes due to an index out of bounds error.

{"timestamp":"2024-09-29 17:43:30.900875Z","level":"Fatal","source":{"module":"Init__Mina_run","location":"File \"src/app/cli/src/init/mina_run.ml\", line 669, characters 2-26"},"message":"Unhandled top-level exception: $exn\nGenerating crash report","metadata":{"exn":{"commit_id":"3ba67430251d36622086183fdcbac464d4603c56","sexp":["monitor.ml.Error",["exn.ml.Reraised","Mina_net2 raised an exception",["monitor.ml.Error",["Mina_net2__Libp2p_helper.Libp2p_helper_died_unexpectedly"],["Raised at Mina_net2__Libp2p_helper.handle_libp2p_helper_termination.(fun) in file \"src/lib/mina_net2/libp2p_helper.ml\", line 146, characters 8-45","Called from Async_kernel__Deferred1.M.map.(fun) in file \"src/deferred1.ml\", line 17, characters 40-45","Called from Async_kernel__Job_queue.run_job in file \"src/job_queue.ml\" (inlined), line 128, characters 2-5","Called from Async_kernel__Job_queue.run_jobs in file \"src/job_queue.ml\", line 169, characters 6-47","Caught by monitor at file \"src/lib/gossip_net/libp2p.ml\", line 236, characters 31-31"]]],["Raised at Base__Exn.reraise in file \"src/exn.ml\", line 59, characters 22-49","Called from Base__Result.try_with in file \"src/result.ml\", line 195, characters 9-15","Caught by monitor coda"]],"backtrace":["Raised at Base__Exn.reraise in file \"src/exn.ml\", line 59, characters 22-49","Called from Base__Result.try_with in file \"src/result.ml\", line 195, characters 9-15"]},"host":"24.55.74.203","peer_id":"12D3KooWAFFq2yEQFFzhU5dt64AWqawRuomG9hL8rSmm5vxhAsgr","port":3002}}

Daemon version

3ba6743

How frequently do you see this issue?

Always

What is the impact of this issue on your ability to run a node?

Low

Status

Not relevant

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mina-node Issues related to all types of mina node triage
Projects
Status: No status
Development

No branches or pull requests

2 participants