mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
PVF: Document that preparation cannot lead to disputes (#6873)
* PVF: Document that preparation cannot lead to disputes * Add warning for deterministic errors * Fix warning
This commit is contained in:
@@ -623,7 +623,7 @@ where
|
||||
.await;
|
||||
|
||||
if let Err(ref error) = result {
|
||||
gum::info!(target: LOG_TARGET, ?para_id, ?error, "Failed to validate candidate",);
|
||||
gum::info!(target: LOG_TARGET, ?para_id, ?error, "Failed to validate candidate");
|
||||
}
|
||||
|
||||
match result {
|
||||
@@ -638,9 +638,16 @@ where
|
||||
))),
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::PrepareError(e))) => {
|
||||
// In principle if preparation of the `WASM` fails, the current candidate can not be the
|
||||
// reason for that. So we can't say whether it is invalid or not in addition with
|
||||
// reason for that. So we can't say whether it is invalid or not. In addition, with
|
||||
// pre-checking enabled only valid runtimes should ever get enacted, so we can be
|
||||
// reasonably sure that this is some local problem on the current node.
|
||||
// reasonably sure that this is some local problem on the current node. However, as this
|
||||
// particular error *seems* to indicate a deterministic error, we raise a warning.
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
?para_id,
|
||||
?e,
|
||||
"Deterministic error occurred during preparation (should have been ruled out by pre-checking phase)",
|
||||
);
|
||||
Err(ValidationFailed(e))
|
||||
},
|
||||
Ok(res) =>
|
||||
|
||||
@@ -120,12 +120,6 @@ impl From<PrepareError> for ValidationError {
|
||||
fn from(error: PrepareError) -> Self {
|
||||
// Here we need to classify the errors into two errors: deterministic and non-deterministic.
|
||||
// See [`PrepareError::is_deterministic`].
|
||||
//
|
||||
// We treat the deterministic errors as `InvalidCandidate`. Should those occur they could
|
||||
// potentially trigger disputes.
|
||||
//
|
||||
// All non-deterministic errors are qualified as `InternalError`s and will not trigger
|
||||
// disputes.
|
||||
if error.is_deterministic() {
|
||||
ValidationError::InvalidCandidate(InvalidCandidate::PrepareError(error.to_string()))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user