diff --git a/src/js/extensions/ccf/historical.cpp b/src/js/extensions/ccf/historical.cpp index 29531960ab5d..3d0a0556d6b5 100644 --- a/src/js/extensions/ccf/historical.cpp +++ b/src/js/extensions/ccf/historical.cpp @@ -25,7 +25,7 @@ namespace ccf::js::extensions }; std::unordered_map historical_handles; - Impl(ccf::historical::AbstractStateCache* hs) : historical_state(hs){}; + Impl(ccf::historical::AbstractStateCache* hs) : historical_state(hs) {}; }; namespace @@ -33,6 +33,7 @@ namespace ccf::js::extensions static JSValue js_historical_get_state_range( JSContext* ctx, JSValueConst this_val, int argc, JSValueConst* argv) { + std::cout << "PATTERN historical executed" << std::endl; if (argc != 4) { return JS_ThrowTypeError( diff --git a/tests/recovery.py b/tests/recovery.py index 2f170262b493..f7b8d6fa650d 100644 --- a/tests/recovery.py +++ b/tests/recovery.py @@ -165,6 +165,11 @@ def test_recover_service_with_wrong_identity(network, args): network.save_service_identity(args) first_service_identity_file = args.previous_service_identity_file + with old_primary.client() as c: + last_view, last_seq = ( + c.get('/node/commit').body.json()['transaction_id'].split('.') + ) + network.stop_all_nodes() current_ledger_dir, committed_ledger_dirs = old_primary.get_ledger() @@ -254,6 +259,22 @@ def test_recover_service_with_wrong_identity(network, args): snapshots_dir=snapshots_dir, ) + breakpoint() + + primary, _ = recovered_network.find_primary() + with primary.client() as cli: + curr_view, curr_seq = ( + cli.get('/node/commit').body.json()['transaction_id'].split('.') + ) + response = cli.get(f"/node/receipt?transaction_id={last_view}.{last_seq}") + breakpoint() + print(response) + + curr_receipt = primary.get_receipt(curr_view, curr_seq) + verify_receipt(curr_receipt.json(), network.cert) + + breakpoint() + recovered_network.recover(args) return recovered_network @@ -869,26 +890,26 @@ def add(parser): snapshot_tx_interval=30, ) - # Note: `run_corrupted_ledger` runs with very a specific node configuration - # so that the contents of recovered (and tampered) ledger chunks - # can be dictated by the test. In particular, the signature interval is large - # enough to create in-progress ledger files that do not end on a signature. The - # test is also in control of the ledger chunking. - cr.add( - "recovery_corrupt_ledger", - run_corrupted_ledger, - package="samples/apps/logging/liblogging", - nodes=infra.e2e_args.min_nodes(cr.args, f=0), # 1 node suffices for recovery - sig_ms_interval=1000, - ledger_chunk_bytes="1GB", - snapshot_tx_interval=1000000, - ) - - cr.add( - "recovery_snapshot_alone", - run_recover_snapshot_alone, - package="samples/apps/logging/liblogging", - nodes=infra.e2e_args.min_nodes(cr.args, f=0), # 1 node suffices for recovery - ) + # # Note: `run_corrupted_ledger` runs with very a specific node configuration + # # so that the contents of recovered (and tampered) ledger chunks + # # can be dictated by the test. In particular, the signature interval is large + # # enough to create in-progress ledger files that do not end on a signature. The + # # test is also in control of the ledger chunking. + # cr.add( + # "recovery_corrupt_ledger", + # run_corrupted_ledger, + # package="samples/apps/logging/liblogging", + # nodes=infra.e2e_args.min_nodes(cr.args, f=0), # 1 node suffices for recovery + # sig_ms_interval=1000, + # ledger_chunk_bytes="1GB", + # snapshot_tx_interval=1000000, + # ) + + # cr.add( + # "recovery_snapshot_alone", + # run_recover_snapshot_alone, + # package="samples/apps/logging/liblogging", + # nodes=infra.e2e_args.min_nodes(cr.args, f=0), # 1 node suffices for recovery + # ) cr.run()