-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat: overhaul SignedState.getAddressBook() #16656
feat: overhaul SignedState.getAddressBook() #16656
Conversation
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
...c/testFixtures/java/com/swirlds/platform/test/fixtures/state/RandomSignedStateGenerator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
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.
Makes sense to me, tyvm @anthony-swirldslabs !
Description:
This is the first step in a series of fixes to eventually remove
AddressBook
objects from thePlatformState
. In this fix, theSignedState
class now uses theRosterRetriever
to fetch the active roster from the state. The latter automatically falls back to reading the AddressBook from the PlatformState if the RosterService data isn't populated.Notable changes:
SignedState.getAddressBook()
implementation and the supportingSignedStateFileReader.registerServiceStates()
that allows the former to access states of the RosterService and the PlatformState via the States API.SignedStateFileReader
and theReconnectLearner
initialize these states to make the AddressBook/Roster accessible from the loaded/received SignedState.FakeMerkleStateLifecycles
is similarly extended to enable accessing these states in tests (both unit, and JRS.)RandomSignedStateGenerator
also enables the tests to uses these states, and it also registers all the generated states in ThreadLocal lists, allowing the tests to release them once the tests finish. This is now required to avoid producing OOMs due to a large number of VirtualMap instances created with each generated state.RosterSchema
is moved back to the platform code, and theRosterStateId
is resurrected, again, to be accessed from the platform code and eliminate circular dependencies between app and platform.MerkleDb.resetDefaultInstancePath()
calls to allow the VirtualMap implementation to create multiple instances of the same map on disk. W/o this call, the tests would clash because each of them would want to create the same ROSTERS map when a SignedState object is initialized in them.Related issue(s):
Fixes #16541
Notes for reviewer:
Tests should pass.
Checklist