-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(rpc): Replace TypedTransactionType #11089
Conversation
628af0d
to
5a2d892
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.
cool, this looks pretty good already
some suggestions
crates/rpc/rpc-eth-api/Cargo.toml
Outdated
@@ -21,7 +21,7 @@ reth-evm.workspace = true | |||
reth-primitives.workspace = true | |||
reth-provider.workspace = true | |||
reth-revm.workspace = true | |||
reth-rpc-types.workspace = true | |||
# reth-rpc-types.workspace = true |
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.
cool, can we remove this entirely?
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.
yes after I rebased seems like it's not used anymore at all- will have a go at removing entirely
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.
@mattsse I feel like this reth-rpc-types doesn't do much anymore, should I give it a go to remove it fully ? (in this or separate pr)?
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.
yep: #11198
// create local signer wallet from signing key | ||
let sk_bytes = self.accounts.get(address).ok_or(SignError::NoAccount)?.secret_bytes(); | ||
let wallet = | ||
PrivateKeySigner::from_bytes(&sk_bytes.into()).map_err(|_| SignError::NoAccount)?; | ||
let signer = EthereumWallet::from(wallet); |
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.
perhaps we can simplify this by changing SecretKey to
PrivateKeySigner
?
} |
see also PrivateKeySigner::random_{with}
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.
updated now using signer api
b188cea
to
cd23c92
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.
cool, one more suggestion
let sk = self.get_key(account)?.to_field_bytes(); | ||
let signature = sign_message(B256::from_slice(sk.as_ref()), hash); | ||
signature.map_err(|_| SignError::CouldNotSign) |
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.
you can use the signer API here:
use alloy_signer::signer::SignerSync;
let sk = self.get_key(account)?.sign_hash_sync
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.
fixed
d536c3b
to
070debb
Compare
to_primitive_transaction(request).ok_or(SignError::InvalidTransactionRequest)?; | ||
let tx_signature_hash = transaction.signature_hash(); | ||
let signature = self.sign_hash(tx_signature_hash, *address)?; | ||
// create local signer wallet from signing key |
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.
update comment
crates/rpc/rpc-types/src/lib.rs
Outdated
#[cfg(feature = "jsonrpsee-types")] | ||
pub use eth::{ | ||
engine, | ||
engine::{ | ||
ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, PayloadError, | ||
}, | ||
}; | ||
|
||
use alloy_primitives as _; |
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.
possibly could be removed can look into it
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.
nice, I only removed the unused deps and made sure the features are updated accordingly
Towards closing #7490
Quick vibe check if I'm going the right way here