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

Replace rusk.persist() method #924

Closed
herr-seppia opened this issue Jun 13, 2023 · 2 comments
Closed

Replace rusk.persist() method #924

herr-seppia opened this issue Jun 13, 2023 · 2 comments
Labels
module:rusk Issues related to rusk module module:rusk-schema Issues related to rusk-schema module

Comments

@herr-seppia
Copy link
Member

herr-seppia commented Jun 13, 2023

Summary

With the land of piecrust, the rusk.persist() method is now a noop, since every accept/finalize is always persisted.
Unluckily, all the dusk-blockchain sync was incepted around that method.
(See also: dusk-network/dusk-blockchain#1530 and dusk-network/dusk-blockchain#1532)

Said that, current dusk-blockchain implementation is not usable with a piecrust version of rusk.

Possible solution design or implementation

To avoid completely wasting time on upgrading grpcAPI just to fit only dusk-blockchain need, we should at least upgrade those API with a logic that is reusable by the rusk full node.
So, I'm for changing the current state grpcAPI with the following

  • Execute(from_root, txs[]) -> new_root, executed_txs[], invalid_txs[] //forget session
  • Verify(from_root, txs[], expected_root) -> bool //forget session
  • Persist(from_root, txs[], expected_root) -> () // Replace the previous Accept/Finalize calls. It executes txs and updates the current commit only if root is equal to the expected
  • Finalize(from, to) --> () // Squash commits and update base_root to to if base_root==from
  • Revert(to) -> () //remove all inner.commits between to and current_commit and replace current_commit with to
@herr-seppia herr-seppia added module:rusk Issues related to rusk module module:rusk-schema Issues related to rusk-schema module labels Jun 13, 2023
@goshawk-3
Copy link
Contributor

Unluckily, all the dusk-blockchain sync was incepted around that method

I'm not certain this is true:

For the record, Persist grpc API was added as an optimization. (see also #572).

If we now are back to the strategy where we persist on each accept/finalize call, there should be no issue with dusk-blockchain sync if we always call StoreBlock(block, persisted = true).

@herr-seppia
Copy link
Member Author

See also #970

@HDauven HDauven closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:rusk Issues related to rusk module module:rusk-schema Issues related to rusk-schema module
Projects
None yet
Development

No branches or pull requests

3 participants