feat: add annex to env#345
Conversation
|
LGTM I copied most of #331 for this. Gonna take a look at fixing CI first |
7ce98ca to
61440dc
Compare
|
CI is passing -- can this be undrafted? |
|
done |
|
In 7ce98ca: Please separate out the typo fixes and the serde stuff (is this necessary at all?) into separate commits. |
| annex: inp_data | ||
| .annex | ||
| .as_ref() | ||
| .map(|annex| c_elements::CRawBuffer::new(annex)) |
There was a problem hiding this comment.
In 7ce98ca:
This creates a dangling raw pointer and is unsound.
61440dc to
d0401b1
Compare
6c88fb7 to
0c9abb8
Compare
|
In 0c9abb8: Can you remove the unrelated serde changes from src/analysis.rs? |
| for (((n, inp), in_utxo), inp_data) in tx | ||
| .input | ||
| .iter() | ||
| .enumerate() |
There was a problem hiding this comment.
In 0c9abb8:
I'd prefer you add .zip(raw_annexes.iter_mut()) here rather than enumerate, so then it's clear that we're going through all the iterators simultaneously.
|
utACK other than the above nits. I spent some time looking for methods on |
|
Yeah I also tried some variants but they seemed worse than this |
These seem unrelated but they are necessary for |
|
re: serde changes: I am happy to push them into another PR but that would also need to be merged before we can complete this section of work |
Previously the annex field was always null in the C FFI input struct. This extracts the annex from the witness stack and passes it through, with careful lifetime management using a boxed slice to prevent reallocation before the FFI call completes.
This is useful for downstream users to determine if annex padding is needed
606f43d to
c4d6ee6
Compare
|
Force pushed into two commits, one for annex and one for serde changes |
|
In 050f9bd: Note to self that a future rust-elements update should provide the |
|
In c4d6ee6: Cool, thanks for separating into another patch. I still don't get the motivation but I'm happy to add these serde impls. |
Add the annex to the transaction environment so that it is included in hashes created by jets.
This is almost entirely coded by delta1 but is required to add functionality to
hal-simplicityand can be seen/tested here https://github.com/stringhandler/hal-simplicity/tree/feat/add-annex.