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: add missing admin_* methods #991

Merged
merged 10 commits into from
Jul 3, 2024

Conversation

alexfertel
Copy link
Contributor

@alexfertel alexfertel commented Jun 29, 2024

Motivation

Adds missing admin_* RPC methods. Work towards completing #926.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@alexfertel alexfertel marked this pull request as ready for review June 29, 2024 09:13
@alexfertel
Copy link
Contributor Author

alexfertel commented Jun 29, 2024

Interestingly, the wasm-wasi check also fails on main. Unsure why ext::anvil::tests::test_anvil_set_interval_mining fails on windows. Damn, why is this PR breaking this stuff...

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.

ty, this is a subscription for

https://github.com/ethereum/go-ethereum/blob/473ee8fc07a3f89cf3978e164a6fad218de9a6b5/p2p/peer.go#L92-L103

and it looks like we're missing this type in the admin crate

crates/provider/src/ext/admin.rs Outdated Show resolved Hide resolved
crates/provider/src/ext/admin.rs Outdated Show resolved Hide resolved
@DaniPopes
Copy link
Member

DaniPopes commented Jun 29, 2024

Interestingly, the wasm-wasi check also fails on main. Unsure why ext::anvil::tests::test_anvil_set_interval_mining fails on windows. Damn, why is this PR breaking this stuff...

Not your fault, fixed on main

@mattsse
Copy link
Member

mattsse commented Jun 29, 2024

@alexfertel

see also

/// Set the request to be a non-standard subscription (i.e. not
/// "eth_subscribe").
///
/// # Panics
///
/// Panics if called after the request has been sent.
pub fn set_is_subscription(&mut self) {

"eth_subscribe" is detected as subscription by default, for others we'd need to set it after calling ".request("admin_peeEvents").set_is_subscription"

@alexfertel alexfertel marked this pull request as draft June 29, 2024 14:02
@alexfertel
Copy link
Contributor Author

@mattsse Does this make more sense?

I'm worried that PeerEvent may not serialize/deserialize correctly, is there a place where I can find a few json examples of the responses so that I can test this?

@alexfertel alexfertel marked this pull request as ready for review June 29, 2024 14:06
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks!

@DaniPopes DaniPopes merged commit ec9e13e into alloy-rs:main Jul 3, 2024
22 checks passed
@alexfertel alexfertel deleted the admin-namespace branch July 3, 2024 17:52
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
* feat: add missing admin_* methods

* fix: add 0x prefix to subscription ids

* fix: u16 -> U128

* fix: remork to match other subscriptions

* lint(fmt): fix formatting

* fix: use alloy_pubsub when pubsub is enabled

* fix: add missing type path

* fix(docs): remove outdated comment

* doc: nit

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
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.

3 participants