From f060aa821b2b6990b77c38af154bf05209704670 Mon Sep 17 00:00:00 2001 From: mertwole Date: Thu, 28 Nov 2024 11:00:25 +0000 Subject: [PATCH] Rename struct --- prover/src/block_finality/mod.rs | 5 ++--- .../validator_signs_chain/indexed_validator_sign.rs | 4 ++-- prover/src/block_finality/validator_signs_chain/mod.rs | 8 ++++---- .../validator_signs_chain/single_validator_sign.rs | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/prover/src/block_finality/mod.rs b/prover/src/block_finality/mod.rs index c33e9fce..4a2060eb 100644 --- a/prover/src/block_finality/mod.rs +++ b/prover/src/block_finality/mod.rs @@ -35,7 +35,7 @@ impl_target_set! { /// Blake2 hash of concatenated validator public keys. pub validator_set_hash: Blake2Target, /// GRANDPA message. - pub message: GrandpaVoteTarget, + pub message: GrandpaMessageTarget, } } @@ -45,10 +45,9 @@ impl_target_set! { // - block number (4 bytes) // - round number (8 bytes) // - authority set id (8 bytes) -// TODO: Rename to GrandpaMessageTarget impl_parsable_target_set! { /// Target that reflects the way GRANDPA vote is implemented in substrate. - pub struct GrandpaVoteTarget { + pub struct GrandpaMessageTarget { /// Discriminant determining sub-round of voting. 1 here stands for pre-commit. pub discriminant: BitArrayTarget<8>, /// Block hash that's being finalized. diff --git a/prover/src/block_finality/validator_signs_chain/indexed_validator_sign.rs b/prover/src/block_finality/validator_signs_chain/indexed_validator_sign.rs index c0715d7e..10dc2b3a 100644 --- a/prover/src/block_finality/validator_signs_chain/indexed_validator_sign.rs +++ b/prover/src/block_finality/validator_signs_chain/indexed_validator_sign.rs @@ -11,7 +11,7 @@ use plonky2::{ use plonky2_field::types::Field; -use super::{single_validator_sign::SingleValidatorSign, GrandpaVoteTarget}; +use super::{single_validator_sign::SingleValidatorSign, GrandpaMessageTarget}; use crate::{ block_finality::validator_set_hash::ValidatorSetHashTarget, common::{ @@ -32,7 +32,7 @@ impl_target_set! { /// Validator index that have signed GRANDPA message. pub validator_idx: Target, /// GRANDPA message. - pub message: GrandpaVoteTarget, + pub message: GrandpaMessageTarget, } } diff --git a/prover/src/block_finality/validator_signs_chain/mod.rs b/prover/src/block_finality/validator_signs_chain/mod.rs index 745f63ce..7ed86161 100644 --- a/prover/src/block_finality/validator_signs_chain/mod.rs +++ b/prover/src/block_finality/validator_signs_chain/mod.rs @@ -42,7 +42,7 @@ use self::indexed_validator_sign::IndexedValidatorSignTarget; use indexed_validator_sign::IndexedValidatorSign; -use super::{validator_set_hash::ValidatorSetHash, GrandpaVoteTarget, ProcessedPreCommit}; +use super::{validator_set_hash::ValidatorSetHash, GrandpaMessageTarget, ProcessedPreCommit}; const VALIDATOR_SIGN_PROVER_THREAD_MAX_STACK_SIZE: usize = 65_536 * 64; @@ -52,7 +52,7 @@ impl_target_set! { /// Blake2 hash of concatenated validator public keys. pub validator_set_hash: Blake2Target, /// GRANDPA message. - pub message: GrandpaVoteTarget, + pub message: GrandpaMessageTarget, } } @@ -159,7 +159,7 @@ impl_target_set! { validator_set_hash: Blake2Target, validator_count: Target, - message: GrandpaVoteTarget, + message: GrandpaMessageTarget, latest_validator_idx: Target, sign_count: Target, @@ -173,7 +173,7 @@ impl_parsable_target_set! { validator_set_hash: Blake2Target, validator_set_count: Target, - message: GrandpaVoteTarget, + message: GrandpaMessageTarget, latest_validator_idx: Target, sign_count: Target, diff --git a/prover/src/block_finality/validator_signs_chain/single_validator_sign.rs b/prover/src/block_finality/validator_signs_chain/single_validator_sign.rs index b239271d..fcc5c3d4 100644 --- a/prover/src/block_finality/validator_signs_chain/single_validator_sign.rs +++ b/prover/src/block_finality/validator_signs_chain/single_validator_sign.rs @@ -10,7 +10,7 @@ use plonky2::{ use plonky2_ed25519::gadgets::eddsa::make_verify_circuits as ed25519_circuit; -use super::GrandpaVoteTarget; +use super::GrandpaMessageTarget; use crate::{ common::{ array_to_bits, @@ -30,7 +30,7 @@ impl_target_set! { /// Public inputs for `SingleValidatorSign`. pub struct PublicInputsTarget { /// GRANDPA message. - pub message: GrandpaVoteTarget, + pub message: GrandpaMessageTarget, /// Validator public key. pub public_key: Ed25519PublicKeyTarget, }