Commit Graph

720 Commits

Author SHA1 Message Date
Lee Clagett 5d7ae2d279 Adding support for hidden (anonymity) txpool 2019-11-02 20:36:03 +00:00
JamesWrigley b9fc206660 Add a --keep-fakechain option to keep fakechain databases
This is handy when doing tests that generate a lot of transactions, since that
takes time it's preferable to re-use the database for future runs.
2019-11-01 23:56:08 +01:00
Jason Rhinelander a9294cdbef Remove boost::value_initialized and BOOST_FOREACH (#921)
Neither of these have a place in modern C++11; boost::value_initialized
is entirely superseded by `Type var{};` which does value initialization
(or default construction if a default constructor is defined).  More
problematically, each `boost::value_initialized<T>` requires
instantiation of another wrapping templated type which is a pointless
price to pay the compiler in C++11 or newer.

Also removed is the AUTO_VAL_INIT macro (which is just a simple macro
around constructing a boost::value_initialized<T>).

BOOST_FOREACH is a similarly massive pile of code to implement
C++11-style for-each loops. (And bizarrely it *doesn't* appear to fall
back to C++ for-each loops even when under a C++11 compiler!)

This removes both entirely from the codebase.
2019-11-01 09:26:58 +11:00
moneromooo-monero d31024c2e1
cryptonote: untangle dependency from miner to blockchain
It causes link errors at least on mac
2019-10-31 01:25:07 +00:00
moneromooo-monero ebc6ce44f4
cryptonote: untangle dependency from miner to blockchain
It causes link errors at least on mac
2019-10-31 01:06:42 +00:00
Jason Rhinelander 1e496975b3 Add fee burning
This adds a tx extra field that specifies an amount of the tx fee that
must be burned; the miner can claim only (txnFee - burnFee) when
including the block.

This will be used for the extra, burned part of blink fees and LNS fees
and any other transaction that requires fee burning in the future.
2019-10-30 18:47:22 -03:00
Doyle e949e15c6e
Remove hard-forking code on the boundary of 12 and 13 (#919) 2019-10-30 14:50:34 +11:00
moneromooo-monero 65301c406e
core: point out when we hit the block rate visibility limit 2019-10-28 16:06:15 +00:00
moneromooo-monero a4dc575ccb
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache,
which will allow debugging a stuck monerod after it has failed to
verify a transaction in a block, since it would otherwise not try
again, making subsequent log changes pointless)
2019-10-25 18:41:54 +00:00
Doyle ba9a4d84ed Remove check_tx_syntax unused since 2015 2019-10-23 15:22:01 +11:00
Doyle 5ac419ac1a Disable pruning in Loki, it is not supported yet 2019-10-23 13:44:56 +11:00
luigi1111 4233d88341
Merge pull request #5973
abd3763 cryptonote: fill in tx weight when syncing from pruned blocks (moneromooo-monero)
2019-10-22 10:54:46 -05:00
moneromooo-monero fe443bbdec
cryptonote: don't leave block_weight uninitialized
CID 204467
2019-10-11 14:09:31 +00:00
moneromooo-monero abd376313b
cryptonote: fill in tx weight when syncing from pruned blocks 2019-10-10 11:08:02 +00:00
luigi1111 bf525793c7
Merge pull request #5915
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
2019-10-08 15:55:03 -05:00
Doyle 4db1f0ddd0
Merge pull request #872 from jagerman/qnet-backport
Backports from quorumnet branch for 5.x
2019-10-08 17:13:34 +11:00
Jason Rhinelander 13f7b7f11e Wait for storage server (#874)
* Fix elapsed time in storage server warning message

This was passing the time value rather than the number of seconds so
basically always printed "a long time" instead of the elapsed time.

* Removed pre-HF12 code

* Wait for storage server before sending proof

On startup we send a proof immediately, but this is misleading to the
operator - they may see a proof broadcast over the network suggesting
everything is good even when the storage server is still down.  This
makes lokid wait for a first ping before the first proof so that the
user doesn't get mislead.

It also adds the storage server last ping into the `lokid status`
message, such as:

    Height: 375634/375634 (100.0%) on mainnet, not mining, net hash 63.00 MH/s, v12, up to date, 1(out)+0(in) connections, uptime 0d 0h 0m 4s
    SN: f4558f60b1c4075e469a15411f12d5a747c1c62b44bcbc8523f1a90becc80475 not registered, s.server: NO PING RECEIVED

or:

    Height: 375663/375663 (100.0%) on mainnet, not mining, net hash 76.17 MH/s, v12, up to date, 1(out)+0(in) connections, uptime 0d 0h 0m 32s
    SN: f4558f60b1c4075e469a15411f12d5a747c1c62b44bcbc8523f1a90becc80475 not registered, s.server: last ping 11 seconds ago
2019-10-08 15:40:11 +11:00
Jason Rhinelander c00e8221cc Add SN ed25519/x25519 pubkeys + quorumnet port in proofs
This generates a ed25519 keypair (and from it derives a x25519 keypair)
and broadcasts the ed25519 pubkey in HF13 uptime proofs.

This auxiliary key will be used both inside lokid (starting in HF14) in
places like the upcoming quorumnet code where we need a standard
pub/priv keypair that is usable in external tools (e.g. sodium) without
having to reimplement the incompatible (though still 25519-based) Monero
pubkey format.

This pulls it back into HF13 from the quorumnet code because the
generation code is ready now, and because there may be opportunities to
use this outside of lokid (e.g. in the storage server and in lokinet)
before HF14.  Broadcasting it earlier also allows us to be ready to go
as soon as HF14 hits rather than having to wait for every node to have
sent a post-HF14 block uptime proof.

For a similar reason this adds a placeholder for the quorumnet port in
the uptime proof: currently the value is just set to 0 and ignored, but
allowing it to be passed will allow upgraded loki 6.x nodes to start
sending it to each other without having to wait for the fork height so
that they can start using it immediately when HF14 begins.
2019-10-07 22:09:17 -03:00
Jason Rhinelander 2c52c1c020 Add unified key container
This puts the SN pubkey/privkey into a single struct (which have
ed25519/x25519 keys added to it in the future), which simplifies various
places to just pass the struct rather than storing and passing the
pubkey and privkey separately.
2019-10-07 22:09:17 -03:00
Jason Rhinelander c2f2c8306e Remove useless method.
Five years into the future this pointless method is still not used.
Time to go.
2019-10-07 22:09:17 -03:00
Jason Rhinelander dd6de52378 Add --dev-allow-local-ip flag for allowing local network public-ip
This is very useful for testing.  Also adds a suitable scary warning at
startup when used.
2019-10-07 22:09:17 -03:00
moneromooo-monero 8330e772f1
monerod can now sync from pruned blocks
If the peer (whether pruned or not itself) supports sending pruned blocks
to syncing nodes, the pruned version will be sent along with the hash
of the pruned data and the block weight. The original tx hashes can be
reconstructed from the pruned txes and theur prunable data hash. Those
hashes and the block weights are hashes and checked against the set of
precompiled hashes, ensuring the data we received is the original data.
It is currently not possible to use this system when not using the set
of precompiled hashes, since block weights can not otherwise be checked
for validity.

This is off by default for now, and is enabled by --sync-pruned-blocks
2019-09-27 00:10:37 +00:00
Howard Chu 81c2ad6d5b
RandomX integration
Support RandomX PoW algorithm
2019-09-25 21:29:42 +01:00
Howard Chu 3b8dd4b25b Updated RandomX integration from upstream
Support RandomX PoW algorithm
2019-09-25 17:12:23 -03:00
luigi1111 06bee964a8
Merge pull request #5878
f9b3f6e Removed Berkeley DB and db switching logic (JesusRami)
2019-09-24 10:10:28 -05:00
luigi1111 ee6e849627
Merge pull request #5877
2cd4fd8 Changed the use of boost:value_initialized for C++ list initializer (JesusRami)
4ad191f Removed unused boost/value_init header (whyamiroot)
928f4be Make null hash constants constexpr (whyamiroot)
2019-09-24 10:08:44 -05:00
luigi1111 8c41d36a08
Merge pull request #5864
32f725d Properly format multiline logs (moneromooo-monero)
2019-09-24 10:05:21 -05:00
Doyle 705885af1b
Add testnet checkpoint & enable checkpoints from json (#851) 2019-09-20 17:06:12 +10:00
moneromooo-monero d0663837d2
core: move hardforks into its own lib
So it can be used by others without encumbrance
2019-09-19 11:28:18 +00:00
Doyle a94c1587d1 Remove sychronization check on receipt of uptime
If a peer views the destination peer as not synchronizing, then the
destination peer should just accept the uptime proof, rather than accept
it and then conditionally relay it depending on whether or not you are
synchronizing at the point of attempting to relay (which you could
transition into synchronizing state interim between accepting and
attempting to relay the proof).
2019-09-19 16:58:09 +10:00
Doyle 409cf4faee Relay proofs back to source, but don't relay your proof again
Otherwise we get into a ping-pong situation as follows
Node1 sends uptime ->
Node2 receives uptime and relays it back to Node1 for acknowledgement ->
Node1 receives it, handle_uptime_proof returns true to acknowledge ->
Node1 tries to resend to the same peers again

Instead, if we receive our own uptime proof, then acknowledge but don't
send on. If the we are missing an uptime proof it will have been
submitted automatically by the daemon itself instead of using my own
proof relayed by other nodes.
2019-09-18 15:37:32 +10:00
Doyle aedf023dc9 Add message on receipt of your own uptime proof from network 2019-09-18 15:21:59 +10:00
moneromooo-monero 32f725d32f
Properly format multiline logs
As a side effect, colouring on Windows should now work
regardless of version
2019-09-16 16:58:01 +00:00
Jesus Ramirez f9b3f6ef3b Removed Berkeley DB and db switching logic 2019-09-16 16:18:05 +02:00
Doyle ce85eccf72
Rescan difficulty periodically, fix incorrect timestamps/difficulties in rescan (#835)
* Rescan difficulty periodically, fix incorrect timestamps/difficulties in rescan

* Code review
2019-09-13 15:46:15 +10:00
Doyle 50228e2a0e Merge branch 'dev' into AlternativeQuorums 2019-09-10 12:31:03 +10:00
Doyle 39987729ab
Update soft-forking checks to be effective HF13 (#825)
Code review

m_oldest_allowable_alternative_block -> m_immutable_height
2019-09-10 10:04:44 +10:00
Doyle 4724a7436f Incorporate checkpoint validation into syncing step
Fix checkpoint verification check and add messages
2019-09-06 14:41:55 +10:00
Doyle 15ff209db0 Add alt block added hook
Move service node list methods to state_t methods

Add querying state from alt blocks and put key image parsing into function

Incorporate hash into state_t to find alt states

Add a way to query alternate testing quorums

Rebase cleanup
2019-09-06 14:41:55 +10:00
Jesus Ramirez 2cd4fd8972 Changed the use of boost:value_initialized for C++ list initializer 2019-09-02 14:16:29 +02:00
Maxim Shishmarev b91e690a62 Add storage server reachability field; test it with quorums (#820)
* Add storage server reachability field; test it with quorums

* Improve method names

* Address review comments
2019-09-02 13:06:15 +10:00
moneromooo-monero 2cb22d4071
core: make the "update probably needed soon" message less scary 2019-08-26 07:56:55 +00:00
Jason Rhinelander d5f234477e Removed unused/always-obsolete macros
This removes a bunch of macros from cryptonote_config.h that either
aren't used at all, or have never applied to Loki, along with
removing/simplifying some of the dead code touching these macros.

A few of these are still used only in the test suite, so I moved them
there instead.

One of these sounds sort of scary -- ALLOW_DEBUG_COMMANDS -- but this
has *always* been forcibly enabled with no way to disable it going back
to the very first monero git commit.

DYNAMIC_FEE_PER_KB_BASE_FEE_V5 was defined in a very strange way that
doesn't make a lot of sense (including using a constant that is not
otherwise applied in loki), so I just replaced it with the expanded
value.
2019-08-22 21:42:10 -03:00
luigi1111 1167370239
Merge pull request #5637
69f9420 core: do not complain about low block rate if disconnected (moneromooo-monero)
2019-08-15 17:09:15 -05:00
Doyle a6cbad1701 Enforce ordering of votes in HF13 2019-08-15 11:42:46 +10:00
Doyle f7e6c98e48
Merge pull request #788 from jagerman/opt-simp
Service node data optimizations and code cleanups/simplifications
2019-08-13 13:16:38 +10:00
Doyle 00284cfdcd
Don't relay service node votes or uptime proof if synchronising (#779)
* Don't relay service node votes or uptime proof if synchronising

* Only relay votes if state is > state_synchronizing

Not before. Handshake = no, synchronizing = no.

* Relay votes/uptime to all nodes including those on I2P/TOR.
2019-08-13 12:23:08 +10:00
Jason Rhinelander 59a2175f47 Use shared_ptr storage for service_node_info
This converts the stored service_node_info value into a
`shared_ptr<const service_node_info>` rather than a plain
`service_node_info`.  This yields a huge performance benefit by
significantly eliminating the vast majority of service_node_info
construction, destruction, and copying.

Most of the time when we copy a service_node_info nothing in it has
changed, which means we're storing exactly the same thing; this means an
extra construction for every SN info on every block *and* an extra
destruction when we cull old stored history.  By using a
shared_ptr, the vast majority of those constructions and destructions
are eliminated.

The immediately previous commit (upon which this one builds) already
reduced a full rescan from 180s to 171s; this commit further reduces
that time to 104s, or about 42% reduced from the rescan time required
before this pair of commits.  (All timings are from the dev.lokinet.org
box, tested over multiple runs with the entire lmdb cached in memory).

With the shared_ptr approach, we only make a copy when a change is
actually needed: because of infrequent (at the per-SN level) events like
a state_change, received reward, contribution, etc.  The contained
reference is deliberately `const` so that values are not changeable;
there's a new function that does an explicit copying duplication,
returning the new non-const and storing the const ref in the shared
pointer.

Related to this is a small change (and fix) to how proof info and
public_ip/storage_port are stored: rather than store the values in the
service_node_info struct itself, they now gets stored in a shared_ptr
inside the service_node_info that intentionally gets shared among all
copies of the service_node_info (that is, a SN info copy deliberately
copies the pointer rather than the values).  This also moves the ip/port
values into the proof struct, since that seemed much easier than
maintaining a separate shared_ptr for each value.

Previously, because these were stored as values in the service_node_info
they would actually get rolled back in the event of a reorg, but that
seems highly undesirable: you would end up rolling back to the old
values of the uptime proof and ip address (for example), but that should
not happen: those values are not dependent on the blockchain and so
should not be affected by a reorg/rollback.  With this change they
aren't since there is only one actual proof stored.

Note that the shared storage here only applies to in-memory states;
states loaded from the db will still be duplicated.
2019-08-11 22:35:00 -03:00
Jason Rhinelander d4635e5344 Optimizations and simplifications
This commit makes various simplifications and optimizations, mainly in
the service node list code.

All in all, this shaves about 5% of the CPU time used for re-processing
the entire service node list.

In particular:

- changed m_state_history from a std::vector to a std::set that sorts on
  height.  This is responsible for the bulk of the CPU reduction by
  significant reducing the amount of work required for checkpoint
  culling, which has to shuffle a lot of `state_t`s around when removing
  from the midde of a vector.

- the above also allows replacing the binary-search `std::lower_bound`
  complexity with a much simpler `find()`.

- since the history is now always sorted, removed the error messages
  related to sorting that either can't happen (on store) or don't matter
  (on load).

- Added some converting constructors to simplify code (for example, a
  `state_t` can now be very usefully constructed from an r-value
  `state_serialized`).

- Many construct + moves (and a couple construct + copy) were replaced
  with in-place constructions.

- removed some unused variables
2019-08-11 22:35:00 -03:00
Doyle a0c327bcdf
Handle multi state changes in the pool (#781)
* Update state transition check to account for height and universally set timestamp on recommission

Reject invalidated state changes by their height after HF13

* Prune invalidated state changes on blockchain increment

Simplify check_tx_inputs for state_changes by using service node list

Instead of querying the last 60 historical blocks for every transaction,
use the service node list and determine the state of the service node
and if it can transition to its new state.

We also now enforce at hardfork 13, that the network cannot commit
transactions to the network if they would have been invalidated by
a newer state change that already is already on the blockchain.

This is backwards compatible all the way back to hardfork 9.

Greatly simplify state change tx pruning on block added

Use the new stricter rules for pruning state changes in the txpool

We can do so because pruning the TX pool won't cause issues at the
protocol level, but the more people we can upgrade the better network
behaviour we get in terms of propagating more intrinsically correct
ordering of state changes to other peers.

* Don't generate state changes if not valid, disallow voting if node is non-votable
2019-08-12 09:48:47 +10:00
Doyle c2ef3b413a Inline update_miner_block_template and remove from core header 2019-08-07 10:30:46 +10:00
Doyle de1d9ab53d Remove NOTIFY_NEW_DEREGISTER_VOTE code, deprecated by service node vote 2019-08-07 10:18:53 +10:00
luigi1111 9f746b72e2
Merge pull request #5585
270a3ae Unused private member m_miner_address (JesusRami)
2019-07-24 14:19:15 -05:00
luigi1111 4b76656f5c
Merge pull request #5524
06b8f29 blockchain: keep alternative blocks in LMDB (moneromooo-monero)
2019-07-24 14:04:16 -05:00
luigi1111 e3de4aa68b
Merge pull request #5502
25a7cfd add a few checks where it seems appropriate (moneromooo-monero)
1a66a86 remove unused code (moneromooo-monero)
2019-07-24 13:57:06 -05:00
Jason Rhinelander 5b819ba558 (Low priority) Add disabled-by-default quorum storage support (#702)
* Add disabled-by-default quorum storage support

This adds support for storing N blocks of recent expired quorum state
history in lokid (and dumping to/from the lmdb).

This isn't useful for regular nodes (and that's why we don't store it)
but is incredibly useful for the block explorer to be able to report
*which* node got deregistered/decommissioned/etc. by a given
state_change tx.

* Fix quorum states copy
2019-07-17 16:01:54 +10:00
Jason Rhinelander 25c8058a7c Don't send NOTIFY_NEW_SERVICE_NODE_VOTE before v12
They were being sent too early by upgraded lokids, resulting in "Unknown
command:2012" errors on 3.0.x mainnet nodes.
2019-07-11 16:30:17 -03:00
Doyle 8dca820ed7
Service node checkpointing soft fork for mainnet (#719)
* Add soft forking for checkpointing on mainnet

* Clear checkpoints on softfork on mainnet

* Move softfork date until we're ready, fix test results and modulo addition

* Only round up delete_height if it's not a multiple of CHECKPOINT_INTERVAL

* Remove unused variable soft fork in service_node_rules (replaced by cryptonote_config)
2019-07-11 16:16:16 +10:00
Doyle fd0b2bb3db
Merge pull request #712 from Doy-lee/CheckpointingFixes
Switch to a circular buffer for recording checkpointing votes
2019-07-11 16:07:58 +10:00
Doyle bdf8829f6b Switch to a circular buffer for recording checkpointing votes 2019-07-11 14:21:59 +10:00
Doyle afc86db4a9
Rollback chain when receiving conflicting checkpoints (#726) 2019-07-11 14:16:55 +10:00
Doyle 17ba8d88cf
Resolve pubkeys from state change in dupe check in the tx_pool (#707)
* Resolve public keys from state changes for the TX pool to avoid dupes

* Update copy pasted error message for quorum index OOB

* Code review
2019-07-04 17:25:02 +10:00
Jason Rhinelander 192ea32326 Don't relay expired votes; add vote tolerance before disconnection
Update the way votes are relayed to fix superfluous p2p disconnections:
- check that votes are actually not older than VOTE_LIFETIME before
  relaying.
- Fix off-by-one error in incoming vote handling (it was rejecting on >=
  maximum age instead of > maximum age).
- Add a 5-block buffer to the incoming vote tolerance handling: don't
  accept a vote that is too new or too old, but also don't trigger a
  disconnection if it is within 5 blocks of where it would be
  acceptable so that relays from slightly out of sync peers don't
  trigger p2p disconnections.
2019-06-30 14:25:20 -03:00
Jason Rhinelander c1d4d3b347 Fix setting relayed votes
`relayable_votes` was already moved away a few lines above this.
2019-06-29 21:27:08 -03:00
Doyle e6b5ef558a
Service node checkpointing deregistration (#672)
* Add deregistration of checkpoints by checking how many votes are missed

Move uptime proofs and add checkpoint counts in the service_node_list
because we typically prune uptime proofs by time, but it seems we want
to switch to a model where we persist proof data until the node expires
otherwise currently we would prune uptime entries and potentially our
checkpoint vote counts which would cause premature deregistration as the
expected vote counts start mismatching with the number of received
votes.

* Revise deregistration

* Fix test breakages

* uint16_t for port, remove debug false, min votes to 2 in integration mode

* Fix integration build
2019-06-27 17:05:44 +10:00
Doyle 66da3b605f
Merge branch 'dev' into randomx 2019-06-27 17:04:48 +10:00
Doyle 2c07c92440
Removes sn-public-ip and combines into --service-node (#676)
* Removes sn-public-ip and combines into --service-node

* Only rename the argument, don't combine args for clarity

* Update help message to use --service-node-public-ip
2019-06-27 16:03:22 +10:00
Doyle 918cfec703
Merge pull request #671 from jagerman/ip-switch-penalty
Add penalty for switching IPs
2019-06-27 13:21:42 +10:00
Jason Rhinelander 94b5857a84 Merge remote-tracking branch 'LMDB/randomx' into randomx 2019-06-26 21:50:51 -03:00
Doyle 212b859a66 Merge branch 'dev' into LokiMergeUpstream 2019-06-26 15:46:06 +10:00
Jason Rhinelander 3489ae1e72 Replace is_fully_funded() calls with is_active()
The vast majority of the time `is_active()` is what we actually want.
Most of these are just a name change, but there is also one important
fix here to the next-winner list which needs to use active, not
fully-funded.
2019-06-26 01:14:52 -03:00
Jason Rhinelander 0754885103 Tighten allowed IPv4 ranges
epee's is_ip_local is missing two ranges that are commonly found:
link-local auto-config addresses (169.254.0.0/16) that are sometimes
used as a fallback when DHCP isn't present; and the carrier-grade NAT
range (100.64.0.0/10) reserved for carriers who impose NAT on their
customers.

There are also other ranges that aren't exactly "local" but aren't
public either: 0.0.0.0/8 isn't a valid destination address; and
224.0.0.0/3 (includes includes both the 224/4 multicast range, and the
reserved (but will most likely never be used) 240.0.0.0/4 range).

These are now added to a new `is_ip_public` function that returns true
if it's not local or loopback, and not one of these special ranges.

This also simplifies some convoluted netmask logic.  (The simplification
would look better except that epee took the extremely bizarre and wrong
decision to store IPv4 addresses in little-endian order).
2019-06-26 01:14:52 -03:00
Doyle fdc340b0ee
Service node checkpointing: rebased on relaxed deregistration (#662)
* core: do not commit half constructed batch db txn

* Add defer macro

* Revert dumb extra copy/move change

* Fix pop_blocks not calling hooks, fix BaseTestDB missing prototypes

* Merge ServiceNodeCheckpointing5 branch, syncing and integration fixes

* Update tests to compile with relaxed-registration changes

* Get back to feature parity pre-relaxed registration changes

* Remove debug changes noticed in code review and some small bugs
2019-06-26 14:00:05 +10:00
Doyle f761ed6345 Merge commit '51766d0' into LokiMergeUpstream 2019-06-26 12:43:21 +10:00
Jason Rhinelander 6d6541670e Relax deregistration rules
The replaces the deregistration mechanism with a new state change
mechanism (beginning at the v12 fork) which can change a service node's
network status via three potential values (and is extensible in the
future to handle more):

- deregistered -- this is the same as the existing deregistration; the
SN is instantly removed from the SN list.
- decommissioned -- this is a sort of temporary deregistration: your SN
remains in the service node list, but is removed from the rewards list
and from any network duties.
- recommissioned -- this tx is sent by a quorum if they observe a
decommissioned SN sending uptime proofs again.  Upon reception, the SN
is reactivated and put on the end of the reward list.

Since this is broadening the quorum use, this also renames the relevant
quorum to a "obligations" quorum (since it validates SN obligations),
while the transactions are "state_change" transactions (since they
change the state of a registered SN).

The new parameters added to service_node_rules.h control how this works:

    // Service node decommissioning: as service nodes stay up they earn "credits" (measured in blocks)
    // towards a future outage.  A new service node starts out with INITIAL_CREDIT, and then builds up
    // CREDIT_PER_DAY for each day the service node remains active up to a maximum of
    // DECOMMISSION_MAX_CREDIT.
    //
    // If a service node stops sending uptime proofs, a quorum will consider whether the service node
    // has built up enough credits (at least MINIMUM): if so, instead of submitting a deregistration,
    // it instead submits a decommission.  This removes the service node from the list of active
    // service nodes both for rewards and for any active network duties.  If the service node comes
    // back online (i.e. starts sending the required performance proofs again) before the credits run
    // out then a quorum will reinstate the service node using a recommission transaction, which adds
    // the service node back to the bottom of the service node reward list, and resets its accumulated
    // credits to 0.  If it does not come back online within the required number of blocks (i.e. the
    // accumulated credit at the point of decommissioning) then a quorum will send a permanent
    // deregistration transaction to the network, starting a 30-day deregistration count down.

This commit currently includes values (which are not necessarily
finalized):
- 8 hours (240 blocks) of credit required for activation of a
decommission (rather than a deregister)
- 0 initial credits at registration
- a maximum of 24 hours (720 blocks) of credits
- credits accumulate at a rate that you hit 24 hours of credits after 30
days of operation.

Miscellaneous other details of this PR:

- a new TX extra tag is used for the state change (including
deregistrations).  The old extra tag has no version or type tag, so
couldn't be reused.  The data in the new tag is slightly more
efficiently packed than the old deregistration transaction, so it gets
used for deregistrations (starting at the v12 fork) as well.

- Correct validator/worker selection required generalizing the shuffle
function to be able to shuffle just part of a vector.  This lets us
stick any down service nodes at the end of the potential list, then
select validators by only shuffling the part of the index vector that
contains active service indices.  Once the validators are selected, the
remainder of the list (this time including decommissioned SN indices) is
shuffled to select quorum workers to check, thus allowing decommisioned
nodes to be randomly included in the nodes to check without being
selected as a validator.

- Swarm recalculation was not quite right: swarms were recalculated on
SN registrations, even if those registrations were include shared node
registrations, but *not* recalculated on stakes.  Starting with the
upgrade this behaviour is fixed (swarms aren't actually used currently
and aren't consensus-relevant so recalculating early won't hurt
anything).

- Details on decomm/dereg are added to RPC info and print_sn/print_sn_status

- Slightly improves the % of reward output in the print_sn output by
rounding it to two digits, and reserves space in the output string to
avoid excessive reallocations.

- Adds various debugging at higher debug levels to quorum voting (into
all of voting itself, vote transmission, and vote reception).

- Reset service node list internal data structure version to 0.  The SN
list has to be rescanned anyway at upgrade (its size has changed), so we
might as well reset the version and remove the version-dependent
serialization code.  (Note that the affected code here is for SN states
in lmdb storage, not for SN-to-SN communication serialization).
2019-06-23 22:37:53 -03:00
Jason Rhinelander 4f721c0098 Make tx type and version scoped enums
This converts the transaction type and version to scoped enum, giving
type safety and making the tx type assignment less error prone because
there is no implicit conversion or comparison with raw integers that has
to be worried about.

This ends up converting any use of `cryptonote::transaction::type_xyz`
to `cryptonote::transaction::txtype::xyz`.  For version, names like
`transaction::version_v4` become `cryptonote::txversion::v4_tx_types`.

This also allows/includes various other simplifications related to or
enabled by this change:
- handle `is_deregister` dynamically in serialization code (setting
  `type::standard` or `type::deregister` rather than using a
  version-determined union)
- `get_type()` is no longer needed with the above change: it is now
  much simpler to directly access `type` which will always have the
  correct value (even for v2 or v3 transaction types).  And though there
  was an assertion on the enum value, `get_type()` was being used only
  sporadically: many places accessed `.type` directly.
- the old unscoped enum didn't have a type but was assumed castable
  to/from `uint16_t`, which technically meant there was potential
  undefined behaviour when deserializing any type values >= 8.
- tx type range checks weren't being done in all serialization paths;
  they are now.  Because `get_type()` was not used everywhere (lots of
  places simply accessed `.type` directory) these might not have been
  caught.
- `set_type()` is not needed; it was only being used in a single place
  (wallet2.cpp) and only for v4 txes, so the version protection code was
  never doing anything.
- added a std::ostream << operator for the enum types so that they can be
  output with `<< tx_type <<` rather than needing to wrap it in
  `type_to_string(tx_type)` everywhere.  For the versions, you get the
  annotated version string (e.g. 4_tx_types) rather than just the number
  4.
2019-06-19 17:47:03 -03:00
Maxim Shishmarev 95eb74704c
Merge pull request #656 from jagerman/ip-display-fix
Format sn-public-ip option in error message
2019-06-19 15:43:24 +10:00
Jason Rhinelander 28525b81e1 Format sn-public-ip option in error message
Prints a human-readable IP instead of a 32-bit integer
2019-06-19 02:26:48 -03:00
Jason Rhinelander e873130cb0 RED error message for storage server uptime fail (#653)
Because bright red is scarier.
2019-06-19 14:58:21 +10:00
moneromooo-monero 5d6b43b672
core: fix --prune-blockchain not pruning if no blockchain exists 2019-06-17 16:26:43 +00:00
moneromooo-monero 69f9420489
core: do not complain about low block rate if disconnected
In that case, we'll still keep the "Monero is now disconnected
from the network" near the end of the log
2019-06-13 10:25:30 +00:00
Doyle 9f12ae0c0a
Service Node Checkpointing: More reliable transportation of votes, culling of old checkpoints (#632)
* Initial updates to allow syncing of checkpoints in protocol_handler

* Handle checkpoints in prepare_handle_incoming_blocks

* Debug changes for testing, cancel changes later

* Add checkpoint pruning code

* Reduce DB checkpoint accesses, sync votes for up to 60 blocks

* Remove duplicate lifetime variable

* Move parsing checkpoints to above early return for consistency

* Various integration test fixes

- Don't try participate in quorums at startup if you are not a service node
- Add lock for when potentially writing to the DB
- Pre-existing batch can be open whilst updating checkpoint so can't use
  DB guards
- Temporarily emit the ban message using msgwriter instead of logs

* Integration mode bug fixes

- Always deserialize empty quorums so get_testing_quorum only fails when
an actual critical error has occurred
- Cache the last culled height so we don't needlessly query the DB over
the same heights trying to delete already-deleted checkpoints
- Submit votes when new blocks arrive for more reliable vote
transportation

* Undo debug changes for testing

* Update incorrect DB message and stale comment
2019-06-13 18:01:08 +10:00
Maxim Shishmarev e53922faa8 Require storage server running for uptime proofs (v.2) (#631)
* Require storage server running for uptime proofs (v.2)

* use atomic time_t; reset ping on startup
2019-06-07 17:03:11 +10:00
Doyle ae76293487
Make --service-node give more verbose failure flags (#630) 2019-06-06 17:39:54 +10:00
Maxim Shishmarev 0c23035562 Incorporate service node ip address into uptime proofs (#622)
* Incorporate service node ip address into uptime proofs; expose them using rpc

* Check that storage server port is specified in service-node mode

* Remove problematic const, rename argument name for storage port, update comments

* Validate ip address when receive uptime proof

* Better argument names and descriptions
2019-06-04 14:15:16 +10:00
Doyle 3794dce241
Service Node Checkpointing Basic Syncing (#621)
* Initial updates to allow syncing of checkpoints in protocol_handler

* Handle checkpoints in prepare_handle_incoming_blocks

* Parse checkpoints sent by peer

* Fix rebase to dev referencing no longer valid argument
2019-06-04 13:50:31 +10:00
Doyle cdde63b6ce
Remove non-fluffy blockchain syncing path (#618)
Obsolete since forever, fluffy blocks is by default- it's more space
efficient when syncing the blockchain.
2019-06-04 12:28:56 +10:00
Howard Chu cfe0e9c7c5
RandomX integration
Support RandomX PoW algorithm
2019-06-01 21:40:55 +01:00
moneromooo-monero aed89cd99f
blockchain: keep alternative blocks in LMDB
Alternative blocks are cleared on startup unless --keep-alt-blocks
is passed on the command line
2019-06-01 21:40:46 +01:00
Doyle 8af377d2b8
Unify and move responsibility of voting to quorum_cop (#615)
* Unify checkpointing and uptime quorums

* Begin making checkpoints cull old votes/checkpoints

* Begin rehaul of service node code out of core, to assist checkpoints

* Begin overhaul of votes to move resposibility into quorum_cop

* Update testing suite to work with the new system

* Remove vote culling from checkpoints and into voting_pool

* Fix bugs making integration deregistration fail

* Votes don't always specify an index in the validators

* Update tests for validator index member change

* Rename deregister to voting, fix subtle hashing bug

Update the deregister hash derivation to use uint32_t as originally set
not uint64_t otherwise this affects the result and produces different
results.

* Remove un-needed nettype from vote pool

* PR review, use <algorithms>

* Rename uptime_deregister/uptime quorums to just deregister quorums

* Remove unused add_deregister_vote, move side effect out of macro
2019-05-31 11:06:42 +10:00
Jesus Ramirez 270a3ae58b Unused private member m_miner_address 2019-05-29 10:12:47 -04:00
moneromooo-monero f950517a08
core: update pruning if using --prune-blockchain on a pruned blockchain
Avoids a massive amount of spurious warnings if the last update before
the daemon exited was a while ago and the daemon was syncing
2019-05-28 09:12:11 +00:00
Doyle 47e5ab779c Merge branch 'master' into BackportVersion3Patch6ToDev 2019-05-27 10:16:13 +10:00
Doyle 71447e7877
Add flag to recalculate difficulty per block (#598)
* Beging adding functions to recalculate difficulty

* Add command line args to utility for recalculating difficulty

* Exception safety for recalculating difficulty

* Update help text for recalc difficulty

* Add recalc flag on the daemon

* Make context be const, signify intent for var++ to 1
2019-05-12 09:40:57 +10:00
moneromooo-monero 06b8f29992
blockchain: keep alternative blocks in LMDB
Alternative blocks are cleared on startup unless --keep-alt-blocks
is passed on the command line
2019-05-08 17:36:52 +00:00
Doyle bad39ac86b Merge commit '45a4145' into LokiMergeUpstream 2019-05-01 18:11:56 +10:00
Doyle 455129c8ca Merge branch 'dev' into LokiMergeUpstream 2019-05-01 16:31:54 +10:00
Doyle cc0d51078c Merge dev into upstream 2019-05-01 16:01:17 +10:00
Doyle 73e8ac0343
Service Node Checkpoint Storage (#579)
* Add functions for storing checkpoints to the DB

* Allocate the DB entry on the stack instead of heap

* Add virtual overrides for new checkpoint functions

* Clean up for pull request, simplify some logic

* Revise API to include height in checkpoint header

* Move log to top of function even if early exit

* Begin moving checkpoints to db

* Allow storing of checkpoints to DB

* Cleanup for code reviewer, fix unit tests

* Fix tests, fix casting issues

* Don't use DUPSORT, use height->checkpoint mapping in DB

* Remove if 0 disabling checkpoint vote, we already check HF12

* Fix unit test infinite loop

* Update db schemas to match blk_checkpoint_header

* Code review
2019-05-01 15:57:41 +10:00
moneromooo-monero 25a7cfdb4a
add a few checks where it seems appropriate 2019-04-29 20:52:40 +00:00
Doyle 47522768f0
Remove loading checkpoints from DNS (#570)
* Remove loading checkpoints from DNS code

* Remove DNS code from blockchain utilities

* Fix grammar in json checkpoint comments
2019-04-26 13:16:56 +10:00
Doyle dee66d4556
Non-Enforced Transient Service Node Checkpointing (#566)
* Collect checkpoint votes and signatures

* Copy deregister vote and adapt for checkpoint vote

Monkey see, monkey do

Write boilerplate code for receiving and relaying votes

* Make current checkpoints service node aware

Fix not saving checkpoint hash for normal checkpoints

Simplify some of the checkpointing API

* Verify blocks against service node checkpoints

Remove checkpoint copy, make checkpoint at vote threshold

Fix null ptr dereferences, add debug print checkpoints

* Add simple node checkpointing w/no conflict resolution

* Use endl to flush output

* Add hash to vote

* Revise checkpoint rules

* Don't store checkpoints in a linked list

* Commit checkpoints on super majority of votes received

* Add locks since checkpoints is accessed in network thread

* Handle checkpoint vote conflicts better

* Comment out early exiting voting process for simplicity

* Clean up for code review

* Fix whitespacing

* More cleanup for review

* Remove debug changes, fix using upper_bound incorrectly, return points by value

* find_if uses == not < as the predicate

* Fix merge issues from rebasing multiple quorum types
2019-04-23 12:04:47 +10:00
Doyle 6024539e13
Allow storing multiple quorum types (#562) 2019-04-23 10:53:17 +10:00
Riccardo Spagni ce2f46f76b
Merge pull request #5405
ffdbcfb6 core: don't check block rate nor fork time in regtest mode (moneromooo-monero)
2019-04-16 22:32:06 +02:00
Doyle 5653661258 Merge commit '9c77dbf' into LokiMergeUpstream 2019-04-12 19:04:00 +10:00
Doyle 4778d862c9 Merge commit 'bd42903' into LokiMergeUpstream 2019-04-12 18:37:56 +10:00
Doyle c53bee7177 Merge commit '5dbcceb' into LokiMergeUpstream 2019-04-12 18:21:16 +10:00
Doyle aded2cef69 Merge commit '1ed6441' into LokiMergeUpstream 2019-04-12 17:44:20 +10:00
Doyle 9f2e091280 Merge commit 'e4b049d' into LokiMergeUpstream 2019-04-12 16:45:24 +10:00
Doyle 892469ded1 Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
moneromooo-monero 064ab12340
functional_tests: add more blockchain related tests
Related to emission, reorgs, getting tx data back, output
distribution and histogram
2019-04-11 11:07:58 +00:00
Riccardo Spagni 76fbcfe2dd
Merge pull request #5123
089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
2019-04-11 12:41:07 +02:00
Doyle 8d7d90c374 Merge commit 'ed6aa76cca69e4f6d0b84eb55ef7061dc4b6fc77' into LokiMergeUpstream 2019-04-11 15:08:26 +10:00
Doyle b1c92fd216 Add helper functions to facilitate more reliable integration tests 2019-04-09 15:47:23 +10:00
moneromooo-monero ffdbcfb6b3
core: don't check block rate nor fork time in regtest mode 2019-04-07 13:30:02 +00:00
Riccardo Spagni 4ac78e1612
Merge pull request #5346
c84ea299 cryptonote_basic: some more minor speedups (moneromooo-monero)
e40eb2ad cryptonote_basic: speedup calculate_block_hash (moneromooo-monero)
547a9708 cryptonote: block parsing + hash calculation speedup (moneromooo-monero)
11604b6d blockchain: avoid unneeded block copy (moneromooo-monero)
8461df04 save some database calls when getting top block hash and height (moneromooo-monero)
3bbc3661 Avoid repeated (de)serialization when syncing (moneromooo-monero)
2019-04-06 15:59:43 +02:00
moneromooo-monero 089c7637a6
cryptonote: rework block blob size sanity check
Use the actual block weight limit, assuming that weight is always
greater or equal to size
2019-04-05 09:35:19 +00:00
Doyle f154d309e6
Merge pull request #535 from loki-project/master
Backport 3.0.3 + 3.0.4 changes to dev
2019-04-03 15:36:28 +11:00
Jason Rhinelander a7b19950a2 Add last announced SN version to stored proof info (#503)
This changed the stored proof info to a struct storing both the
timestamp and the major/minor/patch versions that were included in the
last uptime proof.

The version gets exposed as a "service_node_version" 3-int array in the
get_service_nodes RPC call.

This commit also includes a minor non-critical fix to the uptime proof
pruning as part of the changes: deleting while iterating isn't
guaranteed to iterate through all elements before C++14.
2019-04-01 18:39:27 +11:00
Doyle aded258c0b
Update deregister transaction versions (#533) 2019-03-29 16:40:21 +11:00
moneromooo-monero 547a9708de
cryptonote: block parsing + hash calculation speedup
This saves a duplicate serialization step
2019-03-25 13:43:17 +00:00
moneromooo-monero 1730a44f90
core: improve block rate monitor trigger probabilities
The original intent of one false positive a week on average
was not met, since what we really want is not the probability
of having N blocks in T seconds, but either N blocks of fewer
in T seconds, or N blocks or more in T seconds.

Some of this could be cached since it calculates the same fairly
complex floating point values, but it seems pretty fast already.
2019-03-25 00:55:09 +00:00
moneromooo-monero e9519e9876
cryptonote: fix calculating coinbase tx hash
Also set error flag on exception when handling new txes
to keep tests working
2019-03-21 17:13:01 +00:00
Jason Rhinelander a2f5769a86 Fix for v3 proofs not being accepted by v2 nodes (#496)
Current 2.0.x nodes will only accept a v10 network uptime proof if the
proof's snode_version_major is exactly equal to 2 (rather than >= 2), so
the proofs generated by a 3.0.x node won't be accepted by 2.0.x nodes.

This commit fakes the snode version put into an uptime proof prior to
the to the v11 fork to a fictitious 2.3.x version instead of the actual
3.0.x to keep v2 nodes happy with the proof.

(The same issue isn't present for future upgrade: the code in 3.0
properly recognizes >= 3 as valid for sending v11 network proofs).
2019-03-18 09:47:23 +10:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
moneromooo-monero 88c85c18e0
cryptonote: avoid double parsing blocks when syncing 2019-03-05 11:58:18 +00:00
moneromooo-monero 238401d4e9
core: avoid double parsing blocks after hoh 2019-03-05 11:58:13 +00:00
moneromooo-monero f75d51abda
core: avoid calculating tx prefix hash when we don't need it 2019-03-05 11:57:57 +00:00
moneromooo-monero a17da7202b
Print the reason why a notification spec failed to parse 2019-03-04 11:48:46 +00:00
moneromooo-monero 356d813799
blockchain: include number of discarded blocks in --reorg-notify 2019-03-04 11:48:44 +00:00
moneromooo-monero 4d598e3d4d
core: add a few more block rate window sizes
The 10 minute one will never trigger for 0 blocks, as it's still
fairly likely to happen even without the actual hash rate changing
much, so we add a 20 minute window, where it will (for 0 blocks)
and a one hour window.
2019-03-04 11:48:42 +00:00
moneromooo-monero d4fb9641e0
core: add --block-rate-notify
This runs a command whenever the block rate deviates too much
from the expectation
2019-03-04 11:48:39 +00:00
moneromooo-monero b8787f4302
ArticMine's new block weight algorithm
This curbs runaway growth while still allowing substantial
spikes in block weight

Original specification from ArticMine:

here is the scaling proposal
Define: LongTermBlockWeight
Before fork:
LongTermBlockWeight = BlockWeight
At or after fork:
LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight)
Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time.
Define:   LongTermEffectiveMedianBlockWeight
LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight))
Change Definition of EffectiveMedianBlockWeight
From (current definition)
EffectiveMedianBlockWeight  = max(300000, MedianOverPrevious100Blocks(BlockWeight))
To (proposed definition)
EffectiveMedianBlockWeight  = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight)
Notes:
1) There are no other changes to the existing penalty formula, median calculation, fees etc.
2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This  is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork.
3) When the  EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty.

Note: the long term block weight is stored in the database, but not in the actual block itself,
since it requires recalculating anyway for verification.
2019-03-04 09:33:58 +00:00
Doyle 7f9b2ffee8 Merge branch 'dev' into IntegrationTestFramework 2019-02-25 17:18:16 +11:00
moneromooo-monero 6cc35100f9 ArticMine's new block weight algorithm
This curbs runaway growth while still allowing substantial
spikes in block weight

Original specification from ArticMine:

here is the scaling proposal
Define: LongTermBlockWeight
Before fork:
LongTermBlockWeight = BlockWeight
At or after fork:
LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight)
Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time.
Define:   LongTermEffectiveMedianBlockWeight
LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight))
Change Definition of EffectiveMedianBlockWeight
From (current definition)
EffectiveMedianBlockWeight  = max(300000, MedianOverPrevious100Blocks(BlockWeight))
To (proposed definition)
EffectiveMedianBlockWeight  = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight)
Notes:
1) There are no other changes to the existing penalty formula, median calculation, fees etc.
2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This  is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork.
3) When the  EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty.
2019-02-20 18:57:58 +11:00
moneromooo-monero 0356ac2dcc core: add --block-rate-notify
This runs a command whenever the block rate deviates too much
from the expectation
2019-02-20 17:12:02 +11:00
moneromooo-monero f6da98b935 core: add a few more block rate window sizes
The 10 minute one will never trigger for 0 blocks, as it's still
fairly likely to happen even without the actual hash rate changing
much, so we add a 20 minute window, where it will (for 0 blocks)
and a one hour window.
2019-02-20 17:09:33 +11:00
Doyle 53742cacd2 Merge branch 'dev' into IntegrationTestFramework 2019-02-18 16:30:06 +11:00
Doyle 91f3f4f7fa
Simplify deregister vote API by inlining set relayed (#420)
No need to do a round-trip just to call set relayed on votes. Also makes
it more robust by actually checking that we were able to relay the vote
before declaring it as relayed.
2019-02-15 11:13:46 +11:00
Doyle 43436b081d
Infinite Staking Part 2 (#406)
* Cleanup and undoing some protocol breakages

* Simplify expiration of nodes

* Request unlock schedules entire node for expiration

* Fix off by one in expiring nodes

* Undo expiring code for pre v10 nodes

* Fix RPC returning register as unlock height and not checking 0

* Rename key image unlock height const

* Undo testnet hardfork debug changes

* Remove is_type for get_type, fix missing var rename

* Move serialisable data into public namespace

* Serialise tx types properly

* Fix typo in no service node known msg

* Code review

* Fix == to >= on serialising tx type

* Code review 2

* Fix tests and key image unlock

* Add command to print locked key images

* Update ui to display lock stakes, query in print cmd blacklist

* Modify print stakes to be less slow

* Remove autostaking code

* Refactor staking into sweep functions

It appears staking was derived off stake_main written separately at
implementation at the beginning. This merges them back into a common
code path, after removing autostake there's only some minor differences.

It also makes sure that any changes to sweeping upstream are going to be
considered in the staking process which we want.

* Display unlock height for stakes

* Begin creating output blacklist

* Make blacklist output a migration step

* Implement get_output_blacklist for lmdb

* In wallet output selection ignore blacklisted outputs

* Apply blacklisted outputs to output selection

* Fix broken tests, switch key image unlock

* Fix broken unit_tests

* Begin change to limit locked key images to 4 globally

* Revamp prepare registration for new min contribution rules

* Fix up old back case in prepare registration

* Remove debug code

* Cleanup debug code and some unecessary changes

* Fix migration step on mainnet db

* Fix blacklist outputs for pre-existing DB's

* Remove irrelevant note

* Tweak scanning addresses for locked stakes

Since we only now allow contributions from the primary address we can
skip checking all subaddress + lookahead to speed up wallet scanning

* Define macro for SCNu64 for Mingw

* Fix failure on empty DB

* Add missing error msg, remove contributor from stake

* Improve staking messages

* Flush prompt to always display

* Return the msg from stake failure and fix stake parsing error

* Tweak fork rules for smaller bulletproofs

* Tweak pooled nodes minimum amounts

* Fix crash on exit, there's no need to store on destructor

Since all information about service nodes is derived from the blockchain
and we store state every time we receive a block, storing in the
destructor is redundant as there is no new information to store.

* Make prompt be consistent with CLI

* Check max number of key images from per user to node

* Implement error message on get_output_blacklist failure

* Remove resolved TODO's/comments

* Handle infinite staking in print_sn

* Atoi->strtol, fix prepare_registration, virtual override, stale msgs
2019-02-14 12:12:57 +11:00
doy-lee fe4b8f3e7a Merge branch 'IntegrationTestFramework2' into IntegrationTestFramework 2019-01-31 18:58:24 +11:00
doy-lee 9c6193167b Revamp to use semaphores for IPC
Delay hooks into stdin/out until core is idle for daemons

Disable logging for daemon (super problematic)
2019-01-31 18:29:08 +11:00
doy-lee bebecbd0a6 Merge branch 'dev' into LokiMergeUpstream 2019-01-30 16:59:47 +11:00
doy-lee 261570ac35 Merge commit '227bf14' into LokiMergeUpstream 2019-01-30 15:18:15 +11:00
doy-lee 6634d97e29 Merge commit '0daa00e' into LokiMergeUpstream 2019-01-30 13:05:20 +11:00
doy-lee ac4d0469bf Merge commit '4a0e4c7' into LokiMergeUpstream 2019-01-30 12:04:20 +11:00
moneromooo-monero 23813c7160
blockchain: add --reorg-notify
This will trigger if a reorg is seen. This may be used to do things
like stop automated withdrawals on large reorgs.

%s is replaced by the height at the split point
%h is replaced by the height of the new chain
%n is replaced by the number of new blocks after the reorg
2019-01-28 19:32:31 +00:00
Riccardo Spagni 0daa00e035
Merge pull request #5052
b6534c40 ringct: remove unused senderPk from ecdhTuple (moneromooo-monero)
7d375981 ringct: the commitment mask is now deterministic (moneromooo-monero)
99d946e6 ringct: encode 8 byte amount, saving 24 bytes per output (moneromooo-monero)
cdc3ccec ringct: save 3 bytes on bulletproof size (moneromooo-monero)
f931e16c add a bulletproof version, new bulletproof type, and rct config (moneromooo-monero)
2019-01-28 21:24:55 +02:00
Doyle 3a7b6b59eb
Infinite Staking Part 1 (#387)
* Remove dead branches in hot-path check_tx_inputs

Also renames #define for mixins to better match naming convention

* Shuffle around some more code into common branches

* Fix min/max tx version rules, since there 1 tx v2 on v9 fork

* First draft infinite staking implementation

* Actually generate the right key image and expire appropriately

* Add framework to lock key images after expiry

* Return locked key images for nodes, add request unlock option

* Introduce transaction types for key image unlock

* Update validation steps to accept tx types, key_image_unlock

* Add mapping for lockable key images to amounts

* Change inconsistent naming scheme of contributors

* Create key image unlock transaction type and process it

* Update tx params to allow v4 types and as a result construct_tx*

* Fix some serialisation issues not sending all the information

* Fix dupe tx extra tag causing incorrect deserialisation

* Add warning comments

* Fix key image unlocks parsing error

* Simplify key image proof checks

* Fix rebase errors

* Correctly calculate the key image unlock times

* Blacklist key image on deregistration

* Serialise key image blacklist

* Rollback blacklisted key images

* Fix expiry logic error

* Disallow requesting stake unlock if already unlocked client side

* Add double spend checks for key image unlocks

* Rename get_staking_requirement_lock_blocks

To staking_initial_num_lock_blocks

* Begin modifying output selection to not use locked outputs

* Modify output selection to avoid locked/blacklisted key images

* Cleanup and undoing some protocol breakages

* Simplify expiration of nodes

* Request unlock schedules entire node for expiration

* Fix off by one in expiring nodes

* Undo expiring code for pre v10 nodes

* Fix RPC returning register as unlock height and not checking 0

* Rename key image unlock height const

* Undo testnet hardfork debug changes

* Remove is_type for get_type, fix missing var rename

* Move serialisable data into public namespace

* Serialise tx types properly

* Fix typo in no service node known msg

* Code review

* Fix == to >= on serialising tx type

* Code review 2

* Fix tests and key image unlock

* Add additional test, fix assert

* Remove debug code in wallet

* Fix merge dev problem
2019-01-25 14:15:52 +11:00
Doyle 101f1799eb
All Service Node Keys as Base32z RPC Call (#404)
* create get_service_node_list rpc call

currently does nothing, just a shell (that compiles)

* implement get_all_service_node_keys rpc call

* change get_all_service_node_keys rpc to use json rpc

also change the result to be vector of hex strings rather than binary keys

* Make nodes be plural, add hex to base32z for keys

Base32z for Lokinet internal usage

* Add option to return fully funded service nodes only

* Add nullptr check for conversion

* Add assert for incorrect usage of to base32z
2019-01-25 10:50:42 +11:00
moneromooo-monero f931e16c6e
add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-01-22 23:17:24 +00:00
moneromooo-monero b750fb27b0
Pruning
The blockchain prunes seven eighths of prunable tx data.
This saves about two thirds of the blockchain size, while
keeping the node useful as a sync source for an eighth
of the blockchain.

No other data is currently pruned.

There are three ways to prune a blockchain:

- run monerod with --prune-blockchain
- run "prune_blockchain" in the monerod console
- run the monero-blockchain-prune utility

The first two will prune in place. Due to how LMDB works, this
will not reduce the blockchain size on disk. Instead, it will
mark parts of the file as free, so that future data will use
that free space, causing the file to not grow until free space
grows scarce.

The third way will create a second database, a pruned copy of
the original one. Since this is a new file, this one will be
smaller than the original one.

Once the database is pruned, it will stay pruned as it syncs.
That is, there is no need to use --prune-blockchain again, etc.
2019-01-22 20:30:51 +00:00
doy-lee cbd8193ba2 Fix destruction of service node list locking destroyed mutex 2019-01-18 16:16:23 +11:00
doy-lee 074ed7680f Merge commit '3e9bb96' into LokiMergeUpstream 2019-01-18 10:35:18 +11:00
doy-lee 485bd27532 Merge branch 'dev' into IntegrationTestFramework 2019-01-11 17:05:30 +11:00
doy-lee 7464673c64 Merge branch 'dev' into LokiMergeUpstream 2019-01-07 11:56:23 +11:00
Doyle baa100a345
Remove loki namespace and merge into service_nodes (#334) 2018-12-21 11:33:05 +11:00
doy-lee f5b17fc86e Merge commit '6bc0c7e' into LokiMergeUpstream 2018-12-19 12:25:48 +11:00
moneromooo-monero 008647d7eb
blockchain_db: speedup tx output gathering
We know all the data we'll want for getblocks.bin is contiguous
2018-12-18 11:55:21 +00:00
Riccardo Spagni fe3c8c9682
Merge pull request #4923
aba9a9c2 daemon: stop miner before we bring the whole thing down (moneromooo-monero)
2018-12-12 12:00:37 +02:00
Riccardo Spagni e19a205ff4
Merge pull request #4920
e98ae34e core: fix adding new pre-hoh block when a tx is already in the pool (moneromooo-monero)
2018-12-12 11:59:43 +02:00
Riccardo Spagni dde1e69723
Merge pull request #4787
3dba7f25 protocol: option to pad transaction relay to the next kB (moneromooo-monero)
2018-12-12 11:53:10 +02:00
doy-lee 4efbf023d3 Disable automatic DB delete on fakechain for integration test 2018-12-12 12:12:15 +11:00
doy-lee 5876b4d6f5 Disable block rate and min life time in integration mode 2018-12-11 14:43:04 +11:00
doy-lee cf6570fb12 Add ability to handle multiple daemon/wallets 2018-12-11 14:43:04 +11:00
doy-lee 7657c5a26e Add support for fakechain in wallet 2018-12-11 14:43:04 +11:00
doy-lee e8a8ebb23a Allow overriding hardforks without forcing fakechain 2018-12-11 14:43:04 +11:00
doy-lee d3b12ee2fa Allow passing custom hardfork heights through cmdline
Expected format: <fork_version>:<fork_height>, ...
Example: 7:0, 8:10, 9:20, 10:100
2018-12-11 14:43:04 +11:00
doy-lee 40506127a4 Merge commit '7e957c1' into LokiMergeUpstream 2018-12-11 13:46:35 +11:00
doy-lee d5beaee824 Merge commit 'a605c0d' into LokiMergeUpstream 2018-12-10 19:32:50 +11:00
Riccardo Spagni 81418cb281
Merge pull request #4894
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero)
1a0733e5 windows_service: fix memory leak (moneromooo-monero)
0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero)
5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero)
d4f50cb1 remove some unused code (moneromooo-monero)
61163971 a few minor (but easy) performance tweaks (moneromooo-monero)
30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
2018-12-04 17:33:19 +02:00
Riccardo Spagni c00ac446fd
Merge pull request #4854
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-12-04 17:08:42 +02:00
moneromooo-monero aba9a9c277
daemon: stop miner before we bring the whole thing down
This avoids the miner erroring out trying to submit blocks
to a core that's already shut down (and avoids pegging
the CPU while we're busy shutting down).
2018-11-30 15:10:25 +00:00
moneromooo-monero e98ae34e4b
core: fix adding new pre-hoh block when a tx is already in the pool 2018-11-26 23:45:01 +00:00
moneromooo-monero d4f50cb109
remove some unused code
Found by codacy.com
2018-11-23 15:37:36 +00:00
doy-lee e36737a525 Merge commit 'd0c4123' into LokiMergeUpstream 2018-11-22 13:27:45 +11:00
doy-lee 6154d3af6a Fix TXBuilder default hf value causing regression in core_tests 2018-11-21 16:34:07 +11:00
Martijn Otto bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
Riccardo Spagni 0cc3fc3756
Merge pull request #4769
5808530f blockchain: remove unused output_scan_worker parameter (moneromooo-monero)
1426209a blockchain: don't run threads if we have just one function to run (moneromooo-monero)
6f7a5fd4 db_lmdb: slight speedup getting array data from the blockchain (moneromooo-monero)
99fbe100 db_lmdb: save some string copies for readonly db keys/values (moneromooo-monero)
bf31447e tx_pool: speed up take_tx for transactions from blocks (moneromooo-monero)
4f005a77 tx_pool: remove unnecessary get_transaction_hash (moneromooo-monero)
593ef598 perf_timer: call reserve on new timer array (moneromooo-monero)
6ecc99ad core: avoid unnecessary tx/blob conversions (moneromooo-monero)
00cc1a16 unit_tests: notify test special case for the usual weirdo (moneromooo-monero)
2018-11-14 21:35:03 +02:00
doy-lee 3afbc0bceb Merge branch 'dev' into LokiMergeUpstream 2018-11-12 15:25:39 +11:00
doy-lee 8f03bb3fd7 Merge commit '8534f71' into LokiMergeUpstream 2018-11-12 14:55:42 +11:00
moneromooo-monero 3dba7f252e
protocol: option to pad transaction relay to the next kB
To help protect one's privacy from traffic volume analysis
for people using Tor or I2P. This will really fly once we
relay txes on a timer rather than on demand, though.

Off by default for now since it's wasteful and doesn't bring
anything until I2P's in.
2018-11-06 15:47:05 +00:00
doy-lee 9abf99a819 Add versioning to uptime proofs to enforce behaviour 2018-11-05 15:52:44 +11:00
doy-lee f220bc3dc6 Fix broken builds from upstream merge 2018-11-05 13:02:05 +11:00
doy-lee 42f0933e58 Merge commit '7e2483e' into LokiMergeUpstream 2018-11-05 11:27:45 +11:00
xiphon b3067962fa cryptonote_core: avoid gratuitous recalculations in check_block_rate() 2018-11-05 00:13:51 +00:00
xiphon 233f00c601 cryptonote_core: fix build error gcc 5.4.0 'sign-compare' 2018-11-01 22:57:08 +00:00
moneromooo-monero 6ecc99ad1f
core: avoid unnecessary tx/blob conversions 2018-11-01 15:51:19 +00:00
doy-lee 997c0a9991 Merge commit '8f9c381' into LokiMergeUpstream 2018-10-31 17:26:00 +11:00
doy-lee 2166a961f4 Merge commit 'a91b432' into LokiMergeUpstream 2018-10-31 17:06:48 +11:00
Riccardo Spagni 056a58d13f
Merge pull request #4536
fd62b6e7 blocks: use auto-generated .c files instead of 'LD -r -b binary' (xiphon)
2018-10-26 22:20:39 +02:00
Riccardo Spagni 557c17e206
Merge pull request #4408
341b3931 cryptonote_core: warn when the block rate deviates from expectations (moneromooo-monero)
2018-10-26 22:18:41 +02:00
doy-lee 9401c0b3b4 Fix build warning on Mingw 2018-10-24 12:00:33 +11:00
doy-lee 7375725020 Add minor whitespace/delete dead code after diffing Monero and Loki
Mostly small whitespace changes that make comparing a diff of the
entirety of Loki and Monero less noisy.
2018-10-24 11:33:48 +11:00
doy-lee 913b3a40b5 Merge commit '2287fb9' into CherryPickUnboundWindowsBuildFix 2018-10-22 15:43:00 +11:00
xiphon fd62b6e79f blocks: use auto-generated .c files instead of 'LD -r -b binary' 2018-10-22 01:12:00 +03:00
moneromooo-monero c39e0a1706
core: don't verify range proofs multiple times 2018-10-17 16:23:10 +00:00
doy-lee b9fabc269f Merge branch 'dev' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-11 13:21:23 +11:00
doy-lee e2c8660d22 Merge dev changes 2018-10-10 17:51:16 +11:00
Maxim Shishmarev 207c1fa89a Making service nodes list and quorum cop thread-safe (#285)
* Remove dependency on service node list in quorum cop

* making service node list therad-safe

* improve thread-safety of quorum cop
2018-10-10 16:24:01 +11:00
doy-lee 339f96b0cc Merge commit 'c23b6f8' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-10 15:07:16 +11:00
doy-lee c73da116ae Merge commit '4a652d6' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-10 13:48:01 +11:00
doy-lee 2d3adf003b Merge commit '7addabc' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-10 10:30:31 +11:00
doy-lee c1da4f690d Merge commit '5ffb2ff' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-09 12:31:08 +11:00
Riccardo Spagni ac5674524a
Revert "Merge pull request #4472"
This reverts commit 79d46c4d55, reversing
changes made to c9fc61dbb5.
2018-10-08 21:39:54 +02:00
doy-lee 43d75894f2 Merge commit '869b3bf' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-08 19:51:13 +11:00
doy-lee 5805b72778 Merge commit '2a8fcb421bc41eb254f95379dd73238915dd509d' into LokiMergeUpstreamUntil_20180911_e6d36c1
Begin fixing broken bulletproof tests in Loki
2018-10-08 13:34:36 +11:00
doy-lee ffcee98d37 Merge commit '126196b' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-04 15:00:37 +10:00
xiphon 02d3ef7bda blocks: use auto-generated .c files instead of 'LD -r -b binary' 2018-10-04 00:01:09 +00:00
doy-lee 4caffeff78 Merge branch 'dev' into LokiMergeUpstreamUntil_20180905_fad88e1 2018-10-01 16:48:40 +10:00
Riccardo Spagni 83d8f03c23
Merge pull request #4333
73403004 add --block-notify to monerod and --tx-notify to monero-wallet-{cli,rpc} (moneromooo-monero)
2018-09-29 22:20:44 +02:00
Doyle a71b7640d2
Service Nodes Improve Reliability & Feedback (#262)
* If unable to receive own uptime proof, switch to more granular pinging

* Uptime proof simpler solution to repeatedly ping on failure
2018-09-27 18:31:08 +10:00
doy-lee 3f85a1b716 Merge commit '89645ec' into LokiMergeUpstream20180821 2018-09-25 17:50:49 +10:00
Riccardo Spagni 0645dcdbdb
Merge pull request #4378
ac934663 rpc: add a "is an update available" flag in get_info (moneromooo-monero)
2018-09-21 20:41:53 +02:00
moneromooo-monero 341b3931ed
cryptonote_core: warn when the block rate deviates from expectations
The warning threshold is set to allow a false positive every
ten days on average.
2018-09-20 14:01:52 +00:00
doy-lee 5b9091d119 Merge commit '025187e' into LokiMergeUpstream20180821 2018-09-19 14:05:07 +10:00
moneromooo-monero be001326d1
remove obsolete daemon selection of fake outs and old tx construction 2018-09-14 10:51:45 +00:00
moneromooo-monero ac9346637a
rpc: add a "is an update available" flag in get_info
Make it easier for a user to be told when to update
2018-09-14 09:28:03 +00:00
doy-lee f8d12478c2 Merge commit '2771a18' into LokiMergeUpstream20180821 2018-09-14 15:40:55 +10:00
doy-lee ae4d7e4465 Merge commit 'a830db25775f7b708210e736154caf147ddf0ef3' into LokiMergeUpstream20180821 2018-09-13 18:42:56 +10:00
doy-lee ca464be3bd Merge commit 'ed2c81e' into LokiMergeUpstream20180821 2018-09-13 18:42:49 +10:00
moneromooo-monero 8d769392d9 replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-09-13 18:31:35 +10:00
doy-lee 0b166ffaa3 Merge branch 'dev' into LokiMergeUpstream20180821 2018-09-13 17:46:15 +10:00
jcktm 76657697ef Revert "core: fix type mismatch between function and declaration"
This reverts commit 0349e183ca.

Revert "Merge pull request #197 from Doy-lee/BlockchainPopBlocksCommand"

This reverts commit 0796630ffa, reversing
changes made to b73aa8ee1c.
2018-09-12 16:32:28 +10:00
moneromooo-monero 5ffb2ff9b7
v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +00:00
moneromooo-monero c444b1b229
require canonical multi output bulletproof layout 2018-09-11 13:37:39 +00:00
moneromooo-monero 2a8fcb421b
Bulletproof aggregated verification and tests
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11 13:37:37 +00:00
moneromooo-monero bacf0a1e2f
bulletproofs: add aggregated verification
Ported from sarang's java code
2018-09-11 13:37:32 +00:00
jcktm 0796630ffa
Merge pull request #197 from Doy-lee/BlockchainPopBlocksCommand
Blockchain pop_blocks command
2018-09-11 18:07:55 +10:00
Doyle 25292b3e86 Version 0.4.0 Release Candidate (#216)
* core: submit uptime proof immediately after registering

* Increase visibility of autostaking prompts

* quorum_cop: changed uptime proof prune timeout to 2 hours 10 minutes

* cleanup: removed scope limiting block

* check_tx_inputs: fix deregister double spend test to include deregisters from other heights

* config: new testnet network id, genesis tx, and version bump

* wallet2: fix testnet wallet blockheight approximation

* Fix change in address format in RPC which broke parsing and pooling contributors (#184)

* Fix service node endpoints for RPC to also use stdout (#185)

* fixed some further rct core tests (#180)

* Fix service node state by calling detached hooks on failure to switch to alt chain (#188)

* fixed block verification core tests (#186)

* fixed block verification core tests

* core tests: removed gen_block_miner_tx_out_is_small which is only relevant to hardfork version 1

*  Don't consider expired deregistrations when filling block template

* Add unit tests for getting staking requirement (#191)

* First service node test (#190)

* core_tests: added service node tests

* core_tests: check balance after registration tx

* Fix underflow for popping rollback events (#189)

* Move deregistration age check into check_tx_inputs

* Zero initialise rct_signatures member txnFee is a uint64_t and has uninit values

* Enforce that deregisters must be 0 fee since we skip checks

* Add unit tests for vote validation (#193)

* Add unit tests for deregistration validation (#194)

* Mainnet checkpoint 86535, testnet 3591, 4166

* Bump version number

* Add print_sr for getting staking requirement (#198)

* Misc bugfixes (#203)

* removed unnecessary cast to double during txfee+coinbase calculation

* simplewallet: increased autostaking interval from 2 minutes to 40

* Fix casting issues from uint to int (#204)

* core_tests: check service node registration and expiration (#195)

* core_tests: check service node registration and deregistration

* core_tests for service nodes:

- include service nodes rewards when calculating account's balance
- check that service nodes rewards have been received

* fixed namespace error; reduced the scope of staking requirement constants

* On blockchain inc/dec mark deregisters relayble based on age (#201)

* Service nodes restore only 1 rollback bug (#206)

* Fix restore 1 rollback event, ensure prevent rollback is always added

* Remove adding prevent_rollback event at init

It gets called in on block added generic anyway.

* Log db exception, fix relation operators for vote/deregister lifetime (#207)

* Filter relayable deregisters w/ check_tx_inputs instead of blockchain callbacks

* Bump version to 0.3.7-beta

* fix build with GCC 8.1.0 (#211)

* Add temp hardfork rule in testnet for deregister lifetimes (#210)

* Update testnet, remove testnet forks, remove checkpoints, update blockheight estimate (#212)

* Don't ban peers for a bad vote, just drop their connection (#213)

* Update to version 0.3.0 release candidate (#215)
2018-09-07 17:42:48 +10:00
Doyle T 54d91548de Merge branch 'dev' into LokiMergeUpstream 2018-09-05 12:07:29 +10:00
Doyle T 3273e02670 Add pop blocks command which is helpful for "unstucking" your chain 2018-09-04 19:38:16 +10:00
Doyle 7a39586536
Log db exception, fix relation operators for vote/deregister lifetime (#207) 2018-09-04 19:17:17 +10:00
Doyle T c9e7a68c6d Mainnet checkpoint 86535, testnet 3591, 4166 2018-08-31 13:26:25 +10:00
Maxim Shishmarev 93302c19ff First service node test (#190)
* core_tests: added service node tests

* core_tests: check balance after registration tx
2018-08-29 15:53:13 +10:00
jcktm d95d69d3c2 cleanup: removed scope limiting block 2018-08-23 16:11:59 +10:00
jcktm de78b6d5cd core: submit uptime proof immediately after registering 2018-08-22 20:47:32 +10:00
moneromooo-monero ccb0a48ca3 core: lock incoming tx lock when checking the txpool and chain
This gets rid of an innocuous race trying to add the same tx
twice to the txpool
2018-08-21 12:59:04 +10:00
moneromooo-monero e517a7c720 core: remove threadpool dependency from header 2018-08-21 12:59:04 +10:00
Doyle T b8e0a65ba5 Merge branch 'dev' into LokiMergeUpstream 2018-08-21 12:45:50 +10:00
Doyle T 1f8e81afe3 Move error logging of verfication context to one function 2018-08-20 14:21:56 +10:00
jcktm a29c3a8eb3 simplewallet: added autostaking 2018-08-17 16:21:03 +10:00
jcktm 96b395574a
Merge pull request #156 from tewinget/loki-store-service-node-data
Loki store service node data
2018-08-17 12:22:23 +10:00
Doyle T 97b4ed900b Merge commit '13d73d9' into LokiMergeUpstream 2018-08-17 11:47:44 +10:00
Doyle f3b43dd8c3 Fix assigning the last voter as the deregistration voter 7 times (#157) 2018-08-16 16:28:12 +10:00
Thomas Winget 06b6c738a7 Revert "Revert "Store Service Node State to DB as Blob (#125)" (#127)"
This reverts commit c4988f5a1f.

This un-reverts the changes to store the service node info in the
database.  This could easily just be its own commit instead of a
revert, but doing a revert is amusing (and easier in this case).
2018-08-15 23:38:06 -04:00
Doyle f55b9b1b82
Service Nodes States Endpoint (#145)
* Add get_service_node_list_state command for analytics

* Update service_node_list_state to search particular pubkey

* Service node list state sorts display results by longest waiting

* Fix up leftover todos/unused data structures

* Change get_service_node_list_state to print_sn
2018-08-15 12:59:05 +10:00
jcktm a0e6cee7fe changed invalid vote message from error to info (#136) 2018-08-13 10:51:27 +10:00
moneromooo-monero b278b83860
core: sync database based on bytes added, not blocks added
Blocks have a very wide range, whereas actual size is the relevant
quantity to consider when syncing
2018-08-12 16:13:46 +00:00
jcktm c4988f5a1f Revert "Store Service Node State to DB as Blob (#125)" (#127)
This reverts commit 591fda78f0.
2018-08-08 18:51:14 +10:00