-
Notifications
You must be signed in to change notification settings - Fork 50
[ci] Zero balance related fields in round aggregates so that they always agree (BFT) #3204
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
…they always agree. Signed-off-by: Raymond Roestenburg <[email protected]>
Can we test this somehow? Should we also mention this in the release notes? |
|
@martinflorian-da the existing tests for scan aggregation should suffice but will have another look. |
@ray-roestenburg-da Well if they did they should be failing on main now :) Specifically I wonder if we can have a test that replicates the current situation on MainNet, and fails without these changes. (I'm not super confident in my context here.) |
Since all results are zero for these values, they will always agree, so the tests should not fail (that use this code I changed, though possibly there is no test). In any case I'll add a test. |
3221ec5 to
5af39a1
Compare
|
@martinflorian-da @OriolMunoz-da added a test and updated release notes, please have another look. |
Also added release notes. Signed-off-by: Raymond Roestenburg <[email protected]>
5af39a1 to
23d08e3
Compare
martinflorian-da
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.
Looks reasonable, thank you! You might want to wait for someone more knowledgeable than me to approve as well though.
docs/src/release_notes.rst
Outdated
|
|
||
| - The round-based aggregates for balance values (changes to holding fees and initial amounts since round zero) | ||
| have diverged between scans because of how amulets expire in the ``scan_txlog_store``. | ||
| The balance values recorded in the round aggregates are effectively not used anymore, and are now set to zero to avoid consensus problems when an SV reads aggregates |
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.
not used anymore
By splice apps?
I'm not sure this makes sense, but do some people implement their own variant of BFT scan reads? This should probably be fixes as well then? (I.e., do we need to call this out?)
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'll rephrase it
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.
By scan APIs, I'll rephrase
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.
rephrased. Oh and no, this is not something people implement by themselves, this is for backfilling and starting from known state for the aggregation. When an SV starts and has no aggregates yet, scan will request the totals from the other SVs in BFT fashion, and continue from that round. It's really all internal API to the scan app.
| result shouldBe Some(roundAggregate) | ||
| } | ||
|
|
||
| "get BFT round aggregates from scans that report having the round aggregate ignoring balance fields" in { |
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.
sentence is a bit hard to parse
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.
fixed.
...test/scala/org/lfdecentralizedtrust/splice/scan/admin/api/client/BftScanConnectionTest.scala
Show resolved
Hide resolved
| val result = con.getRoundAggregate(round).futureValue | ||
| result shouldBe Some(roundAggregateZeroBalanceValues) | ||
|
|
||
| // not using the decoder should fail on the randomized balance values. |
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.
Why even test/commit this? That's a code path that doesn't exist like this anymore, isn't it?
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.
Just to be sure the decode stuff does something
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.
Well if it didn't the previous should should fail? But I don't mind keeping it
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.
yeah true, I could remove it, but liked to see it was failing the consensus, so I didn't do some encode/decode that did nothing
OriolMunoz-da
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.
There was also this comment by nicu in the original PR:
https://github.com/DACH-NY/canton-network-internal/issues/2493#issuecomment-3472570660
will this be handled in a later PR?
| cumulativeChangeToHoldingFeesRate = randomValue, | ||
| totalAmuletBalance = randomValue, | ||
| ) | ||
| def encodeRoundTotals(rt: RoundTotals) = { |
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.
afaict this is duplicate with HttpScanHandler's listRoundTotals, DRY
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.
dried
| totalAmuletBalance = Codec.encode(rt.totalAmuletBalance), | ||
| ) | ||
| } | ||
| def encodeRoundPartyTotals(rpt: RoundPartyTotals) = { |
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.
afaict this is duplicate with HttpScanHandler's listRoundPartyTotals, DRY
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.
oh right I'll cleanup thx
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.
dried
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.
dried
...test/scala/org/lfdecentralizedtrust/splice/scan/admin/api/client/BftScanConnectionTest.scala
Show resolved
Hide resolved
Signed-off-by: Raymond Roestenburg <[email protected]>
297f280 to
35b6cf6
Compare
6ff61c8 to
3b7357e
Compare
|
Also added #3206 thanks @OriolMunoz-da for the heads up |
00b5587 to
00e9d21
Compare
Co-authored-by: Oriol Muñoz <[email protected]> Signed-off-by: Raymond Roestenburg <[email protected]> Signed-off-by: Raymond Roestenburg <[email protected]>
00e9d21 to
be5e147
Compare
Fixes https://github.com/DACH-NY/canton-network-internal/issues/2493 (all SVs will agree on zero values)
API's that depend on the balance values have already been deprecated and replaced by instrument total supply and holdings summary.
balance values are:
Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines