-
Notifications
You must be signed in to change notification settings - Fork 211
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: await_block LRU cache (non-global) #4080
feat: await_block LRU cache (non-global) #4080
Conversation
@@ -360,15 +385,6 @@ pub trait GlobalFederationApi { | |||
|
|||
async fn await_transaction(&self, txid: TransactionId) -> FederationResult<TransactionId>; | |||
|
|||
async fn await_output_outcome<R>( |
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.
Not object safe so had be kicked out (to impl DynGlobalApi
).
fa0419e
to
b68a820
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4080 +/- ##
==========================================
- Coverage 58.27% 58.09% -0.19%
==========================================
Files 192 192
Lines 42682 42972 +290
==========================================
+ Hits 24873 24964 +91
- Misses 17809 18008 +199 ☔ View full report in Codecov by Sentry. |
09d8f03
to
4634780
Compare
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, but blocked on two other PRs
4634780
to
4c4e9da
Compare
4c4e9da
to
3bbb35d
Compare
@elsirion ✔️ ❓ 🙏 🤣 |
fedimint-core/src/api.rs
Outdated
|
||
// but multiple request for the same `block_index` will serialize on the | ||
// per-index lock, avoiding doing the same work | ||
let mut block_lock = block_entry_arc.lock().await; |
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.
block_entry can be a OnceCell
https://docs.rs/tokio/latest/tokio/sync/struct.OnceCell.html
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 pushed 2db867d to reduce review cycles
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.
Interesting.
4efb0f2
to
2db867d
Compare
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.
Good catch, makes the code a lot simpler!
On top of #4035 and #4042.
This is a version #4046 without global statics.
Wasm couldn't handle
lazy_static
, and globals are icky. The price is wrangling with an already overly complicated set of traits in this area.