Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Collectives-polkadot pallet_ranked_collective::remove_member benchmark fails #2777

Closed
bkontur opened this issue Jun 24, 2023 · 4 comments · Fixed by #2781
Closed

Collectives-polkadot pallet_ranked_collective::remove_member benchmark fails #2777

bkontur opened this issue Jun 24, 2023 · 4 comments · Fixed by #2781
Assignees

Comments

@bkontur
Copy link
Contributor

bkontur commented Jun 24, 2023

error in CI
Relates to: #2712 (if this is fixed/merged, then re-run)

Probably related to the:

        // Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance.
	type PromoteOrigin = EnsureNever<pallet_ranked_collective::Rank>;
	
	...
	
	maybe with some benchmark configuration it could instead of `expect` return Weight::MAX?
	
	T::PromoteOrigin::try_successful_origin()
			.expect("PromoteOrigin has no successful origin required for the benchmark"),
			
		BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))

How to reproduce locally:

cargo b -r --features runtime-benchmarks --bin polkadot-parachain

./target/release/polkadot-parachain benchmark pallet --chain=collectives-polkadot-dev --execution=wasm --wasm-execution=compiled --pallet=pallet_ranked_collective --no-storage-info --no-median-slopes --no-min-squares '--extrinsic=*' --steps=2 --repeat=2 --json --header=./file_header.txt --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/

Error:

2023-06-25 00:14:29 assembling new collators for new session 0 at #0    
2023-06-25 00:14:29 assembling new collators for new session 1 at #0    
2023-06-25 00:14:30 Starting benchmark: pallet_ranked_collective::add_member    
2023-06-25 00:14:30 WARNING: benchmark weightless skipped - add_member    
2023-06-25 00:14:30 WARNING: benchmark weightless skipped - add_member    
2023-06-25 00:14:30 WARNING: benchmark weightless skipped - add_member    
2023-06-25 00:14:30 Starting benchmark: pallet_ranked_collective::remove_member    
2023-06-25 00:14:30 panicked at 'PromoteOrigin has no successful origin required for the benchmark: ()', /home/bparity/.cargo/git/checkouts/substrate-7e08433d4c370a21/81d125f/frame/ranked-collective/src/benchmarking.rs:41:14    
Error: Input("Error executing and verifying runtime benchmark: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n    0: 0x38cd56 - <unknown>!rust_begin_unwind\n    1: 0x34bfeb - <unknown>!core::panicking::panic_fmt::h2aa6e58b8ba5c6ef\n    2: 0x34c572 - <unknown>!core::result::unwrap_failed::hfcc3380d53e691a3\n    3: 0x311349 - <unknown>!pallet_ranked_collective::benchmarking::make_member::hcb06efe57a0780ae\n    4: 0x310549 - <unknown>!<pallet_ranked_collective::benchmarking::SelectedBenchmark as frame_benchmarking::utils::BenchmarkingSetup<T,I>>::instance::h2a7bb55a7fc2c5b0\n    5: 0xcf3c1 - <unknown>!pallet_ranked_collective::benchmarking::<impl frame_benchmarking::utils::Benchmarking for pallet_ranked_collective::pallet::Pallet<T,I>>::run_benchmark::h054e02b13e5325d9\n    6: 0x2d599 - <unknown>!<collectives_polkadot_runtime::Runtime as frame_benchmarking::utils::runtime_decl_for_benchmark::BenchmarkV1<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<sp_runtime::multiaddress::MultiAddress<<<sp_runtime::MultiSignature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId,()>,collectives_polkadot_runtime::RuntimeCall,sp_runtime::MultiSignature,(frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_spec_version::CheckSpecVersion<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<collectives_polkadot_runtime::Runtime>)>>>>::dispatch_benchmark::h8567679f80b2a9b7\n    7: 0x14808d - <unknown>!Benchmark_dispatch_benchmark")

@bkontur
Copy link
Contributor Author

bkontur commented Jun 25, 2023

@gavofyork
ok, that error from descritpion disappeared,
but now I see the new one for the same benchmark:

2023-06-25 16:06:51 Starting benchmark: pallet_ranked_collective::remove_member    
2023-06-25 16:06:51 panicked at 'Expected Ok(_). Got Err(
    Module(
        ModuleError {
            index: 60,
            error: [
                8,
                0,
                0,
                0,
            ],
            message: Some(
                "NoPermission",
            ),
        },
    ),
)', /home/bparity/.cargo/git/checkouts/substrate-7e08433d4c370a21/81d125f/frame/ranked-collective/src/benchmarking.rs:45:9    
Error: Input("Error executing and verifying runtime benchmark: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n    0: 0x38e764 - <unknown>!rust_begin_unwind\n    1: 0x34d9f9 - <unknown>!core::panicking::panic_fmt::h2aa6e58b8ba5c6ef\n    2: 0x312311 - <unknown>!pallet_ranked_collective::benchmarking::make_member::hcb06efe57a0780ae\n    3: 0x31092d - <unknown>!<pallet_ranked_collective::benchmarking::SelectedBenchmark as frame_benchmarking::utils::BenchmarkingSetup<T,I>>::instance::h2a7bb55a7fc2c5b0\n    4: 0xcf436 - <unknown>!pallet_ranked_collective::benchmarking::<impl frame_benchmarking::utils::Benchmarking for pallet_ranked_collective::pallet::Pallet<T,I>>::run_benchmark::h054e02b13e5325d9\n    5: 0x2d5a4 - <unknown>!<collectives_polkadot_runtime::Runtime as frame_benchmarking::utils::runtime_decl_for_benchmark::BenchmarkV1<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<sp_runtime::multiaddress::MultiAddress<<<sp_runtime::MultiSignature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId,()>,collectives_polkadot_runtime::RuntimeCall,sp_runtime::MultiSignature,(frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_spec_version::CheckSpecVersion<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<collectives_polkadot_runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<collectives_polkadot_runtime::Runtime>)>>>>::dispatch_benchmark::h8567679f80b2a9b7\n    6: 0x1482de - <unknown>!Benchmark_dispatch_benchmark")

@bkontur
Copy link
Contributor Author

bkontur commented Jun 25, 2023

@gavofyork

and also this error I am not sure about:

2023-06-25 16:07:42 assembling new collators for new session 0 at #0    
2023-06-25 16:07:42 assembling new collators for new session 1 at #0    
Error: Input("Benchmark pallet_salary::payout failed: PayError")
2023-06-25 16:07:45 Starting benchmark: pallet_salary::init    
2023-06-25 16:07:45 Starting benchmark: pallet_salary::bump    
2023-06-25 16:07:45 Starting benchmark: pallet_salary::induct    
2023-06-25 16:07:45 Starting benchmark: pallet_salary::register    
2023-06-25 16:07:45 Starting benchmark: pallet_salary::payout

@muharem
Copy link
Contributor

muharem commented Jun 26, 2023

@bkontur should fix both #2784

@bkontur
Copy link
Contributor Author

bkontur commented Jun 27, 2023

@muharem yes, cool, thank you, it is working (tested locally), just left one nit in PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants