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

Sbtc Changes #8

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

Sbtc Changes #8

wants to merge 7 commits into from

Conversation

jferrant
Copy link

Closes stacks-network#3770

Once this is tested in isolation and all the sbtc changes necessary are made....then this should be opened up against
stacks-network/stacks-blockchain's master.

jferrant and others added 5 commits June 28, 2023 10:18
* Squashed commit of the following:

commit 5d2bce5
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Tue Jan 17 13:43:16 2023 -0800

    Documentation.

commit ee01867
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Tue Jan 17 13:34:01 2023 -0800

    Additional tests and remove unwrapping

commit 145a0ec
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 15:23:48 2023 -0800

    formatting

commit 73f7c5b
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 15:08:05 2023 -0800

    unit test for `update_state`

commit 72f403e
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 14:10:11 2023 -0800

    `update.rs`

commit 9f6f6d6
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 13:04:28 2023 -0800

    MessageRequest => Request

commit 6b94e8e
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 12:51:26 2023 -0800

    unit test for `read_http_request_message`.

commit dcd79b8
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 11:51:38 2023 -0800

    clean-up

commit 9018f6e
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 11:49:09 2023 -0800

    `relay_server` can accept binary data.

commit 29a1ff8
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 10:37:54 2023 -0800

    remove printing "Hello world!" :-)

commit 532507e
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Fri Jan 13 10:37:09 2023 -0800

    Rename `stacks-relay` to `relay-server`.

commit 753958e
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Thu Jan 12 08:49:36 2023 -0800

    change version of `stacks-relay`

commit fb67dc4
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Thu Jan 12 08:47:15 2023 -0800

    formatting

commit 81601bf
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Thu Jan 12 00:52:11 2023 -0800

    readme

commit be5af7c
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Thu Jan 12 00:50:28 2023 -0800

    test

commit ac50e40
Author: Sergey Shandar <sergey-shandar@users.noreply.github.com>
Date:   Wed Jan 11 10:46:19 2023 -0800

    stacks-relay, Rust version, busines-logic only. No IO

* cargo lock

* Brief description.

* Brief description.

---------

Authored-by: Sergey Shandar <sergey-shandar@users.noreply.github.com>
* feat: Peg-in wire format

* refactor: Rename "address" to "recipient" in peg-in operation + SQL comment in sortdb

* feat: Support contract principal for peg-in recipient

* test: Peg-in test in chainstate::coordinator::tests

* fix: Typo

* refactor: Represent peg-in recipient as PrincipalData

* test: Ensure proper error handling of contract name parse errors

* fix: Remove From<PrincipalData> conversion for StacksAddress

* wip: Adding memo bytest to Peg-In

* feat: Only parse contract name from leading non zero bytes

* fix: Remove outdated todo

* feat: Include sortition ID in primary key for peg_in in sortdb

* test: Sortdb test cover two burnchain blocks with the same transaction

* test: Ensure the expected peg-in op is read in coordinator test

* test: Integration test for peg-in with contract principal

* fix: Cargo fmt

* feat: Use (txid, burn_header_hash) as primary key in sortdb for peg_in op

* fix: Sortdb requires version 5 in Epoch 2.1 + small fixes

* 3481: Include memo in tests

* test: Require BITCOIND_TEST flag for integration test

---------

Co-authored-by: Mårten Blankfors <marten@blankfors.se>
* feat: Peg-in wire format

* feat: add GET /v2/burn_ops/

* test: add RPC call to PegIn integration test, document new RPC endpoint

* refactor: Represent peg-in recipient as PrincipalData

* test: Ensure proper error handling of contract name parse errors

* Merge remote-tracking branch 'origin/3481-sbtc-peg-in-wire-formats' into feat/sbtc-burn-ops-rpc

* refactor: Represent peg-in recipient as PrincipalData

* address PR reviews

* Merge remote-tracking branch 'origin/next' into feat/sbtc-burn-ops-rpc

* fix: merge errors, re-add integration assertions, and update example schema

* test: add fixture tests for ser/deser of peg_out

* Fix rebase issues

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>

---------

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Co-authored-by: Aaron Blankstein <aaron@blockstack.com>
Co-authored-by: Mårten Blankfors <marten@blankfors.se>
* feat: Data parsing for peg-out request + rebase noise

* feat: PegOutRequestOp::from_tx implemented

* feat: PegOutFulfillOp::from_tx implemented

* refactor: Move out test helpers from peg_in.rs for reusability

* test: Unit test for peg_out_request and peg_out_fulfill logic

* feat: Sortdb read & write methods for peg-out ops

* feat: Test peg out request and peg out fulfill in chainstate::coordinator

* feat: Integration test

* fix: Add sbtc integration test to CI

* fix: Remove outdated todo comment

* fix: Use StacksBlockId instead of BlockHeaderHash in PegOutFulfillOp

* tests: Check all fields in sortdb insertion tests

* fix: Use match instead of long if expression.

* fix: Update LAST_SORTITION_DB_INDEX

* test: Expand sortdb tests to cover same transactions in two different burn blocks

* refactor: Move `.../test_helpers.rs` to `.../test/mod.rs`

* fix: Signature description update

* feat: Add memo for peg out request & peg out fulfillment ops

* test: Test peg out ops with memo bytes

* fix: Add empty memo to integration test

* feat: Add peg_wallet_address and fulfillment_fee to PegOutRequestOp

* fix: Copyright notices & other nits

* feat: PegOutFulfillOp must consume the third UTXO from the peg out request

* feat: Integration test covering UTXO consumption in peg out fulfillment

Co-authored-by: Jude Nelson <judecn@gmail.com>

* fix: Disambiguate conflicting test modules

* fix: peg-out request UTXO output amount correction + docstrings for peg ops

Co-authored-by: Jude Nelson <judecn@gmail.com>

* feat: Extend BurnchainOps RPC Enum to support PegOutRequestOp & PegOutFulfillOp

* feat: add PegOutRequest and PegOutFulfill to the GetBurnOps RPC

* doc: add examples to the get burn ops RPC open API definitions

* test: extend the sbtc ops test to check peg out ops

* refactor: simplify testing the peg in ops serialization

* test: add serialization tests for peg out ops

Co-authored-by: Stjepan Golemac <stjepan.golemac@gmail.com>
Co-authored-by: Mårten Blankfors <marten@blankfors.se>

* doc: update API spec examples

* fix: Formatting

* doc: Multiple response examples for burn_ops RPC endpoint

---------

Co-authored-by: Mårten Blankfors <marten@blankfors.se>
Co-authored-by: Jude Nelson <judecn@gmail.com>
Co-authored-by: Stjepan Golemac <stjepan.golemac@gmail.com>
* feat: `stx_address()` method on `PegOutRequestOp` implemented

* test: Hard-coded fixture test for peg out request

* test: Added test case for public key recovery failure

* fix: Make StacksAddress construction in `stx_address` infallible

---------

Co-authored-by: Mårten Blankfors <marten@blankfors.se>
@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2023

Codecov Report

Merging #8 (04f01d3) into master (02dabb8) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
- Coverage    0.18%    0.18%   -0.01%     
==========================================
  Files         302      313      +11     
  Lines      277126   280566    +3440     
==========================================
  Hits          512      512              
- Misses     276614   280054    +3440     
Impacted Files Coverage Δ
clarity/src/vm/types/mod.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/http.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/main.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/server.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/state.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/to_io_result.rs 0.00% <0.00%> (ø)
contrib/tools/relay-server/src/url.rs 0.00% <0.00%> (ø)
src/burnchains/burnchain.rs 0.00% <0.00%> (ø)
src/chainstate/burn/db/mod.rs 0.00% <0.00%> (ø)
src/chainstate/burn/db/processing.rs 0.00% <0.00%> (ø)
... and 16 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

jferrant and others added 2 commits June 29, 2023 09:41
* Fix test which was missed in prior rebase

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>

* Remove accidentally added epochs_ref check

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>

---------

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Copy link

@netrome netrome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for squashing the PR commits. Unfortunately I'm not authorized to merge in the upstream next branch or I would have already done it there.

Suggestion: Can we make this a protected branch? I assume the intention is to keep developing sBTC on this branch and maintain this based on master, and to keep it clean I'd prefer to have any changes to this branch being submitted through PRs with linked issues like we've done in the past.

@netrome
Copy link

netrome commented Jul 10, 2023

Thank you for squashing the PR commits. Unfortunately I'm not authorized to merge in the upstream next branch or I would have already done it there.

Suggestion: Can we make this a protected branch? I assume the intention is to keep developing sBTC on this branch and maintain this based on master, and to keep it clean I'd prefer to have any changes to this branch being submitted through PRs with linked issues like we've done in the past.

I took the liberty to add a branch protection rule just now.

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.

Chore: Pull sbtc changes out of the next branch for easier isolated testing
4 participants