-
Notifications
You must be signed in to change notification settings - Fork 30
feat(code/engine): Store proposed values in WAL #896
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #896 +/- ##
===========================
===========================
|
…osals are built (#945) * Make `new_prevote`, `new_precommit` and `new_proposal` methods of `Context` instead of static functions * Stuff middleware in the `TestContext` instead of static variable * Remove unused dep * Add way to access middleware from TestContext
… by us instead of performing `GetValue` effect
Sorry for the stale review, forgot to publish couple of days ago. Will close the ones resolved. |
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 made a full pass! It looks good to me! Great job @romac ! I left some comments!
As a side not, I am more convinced that different modes parts-only
and others should not be part of consensus-core, and that we need to rethink these designs, if for nothing but just for code clarity. IMHO, these modes are complicating the code.
Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
We can look into it but here is a brief overview and history:
We have draft PRs: #942 and (not directly related) #943 along your comments (and some raised during the review of ADR003). Mainly trying to move the checks in the engine and get rid of proposal parts. But we do have some concerns and we can discuss in the future. |
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.
Made another pass! LGTM! Great job!
Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Romain Ruetschi <github@romac.me>
* feat(code/engine): Store locally proposed value in WAL and re-use it if available * Cleanup * Merge all three WalAppend effects into one * Cleanup * Add multi-round test with timeouts * Cleanup * Add a middleware to the test context to override vote building * Less noisy logs in test app * Add concept of middleware to change from the tests how votes and proposals are built (#945) * Make `new_prevote`, `new_precommit` and `new_proposal` methods of `Context` instead of static functions * Stuff middleware in the `TestContext` instead of static variable * Remove unused dep * Add way to access middleware from TestContext * Deduplicate timeout elapsed code * Replay proposed values before other entries * Split `StartHeight` into `PrepareHeight` and `StartHeight` * Add check that we are in the right state before starting a height * Actually replay the proposed values * Cleanup * Store proposed values for other rounds * Better naming * Replay locally proposed value as an `ProposedValue` input instead of `Propose` input * Fix unused variable warning * Replay proposals * On GetValue output from the driver, re-use any full proposal proposed by us instead of performing `GetValue` effect * Remove outdated check in Starknet tests * Cleanup * Simplify WAL replay * Store all proposed values (local or not) in the WAL * Replay the whole WAL in one go after `StartHeight` * The application will get a `GetValue` effect during WAL replay, but its response will be ignored if we already had a proposed value in the WAL. * Re-enable checks in byzantine WAL tests * Cleanup * Cleanup protos * Replay ProposedValue exactly as stored in the WAL * Log proposed values to WAL only if not already seen and therefore logged. * Fix issue with last commit, store proposed values before getting the full proposal. * Fix comments * Ensure all timeouts can be decoded * Re-add check that was previously removed when we were replaying WAL before starting round 0 * Merge `WalReplay` events into one * Review comments * Apply suggestions from code review Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * Add comments to handler functions * Add comments to on_propose handler * Add encode and decode functions for all wal entries * Apply suggestion from code review Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com> Signed-off-by: Romain Ruetschi <github@romac.me> --------- Signed-off-by: Anca Zamfir <ancazamfir@users.noreply.github.com> Signed-off-by: Romain Ruetschi <github@romac.me> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com> Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> Co-authored-by: nenadmilosevic95 <50905385+nenadmilosevic95@users.noreply.github.com>
Closes: #897
PR author checklist
For all contributors
For external contributors