Merge pull request #241 from Feng94/rename-block-producer-to-block-proposer

Rename block producer to block proposer
This commit is contained in:
Paul Hauner 2019-02-19 15:50:24 +11:00 committed by GitHub
commit d0303d0395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
[workspace] [workspace]
members = [ members = [
"eth2/attester", "eth2/attester",
"eth2/block_producer", "eth2/block_proposer",
"eth2/fork_choice", "eth2/fork_choice",
"eth2/state_processing", "eth2/state_processing",
"eth2/types", "eth2/types",

View File

@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
block_producer = { path = "../../eth2/block_producer" } block_proposer = { path = "../../eth2/block_proposer" }
bls = { path = "../../eth2/utils/bls" } bls = { path = "../../eth2/utils/bls" }
boolean-bitfield = { path = "../../eth2/utils/boolean-bitfield" } boolean-bitfield = { path = "../../eth2/utils/boolean-bitfield" }
db = { path = "../db" } db = { path = "../db" }

View File

@ -14,7 +14,7 @@ criterion = "0.2"
[dependencies] [dependencies]
attester = { path = "../../../eth2/attester" } attester = { path = "../../../eth2/attester" }
beacon_chain = { path = "../../beacon_chain" } beacon_chain = { path = "../../beacon_chain" }
block_producer = { path = "../../../eth2/block_producer" } block_proposer = { path = "../../../eth2/block_proposer" }
bls = { path = "../../../eth2/utils/bls" } bls = { path = "../../../eth2/utils/bls" }
boolean-bitfield = { path = "../../../eth2/utils/boolean-bitfield" } boolean-bitfield = { path = "../../../eth2/utils/boolean-bitfield" }
db = { path = "../../db" } db = { path = "../../db" }

View File

@ -3,7 +3,7 @@ use attester::{
PublishOutcome as AttestationPublishOutcome, PublishOutcome as AttestationPublishOutcome,
}; };
use beacon_chain::BeaconChain; use beacon_chain::BeaconChain;
use block_producer::{ use block_proposer::{
BeaconNode as BeaconBlockNode, BeaconNodeError as BeaconBlockNodeError, BeaconNode as BeaconBlockNode, BeaconNodeError as BeaconBlockNodeError,
PublishOutcome as BlockPublishOutcome, PublishOutcome as BlockPublishOutcome,
}; };

View File

@ -2,7 +2,7 @@ use attester::{
DutiesReader as AttesterDutiesReader, DutiesReaderError as AttesterDutiesReaderError, DutiesReader as AttesterDutiesReader, DutiesReaderError as AttesterDutiesReaderError,
}; };
use beacon_chain::BeaconChain; use beacon_chain::BeaconChain;
use block_producer::{ use block_proposer::{
DutiesReader as ProducerDutiesReader, DutiesReaderError as ProducerDutiesReaderError, DutiesReader as ProducerDutiesReader, DutiesReaderError as ProducerDutiesReaderError,
}; };
use db::ClientDB; use db::ClientDB;

View File

@ -1,5 +1,5 @@
use attester::Signer as AttesterSigner; use attester::Signer as AttesterSigner;
use block_producer::Signer as BlockProposerSigner; use block_proposer::Signer as BlockProposerSigner;
use std::sync::RwLock; use std::sync::RwLock;
use types::{Keypair, Signature}; use types::{Keypair, Signature};

View File

@ -5,8 +5,8 @@ mod local_signer;
use attester::PollOutcome as AttestationPollOutcome; use attester::PollOutcome as AttestationPollOutcome;
use attester::{Attester, Error as AttestationPollError}; use attester::{Attester, Error as AttestationPollError};
use beacon_chain::BeaconChain; use beacon_chain::BeaconChain;
use block_producer::PollOutcome as BlockPollOutcome; use block_proposer::PollOutcome as BlockPollOutcome;
use block_producer::{BlockProducer, Error as BlockPollError}; use block_proposer::{BlockProducer, Error as BlockPollError};
use db::MemoryDB; use db::MemoryDB;
use direct_beacon_node::DirectBeaconNode; use direct_beacon_node::DirectBeaconNode;
use direct_duties::DirectDuties; use direct_duties::DirectDuties;

View File

@ -1,5 +1,5 @@
[package] [package]
name = "block_producer" name = "block_proposer"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2018"

View File

@ -236,7 +236,7 @@ mod tests {
epoch_map.map.insert(produce_epoch, produce_slot); epoch_map.map.insert(produce_epoch, produce_slot);
let epoch_map = Arc::new(epoch_map); let epoch_map = Arc::new(epoch_map);
let mut block_producer = BlockProducer::new( let mut block_proposer = BlockProducer::new(
spec.clone(), spec.clone(),
epoch_map.clone(), epoch_map.clone(),
slot_clock.clone(), slot_clock.clone(),
@ -251,28 +251,28 @@ mod tests {
// One slot before production slot... // One slot before production slot...
slot_clock.set_slot(produce_slot.as_u64() - 1); slot_clock.set_slot(produce_slot.as_u64() - 1);
assert_eq!( assert_eq!(
block_producer.poll(), block_proposer.poll(),
Ok(PollOutcome::BlockProductionNotRequired(produce_slot - 1)) Ok(PollOutcome::BlockProductionNotRequired(produce_slot - 1))
); );
// On the produce slot... // On the produce slot...
slot_clock.set_slot(produce_slot.as_u64()); slot_clock.set_slot(produce_slot.as_u64());
assert_eq!( assert_eq!(
block_producer.poll(), block_proposer.poll(),
Ok(PollOutcome::BlockProduced(produce_slot.into())) Ok(PollOutcome::BlockProduced(produce_slot.into()))
); );
// Trying the same produce slot again... // Trying the same produce slot again...
slot_clock.set_slot(produce_slot.as_u64()); slot_clock.set_slot(produce_slot.as_u64());
assert_eq!( assert_eq!(
block_producer.poll(), block_proposer.poll(),
Ok(PollOutcome::SlotAlreadyProcessed(produce_slot)) Ok(PollOutcome::SlotAlreadyProcessed(produce_slot))
); );
// One slot after the produce slot... // One slot after the produce slot...
slot_clock.set_slot(produce_slot.as_u64() + 1); slot_clock.set_slot(produce_slot.as_u64() + 1);
assert_eq!( assert_eq!(
block_producer.poll(), block_proposer.poll(),
Ok(PollOutcome::BlockProductionNotRequired(produce_slot + 1)) Ok(PollOutcome::BlockProductionNotRequired(produce_slot + 1))
); );
@ -280,7 +280,7 @@ mod tests {
let slot = (produce_epoch.as_u64() + 1) * spec.epoch_length; let slot = (produce_epoch.as_u64() + 1) * spec.epoch_length;
slot_clock.set_slot(slot); slot_clock.set_slot(slot);
assert_eq!( assert_eq!(
block_producer.poll(), block_proposer.poll(),
Ok(PollOutcome::ProducerDutiesUnknown(Slot::new(slot))) Ok(PollOutcome::ProducerDutiesUnknown(Slot::new(slot)))
); );
} }

View File

@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
block_producer = { path = "../eth2/block_producer" } block_proposer = { path = "../eth2/block_proposer" }
bls = { path = "../eth2/utils/bls" } bls = { path = "../eth2/utils/bls" }
clap = "2.32.0" clap = "2.32.0"
dirs = "1.0.3" dirs = "1.0.3"

View File

@ -1,4 +1,4 @@
use block_producer::{BeaconNode, BeaconNodeError, PublishOutcome}; use block_proposer::{BeaconNode, BeaconNodeError, PublishOutcome};
use protos::services::{ use protos::services::{
BeaconBlock as GrpcBeaconBlock, ProduceBeaconBlockRequest, PublishBeaconBlockRequest, BeaconBlock as GrpcBeaconBlock, ProduceBeaconBlockRequest, PublishBeaconBlockRequest,
}; };

View File

@ -1,7 +1,7 @@
mod beacon_block_grpc_client; mod beacon_block_grpc_client;
// mod block_producer_service; // mod block_producer_service;
use block_producer::{ use block_proposer::{
BeaconNode, BlockProducer, DutiesReader, PollOutcome as BlockProducerPollOutcome, Signer, BeaconNode, BlockProducer, DutiesReader, PollOutcome as BlockProducerPollOutcome, Signer,
}; };
use slog::{error, info, warn, Logger}; use slog::{error, info, warn, Logger};

View File

@ -1,4 +1,4 @@
use block_producer::{DutiesReader, DutiesReaderError}; use block_proposer::{DutiesReader, DutiesReaderError};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::RwLock; use std::sync::RwLock;
use types::{Epoch, Slot}; use types::{Epoch, Slot};

View File

@ -1,7 +1,7 @@
use self::block_producer_service::{BeaconBlockGrpcClient, BlockProducerService}; use self::block_producer_service::{BeaconBlockGrpcClient, BlockProducerService};
use self::duties::{DutiesManager, DutiesManagerService, EpochDutiesMap}; use self::duties::{DutiesManager, DutiesManagerService, EpochDutiesMap};
use crate::config::ClientConfig; use crate::config::ClientConfig;
use block_producer::{test_utils::LocalSigner, BlockProducer}; use block_proposer::{test_utils::LocalSigner, BlockProducer};
use bls::Keypair; use bls::Keypair;
use clap::{App, Arg}; use clap::{App, Arg};
use grpcio::{ChannelBuilder, EnvBuilder}; use grpcio::{ChannelBuilder, EnvBuilder};