Open
Description
Currently there are three classes left in platform-core
production code that are still using MerkleStateRoot
class:
PlatformStateFacade
. It castsState
object toMerkleStateRoot
to bypass normal access mechanism (viaReadableStates
) because it's not initialized at the moment of invocation. Solution: we need to change the initialization so that we didn't have to do this direct access to Merkle tree node by indexSignedStateFileReader
.registerServiceState
usesMerkleStateRoot#putServiceStateIfAbsent
.
There are two possible soltions:
putServiceStateIfAbsent
can be elevated toState
interface. This will require movingStateMetadata
registerServiceState
can have a callback parameters passed by thehedera-app
code
SignedStateFileWriter
castsstate
to initializetime
field:
if (state instanceof MerkleStateRoot merkleStateRoot) {
merkleStateRoot.setTime(platformContext.getTime());
}
It can be fixed by setting the time where it's more appropriate.
Activity