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: improve node bindings #1279

Merged
merged 8 commits into from
Sep 12, 2024
Merged

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Sep 12, 2024

Motivation

Improves on existing Reth bindings and other node bindings.

Supersedes #1076

Solution

  • Adds ability to set custom ports
  • Now picks random instance for Reth by default to reduce flakiness in tests (busy ports). Users can override this by passing instance(0) to use the default ports.
  • Adds run_with_tempdir_* utility methods to better handle automatic cleaning up and adding of prefixes so that cleaning up the /tmp folder manually becomes easier
  • Unifies Anvil errors with other node errors and generalizes
  • Exposes utils in node-bindings namespaced, allowing to import utilities like run_with_tempdir_* whilst sitting behind a namespace to avoid polluting the scope.

I've decided not to include the hardcoded keys and addresses as proposed in #1076 as it is easy to derive if necessary and it is out of scope for Alloy.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks added the blocked This cannot move forward until something else changes label Sep 12, 2024
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

one suggestion
but this can be solved as followup

@zerosnacks zerosnacks removed the blocked This cannot move forward until something else changes label Sep 12, 2024
@zerosnacks
Copy link
Member Author

zerosnacks commented Sep 12, 2024

Removing blocked label, will update #1278 tests after merging

Requesting final review before merging

@zerosnacks zerosnacks requested a review from mattsse September 12, 2024 11:28
@zerosnacks zerosnacks merged commit 3d8c680 into main Sep 12, 2024
26 checks passed
@zerosnacks zerosnacks deleted the zerosnacks/improve-node-bindings-1 branch September 12, 2024 13:12
lwedge99 pushed a commit to sentioxyz/alloy that referenced this pull request Oct 8, 2024
* add run_with_tempdir

* update tests, now picks random instance by default

* document new random port picking

* fix clippy

* add port customization

* reset instance when configuring custom port as this is incompatible in reth

* additional tests for http_port(0)

* fix comment
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.

2 participants