Closed sanket1729 closed 2 years ago
Overall this looks really great! The last commit makes me worry that the code will start to become unweildy the more things we add to instrospect, but it's fine to clean that up in a later PR.
One thing I don't fully grok is why we always have the user provide a value then VERIFY
that it matches the introspected value. Couldn't we just let the user do this herself using the Arith::Eq
fragement, if needed?
@apoelstra
user provide a value then VERIFY that it matches the introspected value.
I don't fully understand this. The user does not provide a value. All values are taken from transaction introspection or are fixed constants. The VERIFY in the inner fragments asserts that the value is explicit. We need this to compose with other arithmetic operations.
Recall that INSPECTXXXVALUE pushes two things on stack
The last commit makes me worry that the code will start to become unweildy the more things we add to instrospect, but it's fine to clean that up in a later PR.
FTR, I don't see us adding any more things. But I also don't know any way to clean up these things.
The VERIFY in the inner fragments asserts that the value is explicit. We need this to compose with other arithmetic operations.
Oh, derp, thank you. I forgot this.
FTR, I don't see us adding any more things. But I also don't know any way to clean up these things.
Well, it adds a whole bunch of function parameters that maybe could be simplified a bit with a TxEnv
-like structure.