Repository navigation
feat: state transition conversion - #844
Conversation
…latform into feat/stateTransitionConversion
| use crate::data_contract::DataContract; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| pub const DATA_CONTRACT_UPDATE_TRANSITION_ACTION_VERSION: u32 = 0; |
| if maybe_existing_data_contract.is_none() | ||
| || state_transition.get_execution_context().is_dry_run() | ||
| { | ||
| let action: DataContractCreateTransitionAction = state_transition.into(); |
| @@ -65,7 +67,8 @@ pub async fn validate_data_contract_update_transition_state( | |||
| .map_err(Into::into)?; | |||
|
|
|||
| if state_transition.execution_context.is_dry_run() { | |||
There was a problem hiding this comment.
All other validation functions now return actions? Doesn't the validation function should only validate?
I still do not agree with having validate state function which creates action
There was a problem hiding this comment.
So we have a very long discussion about whether the function that validates state transition against the state should or shouldn't return a TransitionAction as a result, or should it just return the errors and the conversion from state transition into action should be a separate step that's done after the validation. I was a proponent of the idea that it should be two separate steps, and @QuantumExplorer was a proponent of the idea that it should be one step and the conversion of the ST into action should happen inside the validation function. We couldn't agree on that, so we added three more people to the discussion: @shumkov, @fominok, and @shotonoff. At the end of the discussion, we had a vote with three people out of five who voted that the validation function should perform a conversion of the StateTransition into an Action. So we are going ahead and merging this PR as is. I want also to set up a precedent for the governing of the architectural decisions with this one: although the solution I've proposed has lost the vote, I have no hard feelings about it, and should a disagreement on any other topic arise we should follow the same decision-making protocol, and I expect anybody who lost the consensus vote on a topic to do the same thing as I did :) Thank you, guys!
|
For the future, I would propose to have ADR for design changes so people don't feel pressure because the code is already written and not having it merged blocks other tasks. |
…mit lifting Rework on grovedb 33a3ad34 (#844/#845): the limited inner page and the derived outer by-ids fetch are now proven as a SINGLE merged grovedb proof — prove_query_many merges them, with the inner query's global limit lifted into its branch's per-instance Query::limit (exact: the branch executes once). One proof means one root by construction, so the two-proof envelope, the verifier's root-equality check, and the Option<outer_proof> shape are gone. Verification becomes one pass: the caller supplies the server's CLAIMED join values as an untrusted bootstrap hint, the verifier re-derives the outer component from it, re-merges at the same grove version, and runs GroveDb::verify_query — grovedb enforces the lifted instance cap and range completeness, and the exact-set assembly against the PROVEN join values refuses any hint lie (dropped, injected, or substituted ids all covered by tests). The root-hash bracket survives in a smaller role: materialize and prove must read the same committed state or the proof's own branches disagree; the failure is now server-side only. ChainedProofBundle is gone; the with-proof surfaces return the merged proof bytes. proof_path_queries is the ONE component builder both prover and verifier call, so the merged query is byte-identical on both sides. Co-Authored-By: Claude Fable 5 <[email protected]>
…mit lifting Rework on grovedb 33a3ad34 (#844/#845): the limited inner page and the derived outer by-ids fetch are now proven as a SINGLE merged grovedb proof — prove_query_many merges them, with the inner query's global limit lifted into its branch's per-instance Query::limit (exact: the branch executes once). One proof means one root by construction, so the two-proof envelope, the verifier's root-equality check, and the Option<outer_proof> shape are gone. Verification becomes one pass: the caller supplies the server's CLAIMED join values as an untrusted bootstrap hint, the verifier re-derives the outer component from it, re-merges at the same grove version, and runs GroveDb::verify_query — grovedb enforces the lifted instance cap and range completeness, and the exact-set assembly against the PROVEN join values refuses any hint lie (dropped, injected, or substituted ids all covered by tests). The root-hash bracket survives in a smaller role: materialize and prove must read the same committed state or the proof's own branches disagree; the failure is now server-side only. ChainedProofBundle is gone; the with-proof surfaces return the merged proof bytes. proof_path_queries is the ONE component builder both prover and verifier call, so the merged query is byte-identical on both sides. Co-Authored-By: Claude Fable 5 <[email protected]>
Issue being fixed or feature implemented
What was done?
This PR contains a lot of changes needed for Rs-Drive-Abci to work as the executor.
How Has This Been Tested?
CI passing.
Breaking Changes
Checklist:
For repository code-owners and collaborators only