Skip to content

Private state update metadata and migration (release 1.4)#402

Merged
lucassaldanha merged 28 commits into
besu-eth:release-1.4from
lucassaldanha:updated-migration-1.4
Feb 17, 2020
Merged

Private state update metadata and migration (release 1.4)#402
lucassaldanha merged 28 commits into
besu-eth:release-1.4from
lucassaldanha:updated-migration-1.4

Conversation

@lucassaldanha
Copy link
Copy Markdown
Contributor

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

lucassaldanha and others added 24 commits February 3, 2020 09:05
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>
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>
@lucassaldanha lucassaldanha added the privacy private transactions label Feb 14, 2020
@lucassaldanha lucassaldanha changed the title Private state update metadata and migration Private state update metadata and migration (release 1.4) Feb 14, 2020
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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@lucassaldanha lucassaldanha merged commit d7baae4 into besu-eth:release-1.4 Feb 17, 2020
@lucassaldanha lucassaldanha deleted the updated-migration-1.4 branch February 17, 2020 00:12
lucassaldanha added a commit to lucassaldanha/besu that referenced this pull request Feb 17, 2020
(backport from release-1.4)
Private state update metadata and migration

Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
lucassaldanha added a commit to lucassaldanha/besu that referenced this pull request Feb 17, 2020
(backport from release-1.4)
Private state update metadata and migration

Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
lucassaldanha added a commit to lucassaldanha/besu that referenced this pull request Feb 17, 2020
(backport from release-1.4)
Private state update metadata and migration

Signed-off-by: Lucas Saldanha <lucas.saldanha@consensys.net>
siladu pushed a commit to siladu/besu that referenced this pull request Oct 28, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

privacy private transactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants