feat(core): implement core/aggsigdb#452
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
- Annotate `wait_for` abort mechanism - Log when deadliner does not have a channel
- Faster evictions
- Avoid `notify` and unnecessary awakes - Removes mutexes
- Use `tokio::select!` - Apply clippy lints
- Do not sleep, wait for eviction to complete
* test: update qbft test * fix: compare run on retached thread * fix: removed hard coded salt in tests * fix: return error on Context cancelled * fix: hash from string, not magic number * fix: one shot cancel when parent is cancelled * fix: fix make_is_leader test * fix: minors naming and comments * fix: linter * fix: early cancel on the loop * fix: context cancel in compare * fix: validate definition * fix: add check pr < r * fix: test and document on run * fix: compare callback failed should timeout * fix: test use timeout channel instead of sleep * fix: add comment on cancellation poll interval * fix: use enum for invalid defnintion error * fix: add more test on check valid round * fix: using test-case * fix: small fixes * fix: linter * fix: remove unnecessary filter * fix: make_is_leader now 0-based * fix: add cancelled state for fake clock * fix: flanky tests by ordering and add small settle window time * fix: harden fake-clock to avoid flanky scheduling * fix: lint * refactor: introduce QbftTypes * refactor: group QBFT callbacks into typed request/logger structs * refactor: add ClientRecord * refactor: simplify internal_tests * refactor: simplify qbft mod.rs * refactor: remove skip clippy on qbft mod
- Proceed with store only when appropriate
- Use type alias instead
|
@claude Review the code and take into consideration the original PR (430) |
|
Claude finished @emlautarom1's task in 5m 36s —— View job Code review
Overall I think the actor model is a solid choice over the 🔴 Unintentional revert of an unrelated bug fix
file.write_all(data).await?;
- file.flush().await?;Please restore it. Fix this → 🟠
|
|
@claude Re-review the code and evaluate if the recent commits fix the issues detected previously. |
|
Claude finished @emlautarom1's task in 2m 43s —— View job Re-review: recent commits
I re-reviewed the four commits since my previous review ( Previously flagged issues✅ 1.
|
| deadliner: deadline::DeadlinerHandle, | ||
| } | ||
|
|
||
| impl Actor { |
There was a problem hiding this comment.
Though I believe it's a pattern that accurately captures the way Charon models services so we can get a lot of benefit from it, we still don't have a lot of actors implemented in Pluto.
For now I would prefer to have them hand-rolled and if we see room for refactoring we can introduce some third-party library.
- Rename structs to `Memory*`
Supersedes #430
Uses an Actor model as in Charon V1 which results in less locks and correct awaits on readers. Also, this implementation supports arbitrary cancellation through
CancellationToken. This is not strictly needed, but adding it is trivial. Lastly, the latest changes ondeadlinerwere merged which makes testing more straightforward.