Skip to content
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

Refactor dao monitor handling #5780

Closed
wants to merge 201 commits into from

Conversation

chimp1984
Copy link
Contributor

@chimp1984 chimp1984 commented Oct 24, 2021

Based on #5775
Starts at: 1ef21ac

Fixes #5779

This adds a flag to preferences for useDaoMonitor which is false by default.
Users can activate DAO state monitoring in the DAO monitor view or settings.
The Monitoring for proposal and blind vote data is not changed by that PR.

The hash creation for DAO state monitoring is due the large data set pretty slow. This makes a DAO sync for 1 months of data to take about 10-15 min. Without that hash creation for DAO state monitoring the DAO block parsing takes only 4 sec. for the same amount of blocks.

Power users should still keep it activated. But I think for most users its a unacceptable experience.
I will look further into a larger DAO state refactoring and maybe I find a new way how we can provide the feature without that high costs.

ripcurlx and others added 30 commits October 19, 2021 11:32
BuyerAsMakerTrade, BuyerAsTakerTrade, BuyerTrade
to bisq.core.trade.model.bisq_v1 package
Move TradeMessage into bisq.core.trade.protocol package
…radeUtil, TradeTxException to package bisq.core.trade.bisq_v1
We create a new address entry when opening the create offer view.
But we close and replace that view with the BSQ swap create offer view if
BSQ swap is selected, therefore the address entry would be dangling and
later cleaned up at openOfferManager. To clean it up directly we call the
resetAddressEntriesForOpenOffer on btcWalletService.
in signBsqSwapTransaction.
Remove unused code
Extract variables, inline method
Let DaoStateSnapshotService do the coordinated call of
`daoStateMonitoringService.createHashFromBlock(block);` and then
`maybeCreateSnapshot(block);`
if `preferences.isUseDaoMonitor()` is true
but activate it later so they have a gap in the chain) we set a flag
instead throwing an error and inform listeners. UI will react on that
and suggest a resync.
Add popup if re-activate
We use default value false but seeds should have
default value true.
@chimp1984 chimp1984 changed the title Optimize dao monitor Deactivate dao monitor by default Oct 24, 2021
super class to concrete class. Handle text and
button visibility in DaoStateMonitorView.
We used prevHash only for display in the UI but it did
not had any functional usage. It took about 50% of the data size
of the StateHashes (about 3 MB out of 6 MB total storage size).
The prevHash is used only as part of the pre image for the hash
but we take the hash of the previous StateHash item and then
stored that in the newly created StateHash item. So we do not change
that the previous item is part of the new hash, but only that we do not
persist it as it is not required and helps reduce the data load.
DaoStateBlock) so that we can persist it.

Apply the dao state hashes received from the seed nodes to our chain.
@chimp1984 chimp1984 changed the title Deactivate dao monitor by default Refactor dao monitor handling Oct 25, 2021
@chimp1984 chimp1984 closed this Oct 25, 2021
@chimp1984
Copy link
Contributor Author

Will re-open PR once complete. Had got too many changes....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redesign DAO state monitoring to avoid performance degradation
5 participants