-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(tx-pool): Add new TransactionPool trait for getting the best transactions with blob fee #4834
Conversation
Codecov Report
... and 143 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -245,6 +245,39 @@ impl<T: TransactionOrdering> TxPool<T> { | |||
} | |||
} | |||
|
|||
/// Returns an iterator that yields transactions that are ready to be included in the block with | |||
/// the given base fee and optional blob fee. | |||
pub(crate) fn best_transactions_with_attributes( |
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.
Hey @mattsse please let me know your opinion about this function and then I can also write the related unit tests
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 is great, ty.
one suggestion to turn the arguments into a new struct type
crates/transaction-pool/src/lib.rs
Outdated
base_fee: u64, | ||
blob_fee: Option<u64>, |
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 want a new struct type for this, this way it's easier to call and it won't break if we need more attributes in the future
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 added BestTransactionsAttributes
struct as the argument
basefee: u64, | ||
blob_fee: Option<u64>, | ||
) -> Vec<Arc<ValidPoolTransaction<T>>> { | ||
unreachable!() |
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.
unreachable!() | |
Vec::new() |
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
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 is great, tysm!
Closes: #4822