Commit graph

353 commits

Author SHA1 Message Date
Riccardo Spagni
bf0f85221b
Merge pull request #5195
a54e81e5 daemon: add '--no-sync' arg to optionally disable blockchain sync (xiphon)
2019-03-19 10:57:28 +02:00
Riccardo Spagni
848591c4d8
Merge pull request #5190
551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
2019-03-17 17:56:04 +02: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
e396146aee
default initialize rpc structures 2019-03-04 22:38:03 +00:00
Riccardo Spagni
372c0da086
Merge pull request #5111
6a3608d3 cryptonote_protocol_handler: pad tx messages when using tor/i2p (moneromooo-monero)
2019-03-04 21:24:32 +02:00
moneromooo-monero
eef164f7cc
cryptonote_protocol_handler: search for syncing peers in "cruise mode"
When all our outgoing peer slots are filled, we cycle one peer at
a time looking for syncing peers until we have at least two such
peers. This brings two advantages:

- Peers without incoming connections will find more syncing peers
that before, thereby strengthening network decentralization

- Peers will have more resistance to isolation attacks, as they
are more likely to find a "good" peer than they were before
2019-02-26 12:45:28 +00:00
xiphon
a54e81e572 daemon: add '--no-sync' arg to optionally disable blockchain sync 2019-02-25 03:22:14 +00:00
xiphon
551104fbf1 daemon: add --public-node mode, RPC port propagation over P2P 2019-02-25 02:40:23 +03: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
moneromooo-monero
2456945408
epee: add SSL support
RPC connections now have optional tranparent SSL.

An optional private key and certificate file can be passed,
using the --{rpc,daemon}-ssl-private-key and
--{rpc,daemon}-ssl-certificate options. Those have as
argument a path to a PEM format private private key and
certificate, respectively.
If not given, a temporary self signed certificate will be used.

SSL can be enabled or disabled using --{rpc}-ssl, which
accepts autodetect (default), disabled or enabled.

Access can be restricted to particular certificates using the
--rpc-ssl-allowed-certificates, which takes a list of
paths to PEM encoded certificates. This can allow a wallet to
connect to only the daemon they think they're connected to,
by forcing SSL and listing the paths to the known good
certificates.

To generate long term certificates:

openssl genrsa -out /tmp/KEY 4096
openssl req -new -key /tmp/KEY -out /tmp/REQ
openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT

/tmp/KEY is the private key, and /tmp/CERT is the certificate,
both in PEM format. /tmp/REQ can be removed. Adjust the last
command to set expiration date, etc, as needed. It doesn't
make a whole lot of sense for monero anyway, since most servers
will run with one time temporary self signed certificates anyway.

SSL support is transparent, so all communication is done on the
existing ports, with SSL autodetection. This means you can start
using an SSL daemon now, but you should not enforce SSL yet or
nothing will talk to you.
2019-02-02 20:05:33 +00:00
moneromooo-monero
6a3608d3d2
cryptonote_protocol_handler: pad tx messages when using tor/i2p 2019-01-30 23:17:45 +00:00
doy-lee
261570ac35 Merge commit '227bf14' into LokiMergeUpstream 2019-01-30 15:18:15 +11:00
doy-lee
ac4d0469bf Merge commit '4a0e4c7' into LokiMergeUpstream 2019-01-30 12:04:20 +11:00
Riccardo Spagni
31bdf7bd11
Merge pull request #4988
973403bc Adding initial support for broadcasting transactions over Tor (Lee Clagett)
2019-01-29 16:47:17 +02:00
Lee Clagett
973403bc9f Adding initial support for broadcasting transactions over Tor
- Support for ".onion" in --add-exclusive-node and --add-peer
  - Add --anonymizing-proxy for outbound Tor connections
  - Add --anonymous-inbounds for inbound Tor connections
  - Support for sharing ".onion" addresses over Tor connections
  - Support for broadcasting transactions received over RPC exclusively
    over Tor (else broadcast over public IP when Tor not enabled).
2019-01-28 23:56:33 +00:00
moneromooo-monero
dc0b86ab4b
block_queue: fix late sanity check off by one 2019-01-28 22:17:43 +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
074ed7680f Merge commit '3e9bb96' into LokiMergeUpstream 2019-01-18 10:35:18 +11:00
doy-lee
8d22d47d69 Merge commit 'b67eb48' into LokiMergeUpstream 2019-01-17 17:41:10 +11:00
Riccardo Spagni
3e9bb9626a
Merge pull request #5001
a5ffc2d5 Remove boost::lexical_cast for uuid and unused uuid function (Lee Clagett)
2019-01-16 19:27:13 +02:00
Riccardo Spagni
846362842c
Merge pull request #4976
85665003 epee: better network buffer data structure (moneromooo-monero)
2019-01-16 19:04:22 +02:00
doy-lee
7464673c64 Merge branch 'dev' into LokiMergeUpstream 2019-01-07 11:56:23 +11:00
Riccardo Spagni
13b006137c
Merge pull request #4949
5464725a protocol: change standby mode to not wait sleeping (moneromooo-monero)
85807dfb add a once_a_time_milliseconds class (moneromooo-monero)
2019-01-06 20:37:51 +02:00
moneromooo-monero
85665003a7
epee: better network buffer data structure
avoids pointless allocs and memcpy
2018-12-23 16:46:07 +00:00
Lee Clagett
a5ffc2d5ad Remove boost::lexical_cast for uuid and unused uuid function 2018-12-23 11:11:30 +00: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
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
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
moneromooo-monero
5464725a29
protocol: change standby mode to not wait sleeping 2018-12-07 12:53:11 +00:00
Riccardo Spagni
5ed45acaec
Merge pull request #4906
506472e0 protocol: fix use after free when dropping a connection (moneromooo-monero)
2018-12-04 17:33:53 +02:00
Riccardo Spagni
868630c1db
Merge pull request #4877
c25260f5 protocol: fix incorrect tx hash in log (moneromooo-monero)
2018-12-04 17:16:52 +02:00
moneromooo-monero
506472e0c6
protocol: fix use after free when dropping a connection 2018-11-26 17:19:25 +00:00
moneromooo-monero
c25260f51c
protocol: fix incorrect tx hash in log 2018-11-20 18:35:58 +00:00
Martijn Otto
bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01: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
5617593905 Merge commit '0722287' into LokiMergeUpstream20180821 2018-09-28 16:44:46 +10:00
doy-lee
3f85a1b716 Merge commit '89645ec' into LokiMergeUpstream20180821 2018-09-25 17:50:49 +10:00
doy-lee
35f5a94753 Merge commit '88369c6' into LokiMergeUpstream20180821 2018-09-20 12:07:32 +10:00
doy-lee
ca464be3bd Merge commit 'ed2c81e' into LokiMergeUpstream20180821 2018-09-13 18:42:49 +10:00
doy-lee
0b166ffaa3 Merge branch 'dev' into LokiMergeUpstream20180821 2018-09-13 17:46:15 +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
luigi1111
46d8bc2a33
Merge pull request #4160
704b60c block_queue: faster check whether a block was requested (moneromooo-monero)
2018-09-04 13:02:09 -05:00
luigi1111
0d415ff638
Merge pull request #4207
ce9457a cryptonote_protocol: don't serialize an unneeded new block message (moneromooo-monero)
2018-08-22 20:45:09 -05:00
Doyle T
de8c58204d Merge commit '31f47d7' into LokiMergeUpstream 2018-08-21 15:08:21 +10:00
jcktm
96097f6710 Update cryptonote_protocol_handler.inl (#174)
* Update cryptonote_protocol_handler.inl

Fixed incorrect "Your node is X days behind" when syncing Daemon.

* Remove bogus v2 code, alter diff to abs_diff

Should fix the "Your node is 0 days behind" when synchronising.
2018-08-20 17:14:06 +10:00
luigi1111
4745e3be22
Merge pull request #4020
c24a0af [monerod] Added blocks remaining count during syncronisation. (Jorropo)
2018-08-15 17:03:35 -05:00
moneromooo-monero
ce9457a379
cryptonote_protocol: don't serialize an unneeded new block message
Non fluffy block nodes should now be very rare
2018-08-09 14:45:31 +00:00
jcktm
ace26fc0cd quorum_cop: added quorum cop and service node keys to lokid
Submit deregistration autonomously, prune uptime_proofs

Move pruner to relayer, fix inf. loop, quorum participation bool return

find_if, fix reorg logic, make 2hrs check a variable

Add iterator assign on erase, adjust detached check

qacop: review iteration, changed warnings and std::find call

Accept proofs excluding the added time buffer
2018-08-02 18:58:19 +10:00
Jorropo
c24a0af9f1 [monerod] Added blocks remaining count during syncronisation.
And percent if usefull (% < 99)
2018-07-25 10:16:01 +02:00
moneromooo-monero
704b60caf0
block_queue: faster check whether a block was requested 2018-07-20 16:05:56 +01:00
Doyle
fb66b7e00b Service Node Deregister Part 5 (#89)
* Retrieve quorum list from height, reviewed

* Setup data structures for de/register TX

* Submit and validate partial/full deregisters

* Add P2P relaying of partial deregistration votes

* Code review adjustments for deregistration part 1

 - Fix check_tx_semantic
 - Remove signature_pod as votes are now stored as blobs. Serialization
   overrides don't intefere with crypto::signature anymore.

* deregistration_vote_pool - changed sign/verify interface and removed repeated code

* Misc review, fix sign/verify api, vote threshold

* Deregister/tx edge case handling for combinatoric votes

* core, service_node_list: separated address from service node pubkey

* Retrieve quorum list from height, reviewed

* Setup data structures for de/register TX

* Submit and validate partial/full deregisters

* Add P2P relaying of partial deregistration votes

* Code review adjustments for deregistration part 1

 - Fix check_tx_semantic
 - Remove signature_pod as votes are now stored as blobs. Serialization
   overrides don't intefere with crypto::signature anymore.

* deregistration_vote_pool - changed sign/verify interface and removed repeated code

* Misc review, fix sign/verify api, vote threshold

* Deregister/tx edge case handling for combinatoric votes

* Store service node lists for the duration of deregister lifetimes

* Quorum min/max bug, sort node list, fix node to test list

* Change quorum to store acc pub address, fix oob bug

* Code review for expiring votes, acc keys to pub_key, improve err msgs

* Add early out for is_deregistration_tx and protect against quorum changes

* Remove debug code, fix segfault

* Remove irrelevant check for tx v3 in blockchain, fix >= height for pruning quorum states

Incorrect assumption that a transaction can be kept in the chain if it could
eventually become invalid, because if it were the chain would be split and
eventually these transaction would be dropped. But also that we should not
override the pre-existing logic which handles this case anyway.
2018-07-18 12:42:47 +10:00
luigi1111
a844844cda
Merge pull request #3716
a2b557f 6795bd0 209ec96 ed2c81e a830db2 57ea902 31a895e ba8331c f7f1917 41be339 f025ae9 ef2cb63 dcfd299 5d3e702 2704624 2771a18 0e4c7d0 (moneromooo-monero)
2018-06-27 15:33:01 -05:00
moneromooo-monero
ed2c81ed95
replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-06-26 22:14:21 +01:00
moneromooo-monero
1789b76b5d
cryptonote_protocol_handler: log when dropping a peer 2018-06-09 19:27:21 +01:00
jcktm
f0740b9a5e Merge remote-tracking branch 'monero/master' into dev 2018-06-08 16:40:07 +10:00
moneromooo-monero
f2cb56a2eb
protocol: drop (and increase fails) if most blocks hashes are invalid 2018-06-03 17:34:08 +01:00
moneromooo-monero
e942d34d54
protocol: do not switch to unsafe sync mode for just a few blocks 2018-05-28 14:36:12 +01:00
jcktm
956263a936 Merge remote-tracking branch 'monero/master' into merge-upstream-changes 2018-05-01 12:26:17 +10:00
Riccardo Spagni
6b9d9f56a1
Merge pull request #3719
3880bf39 cryptonote_protocol_handler.inl: remove span read just now that failed to pass some basic tests (stoffu)
da249fd5 cryptonote_protocol_handler.inl: fix return type mismatches (int vs bool) (stoffu)
2018-04-29 21:38:22 +02:00
KeeJef
50747482d4
Merge pull request #34 from jcktm/lwma
merged in efe03eb0379d87d521f6fc86cef39ec06c119f41 - added LWMA
2018-04-28 18:51:34 +10:00
jcktm, wowrio, jagerman
594a7f569c merged in efe03eb0379d87d521f6fc86cef39ec06c119f41 - added LWMA
merged in 5b349daf08993c694ff9a05022dee432852832a2 - timestamps median mitigation
2018-04-28 18:12:31 +10:00
stoffu
3880bf396a
cryptonote_protocol_handler.inl: remove span read just now that failed to pass some basic tests 2018-04-28 11:10:59 +09:00
stoffu
da249fd5ba
cryptonote_protocol_handler.inl: fix return type mismatches (int vs bool) 2018-04-28 11:07:51 +09:00
Doyle T
808c07768c Update cmakelists and misc refs to Loki 2018-04-25 16:13:38 +10:00
Thaer Khawaja
dad1077577 Only log an error if fork version is higher AND is not known. 2018-04-22 17:26:44 -07:00
Doyle T
161eda3fd1 First pass Monero to Loki refs 2018-04-10 14:49:20 +10:00
Dimitris Apostolou
57c0b1ed9f Fix typos in various files 2018-03-15 18:25:38 +02:00
Riccardo Spagni
4f93f74528
Merge pull request #3277
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu)
af773211 Stagenet (stoffu)
cc9a0bee command_line: allow args to depend on more than one args (stoffu)
55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu)
450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu)
9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05 19:11:20 +02:00
Edward Betts
fbcc91c2a4 Correct spelling mistakes. 2018-03-05 17:00:40 +00:00
stoffu
af773211cb
Stagenet 2018-03-05 11:55:05 +09:00
Riccardo Spagni
ef47ba95c8
Merge pull request #3229
928c1825 cryptonote_protocol: guard against all threads in standby (moneromooo-monero)
2018-02-16 14:23:53 +01:00
Riccardo Spagni
bdf0339dda
Merge pull request #3181
e3f0980a daemon: don't drop RPC with busy error when running offline (moneromooo-monero)
2018-02-16 14:19:54 +01:00
moneromooo-monero
928c1825f0
cryptonote_protocol: guard against all threads in standby 2018-02-02 22:33:53 +00:00
Riccardo Spagni
4fcf609942
Merge pull request #3186
7ed62e63 cryptonote_protocol: fix std::move usage on different types (moneromooo-monero)
2018-01-28 09:54:17 -08:00
xmr-eric
84a7f6a482 Readd copyright starting date 2018-01-26 10:03:20 -05:00
xmr-eric
18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
moneromooo-monero
7ed62e63e5
cryptonote_protocol: fix std::move usage on different types 2018-01-26 10:13:06 +00:00
Riccardo Spagni
d25217f058
Merge pull request #3105
b56f4645 cryptonote_protocol: fix size_t used in wire format (moneromooo-monero)
2018-01-25 16:50:18 -08:00
Riccardo Spagni
5a312752af
Merge pull request #3040
69f9a075 cryptonote_protocol: fix missing space in version mismatch message (moneromooo-monero)
2018-01-25 16:44:51 -08:00
Riccardo Spagni
75cbb7719e
Merge pull request #3015
f06603a4 cryptonote_protocol: update target height when receiving blocks (moneromooo-monero)
2018-01-25 16:39:16 -08:00
moneromooo-monero
e3f0980a1d
daemon: don't drop RPC with busy error when running offline 2018-01-25 13:35:58 +00:00
moneromooo-monero
b56f46457c
cryptonote_protocol: fix size_t used in wire format
This is 32 bits on 32 bit platforms, but 64 bits on 64 bit platforms.
2018-01-11 17:31:47 +00:00
Riccardo Spagni
0b5994fbec
Merge pull request #3004
a2c845c7 cryptonote_protocol: internal error consistency size check (moneromooo-monero)
2018-01-10 11:54:23 +01:00
moneromooo-monero
69f9a07553
cryptonote_protocol: fix missing space in version mismatch message 2017-12-31 17:32:57 +00:00
moneromooo-monero
f06603a439
cryptonote_protocol: update target height when receiving blocks 2017-12-27 13:54:19 +00:00
moneromooo-monero
a2c845c7e3
cryptonote_protocol: internal error consistency size check 2017-12-24 13:04:40 +00:00
moneromooo-monero
b51dc56687
use const refs in for loops for non tiny types 2017-12-18 15:15:54 +00:00
moneromooo-monero
45a1c4c088
add empty container sanity checks when using front() and back() 2017-12-18 15:15:40 +00:00
moneromooo-monero
46d6fa35c9
cryptonote_protocol: sanity check chain hashes from peer 2017-12-18 15:15:07 +00:00
moneromooo-monero
25584f8639
cryptonote_protocol: print peer versions when unexpected
also avoid integer underflow on zero height
2017-12-18 15:15:05 +00:00
Riccardo Spagni
066fd7aced
Merge pull request #2877
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero)
bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero)
4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
2017-12-17 12:59:44 +02:00
moneromooo-monero
bb89ae8b20
move connection_basic and network_throttle from src/p2p to epee
These even had the epee namespace.
This fixes some ugly circular dependencies.
2017-12-16 23:28:43 +00:00
moneromooo-monero
4abf25f3c9
cryptonote_core does not depend on p2p anymore
As a followon side effect, this makes a lot of inline code
included only in particular cpp files (and instanciated
when necessary.
2017-12-16 23:28:38 +00:00
moneromooo-monero
09ce03d612
move includes around to lessen overall load 2017-12-16 22:46:38 +00:00
Riccardo Spagni
9b511d3e93
Merge pull request #2866
cf5f6236 Corrections in rate limiting / trottle code, especially in 'out' direction (rbrunner7)
2017-12-16 23:24:41 +02:00
moneromooo-monero
b927f0b17e
cryptonote_protocol: fix corner case looping asking for same block hashes 2017-12-03 13:05:10 +00:00
rbrunner7
cf5f623616 Corrections in rate limiting / trottle code, especially in 'out' direction
Deleted 3 out of 4 calls to method connection_basic::sleep_before_packet
that were erroneous / superfluous, which enabled the elimination of a
"fudge" factor of 2.1 in connection_basic::set_rate_up_limit;
also ended the multiplying of limit values and numbers of bytes
transferred by 1024 before handing them over to the global throttle
objects
2017-11-28 21:18:01 +01:00
moneromooo-monero
310b790a64
make connection_id a string in RPC
It's sent as JSON, so raw binary is not appropriate
2017-11-18 00:13:07 +00:00
moneromooo-monero
383ff4f689
remove "using namespace std" from headers
It's nasty, and actually breaks on Solaris, where if.h fails to
build due to:

  struct map *if_memmap;
2017-11-14 16:56:10 +00:00
moneromooo-monero
1ff638e927
protocol: drop connections which don't handshake after some time 2017-10-22 19:45:30 +01:00
Vasil Dimov
4d35ad7603
Fix compiler warnings with Clang 6.0.0.
monero/src/cryptonote_protocol/block_queue.cpp:208:44: error:
      suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
  static const boost::uuids::uuid uuid0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           {                                          }

monero/src/wallet/wallet_rpc_server.cpp:1895:43: error:
      lambda capture 'wal' is not used [-Werror,-Wunused-lambda-capture]
  tools::signal_handler::install([&wrpc, &wal](int) {
                                          ^

monero/src/cryptonote_protocol/cryptonote_protocol_handler.inl:1616:40: error:
      lambda capture 'arg' is not used [-Werror,-Wunused-lambda-capture]
    m_p2p->for_each_connection([this, &arg, &fluffy_arg, &exclude_context, &fullConnections...
                                       ^

monero/src/cryptonote_protocol/cryptonote_protocol_handler.inl:1616:46: error:
      lambda capture 'fluffy_arg' is not used [-Werror,-Wunused-lambda-capture]
    m_p2p->for_each_connection([this, &arg, &fluffy_arg, &exclude_context, &fullConnections...
                                             ^

monero/src/blockchain_utilities/blockchain_export.cpp:181:3: error:
      bool literal returned from 'main' [-Werror,-Wmain]
  CHECK_AND_ASSERT_MES(r, false, "Failed to initialize source blockchain storage");
  ^                       ~~~~~
monero/contrib/epee/include/misc_log_ex.h:180:97: note:
      expanded from macro 'CHECK_AND_ASSERT_MES'
  ...fail_ret_val, message)   do{if(!(expr)) {LOG_ERROR(message); return fail_ret_val;};}while(0)
                                                                  ^      ~~~~~~~~~~~~
monero/src/blockchain_utilities/blockchain_export.cpp:195:3: error:
      bool literal returned from 'main' [-Werror,-Wmain]
  CHECK_AND_ASSERT_MES(r, false, "Failed to export blockchain raw data");
  ^                       ~~~~~
monero/contrib/epee/include/misc_log_ex.h:180:97: note:
      expanded from macro 'CHECK_AND_ASSERT_MES'
  ...fail_ret_val, message)   do{if(!(expr)) {LOG_ERROR(message); return fail_ret_val;};}while(0)
                                                                  ^      ~~~~~~~~~~~~
2017-10-15 22:02:24 +03:00
Riccardo Spagni
d5ab55b8d7
Merge pull request #2604
0a872798 protocol: kick idle peers by dropping them (moneromooo-monero)
2017-10-15 18:50:32 +02:00
Riccardo Spagni
1e577e8fbf
Merge pull request #2571
8028dde7 block_queue: use boost::uuids::nil_uuid where appropriate (moneromooo-monero)
2017-10-15 18:34:26 +02:00
Riccardo Spagni
5ea20d6944
Merge pull request #2469
7adceee6 precomputed block hashes are now in blocks of N (currently 256) (moneromooo-monero)
2017-10-15 17:23:50 +02:00
moneromooo-monero
0a872798bc
protocol: kick idle peers by dropping them
This is safer, as we don't risk break expectations (eg, requesting
block hashes and then receiving a late set of blocks). Dropping a
connection means another will be attempted in a fresh state.

Also bump the kick timeout to 5 minutes, to ensure we only kick
really idle peers.
2017-10-07 20:29:11 +01:00
moneromooo-monero
8028dde7a6
block_queue: use boost::uuids::nil_uuid where appropriate 2017-10-03 11:55:45 +01:00
moneromooo-monero
5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
Riccardo Spagni
74c4f1a563
Merge pull request #2460
3487d810 cryptonote_protocol: fix needless chain hashes downloads (moneromooo-monero)
2017-09-25 17:01:53 +02:00
Riccardo Spagni
13be8115e4
Merge pull request #2458
7f2f6ee1 protocol: remove hop count on block propagation (moneromooo-monero)
2017-09-25 17:00:47 +02:00
stoffu
e29282d208
build: auto update version info without manually deleting version.h 2017-09-21 07:47:37 +09:00
moneromooo-monero
7adceee634
precomputed block hashes are now in blocks of N (currently 256)
This shaves a lot of space off binaries
2017-09-18 16:29:00 +01:00
moneromooo-monero
3487d81034
cryptonote_protocol: fix needless chain hashes downloads
The last known hash was calculated incorrectly, causing
further chain hash downloads to restart from the current
chain. When the block queue has close to 10k blocks waiting,
this causes frequent downloads of 10k more hashes, but
with only the last few hashes actually being useful.
2017-09-17 14:13:59 +01:00
moneromooo-monero
7f2f6ee1c9
protocol: remove hop count on block propagation
It is unused, as it was apparently a future optimization,
and it leaks some information (though since pools publish
thei blocks they find, that amount seems small).
2017-09-17 10:26:12 +01:00
moneromooo-monero
6ac61100a1
Add a --fluffy-blocks option to relay blocks as fluffy blocks
Defaults to off, but fluffy blocks are forced enabled on testnet
2017-09-03 11:11:11 +01:00
Riccardo Spagni
1e57e48342
Merge pull request #2372
c867357a cryptonote_protocol: error handling on cleanup_handle_incoming_blocks (moneromooo-monero)
ce901fcb Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks (moneromooo-monero)
84fa015e core: guard against exceptions in handle_incoming_{block,tx} (moneromooo-monero)
2017-09-02 11:30:57 +02:00
moneromooo-monero
c867357adc
cryptonote_protocol: error handling on cleanup_handle_incoming_blocks 2017-08-29 16:11:39 +01:00
moneromooo-monero
63d8dddc0a
cryptonote_protocol: remove old spans when received as old blocks
fixes getting those in a loop
2017-08-28 00:42:58 +01:00
Riccardo Spagni
36b978f50e
Merge pull request #2314
c22d22e2 Cleanup test impact of adding safesyncmode() method (Howard Chu)
9a859844 Toggle SAFE syncmode on and off automatically (Howard Chu)
2017-08-26 23:43:22 +02:00
moneromooo-monero
df0cffede0
cryptonote_protocol: warn if we see a higher top version we expect 2017-08-23 13:38:18 +01:00
moneromooo-monero
317ab21a03
cryptonote_protocol: less strict check on top version on connect
This allows peers who synced past a fork on the wrong height
to reorg to the right chain after they updated their software
to include the new version.
2017-08-23 13:38:15 +01:00
moneromooo-monero
cc81a37155
cryptonote_protocol: update target height when syncing too 2017-08-23 13:38:13 +01:00
moneromooo-monero
e2ad372b87
cryptonote_protocol: simplify and remove unnecessary casts 2017-08-23 13:38:10 +01:00
moneromooo-monero
727e67cada
cryptonote_protocol: print peer top height along with its version 2017-08-23 13:38:06 +01:00
Howard Chu
c22d22e2db
Cleanup test impact of adding safesyncmode() method 2017-08-22 15:11:09 +01:00
moneromooo-monero
70b8c6d77a
cryptonote_protocol: misc fixes to the new sync algorithm
Fix sync wedge corner case:
It could happen if a connection went into standby mode, while
it was the one which had requested the next span, and that span
was still waiting for the data, and that peer is not on the
main chain. Other peers can then start asking for that data
again and again, but never get it as only that forked peer does.

And various other fixes
2017-08-21 21:57:19 +01:00
Howard Chu
9a859844f4
Toggle SAFE syncmode on and off automatically
If monerod is started with default sync mode, set it to SAFE after
synchronization completes. Set it back to FAST if synchronization
restarts (e.g. because another peer has a longer blockchain).

If monerod is started with an explicit sync mode, none of this
automation takes effect.
2017-08-20 16:30:28 +01:00
Riccardo Spagni
4466b6d1b0
Merge pull request #2303
5a283078 cryptonote_protocol: large block sync size before v4 (moneromooo-monero)
7b747607 cryptonote_protocol: kick idle synchronizing peers (moneromooo-monero)
2017-08-17 21:39:44 +02:00
Riccardo Spagni
4859a00134
Merge pull request #2300
42b34b35 Consistently print peer id in hex and on 16 chars (moneromooo-monero)
2017-08-17 21:36:15 +02:00
Riccardo Spagni
1d32a5a445
Merge pull request #2291
b59cd074 befor -> before (Nano Akron)
2017-08-17 21:35:48 +02:00
moneromooo-monero
5a283078ec
cryptonote_protocol: large block sync size before v4 2017-08-17 13:11:52 +01:00
moneromooo-monero
7b74760756
cryptonote_protocol: kick idle synchronizing peers
In case they dropped off downloading for any reason, they'll get
sent to download again.
2017-08-16 22:24:50 +01:00
moneromooo-monero
42b34b3545
Consistently print peer id in hex and on 16 chars 2017-08-16 10:56:55 +01:00
Nano Akron
b59cd0745b befor -> before
Really unique yet consistent spelling mistake
2017-08-15 23:23:26 +01:00
moneromooo-monero
827afcb7ea
protocol: pass blockchain cumulative difficulty when syncing
Not used yet.
2017-08-15 21:03:37 +01:00
Riccardo Spagni
53dde37ceb
Merge pull request #2276
a1891ebe tests: fix tests build (moneromooo-monero)
2017-08-15 20:53:41 +02:00
Riccardo Spagni
86cf8cac86
Merge pull request #2275
88e83f94 cryptonote_protocol_handler: log versions as unsigned ints (moneromooo-monero)
2017-08-15 20:53:08 +02:00
Riccardo Spagni
1d093eff67
Merge pull request #2273
0e8d60c0 cryptonote_protocol: fix recv/send idle time before handshake (moneromooo-monero)
2017-08-15 20:51:50 +02:00
Riccardo Spagni
e0df740bc9
Merge pull request #2272
f90bbe2a cryptonote_protocol: keep target in sync with dropped connections (moneromooo-monero)
2017-08-15 20:51:35 +02:00
moneromooo-monero
35e01a6e50
cryptonote_protocol: fix "holes" in block download schedule 2017-08-15 17:49:06 +01:00
moneromooo-monero
3da1edfde5
cryptonote_protocol: fix out of order addition
This was broken by the reorg fix, since we now have to add blocks
regardless of their starting height. We now check whether we know
the parent for the first block in the next span, or whether it was
requested. If neither, it's an orphan. If it is not known, but was
requested, we wait to get that block.
2017-08-15 16:54:08 +01:00
moneromooo-monero
6edb1b3e46
block_queue: do not add empty spans 2017-08-15 11:38:59 +01:00
moneromooo-monero
2ec15a6931
daemon: print peers' top height in sync_info 2017-08-12 20:36:31 +01:00
moneromooo-monero
88e83f9427
cryptonote_protocol_handler: log versions as unsigned ints
They're interpreted as characters otherwise
2017-08-12 11:57:05 +01:00
moneromooo-monero
08abb670e1
protocol: fix reorgs while syncing 2017-08-12 11:22:42 +01:00
moneromooo-monero
a1891ebea9
tests: fix tests build
Add get_fork_version and add_ideal_fork_version to core so
cryptonote_protocol does not have to need the Blockchain
class directly, as it's not in its dependencies, and add
those to the fake core classes in tests too.
2017-08-10 11:12:56 +01:00