Commit Graph

309 Commits

Author SHA1 Message Date
moneromooo-monero 34884a4b00 store outPk/8 in the tx for speed
It avoids dividing by 8 when deserializing a tx, which is a slow
operation, and multiplies by 8 when verifying and extracing the
amount, which is much faster as well as less frequent
2021-08-30 00:18:45 +03:00
moneromooo-monero ce6db7db63 plug bulletproofs plus into consensus 2021-08-30 00:17:37 +03:00
wowario 30a41c2ab1 vote by block 2021-08-30 00:06:35 +03:00
wowario 118cbd043a adjust difficulty_blocks_count 2021-08-30 00:05:15 +03:00
wowario 87a375b3ff set testnet 2021-08-30 00:04:42 +03:00
wowario 7f7d697f43 miner block header signing 2021-08-30 00:04:17 +03:00
wowario 3898c1c4d9 reset, revert difficulty algorithm, set fork height 2021-08-30 00:04:06 +03:00
wowario f6e95d080d tidy up miner msgs 2021-08-30 00:03:54 +03:00
wowario e1ff02c1c5 support old BP 2021-08-30 00:00:54 +03:00
wowario 952b0492d9 initial commit 2021-08-29 23:56:47 +03:00
anon ceb8e7c508
cmake: fix undefined symbols and multiple definitions 2021-07-13 08:01:23 +02:00
anon 21ab1de89f
cryptonote_protocol_handler: fix race condition 2021-03-22 19:42:45 +00:00
Lee Clagett ba3c627c57 Command max_bytes moved from dynamic map to static switch 2020-12-23 23:53:27 +00:00
moneromooo-monero 3c7eec152c
add a max levin packet size by command type 2021-01-03 14:07:58 +00:00
Lee Clagett 7d67a2dde0 Add aggressive restrictions to pre-handshake p2p buffer limit 2020-12-29 19:58:53 -05:00
moneromooo-monero 0443cccb5d
cryptonote_basic: guess what got lost porting patches to branches again 2020-12-26 23:44:34 +00:00
moneromooo-monero adcbcd8f8b
protocol: drop nodes if they claim new data but only give stale data
Some joker is spending time actually doing this
2020-12-25 20:31:23 +00:00
moneromooo b6b2c9b8e8
protocol: stricter checks on received chain hash list 2020-12-11 18:47:28 +00:00
moneromooo ce26c5b2dd
protocol: drop peers that don't reply to queries 2020-12-06 15:57:23 +00:00
moneromooo 1382b17aa1
protocol: add scoring system to drop peers that don't behave 2020-12-04 01:55:01 +00:00
Riccardo Spagni aefa7740c3
Merge pull request #6111
d20ff4f64 functional_tests: add a large (many randomx epochs) p2p reorg test (moneromooo-monero)
6a0b3b1f8 functional_tests: add randomx tests (moneromooo-monero)
9d42649d5 core: fix mining from a block that's not the current top (moneromooo-monero)
2020-09-06 15:49:37 +02:00
moneromooo-monero 9d42649d58
core: fix mining from a block that's not the current top 2020-08-27 15:13:00 +00:00
moneromooo-monero 82ee01699c
Integrate CLSAGs into monero
They are allowed from v12, and MLSAGs are rejected from v13.
2020-08-27 12:44:04 +00:00
Alexander Blair bad5d8d6f0
Merge pull request #6690
7175dcb10 replace most boost serialization with existing monero serialization (moneromooo-monero)
2020-08-27 02:54:30 -07:00
Alexander Blair 38914fe6fa
Merge pull request #6613
55363c594 Avoid some temporary strings when reading off the database (moneromooo-monero)
2020-08-27 02:52:59 -07:00
Alexander Blair a6f1fa0194
Merge pull request #6607
eb1b321fe miner: increase min/max intervals to full extents (moneromooo-monero)
2020-08-26 12:53:09 -07:00
luigi1111 765db1ae7a
Revert "Use domain-separated ChaCha20 for in-memory key encryption"
This reverts commit 921dd8dde5.
2020-08-17 14:08:59 -05:00
moneromooo-monero 7175dcb107
replace most boost serialization with existing monero serialization
This reduces the attack surface for data that can come from
malicious sources (exported output and key images, multisig
transactions...) since the monero serialization is already
exposed to the outside, and the boost lib we were using had
a few known crashers.

For interoperability, a new load-deprecated-formats wallet
setting is added (off by default). This allows loading boost
format data if there is no alternative. It will likely go
at some point, along with the ability to load those.

Notably, the peer lists file still uses the boost serialization
code, as the data it stores is define in epee, while the new
serialization code is in monero, and migrating it was fairly
hairy. Since this file is local and not obtained from anyone
else, the marginal risk is minimal, but it could be migrated
later if needed.

Some tests and tools also do, this will stay as is for now.
2020-08-17 16:23:58 +00:00
moneromooo-monero 55363c5941
Avoid some temporary strings when reading off the database 2020-08-17 14:02:27 +00:00
Alexander Blair 6d29ee6c52
Merge pull request #6493
921dd8dde Use domain-separated ChaCha20 for in-memory key encryption (Sarang Noether)
2020-08-16 12:39:59 -07:00
Sarang Noether 921dd8dde5 Use domain-separated ChaCha20 for in-memory key encryption 2020-08-09 19:11:54 -04:00
moneromooo-monero eb1b321fe2
miner: increase min/max intervals to full extents
This prevents setting target to, eg, 65 being ignored

and remove an unused constant
2020-05-31 12:36:47 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 483e5cab5c
Merge pull request #6472
2efbd5f cryptonote: fix reuse of non default tx data when relaying (moneromooo-monero)
2020-05-06 00:25:18 -05:00
Lee Clagett e5214a2ca2 Adding ZMQ/Pub support for txpool_add and chain_main events 2020-05-04 02:06:35 +00:00
luigi1111 443f5c6bda
Merge pull request #6436
688a3e8 Add timelock verification on device (cslashm)
2020-05-01 15:20:05 -05:00
moneromooo-monero 2efbd5f0cc
cryptonote: fix reuse of non default tx data when relaying
An automatic tx variable is initialized properly on the first
run through the loop, but not the second. Moving the variable
inside the loop ensures the ctor is called again to init it.
2020-04-22 16:50:20 +00:00
cslashm 688a3e87e7 Add timelock verification on device 2020-04-08 11:12:32 +02:00
Lee Clagett 02d887c2e5 Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
  - Stem loops detected in tx_pool.cpp
  - Embargo timeout for a blackhole attack during stem phase
2020-03-26 15:01:30 +00:00
luigi1111 081d49c59f
Merge pull request #6338
80d5320 Hash domain separation (SarangNoether)
2020-04-04 12:44:45 -05:00
Sarang Noether 80d5320fff Hash domain separation 2020-04-01 08:31:00 -04:00
xiphon 6d6af701ec cryptonote_basic: drop unused verification_context::m_not_rct field 2020-03-31 21:58:25 +00:00
Aaron Hook aa93e38862 p2p: remove old debug commands 2020-03-20 22:09:44 -07:00
Alexander Blair 4371ac4265
Merge pull request #6225
987c3139 print_coinbase_tx_sum now supports 128 bits sums (moneromooo-monero)
2020-02-28 19:48:11 -08:00
moneromooo-monero c2095fc27b
miner: use verification mode for low diff one block nonce searches
This avoids lengthy init times when testing
2020-02-06 14:27:10 +00:00
moneromooo-monero 987c3139dc
print_coinbase_tx_sum now supports 128 bits sums
The tail emission will bring the total above 64 bits
2019-12-12 01:56:59 +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
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
luigi1111 bb2bcf3521
Merge pull request #5972
9447e72 cryptonote: add function to get weight from a pruned tx (moneromooo-monero)
2019-10-22 10:52:14 -05:00
luigi1111 84ce43a239
Merge pull request #5966
be82c40 Support median block size > 4 GB (moneromooo-monero)
2019-10-22 10:08:32 -05:00