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

OP_INOUT_AMOUNT inquisition #50

Conversation

Christewart
Copy link

@Christewart Christewart commented Mar 13, 2024

This PR implements the OP_INOUT_AMOUNT op code. This is built ontop of #49

The purpose of this op code is to push the input amout and output amount on the stack at the index being verified in the Script interpreter.

You can find the corresponding BIP here: https://github.com/Christewart/bips/blob/92c108136a0400b3a2fd66ea6c291ec317ee4a01/bip-op-inout-amount.mediawiki

Here is the delving bitcoin discussion on this topic, particularily around the current limitations of OP_INOUT_AMOUNT's implementation: https://delvingbitcoin.org/t/op-inout-amount/549

Rework IsOpSuccess() to use SigVersion rather than leaf_version

Use switch based impl for IsOpSuccess()

Remove default in switch statement

Fix compiler warning

Move SigVersion to sigversion.h

Fix includes

try to fix compile

Add sigversion.h

Add include guards
…ESSTHANOREQUAL64, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_SCRIPTNUMTOLE64, OP_LE64TOSCRIPTNUM, OP_LE32TOLE64

Remove liquid args

WIP

Get simple OP_1 functional test case working

Get tests for arithmetic and comparison opcodes working

Get all functional tests passing

Rename test case to Arithmetic64bitTest

Rename file to feature_64bit_arithmetic_opcodes.py, add it to test_runner.py

Get tests passing in feature_taproot.py

Remove unused push_le4

Revert test fixture setup

Cleanup

Fix linting

test: Add leaf_version parameter to taproot_tree_helper()

Fix bug

Fix bugs

Fix compile

Fix missing sigversion checks

Fix htole64 -> htole64_internal due to bitcoin#29263
@Christewart Christewart changed the title Op inout amount inquisition OP_INOUT_AMOUNT inquisition Mar 13, 2024
Get things compiling

Get basic OP_INOUT_AMOUNT impl

Get scaffolding for python test feature_inout_amount.py

Add amount param

Get two simple test cases working checking we aren't withdrawing more than 1BTC

Fix test failure

Remove comments

Cleanup interpreter.cpp
@ajtowns ajtowns deleted the branch bitcoin-inquisition:26.x April 9, 2024 08:21
@ajtowns ajtowns closed this Apr 9, 2024
@ajtowns ajtowns reopened this Apr 9, 2024
@ajtowns ajtowns added this to the 26.x milestone Apr 9, 2024
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.

2 participants