No description
![]() * Handle epoch_2 work thresholds in most RPCs This PR is quite large with work generation and validation being a central piece of the node. In lib/config, work thresholds have been added for the beta and test network. They are now placed under a `nano::work_thresholds`. Unlike the main network, the thresholds are 2x and 1/2x from the base threshold. For tests, the previous base threshold was lowered such that the new highest difficulty (2x) is the same as before. The reason for this is that work generation targets the highest difficulty. `nano::work_validate` was renamed to `work_validate_entry`, further validation must be done by using `work_threshold_entry` and `work_threshold_full`. Work generation was changed to always require `difficulty`, except for tests. The reason is that any caller should not assume a base difficulty anymore. These RPCs now fully support the new thresholds and are ready for epoch_2 (will add some tests): - `process` validates at the minimum, entry difficulty, and handles the new `insufficient_work` result from ledger processing (used in https://github.com/nanocurrency/nano-node/pull/2667) - `send` and `account_representative_set` get the account epoch version and targets the correct difficulty - `receive` aditionally checks if the `source` epoch is higher, allowing new epoch propagation - `epoch_upgrader` These RPCs have changes to be compatible but are not yet optimal: - `block_create` now accepts an optional `difficulty`, and will generate at the highest difficulty otherwise (8x on mainnet). - `work_generate` also generates at the highest difficulty if `difficulty` is not specified, and multipliers are now off the highest difficulty. - `work_validate` validates at the highest difficulty unless `difficulty` is specified, meaning this is a breeaking change and it can return "not valid" for valid blocks. Multipliers are now off the highest difficulty. Support is also limited for active difficulty. It is currently calculated off the `epoch_1` difficulty to avoid any changes. All these cases will be handled in separate PRs, as this one is large enough as-is. * Define in source file * Fix websocket active_difficulty * Extract system::work_generate_limited * Fix debug_asserts in active_transactions::update_active_difficulty and add a test to ensure it * Add disabled test for RPC process, to be enabled in https://github.com/nanocurrency/nano-node/pull/2667 * Add auxiliary system::upgrade_genesis_epoch_2 * Set sideband block details for legacy blocks, unused for now * Higher amplitude between thresholds for the test network for easier testing * Handle work thresholds in the node wallet * Tests validating the node wallet handles thresholds * Final tests and adjustments * Fix ASSERT_NE * Add test ensuring the reduced work is also used when opening accounts previously upgraded * Ensure blocks from wallet meet the minimum difficulty * No need to change sideband for legacy, since the wallet never uses them * Enable test rpc.process_ledger_insufficient_work * Fix a couple of RPC tests being slow due to testing unrelated functionality |
||
---|---|---|
.github | ||
api/flatbuffers | ||
ci | ||
CL | ||
cmake | ||
cpptoml@5399650056 | ||
crypto | ||
docker | ||
etc | ||
flatbuffers@3b458f7a17 | ||
gtest@dea0216d0c | ||
images | ||
lmdb@c6bb7edf9f | ||
miniupnp@582375b64f | ||
nano | ||
nano-pow-server@32e7826865 | ||
util | ||
valgrind | ||
.clang-format.base | ||
.gitignore | ||
.gitlab-ci.yml | ||
.gitmodules | ||
asan_blacklist | ||
CMakeLists.txt | ||
doxygen.config | ||
Info.plist.in | ||
LICENSE | ||
logo.png | ||
Nano.icns | ||
Nano.ico | ||
Nano.rc | ||
nanocurrency-beta.spec.in | ||
nanocurrency.spec.in | ||
qt.conf | ||
README.md | ||
rep_weights_beta.bin | ||
rep_weights_live.bin | ||
resources.qrc | ||
tsan_clang_blacklist | ||
tsan_suppressions | ||
valgrind.supp |
What is Nano?
Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.
Guides & Documentation
Other documentation details can be found at https://docs.nano.org.
Links & Resources
Want to Contribute?
Please see the contributors guide.
Contact us
We want to hear about any trouble, success, delight, or pain you experience when using Nano. Let us know by filing an issue, joining us on Reddit, or joining us on Discord.