Skip to content

Commit

Permalink
warn bundle equivocated info
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Dec 11, 2023
1 parent d521915 commit 548daac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/sp-domains-fraud-proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ domain-block-preprocessor = { version = "0.1.0", default-features = false, path
domain-runtime-primitives = { version = "0.1.0", default-features = false, path = "../../domains/primitives/runtime" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c" }
hash-db = { version = "0.16.0", default-features = false }
log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.7.0", default-features = false, features = ["derive"] }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", optional = true }
sc-executor = { version = "0.10.0-dev", git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false, optional = true }
Expand Down Expand Up @@ -60,6 +61,7 @@ std = [
"domain-runtime-primitives/std",
"frame-support/std",
"hash-db/std",
"log/std",
"scale-info/std",
"domain-block-preprocessor",
"sc-client-api",
Expand Down
8 changes: 8 additions & 0 deletions crates/sp-domains-fraud-proof/src/bundle_equivocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ where
if operator_set_1 == operator_set_2 {
// 2) with different hash
return if bundle_header.hash() != previous_bundle_header.hash() {
log::warn!(
"Bundle equivocation occurred: Operator{}; Slot{}; DomainId{}; First Bundle{}; Second Bundle{}",
operator_set_1.0,
slot,
operator_set_1.1,
previous_bundle_header.hash(),
bundle_header.hash(),
);
Ok(Some(FraudProof::BundleEquivocation(
BundleEquivocationProof {
domain_id: bundle_header.header.proof_of_election.domain_id,
Expand Down

0 comments on commit 548daac

Please sign in to comment.