1

given this block header example:

{
  parentHash: '0x3fb321ef847c655e0a3bac64e6bac1a2d3d479c602dab0523e48dc94533e80c8',
  sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
  miner: '0xeBec795c9c8bBD61FFc14A6662944748F299cAcf',
  stateRoot: '0xa8e6dbf88cc5b74f592b76b2419eafbe5609dff85a759c4a69754e5287ba97a9',
  transactionsRoot: '0x21ca37a98150f26b71b3695a28064c48a1734c9e506380341457b5aa3dac125c',
  receiptsRoot: '0xc96d8b52ab7584ea69223839088ed26892e80f2d7484335cad59826e15098bcb',
  logsBloom: '0x02607890272a5820a88284198708003018807009803160f0020d04101c0033205a040024a100180010640a0642f05f010a480428aa01aa050051010000a600010023c1b071008148ab00228c480822e90482304000480a4208001208c1000010170000300b06004100000200000008a10008442800192e82010000900108c02100800542b40a304800c88f4040000103100800c55d8029480c016841005c1e28aee0c1816c806090148240d00180a403024841218001800200246419450c3140713006420158027132006022001a020082c152600080001f201229424000202220182189200260000001b081c4416d4840469068180a0240008800940506a000',
  difficulty: '0',
  number: 15717692,
  gasLimit: 30000000,
  gasUsed: 6707204,
  timestamp: 1665404771,
  extraData: '0x',
  mixHash: '0x3e70de07763d1d3fd9405226d172c87b1842289f1876eafaa2b52d530b22155a',
  nonce: '0x0000000000000000',
  baseFeePerGas: 41409112978,
  hash: '0x8df4345680d1613ba454e77f805c650fdd71e7e1d700b89c0daf35b9b61cd226',
  size: undefined
}

Is it possible to count the amount of logs in this block?

1 Answer 1

0

Unfortunately, that is not possible, since each log is hashed multiple times with different modulo value to create sort of a "random" index for it in multiple places of the logsBloom. So, multiple logs can actually share some indices. This is way this logsBloom sometimes will yield false positive, but never false negative. For this reason, we cannot know exactly how many logs there are in a logsBloom.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.