Private state update metadata and migration (release 1.4)#402
Conversation
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
This reverts commit 118c7e5 Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
| .orElseThrow(PrivateStorageMigrationException::new); | ||
|
|
||
| final List<Transaction> transactionsToProcess = | ||
| block.getBody().getTransactions().subList(0, lastPmtIndex + 1); |
There was a problem hiding this comment.
are you sure about the index+1? I would have thought that index is the actual index to use for the pmt ...
Not that it really matters, we would only execute one transaction that we don't have to execute ...
There was a problem hiding this comment.
The sublist params are (inclusive, exclusive). We have a unit test checking the logic :)
| } | ||
|
|
||
| if (isResultingPrivateStateRootAtHeadValid()) { | ||
| privateStateStorage.updater().putDatabaseVersion(SCHEMA_VERSION_1_4_x).commit(); |
There was a problem hiding this comment.
I'm not sure about the constant name for the schema version. This is going to be the version from 1.4 onwards, but maybe we are going to change the schema within the 1.4 versions again ...
Maybe introduce an Enum for the version number that could be used to match the version number to a String that could be used to have meaningful error messages ...
There was a problem hiding this comment.
I'll rename the constants to SCHEMA_VERSION_1_0_0 and SCHEMA_VERSION_1_4_0 to make it clearer that they are specific to this release. Let's save the enum idea for when we need to change the version again! :)
Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
(backport from release-1.4) Private state update metadata and migration Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
(backport from release-1.4) Private state update metadata and migration Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
(backport from release-1.4) Private state update metadata and migration Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
* Merge getPayloadV3 and getBlobsBundleV1 * Update src/engine/experimental/blob-extension.md Co-authored-by: g11tech <develop@g11tech.io> * kzgs -> commitments * Update src/engine/experimental/blob-extension.md --------- Co-authored-by: g11tech <develop@g11tech.io>
PR description
• Updated the private state storage with new data structures that aren't backwards compatible.
• Added PrivateStateRootResolver that handles public chain forks and their impact on the private state
• Created migration logic that will process previous private txs and re-create the data in the update 1.4.x format.
• Migration is based on the schema version, defined in the
PrivateStateStorage• Added flag that user needs to "opt-in" to migrate the data
• Remove restriction for "latest" block from
priv_call