diff --git a/benchmark/alt_bn_128.cpp b/benchmark/alt_bn_128.cpp index 5ccb1e09be..da1bda15f9 100644 --- a/benchmark/alt_bn_128.cpp +++ b/benchmark/alt_bn_128.cpp @@ -4,7 +4,7 @@ #include -namespace benchmark { +namespace eosio::benchmark { using bytes = std::vector; using g1g2_pair = std::vector; diff --git a/benchmark/benchmark.cpp b/benchmark/benchmark.cpp index bf93c9c239..c72040ab8f 100644 --- a/benchmark/benchmark.cpp +++ b/benchmark/benchmark.cpp @@ -5,7 +5,7 @@ #include -namespace benchmark { +namespace eosio::benchmark { // update this map when a new feature is supported // key is the name and value is the function doing benchmarking diff --git a/benchmark/benchmark.hpp b/benchmark/benchmark.hpp index 8f1935ef18..6ac14e4c47 100644 --- a/benchmark/benchmark.hpp +++ b/benchmark/benchmark.hpp @@ -7,7 +7,7 @@ #include -namespace benchmark { +namespace eosio::benchmark { using bytes = std::vector; void set_num_runs(uint32_t runs); diff --git a/benchmark/blake2.cpp b/benchmark/blake2.cpp index 19aa59d771..a5c971a492 100644 --- a/benchmark/blake2.cpp +++ b/benchmark/blake2.cpp @@ -2,7 +2,7 @@ #include -namespace benchmark { +namespace eosio::benchmark { void blake2_benchmarking() { uint32_t _rounds = 0x0C; diff --git a/benchmark/bls.cpp b/benchmark/bls.cpp index 75c69aef17..97219d338d 100644 --- a/benchmark/bls.cpp +++ b/benchmark/bls.cpp @@ -15,10 +15,7 @@ using namespace bls12_381; // to run a benchmarking session, in the build directory, type // benchmark/benchmark -f bls -namespace eosio::chain { -// placed in eosio::chain name space so that interface_in_benchmark -// can access transaction_context's private member max_transaction_time_subjective. -// interface_in_benchmark is a friend of transaction_context. +namespace eosio::benchmark { // To benchmark host functions directly without CDT wrappers, // we need to contruct a eosio::chain::webassembly::interface object, @@ -96,10 +93,6 @@ struct interface_in_benchmark { std::unique_ptr apply_ctx; std::unique_ptr interface; }; -} // namespace eosio::chain - - -namespace benchmark { // utilility to create a random scalar std::array random_scalar() diff --git a/benchmark/hash.cpp b/benchmark/hash.cpp index 9bb4aef2b4..9193fae80d 100644 --- a/benchmark/hash.cpp +++ b/benchmark/hash.cpp @@ -10,7 +10,7 @@ using namespace fc; -namespace benchmark { +namespace eosio::benchmark { void hash_benchmarking() { std::string small_message = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01"; diff --git a/benchmark/key.cpp b/benchmark/key.cpp index 3d6973d806..cdc8707d0c 100644 --- a/benchmark/key.cpp +++ b/benchmark/key.cpp @@ -9,7 +9,7 @@ using namespace fc::crypto; using namespace fc; using namespace std::literals; -namespace benchmark { +namespace eosio::benchmark { void k1_sign_benchmarking() { auto payload = "Test Cases"; diff --git a/benchmark/main.cpp b/benchmark/main.cpp index eadc35ede4..f8d6663eed 100644 --- a/benchmark/main.cpp +++ b/benchmark/main.cpp @@ -12,7 +12,7 @@ int main(int argc, char* argv[]) { uint32_t num_runs = 1; std::string feature_name; - auto features = benchmark::get_features(); + auto features = eosio::benchmark::get_features(); options_description cli ("benchmark command line options"); cli.add_options() @@ -61,8 +61,8 @@ int main(int argc, char* argv[]) { std::cerr << "unknown exception" << std::endl; } - benchmark::set_num_runs(num_runs); - benchmark::print_header(); + eosio::benchmark::set_num_runs(num_runs); + eosio::benchmark::print_header(); if (feature_name.empty()) { for (auto& [name, f]: features) { diff --git a/benchmark/modexp.cpp b/benchmark/modexp.cpp index 14d8443331..7bf5fbedeb 100644 --- a/benchmark/modexp.cpp +++ b/benchmark/modexp.cpp @@ -5,7 +5,7 @@ #include -namespace benchmark { +namespace eosio::benchmark { void modexp_benchmarking() { std::mt19937 r(0x11223344); diff --git a/libraries/chain/include/eosio/chain/transaction_context.hpp b/libraries/chain/include/eosio/chain/transaction_context.hpp index f9b719c760..806e75d9dd 100644 --- a/libraries/chain/include/eosio/chain/transaction_context.hpp +++ b/libraries/chain/include/eosio/chain/transaction_context.hpp @@ -4,6 +4,10 @@ #include #include +namespace eosio::benchmark { + struct interface_in_benchmark; // for benchmark testing +} + namespace eosio { namespace chain { struct transaction_checktime_timer { @@ -92,7 +96,7 @@ namespace eosio { namespace chain { friend struct controller_impl; friend class apply_context; - friend struct interface_in_benchmark; // defined in benchmark/bls.cpp + friend struct benchmark::interface_in_benchmark; // defined in benchmark/bls.cpp void add_ram_usage( account_name account, int64_t ram_delta );