Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion crates/blockchain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl BlockChainServer {
// Create signed attestation
let signed_attestation = SignedAttestation {
validator_id,
message: attestation_data.clone(),
data: attestation_data.clone(),
signature,
};

Expand Down
2 changes: 1 addition & 1 deletion crates/blockchain/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub fn on_gossip_attestation(
let validator_id = signed_attestation.validator_id;
let attestation = Attestation {
validator_id,
data: signed_attestation.message,
data: signed_attestation.data,
};
validate_attestation_data(store, &attestation.data)
.inspect_err(|_| metrics::inc_attestations_invalid("gossip"))?;
Expand Down
4 changes: 2 additions & 2 deletions crates/common/types/src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub struct AttestationData {
pub struct SignedAttestation {
/// The index of the validator making the attestation.
pub validator_id: u64,
/// The attestation message signed by the validator.
pub message: AttestationData,
/// The attestation data signed by the validator.
pub data: AttestationData,
/// Signature aggregation produced by the leanVM (SNARKs in the future).
pub signature: XmssSignature,
}
Expand Down
22 changes: 11 additions & 11 deletions crates/net/p2p/src/gossipsub/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ pub async fn handle_gossipsub_message(server: &mut P2PServer, event: Event) {
else {
return;
};
let slot = signed_attestation.message.slot;
let slot = signed_attestation.data.slot;
let validator = signed_attestation.validator_id;
info!(
%slot,
validator,
head_root = %ShortRoot(&signed_attestation.message.head.root.0),
target_slot = signed_attestation.message.target.slot,
target_root = %ShortRoot(&signed_attestation.message.target.root.0),
source_slot = signed_attestation.message.source.slot,
source_root = %ShortRoot(&signed_attestation.message.source.root.0),
head_root = %ShortRoot(&signed_attestation.data.head.root.0),
target_slot = signed_attestation.data.target.slot,
target_root = %ShortRoot(&signed_attestation.data.target.root.0),
source_slot = signed_attestation.data.source.slot,
source_root = %ShortRoot(&signed_attestation.data.source.root.0),
"Received attestation from gossip"
);
server
Expand All @@ -113,7 +113,7 @@ pub async fn handle_gossipsub_message(server: &mut P2PServer, event: Event) {
}

pub async fn publish_attestation(server: &mut P2PServer, attestation: SignedAttestation) {
let slot = attestation.message.slot;
let slot = attestation.data.slot;
let validator = attestation.validator_id;

// Encode to SSZ
Expand All @@ -131,10 +131,10 @@ pub async fn publish_attestation(server: &mut P2PServer, attestation: SignedAtte
.inspect(|_| info!(
%slot,
validator,
target_slot = attestation.message.target.slot,
target_root = %ShortRoot(&attestation.message.target.root.0),
source_slot = attestation.message.source.slot,
source_root = %ShortRoot(&attestation.message.source.root.0),
target_slot = attestation.data.target.slot,
target_root = %ShortRoot(&attestation.data.target.root.0),
source_slot = attestation.data.source.slot,
source_root = %ShortRoot(&attestation.data.source.root.0),
"Published attestation to gossipsub"
))
.inspect_err(|err| {
Expand Down