Conversation
…for potential improvemnt in performances
| return &VersionedLevelDBAppStateStore{adapter: adapter}, nil | ||
| } | ||
|
|
||
| func (vdl *VersionedLevelDBAppStateStore) Store( |
There was a problem hiding this comment.
Maybe it is better to change this interface and to have as input params just 1 state and just 1 wasm. At the moment we need to store just one state for a single application. In the future maybe it will be useful to store state and wasm for different applications, but for now it is just an unnecessary complication
| return fmt.Errorf("application state entry is nil") | ||
| } | ||
|
|
||
| if state != nil { |
There was a problem hiding this comment.
Does still make sense that we accept a state == nil? While it is normal to have wasm == nil, I don't have any scenario in mind where we need to store just the wasm, even because now we have the fingerprint in the state so an "update wasm" scenario would require a corresponding update state
There was a problem hiding this comment.
You are right, and basing on this consideration, we can have separate func Store / StoreWithWasm on the storage interface, enforce non-nil state, and add expressive initAppStorage / storeStateToStorage helpers on the manager.
… expressive initAppStorage/storeStateToStorage helpers on the manager
See Jira Task: https://horizenlabs.atlassian.net/browse/HZN-2802
This PR refactors the storage package to support per-application versioning. Each application now maintains its own independent version chain, enabling rollback, version listing, and state retrieval scoped to a single app without affecting others.
The
ApplicationStateStoreinterface, LevelDB implementation, mock implementation, and manager calls are all updated accordingly.Includes expanded test coverage for multi-app scenarios.