Log consensus scan URIs, revert BFT logging - #6413
Conversation
78e09cc to
633bd4b
Compare
633bd4b to
56d97b5
Compare
56d97b5 to
00a8678
Compare
dfordivam
left a comment
There was a problem hiding this comment.
Thanks, this need some adjustments.
And for the logging added in the triggers we should modify the confirmBftRead in
TrafficBasedRewardsSvAppTimeBasedIntegrationTest.scala, to do assertion of log similar to the loggerFactory.assertEventuallyLogsSeq used in it already.
(also make sure the existing entry.warningMessage assertion in the test passes)
| } | ||
|
|
||
| "logs disagreements at WARN level" in { | ||
| "logs disagreements at INFO level" in { |
There was a problem hiding this comment.
We need to revert this to WARN. ie put the disagreementLogLevel back
| } | ||
|
|
||
| "logs disagreements at WARN level" in { | ||
| "logs disagreements at INFO level" in { |
There was a problem hiding this comment.
We need to revert this to WARN
Ok, I can modify the
|
This assertion is still in the entry.warningMessage should (include(
"has a mismatch with confirmations"
) and include(
cid.contractId
)) |
| logger.info(s"Obtained the root-hash for round $round via BFT read.") | ||
| case (RewardAccountingRootHashOk(ok), scanUris) => | ||
| logger.info( | ||
| s"Obtained the root-hash for round $round via BFT read from consensus scans: ${scanUris.mkString(", ")}." |
There was a problem hiding this comment.
Perhaps "BFT read from scans: ..." is better?
Log the scan URIs that formed the BFT consensus for the two reward-accounting reads. Consensus URIs are the `f + 1` URIs whose agreement formed the consensus, not every URI that happened to agree with it. - Expose consensus scan URIs via `getRewardAccountingRootHashWithScanUris` and `getRewardAccountingActivityTotalsWithScanUris` return values, and include them in the log messages of `CalculateRewardsTrigger` and `SummarizingMiningRoundTrigger` respectively. - Thread the consensus URIs through the BFT machinery: `executeCall` and the new private `bftCallWithScanUris` now return `(response, List[Uri])`; the `*WithScanUris` methods surface it while `bftCall` drops it to preserve the existing callers' signatures. - Revert the per-call logging customization introduced in canton-network#5768, keeping only the metrics collection and message formatting. All BFT disagreements are now logged uniformly at INFO including those for `getRewardAccountingRootHash` and `getRewardAccountingActivityTotals`. - Drop `ConsensusLogConfig` since disagreement logging no longer varies per BFT operation. - Update relevant tests. Tested locally: `TrafficBasedRewardsSvAppTimeBasedIntegrationTest` and `BftScanConnectionTest` pass. Signed-off-by: Ilya Silvestrov <tellary@gmail.com>
- Re-introduce a plain `disagreementLogLevel` parameter in place of the dropped `ConsensusLogConfig`, threaded through `bftCallWithScanUris` -> `executeCall` -> `logDisagreements`. `getRewardAccountingRootHashWithScanUris` and `getRewardAccountingActivityTotalsWithScanUris` log disagreements at WARN. All other BFT calls keep the INFO default. Reaching agreement is still NOT logged separately exactly as it was before canton-network#5768. - Assert the consensus scan URI log messages in `TrafficBasedRewardsSvAppTimeBasedIntegrationTest`: the new `withExpectedRewardTriggersLogging` wrapper around `confirmBftRead` captures INFO logs of sv2's `CalculateRewardsTrigger` and `SummarizingMiningRoundTrigger` and checks both "... via BFT read from consensus scans: <uris>." messages are emitted, with URIs restricted to sv1's and sv4's scans (sv3 is stopped and sv2's own scan is not part of its peer BFT connection). - Adjust the `BftScanConnectionTest` disagreement-level tests back to WARN for the two reward accounting reads. Tested locally: `TrafficBasedRewardsSvAppTimeBasedIntegrationTest` and `BftScanConnectionTest` pass. Signed-off-by: Ilya Silvestrov <tellary@gmail.com>
Use 'withExpectedRewardTriggersLogging' to check 'CalculateRewardsTrigger' and 'SummarizingMiningRoundTrigger' emit logs about BFT scans inside the 'confirmBftRead' call. Signed-off-by: Ilya Silvestrov <tellary@gmail.com>
Also, drop 'consensus' from BFT reward-read log messages Signed-off-by: Ilya Silvestrov <tellary@gmail.com>
5bd35d7 to
d13b085
Compare
Log the scan URIs that formed the BFT consensus for the two reward-accounting reads. Consensus URIs are the
f + 1URIs whose agreement formed the consensus, not every URI that happened to agree with it.getRewardAccountingRootHashWithScanUrisandgetRewardAccountingActivityTotalsWithScanUrisreturn values, and include them in the log messages ofCalculateRewardsTriggerandSummarizingMiningRoundTriggerrespectively.executeCalland the new privatebftCallWithScanUrisnow return(response, List[Uri]); the*WithScanUrismethods surface it whilebftCalldrops it to preserve the existing callers' signatures.getRewardAccountingRootHashandgetRewardAccountingActivityTotals.ConsensusLogConfigsince disagreement logging no longer varies per BFT operation.Tested locally:
TrafficBasedRewardsSvAppTimeBasedIntegrationTestandBftScanConnectionTestpass.Fixes #5844.
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./upgrade_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./lsu_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