Posted by Rusty Russell
Oct 24, 2023/03:45 UTC
In an email sent by Andrew Poelstra, he discusses a diff in the code and mentions that it is smaller than the OP_CAT diff. He also expresses the need for refactoring the interpreter code as it requires improvement. Andrew suggests using a class for the stack instead of macros.
The diff in question can be seen in the code snippet provided in the email. It shows changes made to the "interpreter.cpp" file. One of the changes includes adding a function called "effective_size" which calculates the effective size of the stack. This function takes into account the size of each element in the stack and checks if it exceeds the maximum script element size.
The "EvalScript" function is also mentioned in the email. This function evaluates a script and checks if it meets certain conditions. One of the conditions is the size limit of the stack. In the updated code, the size limit is checked using the "effective_size" function for both the main stack and the alternate stack. If the combined effective size exceeds the maximum stack size, an error is returned.
Overall, Andrew's email highlights the changes made in the code, the need for refactoring, and the implementation of the "effective_size" function to calculate the stack size taking into account the maximum script element size.
TLDR
We’ll email you summaries of the latest discussions from authoritative bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.
We'd love to hear your feedback on this project?
Give Feedback