Skip to content

Commit

Permalink
Update ModelConformanceValidator comments and prevent them from get…
Browse files Browse the repository at this point in the history
…ting outdated easily (#11924)
  • Loading branch information
hubert-da authored Nov 30, 2021
1 parent 16a41f7 commit e1559af
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ private[transaction] class ModelConformanceValidator(engine: Engine, metrics: Me
}
}

// Helper to lookup contract instances. Since we look up every contract that was
// an input to a transaction, we do not need to verify the inputs separately.
//
// Note that for an honest participant, a contract may not be in the state only if it was archived and pruned
// on the committer. Then, an honest participant is able to produce such a transaction only by using
// a divulged contract that appeared as active, because it didn't learn about the archival.
// On the other hand, using divulged contracts for interpretation is deprecated so we turn it into Inconsistent.
/** Helper to lookup contract instances. Since we look up every contract that was
* an input to a transaction, we do not need to verify the inputs separately.
*
* Note that for an honest participant, a contract may not be in the state only if it was archived and pruned
* on the committer. Then, an honest participant is able to produce such a transaction only by using
* a divulged contract that appeared as active, because it didn't learn about the archival.
* On the other hand, using divulged contracts for interpretation is deprecated so we turn it into [[Rejection.MissingInputState]].
*/
@throws[Err.MissingInputState]
private[validation] def lookupContract(
commitContext: CommitContext
Expand All @@ -152,11 +153,13 @@ private[transaction] class ModelConformanceValidator(engine: Engine, metrics: Me
Conversions.decodeContractInstance(rawContractInstance)
}

// Helper to lookup package from the state. The package contents are stored in the [[DamlLogEntry]],
// which we find by looking up the Daml state entry at `DamlStateKey(packageId = pkgId)`.
//
// Note that there is no committer pruning of packages, so MissingInputState can only arise from a malicious
// or buggy participant.
/** Helper to lookup package from the state. The package contents are stored
* in the [[com.daml.ledger.participant.state.kvutils.store.DamlLogEntry]],
* which we find by looking up the Daml state entry at `DamlStateKey(packageId = pkgId)`.
*
* Note that there is no committer pruning of packages, so [[Rejection.MissingInputState]]
* can only arise from a malicious or buggy participant.
*/
@throws[Err.MissingInputState]
@throws[Err.ArchiveDecodingFailed]
private[validation] def lookupPackage(
Expand Down

0 comments on commit e1559af

Please sign in to comment.