Skip to content
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

Overhaul SignedState.getAddressBook() #16541

Open
Tracked by #14706
anthony-swirldslabs opened this issue Nov 12, 2024 · 3 comments · May be fixed by #16656
Open
Tracked by #14706

Overhaul SignedState.getAddressBook() #16541

anthony-swirldslabs opened this issue Nov 12, 2024 · 3 comments · May be fixed by #16656
Assignees
Labels
Platform Tickets pertaining to the platform

Comments

@anthony-swirldslabs
Copy link
Contributor

anthony-swirldslabs commented Nov 12, 2024

Background
In order to remove AddressBook from PlatformState we need to:

  1. Allow SignedState to use RosterService (and fall back to PlatformState) to read AddressBook
  2. Switch to using the RosterService instead of PlatformState's addressBook/previousAddressBook. Note that it would be preferable if the App/Services/Execution is the only entity that actually updates the RosterService data. The Platform/Consensus should only ever need to receive this information via the RosterHistory object on startup, or read it via the RosterService/RosterRetriever, but never update it directly.
  3. Actually remove the ABs from the PlatformState

Acceptance criteria
This task covers the item 1 - we need to enable the SignedState to access RosterService data if available. If unavailable, it should fall back to reading the data from the PlatformState. RosterRetriever already implements this logic, we just need to make use of it.

@anthony-swirldslabs anthony-swirldslabs self-assigned this Nov 12, 2024
@anthony-swirldslabs anthony-swirldslabs added the Platform Tickets pertaining to the platform label Nov 12, 2024
@anthony-swirldslabs anthony-swirldslabs linked a pull request Nov 18, 2024 that will close this issue
2 tasks
@anthony-swirldslabs
Copy link
Contributor Author

Draft PR: #16656

@anthony-swirldslabs
Copy link
Contributor Author

anthony-swirldslabs commented Nov 18, 2024

JRS tests run into


java.lang.ClassCastException: class com.swirlds.demo.consistency.ConsistencyTestingToolState cannot be cast to class com.swirlds.platform.state.MerkleStateRoot (com.swirlds.demo.consistency.ConsistencyTestingToolState is in unnamed module of loader com.swirlds.common.constructable.URLClassLoaderWithLookup @4e31276e; com.swirlds.platform.state.MerkleStateRoot is in unnamed module of loader 'app') 	at com.swirlds.platform.state.signed.SignedState.getAddressBook(SignedState.java:265) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.state.signed.SignedState.pruneInvalidSignatures(SignedState.java:665) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.StateInitializer.initializeState(StateInitializer.java:99) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.SwirldsPlatform.<init>(SwirldsPlatform.java:250) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.builder.PlatformComponentBuilder.build(PlatformComponentBuilder.java:205) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.builder.PlatformBuilder.build(PlatformBuilder.java:473) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.Browser.launchUnhandled(Browser.java:316) ~[swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.Browser.launch(Browser.java:161) [swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.Browser.parseCommandLineArgsAndLaunch(Browser.java:136) [swirlds-platform-core-0.57.0.jar:?] 	at com.swirlds.platform.Browser.main(Browser.java:125) [swirlds-platform-core-0.57.0.jar:?]

Apparently, we'll need to either make ConsistencyTestingToolState implement the State interface, or make SignedState aware of this implementation of the SwirldsState and make it use a different code path to fetch the Roster/AB.

@anthony-swirldslabs
Copy link
Contributor Author

Currently blocked by #16660 #15638 and #16352 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Tickets pertaining to the platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant