Skip to content
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

fix: TransactionStatus::status should not be waiting for Final #379

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ChaoticTempest
Copy link
Member

The TransactionStatus::status call should not be waiting for Final inclusion of the transaction as it is supposed to only be checking the status of the transaction on chain and not wait for it to completely complete. Also, this does not take away any feature as TransactionStatus::wait already does the full wait

.worker
.client()
.tx_async_status(
&self.sender_id,
near_primitives::hash::CryptoHash(self.hash.0),
near_primitives::views::TxExecutionStatus::Final,
TxExecutionStatus::Included,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, final is not needed, but looking at the implementation, it feels that you actually need ExecutedOptimistic since the function needs to return the transaction outcome, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, this is just polling the transaction status, so ExecutedOptimistic would have the transaction already be slightly completed. This function should just be returning immediately where ExecutedOptimistic would take some time to resolve

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misinterpreted Poll<> part in the function signature. I thought about it as part of the native Rust futures polling, but it is not.

Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@race-of-sloths score 3

@frol frol merged commit 87c5ae5 into main Oct 18, 2024
6 checks passed
@frol frol deleted the phuong/fix/do-not-wait-on-status branch October 18, 2024 11:00
@race-of-sloths
Copy link

@frol Thank you for calling!

@ChaoticTempest Thank you for the contribution! Join Race of Sloths by simply mentioning me in your comment/PRs description and start collecting Sloth Points through contributions to open source projects.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@frol frol mentioned this pull request Oct 18, 2024
frol added a commit that referenced this pull request Oct 19, 2024
## 🤖 New release
* `near-workspaces`: 0.14.0 -> 0.14.1 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.14.1](near-workspaces-v0.14.0...near-workspaces-v0.14.1)
- 2024-10-18

### Fixed

- TransactionStatus::status should not be waiting for Final
([#379](#379))

### Other

- fix clippy 1.82 (doc preambles)
([#381](#381))
- bump cargo-near-build to 0.2.0
([#380](#380))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants