Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into active/online_re…
Browse files Browse the repository at this point in the history
…ps_election
  • Loading branch information
SergiySW committed Jan 26, 2021
2 parents 415387d + 664a940 commit b27c5cc
Show file tree
Hide file tree
Showing 91 changed files with 505 additions and 386 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/analyzers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@50fbc62
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
- name: Get clang-format 8
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@50fbc62
- uses: actions/setup-python@41b7212
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
- uses: actions/setup-python@41b7212b1668f5de9d65e9c82aa777e6bbedb3a8
with:
python-version: '3.x'
architecture: 'x64'
- uses: BSFishy/pip-action@8f2d471
- uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318
with:
packages: |
cmake-format
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/beta_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -47,7 +47,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -72,7 +72,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -86,7 +86,7 @@ jobs:
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@adb7347
uses: docker/login-action@adb73476b6e06caddec5db0bc1deacbec8cdd947
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -101,7 +101,7 @@ jobs:
- name: tag
run: |
Write-Output "TAG=${{ github.event.inputs.ref }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
linux_job:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
run: ci/actions/linux/install_deps.sh
- name: Login to ghcr.io
uses: docker/login-action@adb7347
uses: docker/login-action@adb73476b6e06caddec5db0bc1deacbec8cdd947
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/live_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -46,7 +46,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -71,7 +71,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -85,7 +85,7 @@ jobs:
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@adb7347
uses: docker/login-action@adb73476b6e06caddec5db0bc1deacbec8cdd947
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -100,7 +100,7 @@ jobs:
- name: tag
run: |
Write-Output "TAG=${{ github.event.inputs.ref }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
BOOST_ROOT: /tmp/boost
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"

Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"

Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"

Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rocksdb_release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
env:
BOOST_ROOT: /tmp/boost
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rocksdb_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
DEADLINE_SCALE_FACTOR: 2
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -28,7 +28,7 @@ jobs:
timeout-minutes: 60
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -41,7 +41,7 @@ jobs:
timeout-minutes: 60
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -57,7 +57,7 @@ jobs:
DEADLINE_SCALE_FACTOR: 2
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Windows Defender
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test_network_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -47,7 +47,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -72,7 +72,7 @@ jobs:
- name: tag
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand All @@ -86,7 +86,7 @@ jobs:
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@adb7347
uses: docker/login-action@adb73476b6e06caddec5db0bc1deacbec8cdd947
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -101,7 +101,7 @@ jobs:
- name: tag
run: |
Write-Output "TAG=${{ github.event.inputs.ref }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
ref: ${{ github.event.inputs.ref }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
BOOST_ROOT: /tmp/boost
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 60
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 60
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Fetch Deps
Expand All @@ -52,7 +52,7 @@ jobs:
timeout-minutes: 60
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@5a4ac90
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
- name: Windows Defender
Expand Down
4 changes: 2 additions & 2 deletions nano/core_test/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ TEST (network, replace_port)
auto wrong_endpoint = nano::endpoint (node1->network.endpoint ().address (), nano::get_available_port ());
auto channel0 (node0->network.udp_channels.insert (wrong_endpoint, node1->network_params.protocol.protocol_version));
ASSERT_NE (nullptr, channel0);
node0->network.udp_channels.modify (channel0, [&node1](std::shared_ptr<nano::transport::channel> channel_a) {
node0->network.udp_channels.modify (channel0, [&node1](std::shared_ptr<nano::transport::channel> const & channel_a) {
channel_a->set_node_id (node1->node_id.pub);
});
auto peers_list (node0->network.list (std::numeric_limits<size_t>::max ()));
Expand Down Expand Up @@ -1119,7 +1119,7 @@ TEST (network, cleanup_purge)
ASSERT_EQ (0, node1.network.size ());

std::weak_ptr<nano::node> node_w = node1.shared ();
node1.network.tcp_channels.start_tcp (node2->network.endpoint (), [node_w](std::shared_ptr<nano::transport::channel> channel_a) {
node1.network.tcp_channels.start_tcp (node2->network.endpoint (), [node_w](std::shared_ptr<nano::transport::channel> const & channel_a) {
if (auto node_l = node_w.lock ())
{
node_l->network.send_keepalive (channel_a);
Expand Down
6 changes: 3 additions & 3 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,7 @@ TEST (node, rep_remove)
ASSERT_EQ (*channel0, reps[0].channel_ref ());
// Modify last_packet_received so the channel is removed faster
std::chrono::steady_clock::time_point fake_timepoint{};
node.network.udp_channels.modify (channel_udp, [fake_timepoint](std::shared_ptr<nano::transport::channel_udp> channel_a) {
node.network.udp_channels.modify (channel_udp, [fake_timepoint](std::shared_ptr<nano::transport::channel_udp> const & channel_a) {
channel_a->set_last_packet_received (fake_timepoint);
});
// This UDP channel is not reachable and should timeout
Expand All @@ -2270,7 +2270,7 @@ TEST (node, rep_remove)
auto node2 (std::make_shared<nano::node> (system.io_ctx, nano::unique_path (), system.alarm, nano::node_config (nano::get_available_port (), system.logging), system.work));
std::weak_ptr<nano::node> node_w (node.shared ());
auto vote3 = std::make_shared<nano::vote> (keypair2.pub, keypair2.prv, 0, genesis.open);
node.network.tcp_channels.start_tcp (node2->network.endpoint (), [node_w, &vote3](std::shared_ptr<nano::transport::channel> channel2) {
node.network.tcp_channels.start_tcp (node2->network.endpoint (), [node_w, &vote3](std::shared_ptr<nano::transport::channel> const & channel2) {
if (auto node_l = node_w.lock ())
{
ASSERT_FALSE (node_l->rep_crawler.response (channel2, vote3));
Expand Down Expand Up @@ -2921,7 +2921,7 @@ TEST (node, vote_by_hash_bundle)
nano::keypair key1;
system.wallet (0)->insert_adhoc (key1.prv);

system.nodes[0]->observers.vote.add ([&max_hashes](std::shared_ptr<nano::vote> vote_a, std::shared_ptr<nano::transport::channel>, nano::vote_code) {
system.nodes[0]->observers.vote.add ([&max_hashes](std::shared_ptr<nano::vote> const & vote_a, std::shared_ptr<nano::transport::channel> const &, nano::vote_code) {
if (vote_a->blocks.size () > max_hashes)
{
max_hashes = vote_a->blocks.size ();
Expand Down
2 changes: 1 addition & 1 deletion nano/core_test/peer_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST (peer_container, no_recontact)
auto observed_disconnect (false);
nano::endpoint endpoint1 (boost::asio::ip::address_v6::loopback (), 10000);
ASSERT_EQ (0, network.size ());
network.channel_observer = [&observed_peer](std::shared_ptr<nano::transport::channel>) { ++observed_peer; };
network.channel_observer = [&observed_peer](std::shared_ptr<nano::transport::channel> const &) { ++observed_peer; };
node1.network.disconnect_observer = [&observed_disconnect]() { observed_disconnect = true; };
auto channel (network.udp_channels.insert (endpoint1, node1.network_params.protocol.protocol_version));
ASSERT_EQ (1, network.size ());
Expand Down
6 changes: 3 additions & 3 deletions nano/core_test/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TEST (socket, drop_policy)
ASSERT_FALSE (ec);

// Accept connection, but don't read so the writer will drop.
server_socket->on_connection ([&connections](std::shared_ptr<nano::socket> new_connection, boost::system::error_code const & ec_a) {
server_socket->on_connection ([&connections](std::shared_ptr<nano::socket> const & new_connection, boost::system::error_code const & ec_a) {
connections.push_back (new_connection);
return true;
});
Expand Down Expand Up @@ -88,7 +88,7 @@ TEST (socket, concurrent_writes)

// We're expecting client_count*4 messages
nano::util::counted_completion read_count_completion (total_message_count);
std::function<void(std::shared_ptr<nano::socket>)> reader = [&read_count_completion, &total_message_count, &reader](std::shared_ptr<nano::socket> socket_a) {
std::function<void(std::shared_ptr<nano::socket> const &)> reader = [&read_count_completion, &total_message_count, &reader](std::shared_ptr<nano::socket> const & socket_a) {
auto buff (std::make_shared<std::vector<uint8_t>> ());
buff->resize (1);
#ifndef _WIN32
Expand Down Expand Up @@ -127,7 +127,7 @@ TEST (socket, concurrent_writes)
std::vector<std::shared_ptr<nano::socket>> connections;

// On every new connection, start reading data
server_socket->on_connection ([&connections, &reader](std::shared_ptr<nano::socket> new_connection, boost::system::error_code const & ec_a) {
server_socket->on_connection ([&connections, &reader](std::shared_ptr<nano::socket> const & new_connection, boost::system::error_code const & ec_a) {
if (ec_a)
{
std::cerr << "on_connection: " << ec_a.message () << std::endl;
Expand Down
Loading

0 comments on commit b27c5cc

Please sign in to comment.