Commit graph

2539 commits

Author SHA1 Message Date
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
Ignotus Peverell
42ff6c2f6b
Clean up last 2 refs to syncing from adapter 2017-10-17 14:06:18 +00:00
Ignotus Peverell
affec50588
Warn when no seed configured 2017-10-17 14:00:54 +00:00
Ignotus Peverell
37cc919f6e
Doc for new OneTime.is_initialized 2017-10-17 13:56:47 +00:00
Ignotus Peverell
4fa7f34b7e
Use local ref to syncing 2017-10-17 13:55:12 +00:00
Ignotus Peverell
28ac46c563
Do not sync when configured with no seeding 2017-10-17 13:51:02 +00:00
Ignotus Peverell
7dbd1ef962
Did not mean to commit that at all 2017-10-17 12:41:57 +00:00
Ignotus Peverell
efdbcd600a
Miner process wait until sync. Fix #185 2017-10-17 12:18:21 +00:00
Ignotus Peverell
60efa62896
Dead downloads need to be retried, not discarded 2017-10-17 09:38:55 +00:00
Ignotus Peverell
ef08140ad7
Merge branch 'master' of github.com:ignopeverell/grin 2017-10-17 08:47:48 +00:00
Yeastplume
2bc7624ca8 Update cuckoo miner tag (#183)
Fixes #143 and mimblewimble/cuckoo-miner#12
2017-10-17 16:53:39 +00:00
Ignotus Peverell
837ef0fd03
Added detail about kernel sticking around 2017-10-17 03:20:31 +00:00
Yeastplume
8f76746e84 Switch commitments (#179)
* Adding switch commit to grin outputs
* logging output fix
* adding switch commitment hash to sum tree node
* added hash_with to Hashed trait, to allow for hashing to include another writeable element
* adding hash_with as method in hashed trait
2017-10-16 21:23:10 +00:00
AntiochP
c84a136e48 refactor burn key into key_overrides on keychain (#178)
* refactor burn key into key_overrides on keychain
* introduce UnconfirmedChange output status, we can potentially spend these with zero confirmations
* pass in burn_key_id for the burn enabled keychain, spend *all* coins when spending from a wallet, spend UnconfirmedChange coins also
* add comment about simplifying wallet_data.select logic
* replace UnconfirmedChange output status with a more flexible zero_ok, flag on the output data
2017-10-16 17:11:01 +00:00
Ignotus Peverell
472912c68c
Added clarification about block struct 2017-10-15 20:44:34 +00:00
Ignotus Peverell
aa520d34d5
Move new block notif out of sumtree lock. Fix #180 2017-10-15 20:44:34 +00:00
Ignotus Peverell
dd90031902
Doc tweaks after feedback 2017-10-15 20:44:34 +00:00
AntiochP
9a230ca7f6 fail deserialization if inputs or outputs are not sorted for txs (#173)
* fail deserialization if input or outputs are not sorted for txs, fail deserialization if inputs or outputs or kernels are not sorted for blocks, make sure we sort them before serialization
* extract consensus rule into verify_sort_order on VerifySortOrder trait
* rework the sort and write into WriteableSorted trait
* fix wallet sending bug (fees related) so we can test
* refactored read_and_verify_ordered out into ser, used in transaction and block
2017-10-13 17:23:18 +00:00
Yeastplume
49797853d9 tweaks to logging configuration (#176)
* tweaks to logging configuration
* doc port update
2017-10-13 16:42:04 +00:00
Ignotus Peverell
dda10a6dee
Wrong extensions 2017-10-13 05:12:39 +00:00
Ignotus Peverell
77ce116eda
Small guide and FAQ for people coming from a bitcoin background 2017-10-13 05:11:42 +00:00
AntiochP
86420d4bca Shorter identifiers and call them key_id (not pubkey) (#175)
* rename pubkey -> key_id, these are key identifiers, not public keys
* reduce identifier seize to 10 bytes, get rid of fingerprints (identifiers are now small enough to use as-is)
* IDENTIFIER_SIZE const
* add FeeDispute error for when sender and recipient disagre on fee calculation (should never happen)
* does not need to be mut
* cleaned up some warnings
2017-10-13 04:45:07 +00:00
Ignotus Peverell
957e402eae
Always clean up block download list, report error 2017-10-12 19:36:57 +00:00
Ignotus Peverell
361e39c87c
Log connection errors 2017-10-12 19:26:10 +00:00
Ignotus Peverell
2222b28981
Dump sumtrees state on error 2017-10-12 19:23:58 +00:00
Yeastplume
8e382a7593 slog-rs logging (#171)
* added global slog instance, changed all logging macro formats to include logger instance
* adding configuration to logging, allowing for multiple log outputs
* updates to test, changes to build docs
* rustfmt
* moving logging functions into util crate
2017-10-12 16:56:44 +00:00
Ignotus Peverell
b85006ebe5 Wallet operation to burn some coins (#172)
* Burn transaction for testing
* Burn bug fixes, embed burn key in keychain
* Better error logging in API, wallet fee calc fix
2017-10-12 03:35:40 +00:00
AntiochP
bf7c1fb44f add lock_height to Transaction and TxKernel (#167)
* add lock_height to Transaction and TxKernel, sign msg including both fee and lock_height in kernel
* make the order of the fields in tx and kernel more consistent
* rename to kernel_sig_msg
* add test to cover adding timelocked tx to pool, where tx is invalid based on current height of the blockchain
* add tests for adding timelocked txs to blocks (valid and otherwise)
2017-10-11 18:12:01 +00:00
AntiochP
dc0dbc62be Set approximate wallet fee to avoid LowFeeTransaction (#163)
Set approximate wallet fee when building a transaction so we avoid getting a LowFeeTransaction error from the pool

* rustfmt
2017-10-10 17:30:34 +00:00
Yeastplume
d0160811dd Not exploding when grin.toml file isn't found (#164) 2017-10-10 17:28:33 +00:00
Ignotus Peverell
9310151680
Block versions and hard fork schedule 2017-10-10 00:09:06 +00:00
AntiochP
62954f1549 Generate wallet key identifier from public key (#162) 2017-10-09 17:19:26 +00:00
Ignotus Peverell
0d26daadc5
Default values for pool config
Allows for deserializing config file without having to specify
all properties in it.
2017-10-08 17:45:31 +00:00
Ignotus Peverell
1e73e3aefc
Add a min fee to accept transactions in the pool
Configuration for a minum accept fee base for the transaction
pool. The base is multipled by a weight computed from the
transaction number of inputs, outputs and kernels. The transaction
fee is required to always be larger than the weight times the
base.

    min_fee = base * (-1*input_len + 4*output_len + kernel_len)

The weight is set to never be less than one.

Also added a configurable (and fairly naive for now) max pool
capacity in number of transactions.
2017-10-07 18:31:01 +00:00
AntiochP
3dd1dde00b Pass pubkey for coinbase (#159)
* store wallet output data in hashmap
* cleanup up commented out code
* pass pubkey/identifier and not derivation around to miner etc.
* fix failing tests
2017-10-07 17:38:41 +00:00
Ignotus Peverell
c7f1ce965e
Block size limit as a max weight 2017-10-06 03:35:06 +00:00
AntiochP
4e41365fe8 Fix duplicate wallet coinbase (#158)
* store wallet output data in hashmap
* cleanup up commented out and debug code
2017-10-06 20:10:30 +00:00
Yeastplume
da21388131 wee warning cleanup + build doc updates (#156)
* warning cleanup
* test compilation
* clarification on architecture in build doc, path export statement fix
2017-10-06 16:46:18 +00:00
Ignotus Peverell
3c137c0d1c
Fix odd fee in coinbase maturity test 2017-10-05 09:56:39 +00:00
Ignotus Peverell
ca7de0f42d
Painstakingly debugged pool test to avoid odd fees 2017-10-05 09:52:01 +00:00
Ignotus Peverell
7012d37f5f
Half of fees get rewarded, half burnt. Minor cleanups
Update coinbase building and block summation to account for half of
the fees going to the coinbase. Forcing fees to be even as a
consequence. Now that we can't build the coinbase independently
from the block (because fees), had to update the miner to keep the
key derivation so a new derivation isn't made any time a new block
gets worked on.

Minor doc and warning cleanups.
2017-10-05 07:30:10 +00:00
AntiochP
e060b1953e rust-secp256k1-zkp breaking changes to support (#155)
Rewinding range proofs to recover transaction value from outputs
2017-10-05 21:40:46 +00:00
Ignotus Peverell
ea632076bd
Merge branch 'master' of github.com:ignopeverell/grin 2017-10-04 02:58:41 +00:00
Yeastplume
e68a6a69bb Cuckoo miner fixes and configurable coinbase maturity (#154)
* cuckoo miner update+coinbase maturity
* set mining parameter mode on immature coinbase test
2017-10-04 17:44:22 +00:00
Ignotus Peverell
275e986490
Fixing chain error type 2017-10-04 02:57:56 +00:00
Ignotus Peverell
4e49b85b82
Cleanup for block validation errors 2017-10-03 22:27:26 +00:00