-
Notifications
You must be signed in to change notification settings - Fork 76
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
Conversation
c42f838
to
a2bc7d6
Compare
crates/wallet/src/lib.rs
Outdated
// err.into() | ||
OdysseyWalletError::InvalidTransactionRequest |
There was a problem hiding this comment.
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
ProviderBuilder::new() | ||
.with_recommended_fillers() | ||
.wallet(wallet) | ||
.on_client(rpc_client), | ||
ctx.config().chain.chain().id(), |
There was a problem hiding this comment.
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
621ea88
to
f7eb8c8
Compare
There was a problem hiding this 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
/// The secret key to sponsor transactions with. | ||
#[arg(long, value_name = "SECRET_KEY", env = "RELAY_SK")] | ||
secret_key: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great reference ty,
There was a problem hiding this 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
9e2a2f0
to
71b108b
Compare
0d37c7d
to
26cac5e
Compare
26cac5e
to
a35e85d
Compare
On top of #90
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.?
crates/wallet/src/lib.rs
Outdated
/// 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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
e6844da
to
d010d67
Compare
d010d67
to
7f3e8ab
Compare
7f3e8ab
to
96aa0ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming bikeshed
Extracts the
wallet_
namespace to its own standalone service in preparation for other things.Closes #94