-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: use network tx for Pool::Pooled
#13159
Conversation
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,
I only have one nit/suggestion, but this could also be done in a smol followup as good first issue
.into_iter() | ||
.map(|tx| tx.into_signed()) | ||
.collect::<Vec<_>>(); |
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 collect is a bit redundant and get_pooled_transaction_elements
was a workaround to avoid the collect here
{ | ||
self.pool.get_pooled_transactions_as(tx_hashes, limit) |
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 existed only so we can avoid a double-collect,
we can either find a way to enforce the
From<RecoveredTx<N::PooledTransaction>>
again which would be a bit weird because this would always be into_signed.
or we add another helper fn to this trait that strips the Recovered
layer away and returns just the pooled type
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.
looks like this fn is only used here, so I've just made it return transactions with already stripped signer e6c0f18
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.
makes sense
Pool::Transaction: | ||
PoolTransaction<Consensus = N::BroadcastedTransaction, Pooled = N::PooledTransaction>, |
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.
hmm, I think this would work for both OP and eth,
but for OP's case this would mean Consensus
must be a different type that what we currently have for TransactionSigned
(minus the deposit variant)
so Conensus
really just means: All consensus variants that are allowed over p2p
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.
couldn't Consensus
be same as Pooled
for OP?
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, for op these are the same type, basically TransactionSigned
- Deposit
@@ -981,7 +967,7 @@ pub trait PoolTransaction: | |||
type Consensus; | |||
|
|||
/// Associated type representing the recovered pooled variant of the transaction. | |||
type Pooled: Encodable2718 + Into<Self>; | |||
type Pooled: SignedTransaction; |
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.
makes sense, we don't expect non signed txs 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.
yeah, it's also more like a RecoverableTransaction
PoolTransaction< | ||
Pooled: From<PooledTransactionsElementEcRecovered> | ||
+ Into<PooledTransactionsElementEcRecovered> | ||
+ Into<PooledTransactionsElement>, | ||
> |
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.
amazing
Similar to #13086, but for
Pooled
transaction AT.This relaxes bound on
EthPoolTransaction
, so they no longer require from/into traits for concretePooledTransactionsEleement
, and the conversion (Consensus, sidecar) -> Pooled is now abstracted asEthPoolTransaction::try_from_eip4844