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

Update secp256k1 to 0.3.2 #4653

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Conversation

thejohnfreeman
Copy link
Collaborator

@thejohnfreeman thejohnfreeman commented Aug 14, 2023

The new code was dropped directly in src/secp256k1 without changes. We can consider changing to a Git submodule, though that will require changes to the build instructions because we are not using submodules anywhere else.

The new code was dropped directly in `src/secp256k1` without changes.
We can consider changing to a Git submodule, though that will require
changes to the build instructions because we are not using submodules
anywhere else.
@intelliot
Copy link
Collaborator

In your PR description, can you link to where you got the secp256k1 source code from, and (if possible) the commit hash of the code used?

Copy link
Collaborator

@intelliot intelliot left a comment

Choose a reason for hiding this comment

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

I checked out b9b7a71 and confirmed that src/secp256k1 is identical to bitcoin-core/secp256k1@acf5c55 (v0.3.2)

Comment on lines +74 to +76
set(SECP256K1_INSTALL TRUE)
add_subdirectory(src/secp256k1)
add_library(secp256k1::secp256k1 ALIAS secp256k1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why were these two lines added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The previous CMakeLists.txt in src/secp256k1 was written by us. The new CMakeLists.txt was written by the Bitcoin developers. The SECP256K1_INSTALL option is necessary to get it to include install instructions, and they don't define the ALIAS library (a CMake best practice) like we were.

@ckeshava
Copy link
Collaborator

Hey John,
Do we need to manually update the code for every new version of secp256k1 ?

If we adopt a git submodule approach and if there is a mistake in the bitcoin-core's implementation of the secp256k1, isn't that a risk for rippled?

@thejohnfreeman
Copy link
Collaborator Author

We don't have to update to every new version of any dependency. Our update cadence is up to us. We always manually update dependencies.

A mistake can be found in the implementation whether or not we use submodules. If a mistake is found in a dependency, the most common fix is to switch to a different version.

@intelliot intelliot requested a review from ckeshava August 16, 2023 23:13
@ckeshava
Copy link
Collaborator

@thejohnfreeman Okay. What are the tradeoffs between manually copying the code versus performing an import using #include ? Does it have an impact on the size of the generated binary or the developer productivity?

In an ideal world, if this piece of code were exported as a library by the bitcoin-core developers, we could import it. That is a better solution right?

@intelliot intelliot added this to the 1.13 milestone Aug 24, 2023
@thejohnfreeman
Copy link
Collaborator Author

@ckeshava I don't understand your questions. Manually copy the code where? We are #include-ing it no matter what. There is no choice between the two. Export how? Right now they are publishing it on GitHub. If they were to publish their own Conan recipe, and make it available in Conan Center, then that would be easiest, but using add_subdirectory as we do now is not much more difficult.

@ckeshava
Copy link
Collaborator

ok, I misunderstood that using git submodules has an impact on the size of the rippled binary. thanks for the clarification.

@intelliot intelliot added Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. Dependencies Issues associated with 3rd party dependencies (RocksDB, SQLite, etc) labels Sep 12, 2023
@intelliot
Copy link
Collaborator

note: confirmed with @thejohnfreeman that this looks good to go

@intelliot intelliot merged commit 7bff9dc into XRPLF:develop Sep 18, 2023
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Sep 22, 2023
Copy the new code to `src/secp256k1` without changes:
`src/secp256k1` is identical to bitcoin-core/secp256k1@acf5c55 (v0.3.2).

We could consider changing to a Git submodule, though that would require
changes to the build instructions because we are not using submodules
anywhere else.
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Sep 25, 2023
Copy the new code to `src/secp256k1` without changes:
`src/secp256k1` is identical to bitcoin-core/secp256k1@acf5c55 (v0.3.2).

We could consider changing to a Git submodule, though that would require
changes to the build instructions because we are not using submodules
anywhere else.
@intelliot
Copy link
Collaborator

  • could check what bitcoin-core does for testing this
  • expect any issues to be caught by existing end to end tests

@thejohnfreeman thejohnfreeman deleted the secp256k1 branch November 21, 2023 22:34
sophiax851 pushed a commit to sophiax851/rippled that referenced this pull request Jun 12, 2024
Copy the new code to `src/secp256k1` without changes:
`src/secp256k1` is identical to bitcoin-core/secp256k1@acf5c55 (v0.3.2).

We could consider changing to a Git submodule, though that would require
changes to the build instructions because we are not using submodules
anywhere else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Issues associated with 3rd party dependencies (RocksDB, SQLite, etc) Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants