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

mina client create-token --sender PUBKEY crashes the daemon #13185

Closed
2 tasks done
Isaac-DeFrain opened this issue May 6, 2023 · 3 comments
Closed
2 tasks done

mina client create-token --sender PUBKEY crashes the daemon #13185

Isaac-DeFrain opened this issue May 6, 2023 · 3 comments

Comments

@Isaac-DeFrain
Copy link
Contributor

Preliminary Checks

Description

Attempting to create-token crashes the daemon with the following error

2023-05-06 20:15:46 UTC [Fatal] Unhandled top-level exception: $exn
Generating crash report
        exn: {
  "commit_id": "e976627007d99415932392a84983de4e4a8db38f",
  "sexp": [
    "monitor.ml.Error",
    [
      "Failure",
      "Tokens disabled. Read (Create_new_token\n ((token_owner_pk B62qk8XYSEM6uNwkmMhPY8onoC4oy8qDpX19zyxfsQpEuRsyacg9YMv)\n  (disable_new_accounts false)))"
    ],
    [
      "Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33",
      "Called from Bin_prot__Utils.Make_binable_gen.bin_size_t in file \"src/utils.ml\", line 91, characters 38-54",
      "Called from Mina_base__Signed_command_payload.Body.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 244, characters 6-381",
      "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 402, characters 6-127",
      "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.With_version.bin_size_typ in file \"src/lib/mina_base/signed_command_payload.ml\" (inlined), line 402, characters 6-127",
      "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 402, characters 6-127",
      "Called from Mina_base__Signed_command_payload.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 416, characters 4-120",
      "Called from Mina_base__Signed_command.Poly.Stable.V1.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 13, characters 6-165",
      "Called from Mina_base__Signed_command.Poly.Stable.V1.With_version.bin_size_typ in file \"src/lib/mina_base/signed_command.ml\" (inlined), line 13, characters 6-165",
      "Called from Mina_base__Signed_command.Poly.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 13, characters 6-165",
      "Called from Mina_base__Signed_command.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 23, characters 4-171",
      "Called from Core_kernel__Binable0.to_bigstring in file \"src/binable0.ml\", line 179, characters 17-31",
      "Called from Core_kernel__Binable.to_string in file \"src/binable.ml\", line 7, characters 40-58",
      "Called from Codable.Make_base58_check.to_base58_check in file \"src/lib/codable/codable.ml\", line 90, characters 46-78",
      "Called from Base__Fn.compose in file \"src/fn.ml\" (inlined), line 25, characters 22-27",
      "Called from Mina_base__Transaction_hash.hash_command in file \"src/lib/mina_base/transaction_hash.ml\", line 37, characters 19-72",
      "Called from Mina_base__Transaction_hash.User_command.create in file \"src/lib/mina_base/transaction_hash.ml\", line 111, characters 59-73",
      "Called from Network_pool__Transaction_pool.Make0.Resource_pool.Diff.apply.go in file \"src/lib/network_pool/transaction_pool.ml\", line 1020, characters 28-67",
      "Called from Base__Result.map in file \"src/result.ml\", line 122, characters 19-24",
      "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 coda"
    ]
  ],
  "backtrace": [
    "Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33",
    "Called from Bin_prot__Utils.Make_binable_gen.bin_size_t in file \"src/utils.ml\", line 91, characters 38-54",
    "Called from Mina_base__Signed_command_payload.Body.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 244, characters 6-381",
    "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 402, characters 6-127",
    "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.With_version.bin_size_typ in file \"src/lib/mina_base/signed_command_payload.ml\" (inlined), line 402, characters 6-127",
    "Called from Mina_base__Signed_command_payload.Poly.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 402, characters 6-127",
    "Called from Mina_base__Signed_command_payload.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command_payload.ml\", line 416, characters 4-120",
    "Called from Mina_base__Signed_command.Poly.Stable.V1.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 13, characters 6-165",
    "Called from Mina_base__Signed_command.Poly.Stable.V1.With_version.bin_size_typ in file \"src/lib/mina_base/signed_command.ml\" (inlined), line 13, characters 6-165",
    "Called from Mina_base__Signed_command.Poly.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 13, characters 6-165",
    "Called from Mina_base__Signed_command.Stable.V1.With_version.bin_size_t in file \"src/lib/mina_base/signed_command.ml\", line 23, characters 4-171",
    "Called from Core_kernel__Binable0.to_bigstring in file \"src/binable0.ml\", line 179, characters 17-31",
    "Called from Core_kernel__Binable.to_string in file \"src/binable.ml\", line 7, characters 40-58",
    "Called from Codable.Make_base58_check.to_base58_check in file \"src/lib/codable/codable.ml\", line 90, characters 46-78",
    "Called from Base__Fn.compose in file \"src/fn.ml\" (inlined), line 25, characters 22-27",
    "Called from Mina_base__Transaction_hash.hash_command in file \"src/lib/mina_base/transaction_hash.ml\", line 37, characters 19-72",
    "Called from Mina_base__Transaction_hash.User_command.create in file \"src/lib/mina_base/transaction_hash.ml\", line 111, characters 59-73",
    "Called from Network_pool__Transaction_pool.Make0.Resource_pool.Diff.apply.go in file \"src/lib/network_pool/transaction_pool.ml\", line 1020, characters 28-67",
    "Called from Base__Result.map in file \"src/result.ml\", line 122, characters 19-24",
    "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"
  ]
}
2023-05-06 20:15:46 UTC [Fatal] Prover terminated due to signal, terminating daemon
2023-05-06 20:15:46 UTC [Info] Running async shutdown handler: "Close transition frontier, if exists"
2023-05-06 20:15:46 UTC [Info] Running async shutdown handler: "Remove daemon lockfile"
2023-05-06 20:15:47 UTC [Fatal] libp2p_helper process died unexpectedly: "died after receiving sigkill (signal number 9)"
2023-05-06 20:15:47 UTC [Error] Encountered $error while asking libp2p_helper for peers
        error: {
  "commit_id": "e976627007d99415932392a84983de4e4a8db38f",
  "string": "libp2p_helper process died before answering"
}
2023-05-06 20:15:48 UTC [Fatal] Unhandled top-level exception: $exn
Generating crash report
        exn: {
  "commit_id": "e976627007d99415932392a84983de4e4a8db38f",
  "sexp": [
    "monitor.ml.Error",
    [ "Mina_net2__Libp2p_helper.Libp2p_helper_died_unexpectedly" ],
    [
      "Raised at Mina_net2__Libp2p_helper.handle_libp2p_helper_termination in file \"src/lib/mina_net2/libp2p_helper.ml\", line 144, characters 8-45",
      "Called from Async_kernel__Deferred0.bind.(fun) in file \"src/deferred0.ml\", line 54, characters 64-69",
      "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 234, characters 31-31"
    ]
  ],
  "backtrace": [
    "Raised by primitive operation at Core__Signal.send in file \"src/signal.ml\", line 162, characters 6-61"
  ]
}
2023-05-06 20:15:48 UTC [Error] Encountered $error while asking libp2p_helper for peers
        error: {
  "commit_id": "e976627007d99415932392a84983de4e4a8db38f",
  "string": "helper process already exited (doing RPC ListPeers)"
}
(monitor.ml.Error
 ("Merkle_mask.Masking_merkle_tree.Make(Inputs).Attached.Dangling_parent_reference(\"467d43a0-aadf-37c5-9a53-ee02ac662a18\", \"File \\\"src/lib/mina_lib/mina_lib.ml\\\", line 1396, characters 49-56\")")
 ("Raised at Merkle_mask__Masking_merkle_tree.Make.Attached.assert_is_attached in file \"src/lib/merkle_mask/masking_merkle_tree.ml\", line 118, characters 10-57"
  "Called from Merkle_mask__Masking_merkle_tree.Make.Attached.merkle_root in file \"src/lib/merkle_mask/masking_merkle_tree.ml\", line 266, characters 6-26"
  "Called from Mina_base__Ledger.Ledger_inner.merkle_root in file \"src/lib/mina_base/ledger.ml\" (inlined), line 259, characters 25-38"
  "Called from Mina_commands.get_status.(fun).active_status.(fun) in file \"src/lib/mina_commands/mina_commands.ml\", line 278, characters 6-31"
  "Called from Mina_commands.get_status.(fun).active_status in file \"src/lib/mina_commands/mina_commands.ml\", line 276, characters 4-1023"
  "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"))

The issue was reported in #5724 and closed after a fix was introduced in #5743, yet I am observing the error today.

Inspecting src/lib/mina_base/signed_command_payload.ml at commit e976627007d99415932392a84983de4e4a8db38f, one sees that
image
So clearly this command will throw an exception and apparently it is not executed inside a try block which handles the exception, causing the daemon to immediately crash. Presumably a similar fate awaits the daemon when executing the create-token-account and mint-tokens commands.

Steps to Reproduce

  1. Run the 1.4.0beta2 daemon and wait for it to sync.
  2. Attach an account and unlock it, e.g. mina accounts create or an existing account (let's call it PUBKEY).
  3. Make sure the account is funded with at least 0.25 MINA.
  4. Do mina client create-token --sender PUBKEY

Expected Result

Create a new token or do nothing; at the very least, not crash the daemon.

Actual Result

Daemon immediately crashes 😢

How frequently do you see this issue?

Always

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

Low

Status

Mina daemon status
-----------------------------------

Max observed block height:              249255
Max observed unvalidated block height:  0
Local uptime:                           5m37s
Chain id:                               5f704cc0c82e0ed70e873f0893d7e06f148524e3f0bdae2afb02e7819a0c24d1
Git SHA-1:                              e976627007d99415932392a84983de4e4a8db38f
Configuration directory:                /path/to/.mina-config
Peers:                                  25
User_commands sent:                     0
SNARK worker:                           None
SNARK work fee:                         100000000
Sync status:                            Bootstrap
Block producers running:                0
Coinbase receiver:                      Block producer
Consensus time now:                     epoch=52, slot=3571
Consensus mechanism:                    proof_of_stake
Consensus configuration:                
        Delta:                     0
        k:                         290
        Slots per epoch:           7140
        Slot duration:             3m
        Epoch duration:            14d21h
        Chain start timestamp:     2021-03-17 00:00:00.000000Z
        Acceptable network delay:  3m

Addresses and ports:                    
        External IP:    MY_IPv4_ADDRESS
        Bind IP:        0.0.0.0
        Libp2p PeerID:  12D3KooWHn2eWhB6JYrWcKrCz5SxXpQVoziQTC8P46S7oB3ej4gV
        Libp2p port:    8302
        Client port:    8301

Metrics:                                
        block_production_delay:             7 (0 0 0 0 0 0 0)
        transaction_pool_diff_received:     8
        transaction_pool_diff_broadcasted:  0
        transactions_added_to_pool:         0
        transaction_pool_size:              0

Additional information

No response

@shimkiv
Copy link
Member

shimkiv commented May 9, 2023

Hey @Isaac-DeFrain thanks for posting it.
Yet it is not really an issue. Thing is that the actual logic was removed even before the mainnet launch but we removed that CLI sub-commands you've used only recently.
Closing it.

@shimkiv shimkiv closed this as completed May 9, 2023
@Isaac-DeFrain
Copy link
Contributor Author

@shimkiv I don't understand. Are saying that the commands have been removed and a new mainnet release will be made that does not have these commands? Because as of today, the latest mainnet release (1.4.0beta2) has these commands. That's the only reason I opened the issue.

@shimkiv
Copy link
Member

shimkiv commented May 20, 2023

I'm talking about the implementation logic behind these sub-commands (removed long time ago) and leftovers in a form of these sub-commands (present for mainnet).
We are not going to prioritise this at least because:
a). I'm pretty sure that no one is really using these commands because mainnet does not provide any tokens capabilities. All tokens stuff will be available in a form of zkApps as part of future Berkeley Hard-Fork.
b). This issue does not really impact the work of the Daemon. Unless the Node Operators intentionally will call mentioned sub-commands.
c). All leftovers were removed in Berkeley-compatible branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants