Commit graph

326 commits

Author SHA1 Message Date
Gavin McDermott
34bd35e8fc fix: foreign_api handles pre-flight OPTIONS call on POST requests (#2365) 2019-01-14 11:53:09 -08:00
Yeastplume
5d257283bd
Only create 1 received tx log entry on restore (#2378)
* restore only creates 1 received tx

* restore child index sanity output
2019-01-14 16:49:34 +00:00
Yeastplume
9a497f1439
Wallet Performance enhancements - cache commit + transaction fetching logic (#2375)
* add optional cached commit to output data, to speed up queries

* rustfmt

* clean up transaction retrieval logic

* rustfmt

* small logic error

* rename cache method

* rustfmt
2019-01-14 15:43:10 +00:00
Yeastplume
5fcf93deae
Cancel tx should set output status to Unspent (#2368)
* cancelling transaction should reset output status to Unspent

* rustfmt
2019-01-13 22:24:01 +00:00
Yeastplume
e93b380a06
Recover outputs from multiple wallets using same seed (#2348)
* adding optional mmr index to key ids

* rustfmt

* update index

* add mmr index to output display

* change restore to match on commit instead of ID, add extensive restore/check tests for multiple wallets using same seed

* rustfmt

* ensure check restores unknown accounts as well

* rustfmt

* remove storage of commit from wallet
2019-01-12 18:39:29 +00:00
Ignotus Peverell
60d3ee3c44
Bump version to 0.5.2 for release 2019-01-11 01:26:30 +00:00
hashmap
5cf4d7acfe Use ZeroingString for password and passpharse in wallet (#2285) 2019-01-10 15:58:37 -08:00
Yeastplume
cd9a539288
Add 'recover' option to grin wallet init (#2330)
* Only update outputs with unconfirmed transactions outstanding

* add further check for Unspent output that have been spent to check_repair

* rename  to

* make updating all outputs optional API parameter. do full update before a wallet check, remove unspent->spent check from check process

* rustfmt

* typo

* add recover from phrase option to init

* rustfmt

* don't panic if recover is cancelled, grin-wallet.toml is created but wallet_data dir doesn't yet exits

* rustfmt
2019-01-10 12:06:12 +00:00
Yeastplume
4191b15410
Wallet - only update outputs with unconfirmed transactions outstanding (#2322)
* Only update outputs with unconfirmed transactions outstanding

* add further check for Unspent output that have been spent to check_repair

* rename  to

* make updating all outputs optional API parameter. do full update before a wallet check, remove unspent->spent check from check process

* rustfmt

* typo
2019-01-10 11:17:35 +00:00
Yeastplume
5915580ab3
Automate wallet seed recovery process (#2319) 2019-01-09 16:13:05 +00:00
Antioch Peverell
27801f6a93
Implement kernel and output features as enums (#2312)
* use enums for kernel and output features

* rustfmt

* add test coverage around deserializing kernel features
2019-01-08 16:07:38 +00:00
Ignotus Peverell
2c5ba853f7
Version bump to 0.5.1 2019-01-07 19:41:07 +00:00
Ducem Barr
a3431fb147 feat: Configuration option to include foreign API endpoints in the owner API (#2305)
* Allow foreign API over owner API port

* Tests for owner_api_include_foreign config option
2019-01-07 10:00:52 +00:00
Yeastplume
b927c10b01
Update libsecp version and a few trivial enhancements (#2304)
* update libsecp version and a few trivial enhancements

* update grin_secp version number
2019-01-06 21:18:02 +00:00
Yeastplume
dca9462669
Http adapter Fix (#2295)
* only send http and keybase adapter slates sync

* rustfmt
2019-01-05 21:16:01 +00:00
Gary Yu
939f42ea56
a bit refactoring on wallet controller for issue_send_tx (#2280)
* a bit refactoring on wallet controller for issue_send_tx
2019-01-03 19:01:31 +08:00
Gavin McDermott
3092221997 fix: specify allowed headers on http responses (#2184) 2019-01-03 10:52:00 +01:00
Blade Doyle
c45486f2b9 fix: issue_send_tx problem with keybase method in grin_owner_api
* don't drop the slate after send_tx_sync, and also call finalize here following the same pattern as other sync method
2019-01-03 09:15:34 +08:00
Ignotus Peverell
216924c677
Fix for genesis outputs confirms count (#2271) 2019-01-02 12:11:02 -08:00
Yeastplume
d9ff8e278e Wallet recovery phrase security fixes (#2276)
* prompt for recovery phrase using linefeed crate functionality
* break out recovery parse function, remove phrase from logging
2019-01-02 12:10:07 -08:00
Yeastplume
906adb9e6d
Don't clean unconfirmed outputs > 500 blocks old (#2275)
* only clean unconfirmed coinbase

* only past 50 blocks
2019-01-02 14:27:17 +00:00
Elichai Turkel
f2a29ce37a Optimizing the code and making it more idiomatic (#2269) 2019-01-01 15:29:16 -08:00
Yeastplume
9c98b798ee
Delete Unconfirmed outputs as part of wallet check_repair (#2261)
* Delete unconfirmed outputs as part of check_repair process

* rustfmt
2018-12-30 22:19:11 +00:00
Yeastplume
3eb599a45c
Grin wallet check/repair (#2256)
* first pass at basic check_fix process

* rustfmt

* unlocks and tx log entry reversals in place

* log restore output at warn

* rename check_repair

* rename check_repair

* add command line functionality and sanity test

* rustfmt

* update wallet usage doc with check_repair

* doc update

* consistency in NotEnoughFunds output

* consistency in NotEnoughFunds output
2018-12-30 16:32:00 +00:00
Ignotus Peverell
9234e3c251
Re-launch floonet (#2249)
*  Fix secondary scaling bugs;  rename is_testnet -> is_floonet (#2215)
* add global::is_mainnet()
* use it to change pre-genesis pow type
* rename is_testnet -> is_floonet
* Support multiple chain configurations (#2217)
* Support multiple chain configurations
Supports generating the proper configuration for each chain type
(mainnet, floonet, usernet). Will run them by default under
their respective root directory (~/.grin/main, ~/.grin/floo, etc).
Assigned default ports for mainnet, overriding them to keep Floonet
ports unchanged.
For now, starting on mainnet will abort.
* Fixed usernet command line help message. Fixes #2217
* Differing magic numbers for each chain type (#2208)
* stick to e=H(R|P|m) when use schnorr signature (#2200)
* stick to e=H(R|P|m) when use schnorr signature
* (1)add verify_slate_messages for wallet receive (2)log the message content
* remove debug log on verify_slate_messages
* verify the sender's message signature when receive_tx in wallet listen
* Revert "remove debug log on verify_slate_messages"

This reverts commit 65ea32a407.

* Revert "rustfmt"

This reverts commit c380ab9185.

* Revert "(1)add verify_slate_messages for wallet receive (2)log the message content"

This reverts commit 9584ca7a89.

* [re-floonet] Keychain Floonet BIP32 version/network option (#2235)

* add 'is_floonet' property to keychain
* fix hex encoding and tests

* Fix couple floonet loose ends (#2230)

* Fix couple floonet loose ends. Fixes #2216
* Doc fix for sig message

* Refuse unkown kernel features (#2244)

* Minor: magic number change for re-floonet

* Set pre genesis is_secondary to true (#2247)

* Minor: tx validation error display underlying

* New floonet genesis

* genesis rustfmt

* Use chain-specific config for wallet toml gen

* Fix default wallet_listener_url

* New more reasonable genesis block, bumped version

* genesis rustfmt

* Couple minor fixes to genesis generation script
2018-12-28 14:46:21 -08:00
hashmap
80f7ae678a Implement zeroing memory for wallet password (#2229)
Testing ergonomics, if this approach is acceptable I'll implement it for other sensitive parts.
2018-12-28 14:12:59 -08:00
Gary Yu
602bb25ec9
fix: a silly mistake on the keybase recipients count (#2226) 2018-12-25 12:09:43 +08:00
Gary Yu
12811a2445
Keybase notice on receiving grin transaction (#2211)
* keybase notification on transaction received

* fix: use 'keybase status' to get own username

* refactor the code

* security enhancement for multiple recipients

* change the poll interval from 5s to 1s

* log the error message of keybase api
2018-12-25 08:05:24 +08:00
Gary Yu
45ca7cff79
verify message signature on wallet (#2203)
* add verify_slate_messages for wallet receive

* log the message content

* rustfmt

* verify the sender's message signature when receive_tx in wallet listen

* verify the sender's message signature when send by keybase
2018-12-23 07:25:02 +08:00
Yeastplume
7812a9e892
[Floonet] Encrypt private slate data upon storage in DB (#2189)
* xor encrypt stored nonce and blind sum in transaction data

* rustfmt

* stop doc tests splatting wallet files throughout
2018-12-20 13:10:36 +00:00
Ignotus Peverell
a42250445d
Floonet chain type and genesis, testnets cleanup (#2182) 2018-12-18 14:03:55 -08:00
John Tromp
f43df5f601 [Floonet] add feature for height locked kernels (#2168)
* add feature for height locked kernels

* add function to compute kernel features appropriate for lock height, and use it

* only sign kernel-features relevant fields; refactor Features

* simplify invalid kernel logic

* remove unused height arg to reward::output and run some rustfmt

* replace nested if/else by match
2018-12-18 18:26:34 +00:00
Yeastplume
aa9da6838b
rename tx log entry field tx_hex -> stored_tx (#2181) 2018-12-18 16:44:03 +00:00
Yeastplume
230fe191e0
[Floonet] Use switch commits for all blinding factors (#2178)
* move wallet mods back into dirs

* move wallet mod files

* use switched keys for blinding factor in all cases

* rustfmt

* test fix

* test fix

* test fix

* rustfmt

* re-implement flag to turn off switch commit derivation

* rustfmt
2018-12-18 15:44:55 +00:00
jaspervdm
75d2c1cc56 Switch commitments (#2157) 2018-12-18 11:51:44 +00:00
Yeastplume
fcec70d1e3
Fix for #2169 (#2170)
* return all matching tx entries from retrieve_txs

* rustfmt
2018-12-17 10:40:48 +00:00
Yeastplume
8e678058f1
[WIP] Store completed transactions in files instead of DB (#2148)
Store completed transactions in files instead of DB
2018-12-14 16:24:53 +00:00
Yeastplume
df62fd6d95
Coin selection with small amounts fix (#2144)
* coin selection fix for sending with an amount <= smallest output

* rustfmt
2018-12-13 11:19:46 +00:00
Yeastplume
901c665ba7
Wallet tests, bug fixes (#2138)
* More tests for smallest selection, resulting bug fixes, remove unneeded TXLogEntryTypes

* rustfmt
2018-12-12 13:38:29 +00:00
Antioch Peverell
a0b9aa5967
Sign kernel features (#2104)
* include kernel features in msg being signed
hash the msg before signing it (for consistent 32 bytes)

* rustfmt

* fix various tests

* no HF for this (mainnet only)
2018-12-12 09:19:36 +00:00
Quentin Le Sceller
3bb615a753
Merge pull request #2128 from quentinlesceller/tokio
Temporarily lock tokio on 0.1.11
2018-12-11 12:42:36 -05:00
Yeastplume
fb11dd3f4e
Don't allow same transaction to be received multiple times (#2124)
* don't allow same transaction to be received multiple times

* issues in other tests uncovered and fixed

* allow tx_hex update function to operate without an account being specified, to allow finalize_tx function to work without an account being specified

* rustfmt

* fix to retrieve_txs

* rustfmt
2018-12-11 17:18:31 +00:00
Quentin Le Sceller
a9a3264a51
Temporarily lock tokio on 0.1.11 2018-12-11 09:51:40 -05:00
Antioch Peverell
2d4538c428
Clean shutdown via stop_state (#2117)
* clean shutdown wip

* rustfmt

* introduce StopState that we can lock on

* rustfmt

* take lock on stop_state during critical processing (process_block_single etc.)

* rustfmt

* take lock on stop_state during chain::init()

* cleanup

* cleanup

* rustfmt

* docs/comments

* fixup servers tests

* cleanup p2p tests
2018-12-11 11:07:41 +00:00
Yeastplume
b7fe4d6621
Wallet command line tests (#2114)
* tests in place for wallet command line

* tests in place for wallet command line
2018-12-10 14:54:56 +00:00
hashmap
aedac483f5
Convert to Rust 2018 edition (#2084)
* Convert to Rust 2018 edition

* Update gitignore
2018-12-08 00:59:40 +01:00
Yeastplume
68896b2a76
Wallet test framework (#2098)
* remove circular dependency

* rustfmt

* move wallet test framework
2018-12-07 17:18:33 +00:00
Yeastplume
d1b484259b
Wallet command line automated testing (#2097)
* wallet test infrastructure

* rustfmt

* successful wallet create

* rustfmt

* start of command line tests

* rustfmt
2018-12-07 15:06:28 +00:00
Ignotus Peverell
87bfd9aaa4
Mark all crates as publishable 2018-12-07 00:08:15 +00:00
Yeastplume
7ff323c882
Fix keybase wallet listener call (#2091)
* fix keybase adapter call

* rustfmt
2018-12-06 17:51:53 +00:00