10

Reading the yellow paper, I'm attempting to understand the difference between the Hb and Rb values - they appear to be the same thing, unless I've missed something.

Is the LogsBloom in the block header, Hb , the same as the Bloom filter in the Transaction Receipts Trie, Rb?

If they are the same thing - why is it stored twice?

If they are different, please explain how they are different.

5

No, they are not the same thing. The Bloom filter in the transaction (R_b) contains only the logs from this transaction while the Bloom filter in the block header (H_b) contains the logs from all transactions in this block.

So yes, the information is stored twice, but with the benefit of being able to check quickly if a certain log is present in a block without having access to all transactions. This enables light clients (which only know block headers) to watch for events.

  • 2
    Technical correction: You say "So yes, the information is stored twice..." Which is sort of true. Each transaction stores a bloom filter of that transaction's receipt. The block stores the union of all the bloom filters in each transaction. If the block-level bloom filter says "no" you don't have to check the transaction receipts' bloom filters. If the top level says "yes,' it means "maybe," and you have to check each transaction's bloom filter, which again will say "no" or "maybe" If it says "maybe" you have to check the actual logs. There may be false positives, but never false negatives. – Thomas Jay Rush Oct 10 '16 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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