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 the no_payment_proof flag #46

Closed marekyggdrasil closed 3 years ago

marekyggdrasil commented 3 years ago

Description The objective of this test is to test the no_payment_proof flag

-n --no_payment_proof if present, do not request the data required for a payment proof. This shortens the slatepack message length.

Prerequisites:

  1. Setup two GRIN-Wallets (1) + (2)
  2. send funds from wallet (1) to wallet (2) via manual Slatepacks do not specify any extra flags
  3. note down the length of slatepack message in number of characters
  4. cancel the transaction
  5. attempt to perform the transaction again from wallet (1) to wallet (2) via manual Slatepacks and set the --no_payment_proof flag
  6. note down the length of slatepack message in number of characters
  7. cancel the transaction

The wallet (2) is only required to provide a receiver address.

Expected result: Expect the slatepack message to be shorter when the --no_payment_proof flag is set. Document that.

Other info: For both wallets include the output of command

grin-wallet -V

and your environment

uname -a
mojitoo commented 3 years ago

Prerequisites:

Step 1 : send funds from wallet (1) to wallet (2)

grin-wallet -r "https://grinnode.live:3413"  send -d grin1jdj2w0fh8haq9pfuvjmjrev5f4gs34n4n7fnsfmuwf7j09x4v9ws79nq8d 0.1
20201223 10:03:17.405 ERROR grin_wallet_impls::node_clients::http - Error calling get_version: ResponseError error: Cannot parse response
20201223 10:03:17.405 ERROR grin_wallet_impls::node_clients::http - Unable to contact Node to get version info: Client Callback Error: Error calling get_version: ResponseError error: Cannot parse response
Password: 
20201223 10:03:22.260 WARN grin_wallet_api::owner - Attempting to send transaction via TOR
20201223 10:03:30.862 WARN grin_wallet_api::owner - Unable to send transaction via TOR
/Users/workstation/.grin/main/slatepack/97ebabda-347e-4dee-8c0d-97be52fbeb72.S1.slatepack

Slatepack data follows. Please provide this output to the other party

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. 22WLRHEuTy1Jyvk QnRoKjD5iQNPTA9 Ngk1NMBR11w7yko AYH7AkPbxNNXegU zKRJUjgLeqa8Gc6 4NUbPV8csaNcwaw QScBeNzKKSSKrSq r2BAecdWf2abQhf HuYcEjjiXab9Qqc nPzj7vDZPigu9xi CLiqkiJPFJ6s87C Z6GyA6GowqAVVH1 42KsUfLMRzT53iS nqRshhQozhycHRd 3EXVviZNvzTBqaw mi8rJXbjsQ6m3AH pZyxjxVL5rFpVz9 3mD8inPyn4R6RH2 TtEanPxt7kPXf6n Lw2YDe4WKjrAVnj jN7y8qW328VUGFG WVNquhUEfWUGSh7 Qn3cGFgpczLXoqE 79H3aUg4tfhAqsA qUf1pMAKoJY3khM rHPhjxPsbdEGVM8 hFPnmwtrYKJ4Q5q dGDVJExUXBMgUQb iM63sdGdZmaFksm YrqWkFZskE3xRxL RLshy7wPeeeLJBe rqMy3JoPwyAV2hr G9RK45DzEdW33zR eULih2Lz5FxZpNm tytpXeVnPWtEoBs xTiwLFD2vEj7CSz RxD2ed3FLPCGyGc kEmrfnsRVvBihpM CY7fYabhwCt8QwR 2mYKafVnr1mScST HKZ5zUJm8TTFXr5 WVUMgeQ4V9cRdE1 MxMVgdAJJt6peKs Mc34YREPNUjjM5L S45Bj7YJujxsiHZ Qa6HiZPXTtVxZfT bQr8uG4o5xurHJz LmyAM7xHCEK3FBH QrRFCHJw2eMMrPY 7RFdbXi5TcBF6h5 ftBp9DAmqQvRwes onbHvciqiyeyX38 C2XX14eL8PPmZHc R6mR8PMMMq8eHdJ Qcoy9tWngpMUZRT 71jeDaMYLdrFKmA YRVDeiRxSMpePW9 VU9NiQY3QjqAU3M HY9Uo4K1brC2gP9 YTy3kLoGpL25JWH WB. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/Users/workstation/.grin/main/slatepack/97ebabda-347e-4dee-8c0d-97be52fbeb72.S1.slatepack

The slatepack data is encrypted for the recipient only

Command 'send' completed successfully

Command 'send' completed successfully

length of slatepack message : 993

Step 2 : cancel the transaction

grin-wallet -r "https://grinnode.live:3413"  cancel -i 41
20201223 10:05:53.939 ERROR grin_wallet_impls::node_clients::http - Error calling get_version: ResponseError error: Cannot parse response
20201223 10:05:53.939 ERROR grin_wallet_impls::node_clients::http - Unable to contact Node to get version info: Client Callback Error: Error calling get_version: ResponseError error: Cannot parse response
Password: 
20201223 10:05:59.630 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20201223 10:06:01.949 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201223 10:06:01.959 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201223 10:06:01.960 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete
Command 'cancel' completed successfully

Command 'cancel' completed successfully

Step 3 : send using --no_payment_proof flag

grin-wallet -r "https://grinnode.live:3413"  send --no_payment_proof -d grin1jdj2w0fh8haq9pfuvjmjrev5f4gs34n4n7fnsfmuwf7j09x4v9ws79nq8d 0.1
20201223 10:07:40.631 ERROR grin_wallet_impls::node_clients::http - Error calling get_version: ResponseError error: Cannot parse response
20201223 10:07:40.631 ERROR grin_wallet_impls::node_clients::http - Unable to contact Node to get version info: Client Callback Error: Error calling get_version: ResponseError error: Cannot parse response
Password: 
20201223 10:07:51.744 WARN grin_wallet_api::owner - Attempting to send transaction via TOR
20201223 10:08:04.000 WARN grin_wallet_api::owner - Unable to send transaction via TOR
/Users/workstation/.grin/main/slatepack/b556dab1-85c6-41e9-9cf4-39721f6c4726.S1.slatepack

Slatepack data follows. Please provide this output to the other party

--- CUT BELOW THIS LINE ---

BEGINSLATEPACK. SXo8zGGSPxw7V9t LXrKDuadE8WNcVM jYBTMf4igZRFFQx VZJFyuqdrySmqBT HdYHHWDJkSWxuCQ 7YMc7LmcStuDdtu ebXcWs3F8YvbSbR YmgAhi3av4akUnb DztUAwGSSV9Dzeg bQSginCQPPLrEa8 ramshia5t6nMVUR 68FqJjkWQqj6g3r t8ChSw9BHneYJCU zmfZjqieLBqni9x gqzhT5XoqyKxWbe r6761j3412cqtTb Ho4ucawnAytu86q 6ADC1iN4tKGWBsT TBfFZJiHLkXtv49 NqnHRtpMcDP6D6G PWgAAKfWgSZLAxM 9DSegEvnvjwSC8B uh5gbX3p8uhgBmo pUNUtSAT91EsNGA pwWT3vhafsZj5Ji er9xkdxASdGLmxW 7btkbqVATnb8CSq q8XUjZRj9WSoJtD NUuxJJ2X2hsueES HZMGckt2JpUuKSy BF6hoSqEQqbX5yG ENKAWZgphQbd4Fr SN5Bzto3ztnAqB7 heUbT7zQSis86TR FAYtxSsVPPdjJKW NmHYFFAu3hFLQDN x5Y5naF9JfpymKD VzuL56eqk8G2dqS 9XpsFuCeys9F13y iZ998kmgaKDacvE xFtYybCAEm8Mgfe ppFvVged84UQkbL F9dMN5vAnwB2gAu 2HNfzz7A7U2dvRn tuEHjupD. ENDSLATEPACK.

--- CUT ABOVE THIS LINE ---

Slatepack data was also output to

/Users/workstation/.grin/main/slatepack/b556dab1-85c6-41e9-9cf4-39721f6c4726.S1.slatepack

The slatepack data is encrypted for the recipient only

Command 'send' completed successfully

length of slatepack message : 744

Step 4 : cancel the transaction

grin-wallet -r "https://grinnode.live:3413"  cancel -i 42
20201223 10:09:14.949 ERROR grin_wallet_impls::node_clients::http - Error calling get_version: ResponseError error: Cannot parse response
20201223 10:09:14.949 ERROR grin_wallet_impls::node_clients::http - Unable to contact Node to get version info: Client Callback Error: Error calling get_version: ResponseError error: Cannot parse response
Password: 
20201223 10:09:20.827 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20201223 10:09:23.162 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201223 10:09:23.171 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201223 10:09:23.173 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete
Command 'cancel' completed successfully

Conclusion

when using the --no_payment_proof flag, the slatepack was shorter (744 vs 993)

marekyggdrasil commented 3 years ago

Excellent!