Commit graph

384 commits

Author SHA1 Message Date
Yeastplume
48a60858ba Wallet output selection performance (#238)
* allow selecting a commit while providing a key index
* added static reference to libsecp that can be called throughout
* don't serialise rangeproof to json if it's not desired
2017-11-07 11:48:37 -05:00
Ignotus Peverell
8f0373b81e
Fix #235 sumtree size double-counting rm log 2017-11-04 13:34:33 -04:00
Ignotus Peverell
8f78b74d67
Preventing save of loopback IPs, fix #236 2017-11-03 19:08:04 -04:00
Ignotus Peverell
15705b3fa1
Detect unspecified IP and use TCP conn IP instead 2017-11-03 16:47:35 -04:00
AntiochP
ad07866275 iterate once over txs in a block (#233)
Split out verify_sig and build_kernel to make kernel explicit.
2017-11-03 14:17:09 -04:00
clwmckenna
81bd764fd0 Update build.md (#231)
Add info about config files
2017-11-03 12:45:05 -04:00
bgmrk
4dfa7c1770 Update grin4bitcoiners.md with basic supply information (#227) 2017-11-02 19:38:37 -04:00
AntiochP
17bf3c2702 default wallet receive to listen on 127.0.0.1 (#229)
* default wallet receive to listen on 127.0.0.1, optional flag on wallet command to listen on 0.0.0.0
* fix simulnet for new wallet port/interface config
2017-11-02 16:19:22 -04:00
AntiochP
8a42a692ce add new /v1/peers endpoints to the api (#225)
* add new /v1/peers endpoint to the api
* /peers/connected and /peers/all endpoints
2017-11-02 12:49:33 -04:00
Ignotus Peverell
8ded5e23cf
Slight increase of retry on block download before give up 2017-11-01 22:52:10 -04:00
Ignotus Peverell
dbaba8aed5
Order block elements when block is built 2017-11-01 22:18:51 -04:00
Ignotus Peverell
5b462ee2fc
Allowing for dumping of larger sum trees on error 2017-11-01 19:32:49 -04:00
Ignotus Peverell
47255f1250
Fix server run mode when passing a seed
It looks like clap has become more greedy in passing repeating
options. So passing -s for seeds eats up the command right after.
Only allowing a single seed for now (and we could improve that
with a colon separator later).
2017-11-01 19:00:28 -04:00
Ignotus Peverell
362fbcf90f
Proper p2p remote address detection when accepting conn
A receiving peer trusts the address advertised by a client.
However as we do not have external address detection (and there is
generally no very good way to do that), the address detected by
a peer is the loopback, which is useless. So we attempt to detect
these cases and use the IP detected by the TCP connection while
keeping the advertised port.
2017-11-01 18:56:59 -04:00
Ignotus Peverell
de1cdddfb9
Don't burn reward by default 2017-11-01 16:33:32 -04:00
AntiochP
9e36b820f6
fix the wallet receiver api (#222) 2017-11-01 14:32:34 -04:00
Ignotus Peverell
7a803a8dc1
Missing macro use in keychain 2017-10-31 20:22:27 -04:00
Ignotus Peverell
f7ddd6b3d3
Fix couple minor import errors after rebase 2017-10-31 20:00:39 -04:00
Ignotus Peverell
e4ebb7c7cb
Cleanup HTTP APIs, update ports to avoid gap, rustfmt
Moved the HTTP APIs away from the REST endpoint abstraction and
to simpler Hyper handlers. Re-established all routes as v1.
Changed wallet receiver port to 13415 to avoid a gap in port
numbers.

Finally, rustfmt seems to have ignored specific files arguments,
running on everything.
2017-10-31 19:42:56 -04:00
Yeastplume
05d22cb632
changing secp import to tag, and consolidating Cargo.toml import (#220) 2017-10-31 23:20:55 +00:00
Jeremy Bokobza
508349e799 intro.md review (#202) 2017-10-31 18:50:36 -04:00
Yeastplume
914810713d Add test for switch commit consistency (#219) 2017-10-31 17:20:11 -04:00
Ignotus Peverell
283b846243
Small fix to chain tip check for send 2017-10-30 21:35:43 -04:00
Yeastplume
e45593b1db Sumtree mmap fix (#217)
* fix mmap error with version 0.6.0, and change reference to include tag
2017-10-30 12:43:49 -04:00
Yeastplume
7f8d307cc8 Sum tree and improved chain API Endpoints (#214)
* adding more useful handlers
* added method to return last n leaf nodes inserted into the sum tree
* endpoints in place for getting last n sumtree nodes
2017-10-27 21:57:04 +00:00
AntiochP
8b324f7429 add retry logic to miner when hitting wallet coinbase API (#213)
* mount v2 router for flexibility, wallet checker now refreshes multiple outputs via single api call
* fix the api router
* wallet api handlers, miner uses wallet_client
* retry logic via tokio_retry, miner creates new coinbase output via wallet API (retries several times)
* move wallet client into wallet crateand rework the lock acquisition logic to use tokio_retry
2017-10-27 17:36:03 +00:00
Ignotus Peverell
efe414bf07 No send back for blocks and transactions (#212)
* Do not send txs and blocks to senders. Keeps a ring buffer of transaction and blocks hashes that a peer has received. Do not send what we've already received.
* Test fix and fmt
2017-10-26 17:48:51 +00:00
AntiochP
68bcd79da5 height 0 means we have 0 confirmations (cut-through output?) (#211) 2017-10-26 17:41:08 +00:00
AntiochP
d7b94a12f5 only hold wallet write lock for write operations on the wallet (#210)
* mount v2 router for flexibility, wallet checker now refreshes multiple outputs via single api call
* add read_wallet so we can read without acquiring the lock
* fix the api router
* read wallet without acquiring or holding lock, only acquire the write lock for wallet when updating or adding outputs
2017-10-25 21:09:34 +00:00
Ignotus Peverell
e2e24bc38e Transaction broadcast (#209)
* Add transaction broadcast to all known peers once they have been
accepted by our own transaction pool.
* Some debug log

Fixes #200
2017-10-25 21:06:24 +00:00
AntiochP
7178b400b8 refresh multiple wallet outputs in single api call (#205)
* mount v2 router for flexibility - wallet checker now refreshes multiple outputs via single api call
* fix the api router
2017-10-25 17:57:48 +00:00
Ignotus Peverell
17837b9199
Get the sumtree roots outside of an extension 2017-10-24 18:12:32 +00:00
AntiochP
68cfbbecad "grin wallet init" to create the initial wallet.seed file (#198)
* "wallet init" to create the initial wallet.seed file
* cleanup and better error msgs
* add some basic wallet docs
* cleanup and make passphrase optional
2017-10-24 17:34:34 +00:00
Ignotus Peverell
1582ec4e73
Fixing repository links after move 2017-10-23 17:20:32 +00:00
Yeastplume
9c0411ac5e Bind to services to all interfaces rather than loopback (#197)
* changing default ip
2017-10-23 16:34:43 +00:00
bgmrk
7f0d638107 Contract Ideas (#194)
* Contract Ideas - Began to catalogue mentions of different contract ideas from the email list.
* Add files via upload
2017-10-23 16:32:15 +00:00
Ignotus Peverell
f679a9e458
Consensus change: set reward and base grin unit 2017-10-22 10:56:55 +00:00
Ignotus Peverell
2d105deea7
rustfmt 2017-10-22 10:40:24 +00:00
Ignotus Peverell
fd08c34474
Missing mut for test config 2017-10-22 09:44:27 +00:00
Ignotus Peverell
3237df70f6
Spurious mut, different lint level on CI 2017-10-22 09:14:18 +00:00
Ignotus Peverell
fc6349f26c
Ditto 2017-10-22 08:44:30 +00:00
Ignotus Peverell
556dd012af
Last min changes always warrant a recompile... 2017-10-22 08:09:02 +00:00
Ignotus Peverell
f1488f9529
Lots of chain sync and block validation fixes
* Fix for the chain pipeline partly relying on an outdated head,
leading to not properly recognizing a fork and inconsistent sum
tree state.
* Do not drop block requests during sync that don't get satisfied,
retry enough time to get them and avoid stall.
* Always validate header, even in sync where we may have validated
it already. We don't want a block coming from a peer that could
squeeze through with an invalid header.
* When syncing, do not mark blocks that were errored by the chain
as received (typical case: orphan). Keep retrying.
* Improved chain state dump for debugging.
* Do not add to orphans blocks too far in the future.
* Better error reporting on db errors.
* Related sync test fixes.

TODO figure out why syncing peers timeout so often, very useful
to test but not that great for a fast sync experience.
2017-10-22 07:11:45 +00:00
Ignotus Peverell
f12559f53b
Logger init for tests 2017-10-22 07:09:40 +00:00
Ignotus Peverell
6c18451a2b
Fix typo (yes I use vi) 2017-10-18 10:26:37 +00:00
AntiochP
fa1f2f695b we now mine both txs so update test to reflect this (#189) 2017-10-18 23:23:37 +00:00
AntiochP
4d7b46b0b9 wallet can now optionally spend zero-confirmation txs (#188)
* wallet can now optionally spend zero-confirmation txs
* add rule to get_mineable_transactions based on total pool size
2017-10-18 20:47:37 +00:00
AntiochP
bab7bd7060 update_roots on pool to keep it consistent after reconciliation (#182)
* failing test case that exercises
prepare_mineable_transactions and reconcile_block
and highlights what appears to be unexpected behavior
* adjust the failing test - the failure state is where we have
a tx in the pool *but* it is not in the list of roots in the pool
* zero confirmation txs are now working
introduce update_roots to graph to ensure pool is consistent
after calling remove_pool_transaction
* move update_roots to sweep_transactions so we only call it once
rework update_roots to be more efficient
* use HashSet in reconcile_block to avoid marking txs multiple times
* use HashSet and not HashMap
return from mark_transaction early if already seen tx
2017-10-18 20:42:51 +00:00
Ignotus Peverell
6fc48dbae2
More small fixes and improvements to sync 2017-10-18 07:19:44 +00:00
Ignotus Peverell
406642a1f0
Fix for missing header head during sync
Addresses a corner case of sync. If we're still in sync mode but
just caught up to the head, a block could be added through normal
gossip. So we can't short-circuit some of the header handling
even though during sync the header should have already been
validated and saved, because we can still get a block from gossip.
2017-10-18 04:48:21 +00:00