Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calculate sig ops on fly #597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

biryukovmaxim
Copy link
Collaborator

Migrate to runtime signature operation counting

Changes signature operation counting from static analysis to runtime counting during script execution for improved accuracy.

Key changes

  • Add sig_op tracking fields to TxScriptEngine
  • Remove static sig_op counting functions
  • Count sig_ops during script execution
  • Add runtime checks for sig_op limits
  • Add new error type for sig_op limit violations
  • Update transaction validation to use runtime counting

Breaking changes

  • Changes sig_op validation timing from pre-execution to during execution
  • May affect transaction fee estimation

Todo

  • Restore and update test_get_sig_op_count tests
  • Add tests for sig_op limit edge cases and errors
  • Decide approach for P2SH sig_op limits in mempool standardness rules
  • Add documentation for new sig_op runtime counting behavior
  • Consider adding sig_op estimation helper for fee calculation

Requires manual testing and careful review of sig_op counting logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant