feat: implement core/aggsigdb#430
Conversation
- Use Actor model - Implement `store` - Test `store`
- Use Mutex/Notify pattern - Remove need for handles - Adjust tests and docs
- Use existing Deadliner API (Arc) - Add tests
- Match Charon
- Rust specific
- Matches Charon API
|
Claude finished @emlautarom1's task in 3m 32s —— View job Claude PR Review —
|
| Severity | Item |
|---|---|
| 🟠 | wait_for has no cancellation/timeout primitive — confirm intent |
| 🟠 | Deadliner::c() == None silently disables eviction — log or expect |
| 🟡 | tokio::sync::Mutex unnecessary; std::sync::Mutex is sufficient |
| 🟡 | Drop keysByDuty index makes eviction O(n) vs Charon's O(k) |
| 🟡 | notify_waiters fires even on no-op stores |
| 🟡 | deadliner.add before lock — re-confirm the eviction race comment |
| 🔵 | Doc/ergonomic nits, Cargo.lock churn separability |
Nothing here is a blocker; the implementation is correct and matches Charon V2 semantics. Most actionable is the keysByDuty index (Charon left it in for a reason) and the Deadliner::c() == None warn/expect. The wait_for cancellation question is worth nailing down before downstream consumers pin against this API.
· Branch: emlautarom1/core-aggsigdb
- Annotate `wait_for` abort mechanism - Log when deadliner does not have a channel
8b30fe0 to
b341668
Compare
|
Claude finished @emlautarom1's task in 2m 41s —— View job Claude PR Review —
|
| Severity | Item | Status |
|---|---|---|
| 🔴 | Correction: tokio::sync::Mutex is required (lock crosses await) |
— |
| 🟡 | keysByDuty index for O(k) eviction |
Open |
| 🟡 | Audit/comment that deadliner.add stays non-blocking |
New |
| 🟡 | wait_for could take &Duty / &PubKey |
Open |
| 🟢 | yield_now + is_finished test pattern is racy on contended CI |
New |
| 🟢 | IntoIterator yields &Box<dyn SignedData> — clippy may nudge |
New |
| 🔵 | MemDB::new # Panics rustdoc note |
Open |
| 🔵 | Cargo.lock churn separability |
Open |
Nothing blocking. The keysByDuty optimization is the most worthwhile follow-up (it's a deliberate Charon design and ~10 lines of code); everything else is documentation/ergonomics.
· Branch: emlautarom1/core-aggsigdb
|
There is a bug on Charon regarding immediately expired duties, which result in readers getting
Both V1 and V2 showcase this behaviour. The cause is that the result of
Right now, cases 2 and 3 are treated under |
Closes #169
There are two implementations in Charon: V1 uses an Actor model with commands and queries, and V2 uses a Mutex alongside Go runtime trickery. The implementation in use in Charon is V1 due to concurrency issues in V2.
This implementation is closer to V2, and we use tokio's tools (ex.
Notify) to replicate the Go runtime features.Tests have been ported when appropriate, and some new ones were added to increase coverage.