Skip to content

Commit

Permalink
Rename struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mertwole committed Nov 28, 2024
1 parent 09c3c65 commit f060aa8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions prover/src/block_finality/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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,
}
}

Expand Down
8 changes: 4 additions & 4 deletions prover/src/block_finality/validator_signs_chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
}
}

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}
Expand Down

0 comments on commit f060aa8

Please sign in to comment.