You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if the state root returned by the finalize operation mismatch, it's impossible to revert
Possible solution design or implementation
Since accept and finalize are the same operations except for the squashing strategy, we should change the node in order to always call "accept" and, if the state hash match, call finalize to squash previous commits (if the block is finalizable).
This requires that finalize must not process transactions, but just squash commits between from and to (at the beginning, we can omit to explicitly pass those variables, since they are known by rusk)
Additional context
In addition, it would be useful to change the Accept method in order to receive the expected state root. If that is not matching the effective result, the vm should not commit
Persist block should be done only after ensure that state_root returned by accept/finalize is the same of the block header
See also #924
As the ultimate resolution, we concluded to implement a consistency_check in both the accept and finalize calls. This validation enables a caller to ensure the commitment of a VM state change only when a valid state_root is returned.
Summary
Currently, if the state root returned by the
finalize
operation mismatch, it's impossible to revertPossible solution design or implementation
Since accept and finalize are the same operations except for the squashing strategy, we should change the node in order to always call "accept" and, if the state hash match, call finalize to squash previous commits (if the block is finalizable).
This requires that
finalize
must not process transactions, but just squash commits betweenfrom
andto
(at the beginning, we can omit to explicitly pass those variables, since they are known by rusk)Additional context
In addition, it would be useful to change the
Accept
method in order to receive theexpected
state root. If that is not matching the effective result, the vm should not commitOriginally posted by @herr-seppia in #902 (comment)
The text was updated successfully, but these errors were encountered: