Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: log roster history at start of platform #17182

Merged

Conversation

edward-swirldslabs
Copy link
Contributor

@edward-swirldslabs edward-swirldslabs commented Dec 30, 2024

Description:
Logs the roster history at the start of the platform.

If the current roster is used as the previous roster, text is written to indicate this instead of repeating the same data.

The log message has the string encoding of each node's public certificates. To get rid of this, we would need to create more utility functions for pretty printing the roster into a JSON format without the certificates.

NOTE: The ipAddressV4 entries are unreadable because the data is stored as 4 bytes instead of a string of the ip address.

Sample Output From A Local Run:

2025-01-08 11:35:17.597 112      INFO  STARTUP          <main> SwirldsPlatform: Starting with roster history: 
RosterHistory[ currentRosterRound: 0 ][ no previous roster set ]
Current Roster: {
  "rosterEntries": [{
    "weight": "1",
    "gossipCaCertificate": "MIIDpzCCAg+gAwIBAgIJAK05TS8KZeb1MA0GCSqGSIb3DQEBDAUAMBIxEDAOBgNVBAMTB3MtYWxpY2UwIBcNMDAwMTAxMDAwMDAwWhgPMjEwMDAxMDEwMDAwMDBaMBIxEDAOBgNVBAMTB3MtYWxpY2UwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDBoP9dI3K1PRLRK7h90D9eNCfgzuHTyJi70yDEs90XJXlE6jmgf1NE2av83VAhQHLxu8Ehc/55M9Ayx9IQc0zJLSS+IrRM9QwqoG8ZvNdRgNw+je3V/8rAK/mHId+cPnnyDplCyskyi5kWCv6kTULIewFH8/KVZwhe0/hB2+N6ujWixURrxjjGLHA6b2gPoGAb/nxiVOn+L0cWcOzcyiYShxagj0FBWV7AxKx65Ynzfe7eF0gOzBUA+IM10OM5KXJejk53Xz5KpEyGe8htO/bXFlpLdm3UzrYiIhY0oKPYKECAC1s+VAZA6i+MV0nDpqDgxHRRXD8O2arauPhEI6iVT9f05AtzElrs7U95HbpQUuP1sxkaQw+bLdMOQHHMVCgMgw2g0eDdVDAMJD7wjZ+Bs6kDc/EJELb0l1uy2GEnOZMiHkK4K1r4IyZ/ed6QpyIRKfBCNyT5IIpMoVpzRYxVXgjgFdudd8iErKyvSXHThU6nu92c+vSd+FLBFHPpb6ECAwEAATANBgkqhkiG9w0BAQwFAAOCAYEAh9WBNlNwy4tUzqAqOR0T+OBLQvGUN2Ec5my4CraBxoe3/cG0QgQC/IzJXAIZBwLMK2RzL49Oc7WjfJmxL0jTuohNIOxoTfYzjW/9HfUQ79RwtIMKxVfKuMmvZP1zPXxgEe72YuGzeA3ot35KDU1gTyp4XVDMra8p9EKK+Pz5jz1UiO/kXi7lwcvifFp5NBXzplnGdlZ5SMvySG26YSqc2TWQnp79N3yc1L0DtUwV0UsnmC2svOSJpv4T/w5kHiukUuIo6PslgQmy7YrkXidfV9sE57IaSsxqCCK4DkrFeQcixbZ4qSN40R0j3MGwt7+ez3HriQ+5lIipV20JrQDT+jsP65YjHiYTyhyouLzhTgFj0jYETvnbUV1SLrLDAnaqI6yPqjgpv43HHWM/lb47ZhmUICMNq6kWM66btXCCu049ZcL6mMeS3+Fu8EMVxdYUyDWZNqV8mkedKwi0/kl07Uf0xWFPGLeU0GGdJylM46xcjszbub0+Jr3e0SZJl1D9",
    "gossipEndpoint": [{
      "ipAddressV4": "fwAAAQ==",
      "port": 15301
    }]
  }, {
    "nodeId": "1",
    "weight": "1",
    "gossipCaCertificate": "MIIDojCCAgqgAwIBAgIIHWg7e2Q/smQwDQYJKoZIhvcNAQEMBQAwEDEOMAwGA1UEAxMFcy1ib2IwIBcNMDAwMTAxMDAwMDAwWhgPMjEwMDAxMDEwMDAwMDBaMBAxDjAMBgNVBAMTBXMtYm9iMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAqvlawF6lLf7L/T/J8GPMxaN7vOJqcTPuyzOs1ZXdwa7YpSVHu/b73Cn8S1fX4F1waVNOiOAWzmcQE3iUzvoKnomMUfjrXI3wZKQiSl7wZmdvXDgoSNmPlRgxur6o5QjpCbCaAt47xEcCxLqUI/UDIYVqVvZlUnT0NxgPEJFd4WPgGq81u0PmvkNMK2lVPhrHd5venM1IayNBQb3OHKn9ZywCbCbMp0yXva2TqoXy2UBZfLPCIK6NYdLQqWfQLmnISN4U2wbb322gLimBPyO7GKOCx5N4gVGc0eYZJ5KZekCQQQuXAspHwc6ep6JLlRc2p1vE16bH8SklJzmtMHqTMtfbh0i5GyDIggVbHveCg7OZodSiU3jGZ6eJ+gxiVI00zTtauy+aNELk4tz+4aF1aqFkYEIfoAkHwKbDzhAtdV0cTouK54/Wgx3uD743hfzzTAmS6HR5t9XeLt61QifSMuUznQCRG5wb2TBkMn8zgtjsVPYXzlHX+jYVoH/nfsBFAgMBAAEwDQYJKoZIhvcNAQEMBQADggGBACkvl7CAB4wctUx3jWasznlsKtzh4Q+onKQbr2Cw5EIv6sWDTf/DR1tTbyp+KQ+WPMJBlt3Gtp+dpdY/vlz1vXfr0u43B7w63MFWj5sYYwl1ONWtZ41mjzimTd3Sqpj4Ro2mYSUCAK7ABSdgrgKJnpnxncHjIWg6pkMkbQJprc5zprxKT7kk353jUKf+XpVKPGEUgvRKzsMlvVulnUu9YD44yiHcvcu3g+iWZK7GHtM6cP2hMl3FfjBKFlBb9DCeyA87L/7O6g2djBw4F3RLW8d1p3KRfI1VuIr/3Uam7F8R5rtRFRixIA38XN96DwH6S5vCkvGP66Gc6YzCKgYqKLO+IH+XgOr9PZAtliEVVJmzARZd5Jef3xmigf7N4NgkBhl59f5FuxRsc8nBeX7a43KIvtfKOqnZyCwkbsN8QcBhyqEt3ebVtzRhRoJFlLsT6z9a+Yucr3jzTgJRUnM7KqeSv6pug4w0opGe3uJVC9FVYHyeCHGJOMTiAeJS5HWx0w==",
    "gossipEndpoint": [{
      "ipAddressV4": "fwAAAQ==",
      "port": 15302
    }]
  }, {
    "nodeId": "2",
    "weight": "1",
    "gossipCaCertificate": "MIIDpzCCAg+gAwIBAgIJAJg3GRFp5bT9MA0GCSqGSI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66vfKf+Z4fwzG18PfKeE5DkFONZtCbKYL2GQ9g+XUdu/kT9fCS4vbxNlXiXZUtwt4XMjbLm/SmWOwIMf6R0s0nZJ562zyIf3wKfsvPHadCUBIDOeG5Bs646BpOc1",
    "gossipEndpoint": [{
      "ipAddressV4": "fwAAAQ==",
      "port": 15303
    }]
  }, {
    "nodeId": "3",
    "weight": "1",
    "gossipCaCertificate": "MIIDpTCCAg2gAwIBAgIJAN7hww13zBZEMA0GCSqGSIb3DQEBDAUAMBExDzANBgNVBAMTBnMtZGF2ZTAgFw0wMDAxMDEwMDAwMDBaGA8yMTAwMDEwMTAwMDAwMFowETEPMA0GA1UEAxMGcy1kYXZlMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAyv21cr9GVHiWeHCDiJjPsJqrWIwsOIzwAuePVkDz1dbxtJc0qYFfp0SqplgXsYS5Sjd27L63zQlKSkqvJnhcgrXaaU9XYVDphGXKDYS2c6sV29h2GKkT7/NrUfrW4ftu1hbATjqmK2E76+9hAg+6gzrsP16G+iiJmsP2/0iAD3nDKGMtuX5IGJCUhE8HfB1KcLLGB/yUywRfHho400zLrteAEUCnh/AV0rPo41dftyCLVxEUvK8lBg46nObwvGVtZA1UG2/dSA8UY6mWxcobmrKHAqkwHGbohIBPFopcKdoNb2wFJx57yjX4mhAB6BFerxeJXpWloTpzdlObZ6Mf57Oj4g6iGzn7NKZl8YwCtL8XOqGTN08HUbc6OnEm/wGH0HZ5kM5K2vfNJBzddq93+zytj8xgblVD0+3yxgOEt70A2DuK6nIE3Pzi6G7ai7XQbrDhY2bHHyH1FuBlViVCNY/n8Lx2nMVi5smcJUOUOO1La7Y1qRa7uwk5+UuO+5ajAgMBAAEwDQYJKoZIhvcNAQEMBQADggGBAJ8y9VP6s6hGd5DxI2d8bC4MzPCyC/fVrQgY+rATx1a12xMVpBoOdsNKOoTifFHzHCC//9LU3TAfvBS4KWSdsu4oXhe8aErpbE570QuEHkcz6d3TqMwYYUVYV6w7RqOh4yB7eh/dc+igrOL913kxnp+AIACw/Q6mG9r1Z5hqYQRgt53h6OylVjYqxZ+iW4SZu37vKVZczO5k65yM8+g6KG3zaPbnirgbhlJcaO9TXimGb9OfuVPHXuZ+1Lw7HITd85blVc/gJp3jfCqOVLTBaLU5vD011tfNuNyD9exy1ZT8TpbhsyR2r+37GtHJ6Pf00WCcftYm2VKPwJLi9MOMwaoZsCLMrbxQLEganVQ/HZbLCrVftcKYCFCD1odWBlKdlyYRCpzWWzle2pDw6KZfZISY2UfBturj/odun0eirRuwoE98fhl2xz3wSutfJItTy2lUb8rZQ5Ja44Wyd6IMd+QoJv0HUjPSRB1YoDMHFdSgN1eYTNhYceW3CTOwHhasdA==",
    "gossipEndpoint": [{
      "ipAddressV4": "fwAAAQ==",
      "port": 15304
    }]
  }]
}

Related issue(s):

Fixes #15476

Signed-off-by: Edward Wertz <edward@swirldslabs.com>
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.

Project coverage is 67.25%. Comparing base (66ebd29) to head (51cb94f).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ava/com/swirlds/platform/roster/RosterHistory.java 66.66% 1 Missing and 3 partials ⚠️
...ain/java/com/swirlds/platform/SwirldsPlatform.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17182      +/-   ##
============================================
+ Coverage     67.23%   67.25%   +0.01%     
- Complexity    21988    21996       +8     
============================================
  Files          2583     2583              
  Lines         96320    96333      +13     
  Branches      10058    10060       +2     
============================================
+ Hits          64764    64784      +20     
+ Misses        27847    27842       -5     
+ Partials       3709     3707       -2     
Files with missing lines Coverage Δ
...ain/java/com/swirlds/platform/SwirldsPlatform.java 0.64% <0.00%> (-0.01%) ⬇️
...ava/com/swirlds/platform/roster/RosterHistory.java 81.48% <66.66%> (-11.86%) ⬇️

... and 12 files with indirect coverage changes

Impacted file tree graph

Copy link

codacy-production bot commented Dec 30, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 84.62%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (66ebd29) 96103 68321 71.09%
Head commit (51cb94f) 96116 (+13) 68339 (+18) 71.10% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17182) 13 11 84.62%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

timfn-hg
timfn-hg previously approved these changes Dec 31, 2024
edward-swirldslabs and others added 2 commits January 8, 2025 08:33
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
Signed-off-by: Edward Wertz <edward@swirldslabs.com>
@edward-swirldslabs edward-swirldslabs merged commit 70c450e into main Jan 8, 2025
50 of 52 checks passed
@edward-swirldslabs edward-swirldslabs deleted the 15476-log-active-rosters-at-start-of-platform branch January 8, 2025 19:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update roster logging on startup
3 participants