Merge pull request #2196 from mimblewimble/floonet

* Get last bitcon block hash, setup genesis header without PoW (for now)
* More a few properties to mainnet genesis. Don't get too excited, several are placeholders.
* Mine a valid Cuckaroo solution for genesis block
* Use miner as library to get a solution for genesis. Replace final values in genesis.rs before committing it.
* Complete genesis replacement
* Fixed various replacements to obtain a compilable, well-formed genesis
* Check plugin errors, uncomment PoW validation
* Fixes to nonce handling in genesis mining
* Also produce full block hashes
* Fix genesis hash test
* Switch commitments (#2157)
* [Floonet] Use switch commits for all blinding factors (#2178)
* move wallet mods back into dirs
* use switched keys for blinding factor in all cases
* re-implement flag to turn off switch commit derivation
* rename tx log entry field tx_hex -> stored_tx (#2181)
* [Floonet] add feature for height locked kernels (#2168)
* add feature for height locked kernels
* add function to compute kernel features appropriate for lock height, and use it
* only sign kernel-features relevant fields; refactor Features
* simplify invalid kernel logic
* remove unused height arg to reward::output and run some rustfmt
* replace nested if/else by match
* Floonet chain type and genesis, testnets cleanup (#2182)
* [Floonet] Encrypt private slate data upon storage in DB (#2189)
* xor encrypt stored nonce and blind sum in transaction data
* stop doc tests splatting wallet files throughout
* Remove bzip2 dependency
* Changed magic number and seeds for Floonet (#2188)
* Genesis generator now loads a local wallet seed to build coinbase.
* Floonet genesis block
* Add floonet to generated grin-server.toml comments
* Test with final Floonet genesis hashes
* Fix get_header_for_output for genesis (#2192)
* start search with min height 0 (#2195)
This commit is contained in:
Ignotus Peverell
2018-12-20 18:12:08 -08:00
committed by GitHub
55 changed files with 978 additions and 453 deletions
+12 -3
View File
@@ -24,14 +24,18 @@ use std::net::{SocketAddr, ToSocketAddrs};
use std::sync::{mpsc, Arc};
use std::{cmp, io, str, thread, time};
use crate::core::global;
use crate::p2p;
use crate::p2p::ChainAdapter;
use crate::pool::DandelionConfig;
use crate::util::{Mutex, StopState};
// DNS Seeds with contact email associated
const DNS_SEEDS: &'static [&'static str] = &[
"t4.seed.grin-tech.org", // igno.peverell@protonmail.com
const MAINNET_DNS_SEEDS: &'static [&'static str] = &[
"mainnet.seed.grin-tech.org", // igno.peverell@protonmail.com
];
const FLOONET_DNS_SEEDS: &'static [&'static str] = &[
"floonet.seed.grin-tech.org", // igno.peverell@protonmail.com
];
pub fn connect_and_monitor(
@@ -331,7 +335,12 @@ fn listen_for_addrs(
pub fn dns_seeds() -> Box<dyn Fn() -> Vec<SocketAddr> + Send> {
Box::new(|| {
let mut addresses: Vec<SocketAddr> = vec![];
for dns_seed in DNS_SEEDS {
let net_seeds = if global::is_testnet() {
FLOONET_DNS_SEEDS
} else {
MAINNET_DNS_SEEDS
};
for dns_seed in net_seeds {
let temp_addresses = addresses.clone();
debug!("Retrieving seed nodes from dns {}", dns_seed);
match (dns_seed.to_owned(), 0).to_socket_addrs() {
+2 -5
View File
@@ -133,13 +133,10 @@ impl Server {
));
let genesis = match config.chain_type {
global::ChainTypes::Testnet1 => genesis::genesis_testnet1(),
global::ChainTypes::Testnet2 => genesis::genesis_testnet2(),
global::ChainTypes::Testnet3 => genesis::genesis_testnet3(),
global::ChainTypes::Testnet4 => genesis::genesis_testnet4(),
global::ChainTypes::AutomatedTesting => genesis::genesis_dev(),
global::ChainTypes::UserTesting => genesis::genesis_dev(),
global::ChainTypes::Mainnet => genesis::genesis_testnet2(), //TODO: Fix, obviously
global::ChainTypes::Floonet => genesis::genesis_floo(),
global::ChainTypes::Mainnet => genesis::genesis_main(),
};
info!("Starting server, genesis block: {}", genesis.hash());
+1 -1
View File
@@ -173,7 +173,7 @@ fn burn_reward(block_fees: BlockFees) -> Result<(core::Output, core::TxKernel, B
let keychain = ExtKeychain::from_random_seed().unwrap();
let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
let (out, kernel) =
crate::core::libtx::reward::output(&keychain, &key_id, block_fees.fees, block_fees.height)
crate::core::libtx::reward::output(&keychain, &key_id, block_fees.fees)
.unwrap();
Ok((out, kernel, block_fees))
}