electrs icon indicating copy to clipboard operation
electrs copied to clipboard

Disable sigops for Liquid

Open junderw opened this issue 2 years ago • 0 comments

Low priority, since the mempool/backend already sets sigops to 0 when Liquid network is active...

But just in case someone uses mempool/electrs for other purposes we'd like to be correct.

As you can see here, Liquid counts sigops slightly differently for peg-in inputs' witnessScripts...

Liquid https://github.com/ElementsProject/elements/blob/ae023ea98db010953bfc8aaf646b8e81ad30cdcd/src/consensus/tx_verify.cpp#L170-L188

Bitcoin https://github.com/bitcoin/bitcoin/blob/f01416e23c9c820517c37003a2a98dd46d1022ba/src/consensus/tx_verify.cpp#L158-L164

Rather than code that difference in, it'd probably be simpler to just make sigops a non-Liquid only feature.

Choices (either or):

  1. Support Liquid and change the calculations based on liquid feature.
  2. Disable sigops when using liquid

junderw avatar Sep 18 '23 18:09 junderw