Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove retry from backers on failed candidate validation #2182

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
093d537
remove retry from backers on failed candidate validation
jpserrat Nov 6, 2023
186b5d9
rename PvfExecTimeoutKind to PvfExecKind on executor params
jpserrat Nov 6, 2023
11ed725
".git/.scripts/commands/fmt/fmt.sh"
Nov 6, 2023
ab5eb3f
rename PvfPrepKind to PvfPrepKind, remove exec_kind from validate_can…
jpserrat Nov 7, 2023
7fa3947
Merge branch 'jpserrat/backers-dont-retry-on-fail' of github.com:Jpse…
jpserrat Nov 7, 2023
364de31
close delimiter
jpserrat Nov 7, 2023
056146a
refactor candidate-validation tests
jpserrat Nov 8, 2023
d91540b
Merge branch 'master' of github.com:paritytech/polkadot-sdk into jpse…
jpserrat Nov 8, 2023
b5bd481
fix fmt
jpserrat Nov 9, 2023
769cef6
minor fix
jpserrat Nov 10, 2023
5bc8183
add backer dont retry to documentation and refactor candidate-validat…
jpserrat Nov 14, 2023
4777046
Merge branch 'master' into jpserrat/backers-dont-retry-on-fail
mrcnski Nov 14, 2023
d69ef1a
Fix tests
mrcnski Nov 14, 2023
7025c7b
fix multiple ambiguous errors test
jpserrat Nov 15, 2023
c2b69d2
Merge branch 'jpserrat/backers-dont-retry-on-fail' of github.com:Jpse…
jpserrat Nov 16, 2023
8431212
Merge branch 'master' of github.com:paritytech/polkadot-sdk into jpse…
jpserrat Nov 16, 2023
79bf9f5
change PvfPrepKind::Lenient to PvfPrepKind::Prepare
jpserrat Nov 17, 2023
7f74004
minor fix
jpserrat Nov 18, 2023
2507cc1
change doc from PfvPrepKind and PvfExecKind to function
jpserrat Nov 19, 2023
7381ce1
Update polkadot/primitives/src/v6/mod.rs
mrcnski Nov 19, 2023
70c8cbc
Merge branch 'master' into jpserrat/backers-dont-retry-on-fail
mrcnski Nov 20, 2023
852cc85
Merge remote-tracking branch 'Jpserrat/jpserrat/backers-dont-retry-on…
mrcnski Nov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions polkadot/node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use polkadot_node_subsystem_util::{
};
use polkadot_primitives::{
ApprovalVote, BlockNumber, CandidateHash, CandidateIndex, CandidateReceipt, DisputeStatement,
ExecutorParams, GroupIndex, Hash, PvfExecTimeoutKind, SessionIndex, SessionInfo,
ExecutorParams, GroupIndex, Hash, PvfExecKind, SessionIndex, SessionInfo,
ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature,
};
use sc_keystore::LocalKeystore;
Expand Down Expand Up @@ -2867,7 +2867,7 @@ async fn launch_approval<Context>(
candidate_receipt: candidate.clone(),
pov: available_data.pov,
executor_params,
exec_timeout_kind: PvfExecTimeoutKind::Approval,
exec_kind: PvfExecKind::Approval,
response_sender: val_tx,
})
.await;
Expand Down
4 changes: 2 additions & 2 deletions polkadot/node/core/approval-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2705,10 +2705,10 @@ async fn handle_double_assignment_import(
assert_matches!(
overseer_recv(virtual_overseer).await,
AllMessages::CandidateValidation(CandidateValidationMessage::ValidateFromExhaustive {
exec_timeout_kind,
exec_kind,
response_sender,
..
}) if exec_timeout_kind == PvfExecTimeoutKind::Approval => {
}) if exec_kind == PvfExecKind::Approval => {
response_sender.send(Ok(ValidationResult::Valid(Default::default(), Default::default())))
.unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions polkadot/node/core/backing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ use polkadot_node_subsystem_util::{
use polkadot_primitives::{
BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt,
CommittedCandidateReceipt, CoreIndex, CoreState, ExecutorParams, Hash, Id as ParaId,
PersistedValidationData, PvfExecTimeoutKind, SigningContext, ValidationCode, ValidatorId,
PersistedValidationData, PvfExecKind, SigningContext, ValidationCode, ValidatorId,
ValidatorIndex, ValidatorSignature, ValidityAttestation,
};
use sp_keystore::KeystorePtr;
Expand Down Expand Up @@ -566,7 +566,7 @@ async fn request_candidate_validation(
candidate_receipt,
pov,
executor_params,
exec_timeout_kind: PvfExecTimeoutKind::Backing,
exec_kind: PvfExecKind::Backing,
response_sender: tx,
})
.await;
Expand Down
38 changes: 19 additions & 19 deletions polkadot/node/core/backing/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_primitives::{
CandidateDescriptor, GroupRotationInfo, HeadData, PersistedValidationData, PvfExecTimeoutKind,
CandidateDescriptor, GroupRotationInfo, HeadData, PersistedValidationData, PvfExecKind,
ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES,
};
use sp_application_crypto::AppCrypto;
Expand Down Expand Up @@ -344,14 +344,14 @@ async fn assert_validate_from_exhaustive(
validation_data,
validation_code,
candidate_receipt,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == *assert_pvd &&
validation_code == *assert_validation_code &&
*pov == *assert_pov && &candidate_receipt.descriptor == assert_candidate.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_receipt.commitments_hash == assert_candidate.commitments.hash() =>
{
response_sender.send(Ok(ValidationResult::Valid(
Expand Down Expand Up @@ -550,14 +550,14 @@ fn backing_works() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_ab &&
validation_code == validation_code_ab &&
*pov == pov_ab && &candidate_receipt.descriptor == candidate_a.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_receipt.commitments_hash == candidate_a_commitments_hash =>
{
response_sender.send(Ok(
Expand Down Expand Up @@ -729,14 +729,14 @@ fn backing_works_while_validation_ongoing() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_abc &&
validation_code == validation_code_abc &&
*pov == pov_abc && &candidate_receipt.descriptor == candidate_a.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_a_commitments_hash == candidate_receipt.commitments_hash =>
{
// we never validate the candidate. our local node
Expand Down Expand Up @@ -890,14 +890,14 @@ fn backing_misbehavior_works() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_a &&
validation_code == validation_code_a &&
*pov == pov_a && &candidate_receipt.descriptor == candidate_a.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_a_commitments_hash == candidate_receipt.commitments_hash =>
{
response_sender.send(Ok(
Expand Down Expand Up @@ -1057,14 +1057,14 @@ fn backing_dont_second_invalid() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_a &&
validation_code == validation_code_a &&
*pov == pov_block_a && &candidate_receipt.descriptor == candidate_a.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_a.commitments.hash() == candidate_receipt.commitments_hash =>
{
response_sender.send(Ok(ValidationResult::Invalid(InvalidCandidate::BadReturn))).unwrap();
Expand Down Expand Up @@ -1097,14 +1097,14 @@ fn backing_dont_second_invalid() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_b &&
validation_code == validation_code_b &&
*pov == pov_block_b && &candidate_receipt.descriptor == candidate_b.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate_b.commitments.hash() == candidate_receipt.commitments_hash =>
{
response_sender.send(Ok(
Expand Down Expand Up @@ -1224,14 +1224,14 @@ fn backing_second_after_first_fails_works() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_a &&
validation_code == validation_code_a &&
*pov == pov_a && &candidate_receipt.descriptor == candidate.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate.commitments.hash() == candidate_receipt.commitments_hash =>
{
response_sender.send(Ok(ValidationResult::Invalid(InvalidCandidate::BadReturn))).unwrap();
Expand Down Expand Up @@ -1368,14 +1368,14 @@ fn backing_works_after_failed_validation() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
},
) if validation_data == pvd_a &&
validation_code == validation_code_a &&
*pov == pov_a && &candidate_receipt.descriptor == candidate.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate.commitments.hash() == candidate_receipt.commitments_hash =>
{
response_sender.send(Err(ValidationFailed("Internal test error".into()))).unwrap();
Expand Down Expand Up @@ -1634,13 +1634,13 @@ fn retry_works() {
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
..
},
) if validation_data == pvd_a &&
validation_code == validation_code_a &&
*pov == pov_a && &candidate_receipt.descriptor == candidate.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate.commitments.hash() == candidate_receipt.commitments_hash
);
virtual_overseer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ async fn assert_validate_seconded_candidate(
validation_code,
candidate_receipt,
pov,
exec_timeout_kind,
exec_kind,
response_sender,
..
}) if &validation_data == assert_pvd &&
&validation_code == assert_validation_code &&
&*pov == assert_pov &&
&candidate_receipt.descriptor == candidate.descriptor() &&
exec_timeout_kind == PvfExecTimeoutKind::Backing &&
exec_kind == PvfExecKind::Backing &&
candidate.commitments.hash() == candidate_receipt.commitments_hash =>
{
response_sender.send(Ok(ValidationResult::Valid(
Expand Down
Loading
Loading