-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make transaction status stream work #1108
Conversation
We'll likely also want to consider this issue as well, because without a terminal message indicating the closing of the stream it makes error handling on the client side more difficult: #823 |
# Conflicts: # Cargo.lock # tests/Cargo.toml
…freesig/test-submit-await
let (status_sender, _) = broadcast::channel(capacity); | ||
let (update_sender, _) = broadcast::channel(capacity); | ||
let (new_tx_notification_sender, _) = broadcast::channel(capacity); | ||
let update_sender = UpdateSender::new(capacity); |
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.
We use 100
as capacity
right now. It means we can only submit 100 transactions because of the permit
. I think we need to increase it or make configurable
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.
@freesig I made small changes around the main logic. Could you check it, please? If everything okay, I think we can merge 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.
looks good
@@ -147,7 +148,10 @@ impl fuel_core_txpool::ports::TxPoolDb for Database { | |||
fn transaction_status( | |||
&self, | |||
tx_id: &fuel_core_types::fuel_types::Bytes32, | |||
) -> StorageResult<Option<fuel_core_types::services::txpool::TransactionStatus>> { | |||
Ok(self.get_tx_status(tx_id)?) | |||
) -> StorageResult<fuel_core_types::services::txpool::TransactionStatus> { |
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.
Kinda weird to return an error for not found
## What's Changed * version compatibility cleanup by @Voxelot in #1171 * Added example with custom query around the `fuel-core-client` by @xgreenx in #1175 * Update to fuel-vm 0.32 (including wideint gas profiling) by @Dentosal in #1173 * feat: Client primitives by @bvrooman in #1144 * Improve executor config by @Voxelot in #1185 * Added `contract_id` to the `ContractConfig` by @xgreenx in #1184 * fix windows file name error by @firedpeanut in #1176 * Make transaction status stream work by @freesig in #1108 * Added `submit_and_await` endpoint to not miss the notifications by @xgreenx in #1192 * feat: Use ID types in client api by @bvrooman in #1191 * Use `fuel-vm 0.33` with predicate estimation by @xgreenx in #1195 * Add transaction lifecycle diagram to the docs by @digorithm in #1201 * sync with peers before producing blocks by @leviathanbeak in #1169 * SMT storage key hashing by @xgreenx in #1207 ## New Contributors * @firedpeanut made their first contribution in #1176 **Full Changelog**: v0.18.1...v0.19.0 --------- Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
## What's Changed * version compatibility cleanup by @Voxelot in FuelLabs/fuel-core#1171 * Added example with custom query around the `fuel-core-client` by @xgreenx in FuelLabs/fuel-core#1175 * Update to fuel-vm 0.32 (including wideint gas profiling) by @Dentosal in FuelLabs/fuel-core#1173 * feat: Client primitives by @bvrooman in FuelLabs/fuel-core#1144 * Improve executor config by @Voxelot in FuelLabs/fuel-core#1185 * Added `contract_id` to the `ContractConfig` by @xgreenx in FuelLabs/fuel-core#1184 * fix windows file name error by @firedpeanut in FuelLabs/fuel-core#1176 * Make transaction status stream work by @freesig in FuelLabs/fuel-core#1108 * Added `submit_and_await` endpoint to not miss the notifications by @xgreenx in FuelLabs/fuel-core#1192 * feat: Use ID types in client api by @bvrooman in FuelLabs/fuel-core#1191 * Use `fuel-vm 0.33` with predicate estimation by @xgreenx in FuelLabs/fuel-core#1195 * Add transaction lifecycle diagram to the docs by @digorithm in FuelLabs/fuel-core#1201 * sync with peers before producing blocks by @leviathanbeak in FuelLabs/fuel-core#1169 * SMT storage key hashing by @xgreenx in FuelLabs/fuel-core#1207 ## New Contributors * @firedpeanut made their first contribution in FuelLabs/fuel-core#1176 **Full Changelog**: FuelLabs/fuel-core@v0.18.1...v0.19.0 --------- Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
This PR refactors the
transaction_status_change
function to improve its readability and efficiency. The main changes are:BoxStream<'a, Result<TxUpdate, BroadcastStreamRecvError>>
toBoxStream<'a, TxStatusMessage>
.impl Stream<Item = anyhow::Result<TransactionStatus>> + 'a
toimpl Stream<Item = anyhow::Result<ApiTxStatus>> + 'a
.Additionally, this PR introduces property testing to ensure the refactored
transaction_status_change
function behaves correctly under various input conditions. This will help identify potential edge cases, increase the test coverage, and provide greater confidence in the robustness of the changes made.