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

migrate zombie past slashing test #7147

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6abfeae
add zombienet-sdk past-session slashing test
ordian Jan 14, 2025
338b3cd
custom wait_for_metric workaround
ordian Jan 14, 2025
c88dfa1
remove old v1 test
ordian Jan 14, 2025
6f9dc66
some minor adjustments to the test
ordian Jan 16, 2025
87e7391
push some changes that are supposed to make it more robust
ordian Jan 16, 2025
62f2581
use best blocks instead of finalized
ordian Jan 16, 2025
75fe402
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Jan 16, 2025
3dd7784
revert to using built-in zombienet assertion
ordian Jan 20, 2025
18f6580
REVERTME: debug the InvalidProof issue
ordian Jan 20, 2025
74b9e30
fix pre-dispatch pov underweight for ParasInherent
ordian Jan 28, 2025
74195b7
wait for longer to avoid a debug panic
ordian Jan 28, 2025
d296885
Revert "REVERTME: debug the InvalidProof issue"
ordian Jan 29, 2025
722a770
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Jan 30, 2025
a18e8c5
update to zombienet-sdk to 0.2.23
ordian Feb 3, 2025
83a2992
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Feb 3, 2025
c9ad223
add the test to CI
ordian Feb 3, 2025
83c0c87
try specifying malus image
ordian Feb 3, 2025
e12dbde
cargo update -p zombienet-sdk
ordian Feb 3, 2025
dbc9f5a
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Feb 4, 2025
393a0bd
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Feb 6, 2025
d656b4e
litep2p: Increase keep-alive to 10 seconds to mirror libp2p (#7488)
lexnv Feb 6, 2025
41b23e6
address review comments
ordian Feb 6, 2025
88bd366
Revert "litep2p: Increase keep-alive to 10 seconds to mirror libp2p (…
ordian Feb 6, 2025
5135e2b
Merge branch 'master' into ao-migrate-zombie-past-slashing-test
ordian Feb 6, 2025
0ec474d
remove a no longer needed workaround
ordian Feb 7, 2025
773a6a5
lower the upper range of produced blocks
ordian Feb 7, 2025
97f68c5
fmt
ordian Feb 7, 2025
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
Prev Previous commit
Next Next commit
REVERTME: debug the InvalidProof issue
  • Loading branch information
ordian committed Jan 20, 2025
commit 18f65800c6e2b28c474caae076170d5f5a533fa5
2 changes: 1 addition & 1 deletion polkadot/node/core/dispute-coordinator/src/initialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ impl Initialized {
target: LOG_TARGET,
?session_index,
?candidate_hash,
key_ownership_proof_len = key_ownership_proof.len(),
?key_ownership_proof,
"Trying to submit a slashing report",
);

Expand Down
12 changes: 11 additions & 1 deletion polkadot/runtime/parachains/src/disputes/slashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ pub use pallet::*;
#[frame_support::pallet]
pub mod pallet {
use super::*;
use alloc::fmt::Debug;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

Expand All @@ -377,7 +378,7 @@ pub mod pallet {
/// The proof of key ownership, used for validating slashing reports.
/// The proof must include the session index and validator count of the
/// session at which the offence occurred.
type KeyOwnerProof: Parameter + GetSessionNumber + GetValidatorCount;
type KeyOwnerProof: Parameter + GetSessionNumber + GetValidatorCount + Debug + Encode;

/// The identification of a key owner, used when reporting slashes.
type KeyOwnerIdentification: Parameter;
Expand Down Expand Up @@ -617,9 +618,18 @@ fn is_known_offence<T: Config>(
dispute_proof: &DisputeProof,
key_owner_proof: &T::KeyOwnerProof,
) -> Result<(), TransactionValidityError> {
use codec::Encode;
// check the membership proof to extract the offender's id
let key = (polkadot_primitives::PARACHAIN_KEY_TYPE_ID, dispute_proof.validator_id.clone());

let proof_encoded: Vec<u8> = key_owner_proof.encode();
log::debug!(
target: LOG_TARGET,
"Validating key ownership proof key={:?}, proof={:?}, proof_encoded={:?}",
key,
key_owner_proof,
proof_encoded,
);
let offender = T::KeyOwnerProofSystem::check_proof(key, key_owner_proof.clone())
.ok_or(InvalidTransaction::BadProof)?;

Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub use runtime_api::*;
pub type ValidatorCount = u32;

/// Proof of membership of a specific key in a given session.
#[derive(Encode, Decode, Clone, Eq, PartialEq, Default, RuntimeDebug, scale_info::TypeInfo)]
#[derive(Encode, Decode, Clone, Eq, PartialEq, Default, Debug, scale_info::TypeInfo)]
pub struct MembershipProof {
/// The session index on which the specific key is a member.
pub session: SessionIndex,
Expand Down