chore: switch back protocol dep to git next#2282
Conversation
There was a problem hiding this comment.
Should we make db changes like this (breaking)? Or rather remove throught a migration?
There was a problem hiding this comment.
In the future we will have to do this via migrations, and we do have the framework in place for such a situation.
However, this one would be particularly painful since (iiuc) it would require running through every public account's delta and calculating the absolute value instead.
This might be good practice but its also a waste of time since we would never apply this migration to any active network.
So this would just be an additional breaking change entry e.g.
[[entry]]
scope = "node"
impact = "breaking"
description = "Backwards incompatible database schema changes to align with new protocol."|
Thanks! Will begin reviewing. There are a handful of open PRs that I would like to squeeze in before merging this one. |
No hurries, I'm also planning on taking a look soon. Thanks! |
igamigo
left a comment
There was a problem hiding this comment.
Not a full review, but I got through most of the non-test code
| let account_patch = executed_tx.account_patch().clone(); | ||
|
|
||
| // Prove transaction. | ||
| let tx_inputs: TransactionInputs = executed_tx.into(); |
There was a problem hiding this comment.
nit: (I think) you can do executed_tx.into_parts() and avoid cloning here
| ProofKind::Batch => Self::Batch(LocalBatchProver::new()), | ||
| ProofKind::Block => Self::Block(LocalBlockProver::new(MIN_PROOF_SECURITY_LEVEL)), |
There was a problem hiding this comment.
Mostly just curious but do we know why only the batch prover's security level parameter was removed?
| let prover = self.clone(); | ||
|
|
||
| spawn_blocking_in_current_span(move || { | ||
| let executed_batch = BatchExecutor::new().execute(input).map_err(|e| { |
There was a problem hiding this comment.
Is there a lot of overhead in creating a BatchExecutor? If so, might make sense to do something about it
| let executed_batch = BatchExecutor::new() | ||
| .execute(proposed_batch) | ||
| .map_err(BuildBatchError::ProveBatchError)?; |
There was a problem hiding this comment.
Same here about instantiating a BatchExecutor
| let executed_batch = | ||
| BatchExecutor::new().execute(proposed_batch).map_err(|err| { |
There was a problem hiding this comment.
Same here (and below with LocalBatchProver)
| @@ -563,23 +601,8 @@ | |||
|
|
|||
| let mut entries: Vec<(Word, Word)> = Vec::new(); | |||
There was a problem hiding this comment.
We can type this better and make it Vec<(AssetVaultKey, Word)>
| let lineage = Self::vault_lineage_id(account_id); | ||
| let prev_tree = | ||
| self.forest.latest_version(lineage).map(|version| TreeId::new(lineage, version)); | ||
| assert!(!vault_patch.is_empty(), "expected the patch not to be empty"); |
There was a problem hiding this comment.
Let's add a sentence or section in the doc comments mentioning that this expects a non-empty patch and it panics otherwise
| self.forest.latest_version(lineage).map(|version| TreeId::new(lineage, version)); | ||
| assert!(!vault_patch.is_empty(), "expected the patch not to be empty"); | ||
|
|
||
| let mut entries: Vec<(Word, Word)> = Vec::new(); |
There was a problem hiding this comment.
Same here about typing this better
| assert_eq!(prev_root, empty_smt_root(), "account should not be in the forest"); | ||
| assert!( | ||
| self.forest.latest_version(lineage).is_none(), | ||
| "account should not be in the forest" | ||
| ); |
There was a problem hiding this comment.
I would also mention the panics in teh docs of this function
|
|
||
| /// Inserts asset vault data into the forest for the specified account. Assumes that asset vault | ||
| /// for this account does not yet exist in the forest. | ||
| #[expect(clippy::unnecessary_wraps)] |
There was a problem hiding this comment.
I think we can remove Result<> from this function now, and this should propagate (I think) to some of the code that calls this
Summary
Switch back miden protocol dependency from crates.io to github's
nextbranch. Unsure if this is something to have addressed now, the main goal of the PR is to apply most recent changes of protocol as soon as possible on the miden-client.Changelog
Most notable changes are
Deltastorages being replaced byPatch, and the removal of thefeefield from transactions (to be replaced by batched fees).