chore(parallel-executor): compressed coin validation #3001
Merged
+209
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked Issues/PRs
closes #2996
Description
This pull request introduces a new
CoinInBatch
struct to encapsulate coin-related data and replaces the previous tuple-based representation of coins in theparallel-executor
module.Introduction of
CoinInBatch
struct:crates/services/parallel-executor/src/coin.rs
: Added theCoinInBatch
struct, which encapsulates coin data such asutxo_id
,owner
,amount
,asset_id
, and its variant (Signed
orPredicate
). Implemented methods for constructingCoinInBatch
fromCoinSigned
andCoinPredicate
, as well as conversions toCompressedCoin
andInput
.Refactoring to use
CoinInBatch
:crates/services/parallel-executor/src/scheduler.rs
: Replaced all instances of(UtxoId, usize)
withCoinInBatch
in theWorkSessionExecutionResult
andWorkSessionSavedData
structs, as well as in theCoinDependencyChainVerifier
. Updated methods likeregister_coins_created
andverify_coins_used
to work with the new struct. [1] [2] [3] [4]Updates to coin dependency verification:
crates/services/parallel-executor/src/scheduler.rs
: Enhanced theverify_coins_used
method to validate coins using theCoinInBatch
struct. Added logic to compareCoinInBatch
instances with database coins and verify their validity.Integration of
CoinInBatch
in batch processing:crates/services/parallel-executor/src/scheduler.rs
: Updated theget_contracts_and_coins_used
function to constructCoinInBatch
instances fromCoinSigned
andCoinPredicate
inputs during batch processing. [1] [2]Module organization:
crates/services/parallel-executor/src/lib.rs
: Added the newcoin
module to the project and made it accessible within the crate.Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]