Exclude Substrate timestamp inherents from a signed-transaction metric

A block with no user-submitted transfer can still contain extrinsics. Counting every extrinsic as a signed user transaction inflates application activity for quiet blocks.

Inspect the signature flag and call identity

Run the example with a connected polkadot-js API and matching runtime metadata. The timestamp pallet typically receives its time via the unsigned timestamp.set inherent. The code counts it separately from all signed extrinsics.

const hash = await api.rpc.chain.getFinalizedHead()
const {block} = await api.rpc.chain.getBlock(hash)
const signed = block.extrinsics.filter(ex => ex.isSigned)
const timestamps = block.extrinsics.filter(ex =>
  !ex.isSigned && ex.method.section === "timestamp" &&
  ex.method.method === "set")
console.log(block.extrinsics.length, signed.length, timestamps.length)

Choose a metric with an explicit denominator

Suppose a block contains four extrinsics, including one timestamp inherent, another unsigned call and two signed calls. Its signed-extrinsic count is two. Counting all unsigned calls as timestamp updates would incorrectly classify the second unsigned call. Inspect its pallet and method to understand it.

A signed batch can contain several user actions, and a signed extrinsic can fail at dispatch. For payments per block, count successful payment events with their execution phase rather than using the signed-extrinsic count as a substitute.

Sources