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

feat: full btc relay added #273

Merged
merged 3 commits into from
Jul 29, 2024
Merged

feat: full btc relay added #273

merged 3 commits into from
Jul 29, 2024

Conversation

ferencdg
Copy link
Contributor

@ferencdg ferencdg commented Jun 27, 2024

Forked from https://github.com/summa-tx/relays
Changes made:

  1. dependency changes
    1.1 changed summa-tx/bitcoin-spv to keep-network/bitcoin-spv-sol
    1.2 removed SafeMath
  2. test changes
    2.1 fixed some tests that were written incorrectly in the summa repo
    2.2 ported Truffle javascript tests to Foundry solidity
    2.3 new tests added
  3. solidity compiler version upgraded to 0.8.17
  4. OnDemandSPV was gutted and only the verification part was kept

Closes #285

Copy link

vercel bot commented Jun 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bob ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 8:11am

Copy link

changeset-bot bot commented Jun 27, 2024

⚠️ No Changeset found

Latest commit: 60f8c08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@gregdhill gregdhill left a comment

Choose a reason for hiding this comment

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

I didn't pick apart the Summa code since I think this was mostly a copy-paste but please point out anything specific you changed or think would be worth a second look. I also think for next steps it could be good to integrate this code with BitcoinTx.sol and WitnessTx.sol (specifically validateWitnessProof) since I think that will let projects do some interesting things with Ordinals in the future.


/**
* @title Relay
* @author Summa (https://summa.one)
Copy link
Contributor

Choose a reason for hiding this comment

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

Change author

src/relay/FullRelay.sol Show resolved Hide resolved

import {TestRelay} from "../../src/relay/FullRelayWithVerify.sol";

import {stdJson} from "forge-std/StdJson.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't know about this library before!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was thinking it would have been nice in the bob-gateway project if we store all our

  1. env data like RPC node, chain id.... and
  2. deployed contract addresses
    in Jsons for both prod tests.

I don't really like the current env variable approach there.

@ferencdg
Copy link
Contributor Author

I didn't pick apart the Summa code since I think this was mostly a copy-paste but please point out anything specific you changed or think would be worth a second look. I also think for next steps it could be good to integrate this code with BitcoinTx.sol and WitnessTx.sol (specifically validateWitnessProof) since I think that will let projects do some interesting things with Ordinals in the future.

I can certainly integrate the full relay with those libraries, but just as a note a user has to decide in his project upfront what kind of relay he wants to use, as for example validateProof use different data for validation for the FullRelay compared to the LightRelay.

How about doing this in a follow up PR?

* Forked from https://github.com/summa-tx/relays
* Changes made:
* 1. dependency changes
* - changed summa-tx/bitcoin-spv to keep-network/bitcoin-spv-sol
Copy link
Contributor

Choose a reason for hiding this comment

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

Changed to bob-collective/bitcoin-spv

@gregdhill gregdhill merged commit d6f7748 into master Jul 29, 2024
2 checks passed
@gregdhill gregdhill deleted the full-relay branch July 29, 2024 11:01
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.

BOB Full Relay
3 participants