-
Notifications
You must be signed in to change notification settings - Fork 128
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
Coinjoin chart #1640
Coinjoin chart #1640
Conversation
Shouldn't we replace "Coinjoin" with "CoinShuffle++" or something generic like "mixed coins" or "privacy" on these pages? Coinjoin really under sells where Decred has implemented (cspp). |
CSPP is only part of the server client protocol and does not appear on chain. Coinjoin is the name of the transaction type that is being identified. Mixed coins or privacy are accurate but are more generic, less specific. Perhaps more generic is better since what is being identified is actually several specific transaction cases such as the connected sstx transactions. |
I see. From a marketing perspective, how about "anonymity set"? |
Actually, Privacy Participation would jive well with the other charts (e.g. Stake Participation). How about that? |
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.
Partial review. Overall, this is pretty solid. charts_controller
adds a lot of code to force together two data sets that I'm not convinced need to be plotted together, but hopefully you can set me straight. The javascript there can be simplified quite a bit, but I don't want to put too much energy into it until I'm sure that there's a good reason.
@@ -154,7 +165,7 @@ function zipTvY (times, ys, yMult) { | |||
|
|||
function zipIvY (ys, yMult, offset) { | |||
yMult = yMult || 1 | |||
offset = offset || 1 | |||
offset = offset || 1 // TODO: check for why offset is set to a default value of 1 when genesis block has a height of 0 |
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.
33a6809
to
cb3f1c6
Compare
5b7b3e6
to
4a0df68
Compare
e63bab0
to
43de7d5
Compare
I have rolled back these changes for now. |
36843ca
to
4e13df5
Compare
Please have a look at the test failure:
|
db/dcrpg/queries.go
Outdated
if totalMixed < 0 { | ||
totalMixed *= -1 | ||
} |
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.
In what circumstances does this (totalMixed < 0
) happen? Surely that indicates a bug in something else.
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.
Please comment on this case.
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 no longer have this issue, this was based on different implementation where my effort to remove spent vouts
was leading the negative value. I ought to have removed it when the implementation was changed.
Thanks for refactoring to use Length. Just some trivial test failures related to code formatting (https://github.com/decred/dcrdata/runs/423024195#step:9:102). I'll do a final review and hopefully we can get this up on alpha today or tomorrow. |
For follow-up work, we should investigate triggering a fresh charts data update as part of the upgrade process rather than the usual charts data update on startup. The reason is that on startup I see"
It doesn't say what it is doing, but a look at |
After about 5 minutes:
Looks like it got through privacy participation and crashed on anonymity set. |
Note that to reproduce that panic, you will have to run with master to get a chartscache.gob the has all the charts data except anon set and priv partic. |
include fee in ticket price in IsMixedSplitTx steal txsizes from dcrwallet/internal/txsizes return mixDenom from IsMixedSplitTx txWithTicketPrice: really ugly way to get txraw and price for same best block
Add TotalMixed to explorer/types.BlockInfo. Add MixCount and MixDenom to explorer/types.TxBasic, and remove them from explorer/types.TxInfo.
Added a window bin for a moving 28 days sum of the total mixed. Added the 28 days moving sum line to the circulation chart. Added percentage of mixed total to the legend. Persist chart visibility in url. 29.07 days moving sum. {rewardPeriod} total mixed moving sum. Fetched ticket mixed total at 1% tolerance. Filled empty spaces with 0s to maintain the length of the record set Add moving sum graph with a checkbox to the total mixed chart. Removed total mixed moving sum chart from block bin on circulation chart. Used Mixed for label instead of Total Mixed. Hide log scale for coinjoins. Added day range accumulator for chart data and used it for the reward period.
while giving the user the ability to zoom by all other options
Added support for block bin on the chart
to resolve the issue of spent tx showing in anonymity set chart
earlier testnet transactions paid higher fees, checking a range to accommodate those
781ea38
to
e3e2d6e
Compare
Running well now. Fresh updating charts data is down to 20 seconds from >5 minutes. This is still several times longer than before, so we should look to optimizing this in future work. Last issue, code formatting again: https://github.com/decred/dcrdata/runs/425480283#step:9:97 |
this.query.update(this.settings) | ||
this.settings.chart = this.settings.chart || 'ticket-price' | ||
this.zoomCallback = this._zoomCallback.bind(this) | ||
this.drawCallback = this._drawCallback.bind(this) | ||
this.limits = null | ||
this.lastZoom = null | ||
this.visibility = [] | ||
if (this.settings.visibility) { | ||
this.settings.visibility.split(',', -1).forEach(s => { |
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.
Actually, I do not care for how the URL ends up with %2C
in it, but I don't have a better suggestion for this. Since the charts and controls are working, I don't want to delay this PR any longer. For a future issues. @buck54321 might also have a suggestion for this.
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.
The visibility here is an array.
Some chart has multiple lines and checkboxes for toggling the visibility of any of the lines. The encoded value of the array is what lead to the %2C
from visibility = [true, false]
.
During the iterations of the PR, I had a recommendation to preserve the visibility across page reload
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 understand the reason, and I agree tha tit's good to preserve the settings in the URL query parameters, I'm just pointing out that in the URL, the query params are ugly as a result:
We can resolve this in the future though, but it will have to be very near future and definitely before release otherwise we will get broken urls when we change the scheme.
Use running sum to hold block anonymity sum and a map to track spending heights and remove value from the running some. Take daily average for day
e3e2d6e
to
8883e0c
Compare
Letting it run for a while, I get warnings about dataset at index 10 when the charts do their occasional update:
Restarting dcrdata seems to repair things, but it looks like there will be a problem while running for long periods. |
SelectMixedVouts = ` | ||
SELECT vouts.value, fund_tx.block_height, spend_tx.block_height, vouts.tx_tree | ||
FROM vouts | ||
JOIN transactions AS fund_tx ON vouts.tx_hash=fund_tx.tx_hash | ||
LEFT OUTER JOIN transactions AS spend_tx ON spend_tx_row_id=spend_tx.id | ||
WHERE mixed=true and value>0 ORDER BY fund_tx.block_height;` |
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 thought you had a version of this query with a block height constraint like with SelectMixedTotalPerBlock
. Related to your comment at https://github.com/decred/dcrdata/pull/1640/files#diff-87f7a577b6af45d0284e4c3fbb98ddf5R3685
Will you follow up on this in a separate PR? I want to merge this, but this change must be done soon as this is an expensive query that the server can't afford to have running often.
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 will follow up in a separate PR
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.
Excellent, thanks. And thanks for your persistence and patience in this PR.
This does seem to be a consistent problem. Off by one in this dataset? [WRN] PSQL: charts.ValidateLengths: dataset at index 10 has mismatched length 421007 != 421008 [WRN] PSQL: charts.ValidateLengths: dataset at index 10 has mismatched length 421059 != 421060 |
Filled anonymity set until it is the same length with block height and the max funding height is filled
This PR is a collaboration between me and @raedah
We added a chart for coinjoin that shows the mixed amount by day block
We added a chart for the value of
Anonymity Set
to theCoin Supply
chart