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

chore: remove async-trait #1244

Closed
wants to merge 8 commits into from
Closed

chore: remove async-trait #1244

wants to merge 8 commits into from

Conversation

MujkicA
Copy link
Contributor

@MujkicA MujkicA commented Jan 9, 2024

Checklist

  • I have linked to any relevant issues.
  • I have updated the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary labels.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@MujkicA MujkicA added the tech-debt Improves code quality or safety label Jan 9, 2024
@MujkicA MujkicA self-assigned this Jan 9, 2024
Br1ght0ne
Br1ght0ne previously approved these changes Jan 9, 2024
iqdecay
iqdecay previously approved these changes Jan 10, 2024
Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

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

Maybe add in the PR description that this feature was shipped as part of rust 1.75 just so we know.

@MujkicA MujkicA dismissed stale reviews from iqdecay and Br1ght0ne via e84b852 January 22, 2024 11:01
@Br1ght0ne
Copy link
Member

Br1ght0ne commented Jan 22, 2024

(sorry if this was discussed previously, I could have missed it)

Took another look at this. Seems like some sort of type erasure needs to be done, as explained in erased-serde (by none other than dtolnay).

E.g., we would have ErasedSigner and impl Signer for dyn ErasedSigner, and use trait objects like these:

-unresolved_signatures: &[Box<dyn Signer + Send + Sync>],
+unresolved_signatures: &[Box<dyn ErasedSigner + Send + Sync>],

@segfault-magnet
Copy link
Contributor

@MujkicA Any update?
@hal3e did you sort out the object safety issues with @MujkicA ?

@MujkicA
Copy link
Contributor Author

MujkicA commented Feb 12, 2024

We discussed using Rust's own async trait support and also seal traits like Transaction, TranscationBuilder etc.

Because of lack of support for dynamic dispatch, it was agreed that we stick to the async-trait crate for now.
There is no indication that we need the performance gain from not Boxing futures at trait boundaries (e.g. TransactionBuilder).

@MujkicA MujkicA closed this Feb 12, 2024
@MujkicA MujkicA mentioned this pull request Feb 12, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Improves code quality or safety
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants