-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactoring] Budget, round 4: remove Broadcast classes #1851
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
[Refactoring] Budget, round 4: remove Broadcast classes #1851
Conversation
5f44329 to
5045657
Compare
8de3a0c to
6034c6f
Compare
b8be313 to
5da20e0
Compare
26169a6 to
fcff0c0
Compare
|
Rebased on master. Ready for review. |
furszy
left a comment
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.
Review until b40325d (non inclusive), left purely code comments. Looking good so far
furszy
left a comment
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.
Code review ACK fcff0c0 .
Testing it now..
furszy
left a comment
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.
Tested with 1916, the sync is working as intended. ACK fcff0c0 .
There are issues on the superblock creation/validation now on master but it's not related to this PR.
Returning the serialized object for the network message. Also, introduce class constructors from CDataStream.
Just use mapProposals and mapFinalizedBudgets to check for existence
fcff0c0 to
5004e1f
Compare
|
Rebased and renamed |
furszy
left a comment
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.
re utACK 5004e1f .
Fuzzbawls
left a comment
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.
ACK 5004e1f
…ndexes d7a1c99 [Cleanup] Extra call to CBudgetMan::SetBestHeight in reconsiderblock (random-zebra) 5d0731e [Cleanup] Remove redundant Clear in CBudgetManager constructor (random-zebra) 48b723e [Budget] Remove proposal/budgets if FeeTx block is disconnected (random-zebra) 9c6173c [Budget] Introduce mapFeeTxToProposal and mapFeeTxToBudget (random-zebra) Pull request description: Based on top of: - [x] #1851 Starting with `[Budget] Introduce mapFeeTxToProposal and mapFeeTxToBudget` (0eb9e45) Since #1845 we no longer check repeatedly the active chain, when updating a budget object, we just save the height of the block including the collateral tx (ref #1845), when we first add the proposal/budget to the map. Therefore we need to handle the case where said block is disconnected from the chain. In order to do so efficiently, this PR adds two indexes (`mapFeeTxToBudget`/`mapFeeTxToProposal`), mapping collateral txids to the relative budget objects (while such objects are stored in the map). A simple function `CBudgetManager::RemoveByFeeTxId()` can then be called from `DisconnectBlock` when undoing transactions, in order to remove the now-conflicted budget objects (without performing any expensive search). ACKs for top commit: furszy: nice, code review ACK d7a1c99. Fuzzbawls: ACK d7a1c99 Tree-SHA512: 9dd8a671032f79105219b7a0e3e0514b991ff92e55834f5adad4964fb9b5c1842bbb0c0995c9b504ca79c5c86115061f4a93e9b4560a63c2beaf66aa5915c2f5
Continues the budget-refactoring thread.
Remove the following classes entirely
CBudgetProposalBroadcastCFinalizedBudgetBroadcastReplace them with a new dastream-based constructor and a
GetBroadcastfunction (returning the serialized stream) insideCBudgetProposal/CFinalizedBudgetclasses.This allows us to get rid also of
mapSeenProposalsandmapSeenFinalizedBudgetsand all the relative ugly code duplication (just rely onmapProposalsandmapFinalizedBudgetsto check for existence, and to get the broadcast messages to send).Based on top of
Starts with
[Refactoring] Introduce CFinalizedBudget/CBudgetProposal::GetBroadcast(37c629881372e492a65ea17a4b18ad02cd53ed58)