grin-wallet icon indicating copy to clipboard operation
grin-wallet copied to clipboard

Serialization Error with Large Amounts of Inputs or balance too high

Open quentinlesceller opened this issue 5 years ago • 2 comments
trafficstars

Sender side:

grin-wallet -p "" send -d tgrin1m7vmg0z5tu373haxtglape4hv45lw86xscq93ur7jj5rmpk5sw7qf2xf35 -f 1000000

20200714 17:30:02.439 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20200714 17:30:02.439 INFO grin_wallet - Using wallet configuration file at /Users/quentin/test/grin-wallet.toml
20200714 17:30:02.439 INFO grin_wallet - This is Grin Wallet version 4.0.0, built for x86_64-apple-darwin by rustc 1.44.0.
20200714 17:30:02.439 DEBUG grin_wallet - Built with profile "release", features "".
20200714 17:30:02.888 DEBUG grin_store::lmdb - DB Mapsize for /Users/quentin/test/wallet_data/db/lmdb is 402653184
20200714 17:30:02.890 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /Users/quentin/test/wallet_data/wallet.seed
20200714 17:30:04.478 DEBUG grin_wallet_libwallet::internal::updater - Refreshing wallet outputs
20200714 17:30:34.984 DEBUG grin_wallet_libwallet::internal::selection - Extending maximum number of outputs. 16670 outputs selected.
20200714 17:30:35.070 DEBUG grin_wallet_libwallet::internal::selection - Building change outputs: total change: 43169001078 (1 outputs)
20200714 17:30:35.084 DEBUG grin_core::libtx::build - Building output: 43169001078, Commitment(09b066b489a7271af95bb0a6c8658f7a9a91ac5791e2b875226d6148114d99a3bc)
20200714 17:30:35.408 INFO grin_wallet_controller::command - Tx created: 1000000.000000000 grin to tgrin1m7vmg0z5tu373haxtglape4hv45lw86xscq93ur7jj5rmpk5sw7qf2xf35 (strategy 'smallest')
20200714 17:30:35.408 WARN grin_wallet_api::owner - Attempting to send transaction via TOR
20200714 17:30:35.408 INFO grin_wallet_impls::adapters::http - Starting TOR Process for send at Some(V4(127.0.0.1:59050))
20200714 17:30:35.421 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.420 [notice] Tor 0.4.3.6 running on Darwin with Libevent 2.1.12-stable, OpenSSL 1.1.1g, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
20200714 17:30:35.421 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.420 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
20200714 17:30:35.421 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.421 [notice] Read configuration file "/Users/quentin/test/tor/sender/torrc".
20200714 17:30:35.423 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.423 [warn] Path for DataDirectory (./data) is relative and will resolve to /Users/quentin/test/tor/sender/./data. Is this what you wanted?
20200714 17:30:35.425 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.424 [notice] Opening Socks listener on 127.0.0.1:59050
20200714 17:30:35.425 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.425 [notice] Opened Socks listener on 127.0.0.1:59050
20200714 17:30:35.429 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.000 [notice] Parsing GEOIP IPv4 file /usr/local/Cellar/tor/0.4.3.6/share/tor/geoip.
20200714 17:30:35.605 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.000 [notice] Parsing GEOIP IPv6 file /usr/local/Cellar/tor/0.4.3.6/share/tor/geoip6.
20200714 17:30:35.701 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:35.000 [notice] Bootstrapped 0% (starting): Starting
20200714 17:30:36.013 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:36.000 [notice] Starting with guard context "default"
20200714 17:30:37.026 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
20200714 17:30:37.156 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
20200714 17:30:37.439 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
20200714 17:30:37.553 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
20200714 17:30:37.553 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
20200714 17:30:37.553 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
20200714 17:30:37.553 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:37.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
20200714 17:30:38.070 DEBUG grin_wallet_impls::tor::process - Jul 14 17:30:38.000 [notice] Bootstrapped 100% (done): Done
20200714 17:30:38.070 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
20200714 17:30:45.069 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
Wallet command failed: LibWallet Error: Wallet store error: Serialization Error

Receiver side:

grin-wallet --floonet listen
20200714 17:29:52.074 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20200714 17:29:52.075 INFO grin_wallet - Using wallet configuration file at /Users/quentin/.grin/floo/grin-wallet.toml
20200714 17:29:52.075 INFO grin_wallet - This is Grin Wallet version 4.0.0, built for x86_64-apple-darwin by rustc 1.44.0.
20200714 17:29:52.075 DEBUG grin_wallet - Built with profile "release", features "".
Password:
20200714 17:29:53.217 DEBUG grin_store::lmdb - DB Mapsize for /Users/quentin/.grin/floo/wallet_data/db/lmdb is 134217728
20200714 17:29:53.218 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /Users/quentin/.grin/floo/wallet_data/wallet.seed
20200714 17:29:53.251 WARN grin_wallet_controller::controller - Starting TOR Hidden Service for API listener at address 36m3ipcul4r6rx5gli75bzvxmvu7oh2gqyafr4d6ssud3bwuqo6ealad, binding to 127.0.0.1:13415
20200714 17:29:53.264 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.263 [notice] Tor 0.4.3.6 running on Darwin with Libevent 2.1.12-stable, OpenSSL 1.1.1g, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
20200714 17:29:53.264 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.264 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
20200714 17:29:53.264 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.264 [notice] Read configuration file "/Users/quentin/.grin/floo/tor/listener/torrc".
20200714 17:29:53.266 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.266 [warn] Path for DataDirectory (./data) is relative and will resolve to /Users/quentin/.grin/floo/tor/listener/./data. Is this what you wanted?
20200714 17:29:53.266 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.266 [warn] Path for HiddenServiceDir (./onion_service_addresses/36m3ipcul4r6rx5gli75bzvxmvu7oh2gqyafr4d6ssud3bwuqo6ealad) is relative and will resolve to /Users/quentin/.grin/floo/tor/listener/./onion_service_addresses/36m3ipcul4r6rx5gli75bzvxmvu7oh2gqyafr4d6ssud3bwuqo6ealad. Is this what you wanted?
20200714 17:29:53.279 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.000 [notice] Parsing GEOIP IPv4 file /usr/local/Cellar/tor/0.4.3.6/share/tor/geoip.
20200714 17:29:53.451 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.000 [notice] Parsing GEOIP IPv6 file /usr/local/Cellar/tor/0.4.3.6/share/tor/geoip6.
20200714 17:29:53.551 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.000 [notice] Bootstrapped 0% (starting): Starting
20200714 17:29:53.835 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:53.000 [notice] Starting with guard context "default"
20200714 17:29:54.851 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:54.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
20200714 17:29:54.956 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:54.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
20200714 17:29:55.072 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
20200714 17:29:55.375 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
20200714 17:29:55.376 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
20200714 17:29:55.376 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
20200714 17:29:55.376 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
20200714 17:29:55.999 DEBUG grin_wallet_impls::tor::process - Jul 14 17:29:55.000 [notice] Bootstrapped 100% (done): Done
20200714 17:29:55.999 WARN grin_wallet_controller::controller - Starting HTTP Foreign listener API server at 127.0.0.1:13415.
20200714 17:29:55.999 WARN grin_wallet_controller::controller - HTTP Foreign listener started.
20200714 17:29:55.999 WARN grin_wallet_controller::controller - Slatepack Address is: tgrin1m7vmg0z5tu373haxtglape4hv45lw86xscq93ur7jj5rmpk5sw7qf2xf35
20200714 17:30:44.736 DEBUG grin_core::libtx::build - Building output: 1000000000000000, Commitment(08e991abf8cc99dbe33a5bde745f6df9e4df52d5f48a3f2e4a0fd63bc3df09b99f)

Receiver side seems ok.

Grin-Wallet v4.0.0 and Grin v4.0.1.

quentinlesceller avatar Jul 14 '20 21:07 quentinlesceller

This is mostly trying to spend a LOT of Coinbase inputs (which are not involved at this moment of the transaction). Tried with 500 000, 400 00, 300 000 and 200 000 the same situation happens. 100 000 works though.

quentinlesceller avatar Jul 14 '20 21:07 quentinlesceller

This is likely to do with hitting the tx weight limit? Not the value in grin but the number of inputs involved?

20200714 17:30:34.984 DEBUG grin_wallet_libwallet::internal::selection - Extending maximum number of outputs. 16670 outputs selected.

I thought we had a "soft" limit of 500 inputs when building a tx? I'm not clear on what that log line is saying.

😔 I think I might be involved in originally writing that code that logs that line...

This is roughly what I think is happening -

  • Each coinbase output is 60 grin.
  • You try and send 200000 grin.
  • So the code ends up attempting to select ~3000 outputs to spend.
  • Tx exceeds the weight limit.
  • Serialization fails.

I'm guessing the wallet does not actually validate the tx (for weight) during tx building. We should be catching this earlier.

antiochp avatar Jul 15 '20 08:07 antiochp