Grinnode-live / 2020-grin-bug-bash-challenge

Finding bugs in Grin-Wallet & Grin-nodes for a bounty prior to Grin fork v5.
3 stars 1 forks source link

[GRIN-Wallet] Test slatepack flow (Tor) in interactive mode #42

Closed mojitoo closed 3 years ago

mojitoo commented 3 years ago

Description: Test that transacting with Slatepacks through Tor works in interactive mode

Tor transacting should work for both flows:

Prerequisites: Setup two GRIN-Wallets (1) + (2) and send funds from wallet (1) to wallet (2) via Slatepacks through Tor.

Example:

grin-wallet cli
grin-wallet open
...

You will create a transaction and check the behavior of wallet (1) and wallet (2) if there is any problems.

Expected result:

grin-wallet> Tx sent successfully
Command 'send' completed

Include the output of command

grin-wallet -V

and your environment

uname -a
Paouky commented 3 years ago

grin-wallet 5.0.0-beta.4 Linux 4.15.0-122-generic #124-Ubuntu SMP Thu Oct 15 13:03:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Prerequisites

Two v5.0.0 wallets set up in a local environment. Being listening with one of them (grin-wallet listen) and try to send with the other wallet through cli interactive mode, as described in the following steps.

1. Begin interactive mode

grin-wallet cli

log:

20201221 11:13:56.090 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20201221 11:13:56.091 INFO grin_wallet - Using wallet configuration file at /home/arad/.grin/main/grin-wallet.toml
20201221 11:13:56.091 INFO grin_wallet - This is Grin Wallet version 5.0.0-beta.4 (git v5.0.0-beta.4), built for x86_64-unknown-linux-gnu by rustc 1.48.0 (7eac88abb 2020-11-16).
20201221 11:13:56.091 DEBUG grin_wallet - Built with profile "release", features "".

2. Open wallet

Open the wallet. Asks for a password.

open

log:

20201221 11:14:19.570 DEBUG grin_store::lmdb - DB Mapsize for /home/paouky/.grin/main/wallet_data/db/lmdb is 134217728
20201221 11:14:19.610 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /home/paouky/.grin/main/wallet_data/wallet.seed

3. Send transaction

Send 0.1 grins to a "grin1..." Slatepack address that is listening via Tor.

send -d grin1... 0.1

log:

20201221 11:15:05.075 DEBUG grin_wallet_libwallet::internal::selection - Building change outputs: total change: 580261000000 (1 outputs)
20201221 11:15:05.143 DEBUG grin_core::libtx::build - Building output: 580261000000, Commitment(1111111111111111111111111111111111111111111111111111111111111111111111111)
20201221 11:15:05.282 INFO grin_wallet_controller::command - Tx created: 0.100000000 grin to grin1sea7yhpul6svlqmrfvhtd4kz896q5upntjs27recqgvvkl5we2kqtrw3lc (strategy 'smallest')
20201221 11:15:05.282 WARN grin_wallet_api::owner - Attempting to send transaction via TOR
20201221 11:15:05.282 INFO grin_wallet_impls::adapters::http - Starting TOR Process for send at Some(127.0.0.1:59050)
20201221 11:15:05.381 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.380 [notice] Tor 0.3.2.10 (git-0edaa32732ec8930) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1, Zlib 1.2.11, Liblzma 5.2.2, and Libzstd 1.3.3.
20201221 11:15:05.381 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.380 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
20201221 11:15:05.381 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.381 [notice] Read configuration file "/home/paouky/.grin/main/tor/sender/torrc".
20201221 11:15:05.383 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.383 [warn] Path for DataDirectory (./data) is relative and will resolve to /home/paouky/.grin/main/tor/sender/./data. Is this what you wanted?
20201221 11:15:05.383 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.383 [notice] Scheduler type KIST has been enabled.
20201221 11:15:05.383 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.383 [notice] Opening Socks listener on 127.0.0.1:59050
20201221 11:15:05.384 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.000 [notice] Parsing GEOIP IPv4 file /usr/share/tor/geoip.
20201221 11:15:05.474 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.000 [notice] Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
20201221 11:15:05.647 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:05.000 [notice] Bootstrapped 0%: Starting
20201221 11:15:06.094 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:06.000 [notice] Starting with guard context "default"
20201221 11:15:06.096 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:06.000 [notice] Bootstrapped 80%: Connecting to the Tor network
20201221 11:15:07.170 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:07.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
20201221 11:15:07.482 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:07.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
20201221 11:15:07.822 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:07.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
20201221 11:15:07.822 DEBUG grin_wallet_impls::tor::process - Dec 21 11:15:07.000 [notice] Bootstrapped 100%: Done
20201221 11:15:07.822 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
20201221 11:15:21.610 DEBUG grin_wallet_impls::tor::process - Dropping TOR process
20201221 11:15:21.623 DEBUG grin_wallet_libwallet::internal::selection - Change amount is: 580261000000
20201221 11:15:21.762 DEBUG grin_core::libtx::build - Building input (spending regular output): 580384000000, 0300000000000000006e9944ca00000000
20201221 11:15:21.772 DEBUG grin_core::libtx::build - Building output: 580261000000, Commitment(1111111111111111111111111111111111111111111111111111111111111111111111111)
20201221 11:15:21.833 DEBUG grin_wallet_libwallet::slate - Final Tx excess: Commitment(2222222222222222222222222222222222222222222222222222222222222222)
20201221 11:15:21.833 DEBUG grin_wallet_libwallet::slate - Validating final transaction
20201221 11:15:22.119 DEBUG grin_wallet_libwallet::api_impl::owner - api: post_tx: successfully posted tx: 596987549939, fluff? false

Test was successful, no issues found.

marekyggdrasil commented 3 years ago

Thanks guys @Paouky and @mojitoo !