Commit graph

207 commits

Author SHA1 Message Date
Ignotus Peverell
07a6f23880 Create LICENSE 2017-06-29 09:24:44 -07:00
Yeastplume
97b7421ce0 Mining test debug output, fixes to diff. adjustment and start of POW documentation (#69)
* Beginning to add a POW description, and some minor changes to mining testing, addition of further debug information to mining output.
* Many additions to create first draft of POW documentation
* Fixes to difficult adjustments by adding a MINIMUM_DIFFICULTY consensus value. Otherwise never adjusted above 1 due to flooring.
2017-06-29 16:49:11 +02:00
Yeastplume
5f8a0d9f1c Wallet HTTP posting, fixes and additions to port address configurability. (#66)
* Starting to refactor test, adding http post to wallet sender
* Implemented ability to run servers on different ports (mostly for testing), and implemented ability to post http requests directly to receiving wallets
* Adding detailed instructions on running multiple servers on the same machine
* Changes to build.doc to outline server running process
* Removed unwanted debug statements
* WIP Local server testing framework evolution
* More refactoring of server pool, checked in because there's a problem
* Added server reference structure, and ability to return server references from tests cleanly
* Added simulate_parallel_mining test, which puts some artificial slowdown into test mining loops, and the difficulty can currently be watched in the log
* Removing the ServerRef structure placed in earlier and replaced with a ServerStats structure, that just returns relevant info about the Server state without exposing it to the world
2017-06-27 04:09:01 +02:00
Ignotus Peverell
75f19ecfab
Fix difficulty tests, forgot to rename method 2017-06-20 10:21:31 -07:00
Ignotus Peverell
e8a6b61100
Apply new difficulty algo, remove configurable cuckoo size
Integrate the new difficulty calculation into the block chain
validation, the miner and tests. As the difficulty calculation
doesn't use varying Cuckoo sizes anymore and we narrowed down
reasonable final Cuckoo Cycle parameters, removed all Cuckoo
Cycle sizes from block headers.

Formalized easier Cuckoo Cycle sizes for testing (and possibly
testnet) by introducing a test mode in configuration. Updated
all tests.
2017-06-19 08:59:56 -07:00
Ignotus Peverell
163b1133a7
Implemented new difficulty calculation algorithm.
See #62 for background. Still needs to be integrated with proof
of work and validation.
2017-06-17 20:22:20 -07:00
Ignotus Peverell
55eb2f6887
Fixed vagueness on 2nd curve 2017-06-17 20:22:20 -07:00
Jacob Payne
6a15100c96 [WIP] Rate Limiting (#57)
* Setup tests for rate limiting
* Add send and receive rate configs to P2P Config
* Setup ThrottledConnection and ThrottledWrite
* Add Tokio io
* Fix ThrottledReader + Add Bytes
* Attach Rate Limiting to Connection
2017-06-18 01:15:46 +02:00
Yeastplume
a82f9ce415 Testing Framework [WIP] and new command line options to configure wallet ports and directories (#65)
* Beginning to refactor server tests
* Extended test framework to include running wallet servers and miners. Also some changes to the wallet reciever api to include a wallet config and set the data directly for the wallet file explicitly rather than assuming it's always in the working dir.
* Adding wallet config to main executable
* Adding ability to select wallet server while mining
* Configurable wallet receiver url
2017-06-16 18:47:29 +02:00
Ignotus Peverell
fbbd703e99
Protect wallet data file with a file lock
Operations on the wallet data file are now fenced by a lock to
avoid potentially messy concurrent modifications by multiple
processes (i.e. the wallet receiver and a send command). The lock
is done using a create-only lock file, which is an atomic
operation.
2017-06-14 21:42:58 -07:00
Ignotus Peverell
6523966f9e
Bug fixes in wallet and related API
Fixes a few loose ends in the full cycle of sending coins,
accepting them, pushing that transaction to the pool and having it
mined. More specifically:

* The API output endpoint needs to be a UTXO endpoint, as the
server can't make any guarantee about having a spent output.
* Bubbling up HTTP not found errors.
* Wallet output status checker now handles spent outputs.
* Transaction pool validates the transaction before accepting it.
* Fixed the operation API routes.
* Fixed too greedy wallet coin selection loop.
2017-06-12 16:41:27 -07:00
Ignotus Peverell
eb9cc7ef13
Integrate transaction pool with rest of the system
* Transactions coming from the network are now pushed to the pool
through the net adapter.
* New blocks accepted by the chain are sent to the pool for
eviction.
* The miner requests transactions from the pool to build its
blocks.
* The push API adds to the pool, removing the mock.
* Implementation of the adapter to the chain required by the pool
to get consistent UTXOs. Grossly unoptimized until we have the UTXO
MMR ready.
2017-06-10 12:51:33 -07:00
Ignotus Peverell
172c5e840b
TransactionPool uses non-dummy chain trait
Introduced new non-dummy trait for the blockchain as seen from the
pool that just produces a UTXO. Made to pool parametric on that
trait to get rid of the Box wrapper and still allow the test
implementation.
2017-06-10 11:31:05 -07:00
MoaningMyrtle
384554fc46 Change to pool->blockchain interface to avoid get_best_utxo_set (#60)
* Update DummyChain and DummyChainImpl to get_unspent
* Update pool to use get_unspent
2017-06-10 04:33:33 +02:00
Ignotus Peverell
dd1339a9c3
Sending of transaction to push to mocked up API
Once the wallet transaction is fully built, serializing it and
sending the push request to a node. Implemented the push node
API, mocked up for now (until the tx pool is integrated).
2017-06-08 16:34:27 -07:00
Ignotus Peverell
d26a659a97
Command-line receiving end of wallet
Parse the partial transaction encoded in JSON, adding a new output
and finalizing. Should push the final tx to a grin node for
broadcast once that's fleshed out. Should also add an endpoint for
the http receiver.
2017-06-07 18:12:15 -07:00
Ignotus Peverell
aeb3dfc0dd
Minor cleanup and fixes for wallet send 2017-06-06 13:18:16 -07:00
Ignotus Peverell
3d5411b6ad
Deprecated. 2017-06-06 12:27:39 -07:00
Ignotus Peverell
28b6dab21f
Fix partial revert 2017-05-31 17:21:44 -07:00
Ignotus Peverell
92a2beedef
Missing file in #f79fb8ef 2017-05-31 15:52:43 -07:00
Ignotus Peverell
11c0d67805
Revert "Delegate Block Encoding to Store (#44)"
This reverts commit 8ffc0c6f8e.
2017-05-31 15:49:15 -07:00
Ignotus Peverell
40d23db6c1
Revert "[WIP] Partial Transition from Writeable/Readable to Codecs (#51)"
This reverts commit de4ebdde71.
2017-05-31 15:47:52 -07:00
Ignotus Peverell
996eab72ae
Formatting. 2017-05-31 14:44:44 -07:00
Ignotus Peverell
f79fb8ef95
Sending end of the wallet
Most of the logic to build a transaction that sends coin to
another party. Still requires more debugging and clean up.
Main changes and additions are:

* Update to serde 1.0
* API endpoint to retrieve an Output
* Output is now Serialize and Deserialize
* Wallet configuration
* Command line for the send operation
* Wallet data checker to update created outputs into confirmed
* Wallet-specific configuration
2017-05-28 20:21:29 -07:00
Ignotus Peverell
da41120293
Update secp256k1zlp to serde 1.0 2017-05-28 20:20:56 -07:00
Ignotus Peverell
1ae2e905d8
Printing difficulty while mining 2017-05-25 17:42:29 -07:00
Ignotus Peverell
eb2be99d40
Proper configuration for test mining 2017-05-25 17:42:10 -07:00
Ignotus Peverell
791d2355ee
Miner querying wallet receiver for coinbase output
With the coinbase receiver daemon in place, when starting a Grin
server in mining mode, the miner will now ask the receiver for a
coinbase output. The output is then used to insert in a block when
successfully mined.
2017-05-25 17:22:21 -07:00
Ignotus Peverell
f45cfe97f2
HTTP API client utility functions (get, post, etc.) 2017-05-25 17:21:56 -07:00
Ignotus Peverell
ac553493f1
WIP: Wallet functionality to receive and send coins
Beginning of a first pass at simple wallet functionalities so
Grin can be used to author transactions. We introduce a
receiving server, to be at least able to build coinbase outputs
that can be used by the mining daemon.

Present:

* Coinbase receiving API.
* Command to start the receiving server.
* Beginning of a transaction sending command.
* Improvements to the REST API abstractions to support the above.

Still to do:

* Change to the miner daemon to use the receiving server.
* A command line sender.
* API to receive any transaction (not just coinbase).
* A command line receiver.

Beyond that, HD derivation and seed generation are very simple
so far and almost certainly insecure. Just for testing for now.
2017-05-24 16:09:39 -07:00
Jacob Payne
de4ebdde71 [WIP] Partial Transition from Writeable/Readable to Codecs (#51)
* Sample Signatures for put_enc and get_dec
* Implement put_enc and get_dec
* Implement ChainCodec in grin_chain
* Truncate src only on complete Blocks
* Truncate src only on complete Tip + Check Len
* Move BlockHeader Encoding to BlockHeaderCodec
* Define put_enc for store::Batch
* Replace BlockCodec and BlockHeaderCodec with generic BlockCodec<T>
* Implement Default for BlockCodec Manually
* Replace get_ser/put_ser with get_enc/get_dec for chain::ChainKVStore
* Remove Writeable/Readable for chain::Tip
* Add Tokio-io and Bytes to grin_p2p
* Additional Setup for Message enum + Msg{Encode,Decode} traits
* base msg ping pong encoding and test
* fill out msg-codec tests
* Implement Hand Encoding/Decoding
* msg-encode shake
* msg-encode getpeeraddr
* codec peer-addrs message, SockAddr struct wierdness
* header message codec
* msg encoding finished prelim
* Implement PeerCodec Encoding/Decoding
* Set PeerStore to use PeerCodec for Encoding/Decoding
* Add a DecIterator
* Prune PeerStore
* Replace Decoding and Encoding in handle_payload
* Prune Writeable/Readable methods in store::Store
* Remove Incomplete Frame Testing ( Not Nessesary right now )
* separate block and tx codec tests
* Refactor {Tx,Block}Codec Tests
2017-05-22 19:16:13 +02:00
Ignotus Peverell
a402f39633
Custom REST API operations in addition to CRUD
Allows for custom operations associated with POST requests under
the main resource path. For example, in addition to POST on /user
to create a user, allow easy support for /user/login and
/user/logout.
2017-05-19 14:35:49 -07:00
Ignotus Peverell
d8deba15ee
Deprecated. 2017-05-19 08:52:31 -07:00
MoaningMyrtle
23fd07be60 WIP: Tracking Transaction Pool Implementation (#48)
* Beginning work on pool design doc
* Refining data structures; adding connect capability
* Fleshing out the connectivity paths for the tx pool
* Bringing tx pool and orphan set add logic up into parent TransactionPool
* Use output's commitment as identifier in graph structures
* Breaking a bunch of stuff to start migration to output commitment as id instead of hash
* Wrapping up updates to pool using commitment keys, dummy blockchain. Contains lots of cleanup on the internal flow.
* Beginning work on new block reconciliation
* WIP: Replacing monolithic pool cleanup with mark-and-sweep, which greatly simplifies the logic.
* Laying the groundwork for pool tests; test tx generator
* WIP: More elaborate test helpers; starting work on more elaborate block acceptance test.
* Need DummyUtxoSet to actually apply blocks now
* Using search_for_best_output to validate output status in test_basic_pool_add
* Enable modification of chain while under shared pool ownership. Cleanup pending
* WIP: Begining to untangle the TransactionPool impl from Pool and Orphans data structures
* Finishing refactoring of pool block reconciliaition; getting tests working again
* Add metrics for graph sizes; prereq to pool size throttling
* Remove redundant search_for_available_output from pool graph container
* Minimum viable block builder: return all fully rooted txs
* Tests for block building procedure
* Delegate duplicate output checking to check_duplicate_outputs
* Delegate orphan reference resolution to resolve_orphan_refs
2017-05-19 17:22:08 +02:00
Ignotus Peverell
eb1e49094b
Minor clarifications and additional getting started link 2017-05-03 14:23:12 -07:00
dan-da
6122152003 Add some basic build instructions to help people get started (#50) 2017-05-03 13:56:03 -07:00
Jacob Payne
8ffc0c6f8e Delegate Block Encoding to Store (#44)
Builds codecs to encode and decode blocks, block headers, transactions, kernels, etc. Will be used by the store and peer-to-peer layer for serialization, but also to compute hashes. Separates out serialization from core.
2017-05-03 10:27:38 -07:00
gabriel-syme
2787d4259a Typo in intro doc: two inputs and one output (#45)
* vi1 and vi2 as input values. (2 inputs)
* vo3 as output value. (1 outputs)
2017-04-30 20:00:40 -07:00
Simon Horne
94539c768e Typo in intro doc: when->which (#47) 2017-04-30 19:59:39 -07:00
Laurent Meunier
24b107bdf7 Create the beginning of the wallet library. (#36)
The wallet library will be used to manage the keys of the user. Currenty it only contains a minimal implementation of the extended keys. The format of the extended keys is subject to change
2017-04-29 13:58:26 -07:00
Ignotus Peverell
a3a06951ff
Integrated clap for a better command line
Allows for client, server and wallet subcommands. Processes the
main necessary options for server mode right now.
2017-04-27 22:07:25 -07:00
Ignotus Peverell
1b78a73328
Variety of small p2p fixes to block sync
Adds a couple utility function to p2p server to check whether
we're already connected to a peer before trying again. Other
very minor fixes and logging improvements.
2017-04-27 22:05:12 -07:00
Ignotus Peverell
a7089d1975
Fixes for chain processing during bootstrap
Adds checks to ignore a block that's already known (can happen
if the block was saved but the chain update failed). Also saves
saves the chain slightly differently during bootstrap as the
header chain should only be updated when a header is received
(and not when we got a full block). Finally, do not broadcast
during bootstrap.
2017-04-27 21:59:53 -07:00
Ignotus Peverell
2d793639b5
Move main binary to a grin command line 2017-04-27 20:39:32 -07:00
Ignotus Peverell
f18aeb3024
Start of a binary file for the grin node 2017-04-24 18:55:01 -07:00
Ignotus Peverell
96ea9a7d9f
Minor fixes and URL for web static file seeds 2017-04-24 18:53:42 -07:00
Ignotus Peverell
3fe28b0f03
Server types cleanup and serde for configuration types
Moved error and configuration types from server.rs to types.rs
where they should have been from the start. Configuration types
for the server and p2p modules now derive serde Serialize and
Deserialize so we can have a simple JSON configuration file.
2017-04-24 18:49:57 -07:00
Ignotus Peverell
a37e2b99fb
Trivial formatting fixes 2017-04-24 18:47:36 -07:00
Ignotus Peverell
e4ca924b47
Various comment and dead wood cleanup 2017-04-20 11:31:02 -07:00
Ignotus Peverell
4e36c63cbb
Save outputs under their own keys
Save outputs in every new block under their own hash. Done in the
same batch as the block. Allows for direct output lookups by hash
required by the p2p layer. Also store an index of output
commitment to output hash for wallet and input lookups.
2017-04-20 11:31:02 -07:00