{"type":"rich","version":"1.0","author_name":"npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n","author_url":"https://nostr.ae/npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2018-05-23\n📝 Original message:So I checked filter sizes (as a proportion of block size) for each of the\nsub-filters. The graph is attached.\n\nAs interpretation, the first ~120,000 blocks are so small that the\nGolomb-Rice coding can't compress the filters that well, which is why the\nfilter sizes are so high proportional to the block size. Except for the\ninput filter, because the coinbase input is skipped, so many of them have 0\nelements. But after block 120,000 or so, the filter compression converges\npretty quickly to near the optimal value. The encouraging thing here is\nthat if you look at the ratio of the combined size of the separated filters\nvs the size of a filter containing all of them (currently known as the\nbasic filter), they are pretty much the same size. The mean of the ratio\nbetween them after block 150,000 is 99.4%. So basically, not much\ncompression efficiently is lost by separating the basic filter into\nsub-filters.\n\nOn Tue, May 22, 2018 at 5:42 PM, Jim Posen \u003cjim.posen at gmail.com\u003e wrote:\n\n\u003e My suggestion was to advertise a bitfield for each filter type the node\n\u003e\u003e serves,\n\u003e\u003e where the bitfield indicates what elements are part of the filters. This\n\u003e\u003e essentially\n\u003e\u003e removes the notion of decided filter types and instead leaves the\n\u003e\u003e decision to\n\u003e\u003e full-nodes.\n\u003e\u003e\n\u003e\n\u003e I think it makes more sense to construct entirely separate filters for the\n\u003e different types of elements and allow clients to download only the ones\n\u003e they care about. If there are enough elements per filter, the compression\n\u003e ratio shouldn't be much worse by splitting them up. This prevents the\n\u003e exponential blowup in the number of filters that you mention, Johan, and it\n\u003e works nicely with service bits for advertising different filter types\n\u003e independently.\n\u003e\n\u003e So if we created three separate filter types, one for output scripts, one\n\u003e for input outpoints, and one for TXIDs, each signaled with a separate\n\u003e service bit, are people good with that? Or do you think there shouldn't be\n\u003e a TXID filter at all, Matt? I didn't include the option of a prev output\n\u003e script filter or rolling that into the block output script filter because\n\u003e it changes the security model (cannot be proven to be correct/incorrect\n\u003e succinctly).\n\u003e\n\u003e Then there's the question of whether to separate or combine the headers.\n\u003e I'd lean towards keeping them separate because it's simpler that way.\n\u003e\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/5a74bcf7/attachment-0001.html\u003e\n-------------- next part --------------\nA non-text attachment was scrubbed...\nName: filter_sizes.svg\nType: image/svg+xml\nSize: 2066101 bytes\nDesc: not available\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/5a74bcf7/attachment-0001.svg\u003e"}
