Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add started_elections topic to websockets #3851

Merged
merged 37 commits into from
Jul 11, 2022

Conversation

gr0vity-dev
Copy link
Contributor

This PR adds a new topic "started_elections" to websockets.

  • add observers.active_started for started elections

  • Update tests

nano/core_test/websocket.cpp Outdated Show resolved Hide resolved
nano/core_test/websocket.cpp Outdated Show resolved Hide resolved
nano/core_test/websocket.cpp Outdated Show resolved Hide resolved
Russel Waters and others added 25 commits July 9, 2022 12:45
rpm build image, and signing container

rpm build updates
* confirmation_height_clear cli account param

* Add back missing password option

* Improve the error/help messages to the required account option

- Improve the error message to say the account can be 'all'
- Improve the confirmation_height_clear help message to inform the value
'all' can be passed to clear all accounts

Co-authored-by: Thiago Silva <thiago@nano.org>
* Remove unused Travis CI script
* Removes deploy-docker.sh as it is unused
* Replacing mention to Travis to CI instead
… reached. This prevents the unchecked table size from increasing beyond reasonable bounds when it's in sync.

# Conflicts:
#	nano/node/blockprocessor.cpp
# Conflicts:
#	nano/secure/store/unchecked_store_partial.hpp
The network bytes (magic bytes), the first 2 byts of the header, were not
correctly checked. They were checked in the network class inbound function
but that function is called for realtime messages after the handshake is
completed. It is not called for bootstrap messages not handshake messages.

Also the version checking was not done properly so I am doing it now
properly immediately after the magic bytes tests.

The checks are done at the following 3 places:
* nano::bootstrap_server::receive_header_action
* nano::transport::tcp_channels::start_tcp_receive_node_id
* nano::message_parser::deserialize_buffer

The last one is likely only used by UDP and test scripts that use UDP.
So we should be able to remove the last one when we remove the UDP code.

# Conflicts:
#	nano/core_test/network.cpp
…y#142)

- Limit the vote_processor::flush_active()
- The is_active var became useless, also moved the lock position
- Move the condition.notify_all() up
- Improve function flush documentation
- Test normal behavior is getting more votes than processing
- Also updated the invalid_signature test to ASSERT_TIMELY since it
should wait for a flush to happen.
- Also removed the lock for reading total_processed atomic
variable
- Explicitly check for timeout in unit test vote_processor.overflow
- Vote processor: clear votes and notify condition variable on thread
exit

In theory the vote processor can be stopped and have votes left in its
queue which would just be strange and a potential source of problems.

Also, a final kick of the condition variable is needed on thread exit
and after vote clearing.

- Check for confirm req loop blocking too long on vote process flush

This has been a problem in the past and it is always tricky to do flush
operations, so it is prudent to add a check for timeout here and display
a warning in release and throw an assert in debug builds.

- Use std::memory_order_relaxed in vote processor::flush for
total_processed

There is no need to take a memory barrier when reading the atomic
total_processed, so use relaxed memory order.

Co-Authored-By: Dimitrios Siganos <dimitris@siganos.org>

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
# Conflicts:
#	nano/core_test/vote_processor.cpp
* Remove unused `previous_balance` field and unnecessary ledger lookup

* Add a new hinted election behavior

* Adjust time to live for hinted elections

* Reenable inactive vote cache with more aggressive threshold (big thanks to @trashman for tuning those parameters)

* Fix `inactive_votes_cache_election_start` unit test

* Add test for vote hinting election limit

* Add config option for vote hinting limit

* Use a counter for number of active hinted elections

* Add more election stats

* Revert "Add config option for vote hinting limit"

This reverts commit d5a9fd5.

* Use ratio as hinted election limit instead of absolute value

* Naming change to `active_elections_hinted_limit_percentage`

* Vote hinting cleanup
# Conflicts:
#	nano/core_test/active_transactions.cpp
#	nano/lib/stats.cpp
#	nano/lib/stats.hpp
#	nano/node/election.cpp
#	nano/node/election_scheduler.cpp
This disables migrating of unchecked table from lmdb to rocksdb, however, this upgrade really isn't needed.

# Conflicts:
#	nano/secure/store.hpp
#	nano/secure/store/unchecked_store_partial.hpp
…d use for_each with a functor to execute on each result. This prevents iteration details from being exposed externally.

# Conflicts:
#	nano/core_test/block_store.cpp
#	nano/nano_node/entry.cpp
#	nano/node/json_handler.cpp
#	nano/node/lmdb/lmdb.cpp
#	nano/node/node.cpp
#	nano/secure/store.hpp
#	nano/secure/store/unchecked_store_partial.hpp
…::for_each and removing backend-specific variants.

# Conflicts:
#	nano/node/lmdb/lmdb.cpp
#	nano/node/lmdb/lmdb.hpp
#	nano/node/rocksdb/rocksdb.cpp
#	nano/node/rocksdb/rocksdb.hpp
#	nano/secure/store/unchecked_store_partial.hpp
…hold is reached. Blocks are pruned in fifo order.

# Conflicts:
#	nano/node/node.cpp
#	nano/secure/store/unchecked_store_partial.hpp
Fixing rpc.unchecked_get which didn't get translated properly with the for_each conversion.

# Conflicts:
#	nano/node/json_handler.cpp
#	nano/secure/store/unchecked_store_partial.hpp
@clemahieu clemahieu added this to the V24.0 milestone Jul 11, 2022
@clemahieu clemahieu added enhancement rpc Changes related to Remote Procedure Calls labels Jul 11, 2022
@dsiganos dsiganos added the documentation This item indicates the need for or supplies updated or expanded documentation label Jul 11, 2022
@clemahieu clemahieu merged commit 54e1c2e into nanocurrency:develop Jul 11, 2022
@thsfs thsfs mentioned this pull request Jul 11, 2022
7 tasks
@thsfs thsfs added websockets and removed rpc Changes related to Remote Procedure Calls labels Jan 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation This item indicates the need for or supplies updated or expanded documentation enhancement websockets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants