Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ variables:
- build*/*.tar*
- build*/*_test
- csa_results
- build*/SHA1SUMS

script:
- ./ci/build.sh
- ./ci/build-gitlab.sh


Arch Linux:
Expand All @@ -36,10 +37,11 @@ Arch Linux:

script:
- mkdir -p csa_results/
- scan-build -o csa_results/ ./ci/build.sh
- scan-build -o csa_results/ ./ci/build-gitlab.sh


Ubuntu Linux Trusty:
# Disabled, dependency on newer Qt than avail
.Ubuntu Linux Trusty:
<<: *linux_cfg
stage: build
image: ubuntu:trusty
Expand Down Expand Up @@ -75,6 +77,30 @@ Ubuntu Linux Xenial:
- ./ci/ubuntu_prep.sh
- ./ci/bootstrap_boost.sh

Xenial OPTIMIZED:
<<: *linux_cfg
stage: build
image: ubuntu:xenial
variables:
FLAVOR: xenial
SIMD: 1

before_script:
- ./ci/ubuntu_prep.sh
- ./ci/bootstrap_boost.sh

Artful OPTIMIZED:
<<: *linux_cfg
stage: build
image: ubuntu:artful
variables:
FLAVOR: artful
SIMD: 1

before_script:
- ./ci/ubuntu_prep.sh
- ./ci/bootstrap_boost.sh


# DISABLED for now
.Ubuntu Linux:ASAN:
Expand Down Expand Up @@ -115,7 +141,7 @@ Ubuntu Linux Xenial:
- osx

script:
- ./ci/build.sh
- ./ci/build-gitlab.sh

# DISABLED for now
.Alpine Linux:
Expand All @@ -128,5 +154,5 @@ Ubuntu Linux Xenial:
- apk add --update alpine-sdk autoconf automake libtool clang-dev cmake ninja qt5-qtbase-dev qt5-qttools-dev boost-dev ttf-freefont xvfb

script:
- ./ci/build.sh
- ./ci/build-gitlab.sh

8 changes: 6 additions & 2 deletions ci/build.sh → ci/build-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ fi

if [[ ${SIMD} -eq 1 ]]; then
SIMD_CFG="-DRAIBLOCKS_SIMD_OPTIMIZATIONS=ON"
CRYPTOPP_CFG="-DCRYPTOPP_CUSTOM=ON"
CRYPTOPP_CFG=""
echo SIMD and other optimizations enabled
echo local CPU:
cat /proc/cpuinfo # TBD for macOS
else
SIMD_CFG=""
CRYPTOPP_CFG=""
CRYPTOPP_CFG="-DCRYPTOPP_CUSTOM=ON"
fi

if [[ ${ASAN_INT} -eq 1 ]]; then
Expand Down Expand Up @@ -74,6 +77,7 @@ run_build() {
cmake --build ${PWD} -- -v
cmake --build ${PWD} -- install -v
cpack -G ${CPACK_TYPE} ${PWD}
sha1sum *.tar* > SHA1SUMS
}

run_build
44 changes: 0 additions & 44 deletions rai/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,50 +655,6 @@ TEST (node_config, random_rep)
ASSERT_NE (config1.preconfigured_representatives.end (), std::find (config1.preconfigured_representatives.begin (), config1.preconfigured_representatives.end (), rep));
}

TEST (node, block_replace)
{
rai::system system (24000, 2);
system.wallet (0)->insert_adhoc (rai::test_genesis_key.prv);
auto block1 (system.wallet (0)->send_action (rai::test_genesis_key.pub, 0, rai::Gxrb_ratio));
auto block3 (system.wallet (0)->send_action (rai::test_genesis_key.pub, 0, rai::Gxrb_ratio));
ASSERT_NE (nullptr, block1);
auto initial_work (block1->block_work ());
while (rai::work_value (block1->root (), block1->block_work ()) <= rai::work_value (block1->root (), initial_work))
{
system.nodes[1]->generate_work (*block1);
}
{
rai::transaction transaction (system.nodes[0]->store.environment, nullptr, false);
ASSERT_EQ (block3->hash (), system.nodes[0]->store.block_successor (transaction, block1->hash ()));
}
for (auto i (0); i < 1; ++i)
{
rai::transaction transaction_a (system.nodes[1]->store.environment, nullptr, false);
system.nodes[1]->network.republish_block (transaction_a, block1);
}
auto iterations1 (0);
std::unique_ptr<rai::block> block2;
while (block2 == nullptr)
{
system.poll ();
++iterations1;
ASSERT_LT (iterations1, 200);
rai::transaction transaction (system.nodes[0]->store.environment, nullptr, false);
auto block (system.nodes[0]->store.block_get (transaction, block1->hash ()));
if (block->block_work () != initial_work)
{
block2 = std::move (block);
}
}
{
rai::transaction transaction (system.nodes[0]->store.environment, nullptr, false);
ASSERT_EQ (block3->hash (), system.nodes[0]->store.block_successor (transaction, block1->hash ()));
}
ASSERT_NE (initial_work, block1->block_work ());
ASSERT_EQ (block1->block_work (), block2->block_work ());
ASSERT_GT (rai::work_value (block2->root (), block2->block_work ()), rai::work_value (block1->root (), initial_work));
}

TEST (node, fork_publish)
{
std::weak_ptr<rai::node> node0;
Expand Down
18 changes: 1 addition & 17 deletions rai/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,23 +1263,7 @@ rai::process_return rai::block_processor::process_receive_one (MDB_txn * transac
}
case rai::process_result::old:
{
{
auto root (block_a->root ());
auto hash (block_a->hash ());
auto existing (node.store.block_get (transaction_a, hash));
if (existing != nullptr)
{
// Replace block with one that has higher work value
if (rai::work_value (root, block_a->block_work ()) > rai::work_value (root, existing->block_work ()))
{
node.store.block_put (transaction_a, hash, *block_a, node.store.block_successor (transaction_a, hash));
}
}
else
{
// Could have been rolled back, maybe
}
}
//Existing codeblock will become obesolete with universal blocks and as a result is removed
if (node.config.logging.ledger_duplicate_logging ())
{
BOOST_LOG (node.log) << boost::str (boost::format ("Old for: %1%") % block_a->hash ().to_string ());
Expand Down