Stable libra coins (Coin1, Coin2)

Hi all,
What is the current state of the support for the single-currency stablecoins?

On code, I saw some references to ‘Coin1’ or ‘Coin2’ that I imagine would represent the single-currency stablecoins (e.g., ≋USD, ≋EUR, ≋GBP, etc.) from the whitepaper v2.

On the CLI I can ‘mint’ the Coin1 and Coin2 (in addition to LBR) but I do not see a reflection of the increase of balance for those, on the CLI or a direct JRPC call I only see the LBR balance.

Thanks

2 Likes

I see that this TX ends with MISSING_DATA error, thats why no change in balances happen. However, this does not explain how minting mechanics work. Can somebody explain?

1 Like

@astudnev If you haven’t already, check this out: https://developers.libra.org/docs/life-of-a-transaction
Look for updated docs coming soon!

1 Like

Thank you for the link, but this does not explain the minting mechanics. This page even do not contain the word “mint”

1 Like

@amg can you give directions to repro this problem? I just tried on the CLI minting multiple currencies for the same account and see the balances for all of them for that account, both via the CLI and JSON RPC.

1 Like

@astudnev - if you want to mint for a currency different from your initial mint, you need to first add that currency to your account. This functionality is available on the CLI via the following command:
account addc <account_address> <currency_code>

1 Like

Minting LBR:

libra% account mint 0 10 LBR
>> Minting coins
Mint request submitted
 query balance 0
INFO 2020-06-26 07:15:31 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11715709
Balance is: 10.000000LBR

Minting Coin1:

libra% account mintb 0 10 Coin1
>> Minting coins
waiting for 0000000000000000000000000b1e55ed with sequence number 1
INFO 2020-06-26 07:16:39 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11722058
transaction executed!
Finished minting!

However this operation fails in transaction:

{"expiration_time":1593156032,"gas_currency":"LBR","gas_unit_price":0,"max_gas_amount":1000000,"public_key":"c56b384d31b4e2e66dc0b78de7ce537e076c8f6bac1e4c92989c0b05ebc9e122","script":{"type":"unknown_transaction"},"script_hash":"27da8f824f9595a7daace5f63bc540f5e6bbb9c52c862e070ca997ed4dd82f99","sender":"0000000000000000000000000b1e55ed","sequence_number":3956,"signature":"c4fcd0c188685e25f8bcf8e8836651e0274f9e2adb976180050eeede75763d2a6f8ce9eb4cfdc48ad37cc37fe67fd0ca94e21f54f124601afa5dbd9667f4ea0c","signature_scheme":"Scheme::Ed25519","type":"user"},"version":11734488,"vm_status":4008}

with the error 4008 = MISSING_DATA

Now adding Coin1 to account:

libra% account addcb 0 Coin1
>> Adding currency
waiting for 06872ab9c685d5daee32f0636d68d8ea with sequence number 0
INFO 2020-06-26 07:23:15 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759088
.INFO 2020-06-26 07:23:15 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759099
.INFO 2020-06-26 07:23:15 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759109
.INFO 2020-06-26 07:23:15 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759120
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759132
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759143
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759155
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759167
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759178
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759190
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759201
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759213
.INFO 2020-06-26 07:23:16 testsuite/cli/src/libra_client.rs:268 Verified version change to: 11759224

This never ends

1 Like

I created the account and executed mint on:

  • LBR
  • Coin1
  • Coin2

The requested the balances for the account 38a9b3418ec482d460da870d4a3035ac the day I put the post I could only see the balance for LBR, today I can see for the 3 coins thought Coin1 and Coin2 have 0.

From your answer to @astudnev I realized that I had to add the coins to the account.

1 Like

hi Astudnev.
I tried to reproduce your issue (as I could see the Coin1 and Coin2 for my tests with the code of 23th ) I pull the latest changes and executed your steps on the branch testnet
In the last step I get an stacktrace.

libra% account addcb 0 Coin1
>> Adding currency
waiting for 774d660e3e9edcfe849da77f5dcea889 with sequence number 0
ERROR 2020-06-26 08:33:28 common/crash-handler/src/lib.rs:38 details = '''panicked at 'attempt to     subtract with overflow', testsuite/cli/src/client_proxy.rs:701:46'''
1 Like

I got the same error, this is the latest master build, local network:

libra% account mint 0 10 LBR
>> Minting coins
Mint request submitted
libra% query balance 0
INFO 2020-06-26 09:38:38 testsuite/cli/src/libra_client.rs:268 Verified version change to: 673
Balance is: 20.000000LBR
libra% account addcb 0 Coin1
>> Adding currency
waiting for 290fad58e4a3de5b156db10ee0cbffd5 with sequence number 0
ERROR 2020-06-26 09:38:45 common/crash-handler/src/lib.rs:38 details = '''panicked at 'attempt to subtract with overflow', testsuite/cli/src/client_proxy.rs:678:46'''
backtrace = '''
   0:     0x559018c7544d - backtrace::backtrace::libunwind::trace::h877e539ffa202ce0
                               at /home/studnev/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/libunwind.rs:86
                           backtrace::backtrace::trace_unsynchronized::h6358f5457ce1cd8d
                               at /home/studnev/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/mod.rs:66
   1:     0x559018c753ce - backtrace::backtrace::trace::h97d1c6d6a6b3c4e7
                               at /home/studnev/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/backtrace/mod.rs:53
   2:     0x559018c984dd - backtrace::capture::Backtrace::create::hec252e28ea2e2a36
                               at /home/studnev/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/capture.rs:164
   3:     0x559018c983f5 - backtrace::capture::Backtrace::new::h1313d16a4725c7ee
                               at /home/studnev/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.48/src/capture.rs:128
   4:     0x559018c6d9bb - crash_handler::handle_panic::h04fe4cde33afeb26
                               at /home/studnev/libra/common/crash-handler/src/lib.rs:35
   5:     0x559018c6edf6 - crash_handler::setup_panic_handler::{{closure}}::h04f9fc3f36b9a781
                               at /home/studnev/libra/common/crash-handler/src/lib.rs:27
   6:     0x55901a9f7685 - std::panicking::rust_panic_with_hook::h93f74f5ef2f71f31
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:515
   7:     0x55901a9f719b - rust_begin_unwind
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:419
   8:     0x55901aa1f4a1 - core::panicking::panic_fmt::h1ce7d3a6bb2a90c1
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libcore/panicking.rs:111
   9:     0x55901aa1f3ed - core::panicking::panic::hb11e4925ffe07e51
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libcore/panicking.rs:54
  10:     0x559018d88892 - cli::client_proxy::ClientProxy::wait_for_transaction::hb6ec9e3762d31850
                               at /home/studnev/libra/testsuite/cli/src/client_proxy.rs:678
  11:     0x559018d849b1 - cli::client_proxy::ClientProxy::add_currency::hd10a5ab56a6d45e8
                               at /home/studnev/libra/testsuite/cli/src/client_proxy.rs:425
  12:     0x559018de5db5 - <cli::account_commands::AccountCommandAddCurrency as cli::commands::Command>::execute::hbad0bc23216afa4b
                               at /home/studnev/libra/testsuite/cli/src/account_commands.rs:178
  13:     0x559018dc59e4 - cli::commands::subcommand_execute::h3420c8cb63b58dc5
                               at /home/studnev/libra/testsuite/cli/src/commands.rs:109
  14:     0x559018de4b19 - <cli::account_commands::AccountCommand as cli::commands::Command>::execute::h7b849c8d8899fc0c
                               at /home/studnev/libra/testsuite/cli/src/account_commands.rs:29
  15:     0x559018c52e12 - cli::main::h14c08ef8ea50ed17
                               at /home/studnev/libra/testsuite/cli/src/main.rs:161
  16:     0x559018c4a10b - std::rt::lang_start::{{closure}}::hedb70eea21f364e6
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:67
  17:     0x55901a9f79f8 - std::rt::lang_start_internal::{{closure}}::h44dc84346eeba462
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:52
                           std::panicking::try::do_call::h3559ee6be71549e2
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:331
                           std::panicking::try::h78f4c77016541848
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:274
                           std::panic::catch_unwind::hfe46f382761b3d41
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panic.rs:394
                           std::rt::lang_start_internal::he05790f0cb2000df
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:51
  18:     0x559018c4a0e7 - std::rt::lang_start::hdc913d03ff66e0f2
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:67
  19:     0x559018c5541a - main
  20:     0x7f9f8d467b97 - __libc_start_main
  21:     0x559018c4266a - _start
  22:                0x0 - <unknown>
'''

Exit client.
Exit libra-swarm.

1 Like

Another mystery - why it mints Coin1/Coin2 in amount not exactly 50% of LBR ?

38000001 not exactly 38000000

The ‘subtract with overflow’ panicking happens because the CLI incorrectly expects the sequence number of the account to be greater than 0 when adding the currency (in blocking mode). This is a bug, fix upcoming. Otherwise, if you bump up the sequence number of the account with some transfer transaction, you should be able to add the new currency!

3 Likes

Hi @jd119,

I was wondering when to expect the updated docs, by soon do you mean like in a month?

Thanks!

Cheers,
Syed