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

Test #2

Open
wants to merge 272 commits into
base: master
Choose a base branch
from
Open

Test #2

wants to merge 272 commits into from

Conversation

RCasatta
Copy link
Owner

No description provided.

sanket1729 and others added 30 commits May 10, 2022 15:32
Also adds the CHANGELOG file
rust-bitcoin, rust-secp and rust-secp-zkp
These work directly with elements 23.0(24.0?) after it has been released.
There are no changes to elements specific proprietary fields, only main
bitcoin psbt fields.
ac1bd21 Add support for sighash from leafhash (sanket1729)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK ac1bd21

Tree-SHA512: ab2104ae51f281f9ff59fccbce21e4bf118f7c290af0a9329be619ff0c8c780f68f5f4641263ae96e669ffd644779fbcf1dfef04ad72df363d14ad2137574bbe
65f7838 Add taproot psbt fields according to BIP371 (sanket1729)
9a3b1fc Update dependancies (sanket1729)

Pull request description:

  These work directly with elements 23.0(24.0?) after it has been released.
  There are no changes to elements specific proprietary fields, only main
  bitcoin psbt fields.

  Most of this is just copy pasting code from rust-bitcoin and making it work :) . For reference:
  https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki.

  Unfortunately, this is the only supporting implementation. So, there are no test vectors to check against.

ACKs for top commit:
  apoelstra:
    ACK 65f7838

Tree-SHA512: b1a27a57577ce7978dcec7d8ddb2a853f427cca8ef7fe106ed3c2df9a2d5aaf2342f08964a225bcc8e3fa4934484a0bf081053d6dc6bf48a7dc61e394463c8ad
Also adds FromStr/Display for SchnorrSignatureHashType
This was a result of copy-pasting code from rust-bitcoin
rust-bitcoin ecosystem also makes sure that H and h in SighashType and
SigHashType are consistent. We don't have the bandwidth to do it
currently.
SurjectionProofs and RangeProofs were being alloted on stack for the
full 1MB even when they were empty. The fixes this by adding a Box
around it

While we are at it, this also fixes the issue for Psbt decoding while
dealing with these cases

Add failing test case
35110f6 Add utility methods for fetching sighash types from inputs (sanket1729)
a860698 Add #[test] to unused test (sanket1729)
f429873 Rename SigHashType to EcdsaSighashType (sanket1729)
f02eedc Remove std feature (sanket1729)
8f65c48 Add Support for Psbt Sighash type (sanket1729)

Pull request description:

  Also adds FromStr/Display for SchnorrSignatureHashType

  - The first commit adds PsbtSighashType(needed for schnorr sigh psbt support)
  - The second commit fixes a bug introduced in copy-pasting during the ElementsProject#111.
  - The third commit does renaming to distinguish SchnorrSigHashType and EcdsaSigHashType
  - The last and fourth commit fixes a small nit by adding a #[test] to untested code in serde feature.

ACKs for top commit:
  apoelstra:
    ACK 35110f6

Tree-SHA512: 269a10e34bc930de6238a104c7494e56bcb7e68507d194b18a49c612c85c77bf5b5c12a22b43fb467666e3726d178fdfc8564ec1e73881845fd48dc5c1b46155
d27565c Fix Block decoding bug (sanket1729)

Pull request description:

  SurjectionProofs were allocated on the stack for the entire array of characters even when they were empty. The fixes this by adding a Box around it.
  This is not an issue for rangeproofs as there is already a Box in the ffi layer, but when that changes as we add more support to split range proof from a blob into individual components, we should make sure that we are boxing it here.

  While we are at it, this also fixes the issue for Psbt decoding while dealing with these cases.

  The second commit can be swapped to see that test fails without the fix.

ACKs for top commit:
  apoelstra:
    ACK d27565c

Tree-SHA512: 55aff65d198a35e7d85481284f8a52c0adf3e4ad8205eb523967b2fad5f0cb8a22448751b2306f111435267c83ea56be8aabfe279f1a526763d21865ad331422
ab2090e Serde fixes for sighash types (sanket1729)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK ab2090e

Tree-SHA512: 52528f8ec1d160923297c2d400ec29a66d27840c1bbde0ae6598301b0be2d91750cec13d03a900263f405a465e68f80abe2e063d98743bc33c9dd5d1073a6b35
948254b Release 0.19 (sanket1729)

Pull request description:

  Dependency upgrade and taproot support implemented in ElementsProject#121. Please review that before making a release.

  This PR is now only has a single commit with the release.

  Fixes ElementsProject#112

ACKs for top commit:
  apoelstra:
    ACK 948254b

Tree-SHA512: af86984d6cd2154f112a605a80a3274b1ace58e32a87d001e5ab90871a9953c673c7461805f026dcb00b5e37c10ee87a3cbfb149c36c2ba18d6d2870bb2c70b8
…ction methods

2a35bad Use the non-get-prefixed methods (Nadav Ivgi)
bdf4604 Deprecate get_ prefix for Block and Transaction methods (Nadav Ivgi)

Pull request description:

  To match the changes introduced in rust-bitcoin/rust-bitcoin#861.

  This allows using unified code with the same methods for both `elements::{Transaction,Block}` and `bitcoin::{Transaction,Block}` (behind different features), without triggering rust-bitcoin's deprecation warnings for the `get_`-prefixed methods.

  Note that there are other instances of `get_`-prefixed methods in the rust-elements codebase. I only updated the ones needed for compatibility with the changes made in rust-bitcoin.

ACKs for top commit:
  apoelstra:
    ACK 2a35bad

Tree-SHA512: 6c18f79c05fb860b1615c2f302290caa1c2a83d6d1b5128fbef7ab2053c4e5f6bc6a1ecaa9fb1d638598396d9f1e53ae4338c1dcd7562d5dc8bea72d498a0bc1
These are the same values from rust-bitcoin. Makes it easy to create
these structures downstream. Right now, we need to specify all feilds
34cf67c Add some default impls (sanket1729)

Pull request description:

  These are the same values from rust-bitcoin. Makes it easy to create
  these structures downstream. Right now, we need to specify all feilds

ACKs for top commit:
  apoelstra:
    ACK 34cf67c

Tree-SHA512: 4f0728050d17eb8170f57e7b259c27179ed6055f744edbadcdb11010a838650a3a0ab4965a13686b955ee5f49154c9bffa4dd66e48d40fd0b6ecb2b9ac67cd74
We really never should have required BufRead just to make the commitment
parsing a tad more convenient.
This kinda makes the Decodable impls on these types unnecessary,
but I'm not against keeping them around just in case anyone wants them.
It also makes this whole change backwards compatible.
…Encodable trait

c1a7641 encode: Avoid duplicate allocation for commitments (Steven Roose)
203542c encode: Revert io::BufRead requirement on Encodable trait (Steven Roose)

Pull request description:

  We really never should have required `BufRead` just to make the commitment parsing a tad more convenient.

ACKs for top commit:
  apoelstra:
    ACK c1a7641
  sanket1729:
    ACK c1a7641. `Commitment` and `Generator` are Copy. There is no allocation in them. I would like to keep the decodable Impls because they can come in handy in downstream repos.

Tree-SHA512: b4d18cfec524d6d3bdd95511bab2159e5035d01fa04b27f54b39907ecd0e2d546a03458a0e7141a505bcc6dbf4c09a5e680bcc1f5e8ddea2234b98aeba036324
92f7884 Add script utility methods for taproot (sanket1729)

Pull request description:

ACKs for top commit:
  stevenroose:
    utACK [92f7884](ElementsProject@92f7884)
  apoelstra:
    ACK 92f7884

Tree-SHA512: e1baaa222798dc5f4a8c8634ac78817449214e959268fc6d86a1c460e48603625c5c699912461ead10b1deea1f69c264309990376d806956f4cd0c1e5953c52c
e596aac Release v0.19.1 (Steven Roose)

Pull request description:

ACKs for top commit:
  delta1:
    ACK e596aac
  apoelstra:
    ACK e596aac

Tree-SHA512: 5376065db43c40ac6a9e483ce3e1ee9d265b4903a3ca7bb6cfcb687fa16f4e6e1efe4633704faf050cab26fe7c0c159bbfc9db753d313270a241dba65b2e2cd4
apoelstra and others added 30 commits April 23, 2024 15:52
…o input and output

17d354e pset: test input and output asset blinding factors (Leonardo Comandini)
db805b3 pset: output: add asset blinding factor (Leonardo Comandini)
d1dfed4 pset: input: add asset blinding factor (Leonardo Comandini)
04ab514 pset: implement (de)serialize for AssetBlindingFactor (Leonardo Comandini)

Pull request description:

  Change corresponding to ElementsProject/elements#1329

ACKs for top commit:
  apoelstra:
    ACK 17d354e

Tree-SHA512: 14c8d9d096c6412bd15fac1f597a3fbc02a43bee64e3edc8209d487b805671b6cec1fa752337e817324170178a3cf3151bbcbe98dd2646f1e92e3018cd5dceec
New versions of rustc detect invalid feature gates. We had two, which
resulted in tests that were never run.
Recent versions of rustc notice when public structs cannot be
constructed. In this case, the struct in question a copy-and-paste from
the bech32 segwit module, and it was unneeded and (clearly) unused.
We had several accidental list-item continuation in our docs. Add
newlines to break them up.
8d58ec3 clippy: use u32::MAX rather than u32::max_value (Andrew Poelstra)
172e36b clippy: fix indentation in documentation (Andrew Poelstra)
4ab1b77 blech32: delete unconstructable iterator struct (Andrew Poelstra)
a89ff6e fix a couple feature gates (Andrew Poelstra)

Pull request description:

  Do some cleanups and get CI working again.

  Will rebase ElementsProject#203 on this.

ACKs for top commit:
  delta1:
    ACK 8d58ec3

Tree-SHA512: 62ca188d031e71e39279b7407cef746ea4bec2c72baad633603fd67834efa6774027b060d20fddbb9bfff609b676b1b6d2f20a1c663e7fea207a3b08772e3e0c
It is possible to cause a panic by calling `TxIn::pegin_data` on a
malformed pegin, which has 6 entries and the last one (which should be a
Merkle proof of block inclusion) is too small to even have a blockhash
in it.

On the actual chain this should not be possible because invalid pegin
data would be rejected.
…pegin-parse

transaction: range-check pegin data when parsing
b7fc82e tx: add discount_weight and discount_vsize (Byron Hambly)

Pull request description:

  adds implementation of discount virtual size from ElementsProject/elements#1317

  same test vectors in ElementsProject/elements#1341

ACKs for top commit:
  apoelstra:
    ACK b7fc82e

Tree-SHA512: 48f0daafcb93bbcabacff4bb5cd5bc6b2dd99fb97117671f58d2b33c9b9e6357e01eb16d726dcbeb70375c6307b106a11d091604aafde148b5c8377f471e46f1
1166089 pset: elip100: add and get token metadata (Leonardo Comandini)

Pull request description:

  Following changes in ElementsProject/ELIPs#17

ACKs for top commit:
  RCasatta:
    ACK 1166089

Tree-SHA512: 5e8f1d309c4781f10130f9e6b8f8e6d17582e5e5292921e5a372b34a3d55c9de0a7a1496b47fc51b155a0e8072fb25895f4c05592694d13d09416889cbe40f0f
7737c82 Add elip_liquidex module (Leonardo Comandini)
2ca6c7b Revert "pset: input/output: add abf" (Leonardo Comandini)

Pull request description:

  Use "liquidex" field for the asset blinding factor.

  Related ELIP: ElementsProject/ELIPs#18

ACKs for top commit:
  RCasatta:
    ACK 7737c82
  apoelstra:
    ACK 7737c82 successfully ran local tests

Tree-SHA512: 4bde263a0323cc5c1198c0d024552dd53bc44b5f00572c24da773cb417e5a7020e7158dcb72f6519caff7e3dd2082c049ed9cf5394e91fba7f9a8f8eb8bbaa1a
This is propedeutic to upgrading to bitcoin 0.32 where this
address-related variants are removed from base58::Error
4269728 apply tomlfmt to Cargo.toml (Riccardo Casatta)
e9a90cc apply rustfmt to encode.rs (Riccardo Casatta)
6789492 apply rustfmt to pset/raw.rs (Riccardo Casatta)
8ae550b apply rustfmt to src/blind.rs (Riccardo Casatta)
084f7d4 Avoid instantiating base58 errors in Address::from_base58 (Riccardo Casatta)
5eefe85 apply rustfmt to address.rs (Riccardo Casatta)

Pull request description:

  This is propedeutic to upgrade to bitcoin 0.32 ElementsProject#209
  where the base58 error variant specific to address are removed

  Also it applies formatting around on which I think we agreed upon, but also on the toml file which I had doubt, let me know if I have to remove it

ACKs for top commit:
  apoelstra:
    ACK 4269728 successfully ran local tests

Tree-SHA512: 0cdc7077d4ec4550a4df6f5e6eb244c7a8c0793b507c9a4327b30bdaf9f597df0dee7c72e33414df0a87cb10f9a9be12588c9a564d71cb308564cf0226b7dec1
Following bitcoin versions change `io` with `bitcoin_io`, upgrading
would then require changing also elements::Encodable to match.

Instead, we are re-implementing what is needed.
Otherwise we miss them when upgrading to 0.32
… bitcoin::Encodable

c08382c Copy ReadExt/WriteExt from bitcoin (Riccardo Casatta)
4aad862 Stop implementing elements::Encodable with bitcoin::Encodable (Riccardo Casatta)

Pull request description:

  Following bitcoin versions change `io` with `bitcoin_io`, upgrading would then require changing also elements::Encodable to match.

  Instead, we are re-implementing what is needed.

  Makes ElementsProject#209 easier

ACKs for top commit:
  apoelstra:
    ACK c08382c successfully ran local tests; a bit redundant but I think this is the right way to go

Tree-SHA512: e849dc141ab412f1db3539a132688b28e2770befb8fc46e64d3396f16c3b9035bb7d76a0813d4d7bf65ff85df418cb42e8d75e01d1db7879c5853dd40214e053
avoid setting {BITCOIND,ELEMENTSD}_EXE in setup

The logic of setting the env var inside the setup prevents user of other
OS like nixos to run the tests (because the included binary are not
working on nixos).
Setting those env vars is meant to be done in the dev environment not in
the code.
With this users with `bitcoind` and `elementsd` in their PATH will work
too.
The CI script will set the variables only if they are not already set.
(Allowing Nixos users to override and run it locally)
f889525 improve logging on error (Riccardo Casatta)
802c006 upgrade bitcoin 0.31 -> 0.32, fix test env vars (Riccardo Casatta)

Pull request description:

  ElementsProject#208

  ```
      fn consensus_encode<W: bitcoin::io::Write + ?Sized>(&self, e: W) -> Result<usize, crate::encode::Error> {}
      fn consensus_decode<R: bitcoin::io::BufRead + ?Sized>(reader: &mut R) -> Result<Self, crate::encode::Error> {}
  ```

  We went for not depending on bitcoin::Encodable instead

ACKs for top commit:
  apoelstra:
    ACK f889525 successfully ran local tests

Tree-SHA512: 23fbf597c7adad52c40f1c26b2d0cad6755a0ff8f9da3ee498d2dd80856b24f557f2f7bf504712a6d25e358d5417fc5f7c467122470d9087f93f1e7d260e5539
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.