Skip to content

Commit

Permalink
Merge branch 'master' into align_effective_gas_calc_to_erigon
Browse files Browse the repository at this point in the history
  • Loading branch information
lupin012 authored Jun 12, 2024
2 parents edaf3d4 + bcc9607 commit fb9263e
Show file tree
Hide file tree
Showing 206 changed files with 4,066 additions and 3,810 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
working-directory: ${{runner.workspace}}/silkworm
env:
TEST_RESULT: ${{ steps.test_step.outputs.TEST_RESULT }}
run: python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --commit $(git rev-parse HEAD) --test_name rpc-integration-tests --outcome $TEST_RESULT #--result_file ${{runner.workspace}}/rpc-tests/integration/mainnet/result.json
run: python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --branch ${{ github.ref_name }} --commit $(git rev-parse HEAD) --test_name rpc-integration-tests --chain mainnet --outcome $TEST_RESULT #--result_file ${{runner.workspace}}/rpc-tests/integration/mainnet/result.json

- name: Action for Success
if: steps.test_step.outputs.TEST_RESULT == 'success'
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/rpc-performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ jobs:
cp -r ${{runner.workspace}}/rpc-tests/perf/reports/bin ${{runner.workspace}}/last_execution_test/

echo "Save test result on DB"
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --commit $(git rev-parse HEAD) --test_name rpc-performance-test-${servers[i-1]}-$method --outcome success --result_file ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/result.json
cd ${{runner.workspace}}/silkworm
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --branch ${{ github.ref_name }} --commit $(git rev-parse HEAD) --test_name rpc-performance-test-${servers[i-1]}-$method --chain mainnet --outcome success --result_file ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/result.json
else
failed_test=1
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --commit $(git rev-parse HEAD) --test_name rpc-performance-test-${servers[i-1]}-$method --outcome failure
cd ${{runner.workspace}}/silkworm
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py --repo silkworm --branch ${{ github.ref_name }} --commit $(git rev-parse HEAD) --test_name rpc-performance-test-${servers[i-1]}-$method --chain mainnet --outcome failure

fi
done
Expand Down Expand Up @@ -162,6 +164,12 @@ jobs:
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
- name: Run change point analysis
if: steps.test_step.outputs.TEST_RESULT == 'success'
working-directory: ${{runner.workspace}}/rpc-tests/perf/reports/mainnet
run: |
python3 $ERIGON_QA_PATH/test_system/qa-tests/change-points/change_point_analysis.py
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ jobs:
- name: Smoke tests
run: cmake -DSILKWORM_BUILD_DIR=C:\build -P cmake\run_smoke_tests.cmake

# Disabled after https://github.com/erigontech/silkworm/issues/2083
- name: Unit tests
if: false
run: cmake -DSILKWORM_BUILD_DIR=C:\build -P cmake\run_unit_tests.cmake

# Disabled after https://github.com/erigontech/silkworm/issues/2083
- name: Ethereum EL tests
if: false
working-directory: C:\build
run: |
cmd/test/${{ matrix.config.build_type }}/ethereum --threads 4
11 changes: 6 additions & 5 deletions cmd/capi/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <silkworm/capi/silkworm.h>
#include <silkworm/db/access_layer.hpp>
#include <silkworm/db/mdbx/mdbx.hpp>
#include <silkworm/db/snapshot_bundle_factory_impl.hpp>
#include <silkworm/db/snapshots/repository.hpp>
#include <silkworm/infra/common/directories.hpp>
#include <silkworm/infra/common/log.hpp>
Expand Down Expand Up @@ -150,8 +151,8 @@ std::vector<SilkwormChainSnapshot> collect_all_snapshots(SnapshotRepository& sna
std::vector<SilkwormBodiesSnapshot> bodies_snapshot_sequence;
std::vector<SilkwormTransactionsSnapshot> transactions_snapshot_sequence;

snapshot_repository.view_bundles(
[&](const SnapshotBundle& bundle) {
for (const SnapshotBundle& bundle : snapshot_repository.view_bundles()) {
{
{
SilkwormHeadersSnapshot raw_headers_snapshot{
.segment{
Expand Down Expand Up @@ -202,8 +203,8 @@ std::vector<SilkwormChainSnapshot> collect_all_snapshots(SnapshotRepository& sna
};
transactions_snapshot_sequence.push_back(raw_transactions_snapshot);
}
return true;
});
}
}

ensure(headers_snapshot_sequence.size() == snapshot_repository.bundles_count(), "invalid header snapshot count");
ensure(bodies_snapshot_sequence.size() == snapshot_repository.bundles_count(), "invalid body snapshot count");
Expand Down Expand Up @@ -436,7 +437,7 @@ int main(int argc, char* argv[]) {
int status_code = -1;
if (settings.execute_blocks_settings) {
// Execute specified block range using Silkworm API library
SnapshotRepository repository{snapshot_settings};
SnapshotRepository repository{snapshot_settings, std::make_unique<db::SnapshotBundleFactoryImpl>()};
repository.reopen_folder();
status_code = execute_blocks(handle, *settings.execute_blocks_settings, repository, data_dir);
} else if (settings.build_indexes_settings) {
Expand Down
13 changes: 4 additions & 9 deletions cmd/dev/backend_kv_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <silkworm/infra/concurrency/awaitable_wait_for_one.hpp>
#include <silkworm/infra/grpc/client/client_context_pool.hpp>
#include <silkworm/node/backend/ethereum_backend.hpp>
#include <silkworm/node/remote/kv/grpc/server/backend_kv_server.hpp>
#include <silkworm/node/backend_kv_server.hpp>
#include <silkworm/sentry/eth/status_data_provider.hpp>
#include <silkworm/sentry/grpc/client/sentry_client.hpp>
#include <silkworm/sentry/multi_sentry_client.hpp>
Expand Down Expand Up @@ -68,7 +68,7 @@ struct StandaloneBackEndKVSettings : public SilkwormSettings {
};

//! Parse the command-line arguments into the BackEnd and KV server settings
int parse_command_line(int argc, char* argv[], CLI::App& app, StandaloneBackEndKVSettings& settings) {
void parse_command_line(int argc, char* argv[], CLI::App& app, StandaloneBackEndKVSettings& settings) {
auto& log_settings = settings.log_settings;
auto& node_settings = settings.node_settings;
auto& server_settings = settings.node_settings.server_settings;
Expand Down Expand Up @@ -106,8 +106,6 @@ int parse_command_line(int argc, char* argv[], CLI::App& app, StandaloneBackEndK
/*create=*/false,
/*readonly=*/true};
node_settings.chaindata_env_config.max_readers = max_readers;

return 0;
}

std::shared_ptr<silkworm::sentry::api::SentryClient> make_sentry_client(
Expand Down Expand Up @@ -160,10 +158,7 @@ int main(int argc, char* argv[]) {

try {
StandaloneBackEndKVSettings settings;
int result_code = parse_command_line(argc, argv, cli, settings);
if (result_code != 0) {
return result_code;
}
parse_command_line(argc, argv, cli, settings);

const auto pid = boost::this_process::get_id();
const auto tid = std::this_thread::get_id();
Expand Down Expand Up @@ -215,7 +210,7 @@ int main(int argc, char* argv[]) {
};
backend.set_node_name(node_name);

rpc::BackEndKvServer server{server_settings, backend};
node::BackEndKvServer server{server_settings, backend};

// Standalone BackEndKV server has no staged loop, so this simulates periodic state changes
Task<void> tasks;
Expand Down
4 changes: 3 additions & 1 deletion cmd/dev/check_changes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <silkworm/core/types/evmc_bytes32.hpp>
#include <silkworm/db/access_layer.hpp>
#include <silkworm/db/buffer.hpp>
#include <silkworm/db/snapshot_bundle_factory_impl.hpp>
#include <silkworm/db/snapshots/repository.hpp>
#include <silkworm/infra/common/directories.hpp>
#include <silkworm/infra/common/log.hpp>
Expand Down Expand Up @@ -109,7 +110,8 @@ int main(int argc, char* argv[]) {
throw std::runtime_error("Unable to retrieve chain config");
}

snapshots::SnapshotRepository repository;
auto snapshot_bundle_factory = std::make_unique<db::SnapshotBundleFactoryImpl>();
snapshots::SnapshotRepository repository{snapshots::SnapshotSettings{}, std::move(snapshot_bundle_factory)};
repository.reopen_folder();
db::DataModel::set_snapshot_repository(&repository);
db::DataModel access_layer{txn};
Expand Down
Loading

0 comments on commit fb9263e

Please sign in to comment.