diff --git a/README.md b/README.md index 275f47d..8b6c498 100644 --- a/README.md +++ b/README.md @@ -133,12 +133,12 @@ Consult the [Kurtosis OP package](https://github.com/ethpandaops/optimism-packag Odyssey has a custom `wallet_` namespace, that allows users to delegate their EOAs to a contract using EIP-7702, and perform transactions on those accounts, all funded by the sequencer. -To enable this namespace, set the environment variable `EXP1_SK` to a private key that will sign the transactions, and `EXP1_WHITELIST` to a comma-delimited list of checksummed addresses accounts are allowed to delegate to. The new RPC method, `wallet_odyssey_sendTransaction`, will only sign transactions that either: +To enable this namespace, set the environment variable `EXP1_SK` to a private key that will sign the transactions, and `EXP1_WHITELIST` to a comma-delimited list of checksummed addresses accounts are allowed to delegate to. The new RPC method, `odyssey_sendTransaction`, will only sign transactions that either: 1. Delegate accounts to one of the whitelisted addresses using EIP-7702, or 1. Send transactions to an EIP-7702 EOA that is already delegated to a whitelisted address -The `wallet_odyssey_sendTransaction` endpoint accepts the same fields as `eth_sendTransaction`, with these notable exceptions: +The `odyssey_sendTransaction` endpoint accepts the same fields as `eth_sendTransaction`, with these notable exceptions: 1. `nonce` must not be set, as this is managed by the node 1. `value` must be unset or 0 @@ -150,7 +150,7 @@ The following fields are ignored, as they are overwritten internally: 1. `gasLimit` 1. `chainId` -To get the list of contracts that are whitelisted for `wallet_odyssey_sendTransaction`, you can query `wallet_getCapabilities`. +To get the list of contracts that are whitelisted for `odyssey_sendTransaction`, you can query `wallet_getCapabilities`. ### Security diff --git a/crates/e2e-tests/src/tests.rs b/crates/e2e-tests/src/tests.rs index ba74d5b..8e5d68d 100644 --- a/crates/e2e-tests/src/tests.rs +++ b/crates/e2e-tests/src/tests.rs @@ -73,8 +73,7 @@ async fn test_wallet_api() -> Result<(), Box> { let tx = TransactionRequest::default().with_authorization_list(vec![auth]).with_to(signer.address()); - let tx_hash: B256 = - provider.client().request("wallet_odyssey_sendTransaction", vec![tx]).await?; + let tx_hash: B256 = provider.client().request("odyssey_sendTransaction", vec![tx]).await?; let receipt = PendingTransactionBuilder::new(&provider, tx_hash).get_receipt().await?; diff --git a/crates/wallet/src/lib.rs b/crates/wallet/src/lib.rs index 3025dd6..32a5a62 100644 --- a/crates/wallet/src/lib.rs +++ b/crates/wallet/src/lib.rs @@ -4,13 +4,13 @@ //! //! - `wallet_getCapabilities` based on [EIP-5792][eip-5792], with the only capability being //! `delegation`. -//! - `wallet_odyssey_sendTransaction` that can perform sequencer-sponsored [EIP-7702][eip-7702] +//! - `odyssey_sendTransaction` that can perform sequencer-sponsored [EIP-7702][eip-7702] //! delegations and send other sequencer-sponsored transactions on behalf of EOAs with delegated //! code. //! //! # Restrictions //! -//! `wallet_odyssey_sendTransaction` has additional verifications in place to prevent some +//! `odyssey_sendTransaction` has additional verifications in place to prevent some //! rudimentary abuse of the sequencer's funds. For example, transactions cannot contain any //! `value`. //! @@ -100,7 +100,7 @@ pub trait OdysseyWalletApi { /// /// [eip-7702]: https://eips.ethereum.org/EIPS/eip-7702 /// [eip-1559]: https://eips.ethereum.org/EIPS/eip-1559 - #[method(name = "odyssey_sendTransaction")] + #[method(name = "sendTransaction", aliases = ["odyssey_sendTransaction"])] async fn send_transaction(&self, request: TransactionRequest) -> RpcResult; } @@ -213,7 +213,7 @@ where } async fn send_transaction(&self, mut request: TransactionRequest) -> RpcResult { - trace!(target: "rpc::wallet", ?request, "Serving wallet_odyssey_sendTransaction"); + trace!(target: "rpc::wallet", ?request, "Serving odyssey_sendTransaction"); // validate fields common to eip-7702 and eip-1559 if let Err(err) = validate_tx_request(&request) { @@ -382,9 +382,9 @@ fn validate_tx_request(request: &TransactionRequest) -> Result<(), OdysseyWallet #[derive(Metrics)] #[metrics(scope = "wallet")] struct WalletMetrics { - /// Number of invalid calls to `wallet_odyssey_sendTransaction` + /// Number of invalid calls to `odyssey_sendTransaction` invalid_send_transaction_calls: Counter, - /// Number of valid calls to `wallet_odyssey_sendTransaction` + /// Number of valid calls to `odyssey_sendTransaction` valid_send_transaction_calls: Counter, }