Allow skipping merkle proofs' during subscription - #610
Conversation
|
Tested using all12_subs.txt (warm cache). # Without --skip-merkle-proofs-on-subscription:
$ curl -s localhost:4224 | grep 'rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"}'
rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"} 8.590418878
# With --skip-merkle-proofs-on-subscription:
$ curl -s localhost:4224 | grep 'rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"}'
rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"} 7.838893273 |
|
The last commit results in a significant performance gain: # Without --skip-merkle-proofs-on-subscription:
$ curl -s localhost:4224 | grep 'rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"}'
rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"} 8.89051942
# With --skip-merkle-proofs-on-subscription:
$ curl -s localhost:4224 | grep 'rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"}'
rpc_duration_sum{method="blockchain.scripthash.subscribe:multi"} 4.316420194 |
|
Can be relevant for #539 :) |
|
The cool thing is that merkle proofs are being client-side cached (at least in Electrum and Sparrow), so there actually no need to cache them in electrs :) |
|
It seems that we get now comparable performance to the |
Kixunil
left a comment
There was a problem hiding this comment.
That's some great news! The code looks good too.
We still support them (by computing them on-demand) and caching them with `--cache-merkle-proofs`. Also, don't compute block's txids if we don't cache merkle proofs during subscription 3ce23ae#r59562642
I've flipped the logic so we don't cache merkle proofs by default :) |
|
I wonder is there actually any reason to enable caching? Maybe having the option is not actually useful? |

We still support them (by computing them on-demand).
3ce23ae#r59562642