Skip to content

feat: extract wallet api to own service #90

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

Merged
merged 7 commits into from
Dec 10, 2024
Merged

feat: extract wallet api to own service #90

merged 7 commits into from
Dec 10, 2024

Conversation

onbjerg
Copy link
Contributor

@onbjerg onbjerg commented Nov 20, 2024

Extracts the wallet_ namespace to its own standalone service in preparation for other things.

Closes #94

@onbjerg onbjerg added the C-enhancement New feature or request label Nov 20, 2024
@onbjerg onbjerg force-pushed the onbjerg/relay branch 5 times, most recently from c42f838 to a2bc7d6 Compare November 26, 2024 16:52
// err.into()
OdysseyWalletError::InvalidTransactionRequest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

need to fix the error handling, it's a bit cumbersome to work with RpcResult using thiserror

@onbjerg onbjerg marked this pull request as ready for review November 26, 2024 16:53
ProviderBuilder::new()
.with_recommended_fillers()
.wallet(wallet)
.on_client(rpc_client),
ctx.config().chain.chain().id(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could get rid of the chain id arg if we weren't dependent on integrating it into the sequencer also; in that case, the service could just fetch the chain id. but since we init the module here before the rpc server has started, this is not possible

@onbjerg onbjerg requested a review from gakonst November 26, 2024 17:01
@onbjerg onbjerg force-pushed the onbjerg/relay branch 2 times, most recently from 621ea88 to f7eb8c8 Compare November 26, 2024 17:29
Copy link
Contributor

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

really excited for this

Comment on lines +30 to +32
/// The secret key to sponsor transactions with.
#[arg(long, value_name = "SECRET_KEY", env = "RELAY_SK")]
secret_key: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great reference ty,

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.

suggesting to solve this with a helper so we don't need to go through rpc if we keep using this a builtin

@onbjerg onbjerg force-pushed the onbjerg/relay branch 3 times, most recently from 9e2a2f0 to 71b108b Compare December 6, 2024 14:31
@onbjerg onbjerg requested a review from mattsse December 6, 2024 14:33
@onbjerg onbjerg force-pushed the onbjerg/relay branch 6 times, most recently from 0d37c7d to 26cac5e Compare December 9, 2024 18:53
Copy link
Contributor

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

👍 -- batching/queue & sponsorship in separate prs?

/// The Odyssey relayer service sponsors transactions for EIP-7702 accounts.
#[derive(Debug, Parser)]
#[command(author, about = "Relay", long_about = None)]
struct Args {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe should be moved into the lib and be importable in odyssey binary with clap flatten under relayer.http.address, --relayer.signer etc.?

/// The capability to perform [EIP-7702][eip-7702] delegations, sponsored by the sequencer.
/// A trait for any type capable of estimating, signing, and propagating sponsored transactions.
#[async_trait]
pub trait Node<N>
Copy link
Contributor

Choose a reason for hiding this comment

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

good separation

i wish didn't need a new trait and could just work w/ alloy provider traits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but then we'd have to implement alloy provider trait for reth's state provider which is a lot of work when we only need like 3-4 functions

@onbjerg onbjerg force-pushed the onbjerg/relay branch 4 times, most recently from e6844da to d010d67 Compare December 10, 2024 16:32
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.

naming bikeshed

@onbjerg onbjerg merged commit 19548cf into main Dec 10, 2024
14 checks passed
@onbjerg onbjerg deleted the onbjerg/relay branch December 10, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-wallet C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor wallet_ API to make a standalone binary
4 participants