-
Notifications
You must be signed in to change notification settings - Fork 41
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
chore(rpc-types): Preferred Type #375
base: main
Are you sure you want to change the base?
Conversation
📚
|
Needs review from @emhane |
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
/// Types are preferred as follows: | ||
/// - Deposit Transactions if `chain_id` is not set | ||
/// - EIP-7702 if authorization_list is set | ||
/// - EIP-4844 if sidecar or max_blob_fee_per_gas is set |
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.
/// - EIP-4844 if sidecar or max_blob_fee_per_gas is set |
/// - EIP-7702 if authorization_list is set | ||
/// - EIP-4844 if sidecar or max_blob_fee_per_gas is set | ||
/// - EIP-2930 if access_list is set | ||
/// - Legacy if gas_price is set and access_list is unset | ||
/// - EIP-1559 in all other cases |
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.
/// - EIP-7702 if authorization_list is set | |
/// - EIP-4844 if sidecar or max_blob_fee_per_gas is set | |
/// - EIP-2930 if access_list is set | |
/// - Legacy if gas_price is set and access_list is unset | |
/// - EIP-1559 in all other cases | |
/// - See [`TransactionRequest::preferred_type`]. |
I just delegate docs when I delegate a call, that way I know I don't create doc bugs in future
TxType::Eip1559 => OpTxType::Eip1559, | ||
TxType::Eip2930 => OpTxType::Eip2930, | ||
// EIP-4844 transactions are not supported by Optimism. | ||
TxType::Eip4844 => OpTxType::Eip1559, |
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 add a debug log here as well
if self.0.chain_id.is_none() { | ||
return OpTxType::Deposit; | ||
} |
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.
this function is intended for clients sending txs, should we return deposit here?
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.
Does it make sense if the chain_id
is none that deposit is returned and the client should reject the tx?
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.
Alternatively we remove this and just fall-through to the TransactionReceipt
Description
Fixes #28.
Implements the
preferred_type
method on theOpTransactionRequest
.