Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix instant seal #799

Merged
merged 13 commits into from
Nov 1, 2024
Merged

Fix instant seal #799

merged 13 commits into from
Nov 1, 2024

Conversation

1xstj
Copy link
Contributor

@1xstj 1xstj commented Oct 29, 2024

Reference issue to close (if applicable)

Closes #798

How to use instant seal

Build with:

cargo b -rp tangle --features manual-seal,txpool,testnet

Run with:

./target/release/tangle --tmp --dev --validator -linfo --alice --rpc-cors all --rpc-methods=unsafe --rpc-external --rpc-port 9944 -levm=debug -lgadget=trace --sealing instant

@1xstj 1xstj changed the title Fix manual seal Fix instant seal Oct 29, 2024
@1xstj 1xstj marked this pull request as ready for review October 29, 2024 13:51
@shekohex
Copy link
Contributor

I did a clean build of the node and run it using the following command:

./target/release/tangle --tmp --dev --validator -linfo --alice --rpc-cors all --rpc-methods=unsafe --rpc-external --rpc-port 9944 -levm=debug -lgadget=trace --sealing instant --auto-insert-keys

However I still get the same error when I send more than one transaction:

2024-10-29 17:10:19.336 ERROR tokio-runtime-worker sc_consensus_manual_seal::rpc: Consensus with no RPC sender encountered an error: Consensus Error: Import failed: Slot number must increase: parent slot: 288368504, this slot: 288368504

btw, running it without --auto-insert-keys fails, which is fine.

@shekohex
Copy link
Contributor

Just another comment, we should release a binary with instant sealing Option for devs to download. Could you add that to the CI?

@1xstj
Copy link
Contributor Author

1xstj commented Oct 30, 2024

Just another comment, we should release a binary with instant sealing Option for devs to download. Could you add that to the CI?

this already exists

@shekohex
Copy link
Contributor

Still getting this error @1xstj

====================

Version: 1.2.0-93b49c51318

   0: sp_panic_handler::set::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::panicking::assert_failed_inner
   7: core::panicking::assert_failed
   8: pallet_babe::<impl frame_support::traits::hooks::OnTimestampSet<<T as pallet_timestamp::pallet::Config>::Moment> for pallet_babe::pallet::Pal
let<T>>::on_timestamp_set
   9: frame_support::storage::transactional::with_transaction
  10: <pallet_timestamp::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::{{closure}}
  11: environmental::using_once
  12: <tangle_testnet_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter
  13: <tangle_testnet_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch
  14: <fp_self_contained::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra,SelfContainedSignedInfo> as sp_runtime::traits::Applyable>::appl
y
  15: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic
  16: tangle_testnet_runtime::api::dispatch
  17: environmental::using
  18: sc_executor::executor::WasmExecutor<H>::with_instance::{{closure}}
  19: sc_executor::wasm_runtime::RuntimeCache::with_instance
  20: <sc_executor::executor::NativeElseWasmExecutor<D> as sp_core::traits::CodeExecutor>::call
  21: sp_state_machine::execution::StateMachine<B,H,Exec>::execute
  22: <sc_service::client::call_executor::LocalCallExecutor<Block,B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call
....







thread 'tokio-runtime-worker' panicked at 'Timestamp must be updated once in the block', /home/shady/.cargo/git/checkouts/polkadot-sdk-cff69157b985
ed76/51a1705/substrate/frame/timestamp/src/lib.rs:230

This is a bug. Please report it at:

        https://github.com/webb-tools/tangle/issues

2024-10-31 12:56:51.315  INFO tokio-runtime-worker sc_basic_authorship::basic_authorship: 🙌 Starting consensus session on top of parent 0x3366ce90
d39d9733a923bf6cbea0f2a820be85d09bc9e7b8ea6b2aa5d47211fd (#1)
2024-10-31 12:56:51.323  WARN tokio-runtime-worker wasm-runtime: Evicting failed runtime instance error=Runtime panicked: assertion `left == right`
 failed: Timestamp slot must match `CurrentSlot`
  left: Slot(288394769)
 right: Slot(288394770)
2024-10-31 12:56:51.323  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: 1 storage transactions are left open by the runt
ime. Those will be rolled back.
2024-10-31 12:56:51.323  WARN tokio-runtime-worker sp_state_machine::overlayed_changes::changeset: 1 storage transactions are left open by the runt
ime. Those will be rolled back.
2024-10-31 12:56:51.324  WARN tokio-runtime-worker basic-authorship:Inherent extrinsic returned unexpected error: Error at calling runtime api:
 Execution failed: Runtime panicked: assertion `left == right` failed: Timestamp slot must match `CurrentSlot`
  left: Slot(288394769)
 right: Slot(288394770). Dropping.
2024-10-31 12:56:51.325  WARN tokio-runtime-worker wasm-runtime: Evicting failed runtime instance error=Runtime panicked: Timestamp must be updated
 once in the block
2024-10-31 12:56:51.325 ERROR tokio-runtime-worker sc_consensus_manual_seal::rpc: Consensus with no RPC sender encountered an error: Error at calli
ng runtime api: Execution failed: Runtime panicked: Timestamp must be updated once in the block

Runtime panicked: Timestamp must be updated once in the block

Could you try with my blueprint? https://github.com/tangle-network/frost-blueprint

Clone and build using cargo build then for testing is just

RUST_LOG=gadget=debug cargo test keygen::tests::keygen -- --nocapture

This would trigger the panic above.

@1xstj 1xstj added the Waiting for CI Ready to merge if CI is green label Nov 1, 2024
@1xstj 1xstj merged commit 131d1fb into main Nov 1, 2024
2 checks passed
@1xstj 1xstj deleted the fix-manual-seal branch November 1, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for CI Ready to merge if CI is green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Instant and Manual Sealing does not work
3 participants