Skip to content

Commit

Permalink
Merge pull request #4787 from pwojcikdev/bounded-backlog-pr
Browse files Browse the repository at this point in the history
Bounded backlog
  • Loading branch information
pwojcikdev authored Nov 29, 2024
2 parents c9d1666 + 88465ac commit d63dd09
Show file tree
Hide file tree
Showing 28 changed files with 1,020 additions and 145 deletions.
20 changes: 20 additions & 0 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <nano/secure/ledger_set_any.hpp>
#include <nano/secure/ledger_set_confirmed.hpp>
#include <nano/secure/vote.hpp>
#include <nano/test_common/chains.hpp>
#include <nano/test_common/network.hpp>
#include <nano/test_common/system.hpp>
#include <nano/test_common/testutil.hpp>
Expand Down Expand Up @@ -3698,3 +3699,22 @@ TEST (node, container_info)
ASSERT_NO_THROW (node1.container_info ());
ASSERT_NO_THROW (node2.container_info ());
}

TEST (node, bounded_backlog)
{
nano::test::system system;

nano::node_config node_config;
node_config.max_backlog = 10;
node_config.backlog_scan.enable = false;
auto & node = *system.add_node (node_config);

const int howmany_blocks = 64;
const int howmany_chains = 16;

auto chains = nano::test::setup_chains (system, node, howmany_chains, howmany_blocks, nano::dev::genesis_key, /* do not confirm */ false);

node.backlog_scan.trigger ();

ASSERT_TIMELY_EQ (20s, node.ledger.block_count (), 11); // 10 + genesis
}
Loading

0 comments on commit d63dd09

Please sign in to comment.