Skip to main content
11 votes
Accepted

What's the best way to compute square root in Substrate?

If you are just after the integer sqrt (which, depending on your use-case, may be enough), you could follow the approach that the democracy pallet does. In this case it uses integer_sqrt::...
Jaco's user avatar
  • 5,865
8 votes

What's the best way to compute square root in Substrate?

TLDR: sp-arithmetic for relatively simple use cases as highlighted in this answer, and substrate-fixed for more advance stuff. To perform non-deterministic arithmetic like division and square roots, ...
islami00's user avatar
  • 561
5 votes
Accepted

Node startup message missing after upgrade to Polkadot v0.9.23

I had the same problem after upgrading my custom node code to Polkadot 0.9.22. After checking the differences between my code and the node template, I found no relevant difference. I then had a look ...
GDethier's user avatar
4 votes

How to see the hardware benchmark results?

A v0.9.27 Polkadot node will print hardware and performance info on startup. It looks like this: Parity Polkadot ✌️ version 0.9.27-b017bad50d3 ❤️ by Parity Technologies <[email protected]&...
Oliver Tale-Yazdi's user avatar
4 votes
Accepted

How to log in try-runtime?

I missed the --checks for the subcommand on-runtime-upgrade. So, there were no checks running. In the past, the checks were run by default. Now they don't. The command should be: RUST_LOG=runtime=...
AurevoirXavier's user avatar
3 votes
Accepted

How is the logging CLI implemented in substrate?

-l is essentially the same as RUST_LOG(which we also support BTW). You can pass the following values: One log level (error, warn, info, debug, trace) that applies to all targets. target=log level. ...
bkchr's user avatar
  • 11.1k
3 votes
Accepted

How to print color log in terminal with no_std requirement?

You could use the color code directly. Those crates just made a wrapper for the color code. Check: https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences https://chrisyeh96....
AurevoirXavier's user avatar
2 votes

1010: Invalid Transaction: Transaction has a bad signature

This might help someone who is working between AccountId32 and AccountId20 networks. I found this myself. You need to go the PolkadotApps's setting page and update the extension metadata when you ...
AurevoirXavier's user avatar
1 vote
Accepted

What does `Failed to promote during pruning` mean exactly? Why might one be seeing that in their node logs?

Should be nothing to worry about. Some transaction failed to be imported to the ready pool. As long as you are not sending these transactions on your own, you probably can not do anything about it.
bkchr's user avatar
  • 11.1k
1 vote
Accepted

How can I add logs to the runtime for debugging since `--execution native` has been removed?

You can also use Chopsticks to replay blocks and see the logs. Again, you need to have --wasm-override to use a wasm with logging enabled and --runtime-log-level=5 to enable verbose logs. Depends on ...
Bryan Chen's user avatar
1 vote

How can I add logs to the runtime for debugging since `--execution native` has been removed?

You can run your node with --wasm-runtime-overrides PATH_TO_FOLDER. Where PATH_TO_FOLDER contains one or more wasm files that will be used to override the on chain wasm. Overriding is done based on ...
bkchr's user avatar
  • 11.1k
1 vote
Accepted

Substrate Node wont restart

You can not delete individual blocks from the database that easily. When you have run out of disk space with the node running, it means that you have corrupted the database. The only solution for this ...
bkchr's user avatar
  • 11.1k
1 vote
Accepted

Extrinsic execution time traces not showing up in node logs

You need to run with: --tracing-targets target=level,target2=level2 Tracing targets are handled differently than logging targets.
bkchr's user avatar
  • 11.1k
1 vote
Accepted

The log no longer has [Parachain] and [RelayChain] tags

I solved this problem because the version of tracing-core was too high, we had to fix the version of tracing-core to 0.1.26. https://github.com/paritytech/substrate/issues/11691 Solution: edit /node/...
99kies's user avatar
  • 753
1 vote

Node startup message missing after upgrade to Polkadot v0.9.23

In my case, this issue was introduced by some sub-dependency. Seems like one should still not upgrade blindly using cargo update and rather just update a couple of dependencies across the Polkadot, ...
0x5hmoo's user avatar
  • 189

Only top scored, non community-wiki answers of a minimum length are eligible