Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I125 system events not emitted #134

Draft
wants to merge 15 commits into
base: alpha4
Choose a base branch
from
2 changes: 1 addition & 1 deletion bin/oe/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use parity_rpc::{
};
use parity_runtime::Executor;

pub use parity_rpc::{HttpServer, IpcServer, RequestMiddleware};
pub use parity_rpc::{HttpServer, IpcServer};
//pub use parity_rpc::ws::Server as WsServer;
pub use parity_rpc::ws::{ws, Server as WsServer};

Expand Down
4 changes: 1 addition & 3 deletions crates/concensus/ethash/src/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ pub mod keccak_512 {
pub mod keccak_256 {
use super::hash;

pub use self::hash::{
keccak256 as inplace, keccak256_range as inplace_range, keccak_256 as write,
};
pub use self::hash::{keccak256 as inplace, keccak_256 as write};
}
2 changes: 1 addition & 1 deletion crates/db/blooms-db/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl Database {

// Constant forks may lead to increased ratio of false positives in bloom filters
// since we do not rebuild top or mid level, but we should not be worried about that
// because most of the time events at block n(a) occur also on block n(b) or n+1(b)
// because most of the time events at block n(a) occur also on block n(b) or n+1(b)3
db_files.accrue_bloom(pos, bloom)?;
}
db_files.flush()?;
Expand Down
3 changes: 1 addition & 2 deletions crates/ethcore/benches/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl<'a> BuiltinBenchmark<'a> {

let builtin = builtins
.get(&H160::from_str(builtin_address).unwrap())
.unwrap()
.clone();
.unwrap();
let input = FromHex::from_hex(input).unwrap();
let expected = FromHex::from_hex(expected).unwrap();

Expand Down
5 changes: 1 addition & 4 deletions crates/ethcore/src/engines/hbbft/contracts/keygen_history.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use client::traits::EngineClient;
use crypto::{
self,
publickey::{ec_math_utils::public_add, Public},
};
use crypto::{self, publickey::Public};
use engines::{
hbbft::{
contracts::validator_set::{get_validator_pubkeys, ValidatorType},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ pub(crate) struct HbbftEarlyEpochEndManager {

node_id_to_address: BTreeMap<NodeId, Address>,

address_to_node_id: BTreeMap<Address, NodeId>,

// address_to_node_id: BTreeMap<Address, NodeId>,
signing_address: Address,
}

Expand Down Expand Up @@ -109,7 +108,7 @@ impl HbbftEarlyEpochEndManager {
validators: validators,
flagged_validators: flagged_validators,
node_id_to_address,
address_to_node_id,
// address_to_node_id,
signing_address: signing_address.clone(),
};

Expand Down
3 changes: 0 additions & 3 deletions crates/ethcore/src/engines/hbbft/hbbft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,6 @@ impl HoneyBadgerBFT {
Err(e) => {
error!(target: "consensus", "Error initializing synckeygen: {:?}", e);
}
Err(_) => {
error!(target: "consensus", "Error initializing synckeygen: unknown Error");
}
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions crates/ethcore/src/engines/hbbft/hbbft_network_fork_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,11 @@ impl HbbftNetworkForkManager {
#[cfg(test)]
mod tests {

use std::{fs, str::FromStr};

use crate::engines::{hbbft::test::hbbft_test_client::HbbftTestClient, signer::from_keypair};

use super::*;
use ethereum_types::Address;
use ethjson::spec::hbbft::HbbftNetworkFork;
use hbbft::sync_key_gen::{Ack, Part};

use crate::engines::signer::from_keypair;
use crypto::publickey::{KeyPair, Secret};
//use parity_crypto::publickey::{KeyPair, Secret};
use ethjson::spec::hbbft::HbbftNetworkFork;
use std::str::FromStr;

#[test]
fn test_fork_manager_should_fork() {
Expand Down
4 changes: 2 additions & 2 deletions crates/ethcore/src/engines/validator_set/safe_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ mod tests {
use types::{header::Header, log_entry::LogEntry};

let client = generate_dummy_client_with_spec(Spec::new_validator_safe_contract);
let engine = client.engine().clone();
let engine = client.engine();
let validator_contract = "0000000000000000000000000000000000000005"
.parse::<Address>()
.unwrap();
Expand Down Expand Up @@ -900,7 +900,7 @@ mod tests {
use types::header::Header;

let client = generate_dummy_client_with_spec(Spec::new_validator_safe_contract);
let engine = client.engine().clone();
let engine = client.engine();

let mut new_header = Header::default();
new_header.set_number(0); // so the validator set doesn't look for a log
Expand Down
17 changes: 16 additions & 1 deletion crates/ethcore/src/machine/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ use std::{
sync::Arc,
};

use ethereum_types::{Address, H256, U256};
use ethereum_types::{Address, Bloom, H256, U256};
use types::{
header::Header,
receipt::TransactionOutcome,
transaction::{
self, SignedTransaction, TypedTransaction, UnverifiedTransaction, SYSTEM_ADDRESS,
UNSIGNED_SENDER,
Expand Down Expand Up @@ -210,6 +211,20 @@ impl EthereumMachine {
.map_err(|e| ::engines::EngineError::FailedSystemCall(format!("{}", e)))?;
let output = res.return_data.to_vec();

let logs = substate.logs.clone();
let gas_used = gas - res.gas_left;
let mut log_bloom = Bloom::zero();
//log_bloom.accrue(logs);

for log in substate.logs {
let bloom = log.bloom();
log_bloom.accrue_bloom(&bloom);
}

block.receipts.push(types::receipt::TypedReceipt::Legacy(
types::receipt::LegacyReceipt::new(TransactionOutcome::StatusCode(1), gas_used, logs),
));

Ok(output)
}

Expand Down
1 change: 0 additions & 1 deletion crates/rpc/src/v1/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ mod subscription_manager;
mod work;

pub use self::{
dispatch::{Dispatcher, FullDispatcher},
network_settings::NetworkSettings,
poll_filter::{limit_logs, PollFilter, SyncPollFilter},
poll_manager::PollManager,
Expand Down
9 changes: 3 additions & 6 deletions crates/rpc/src/v1/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use rpc_common::Bytes;

pub use self::{
account_info::{AccountInfo, EthAccount, ExtAccountInfo, RecoveredAccount, StorageProof},
block::{Block, BlockTransactions, Header, Rich, RichBlock, RichHeader},
block::{Block, BlockTransactions, Header, RichBlock, RichHeader},
block_number::{block_number_to_id, BlockNumber},
call_request::CallRequest,
confirmations::{
Expand All @@ -40,14 +40,11 @@ pub use self::{
receipt::Receipt,
rpc_settings::RpcSettings,
secretstore::EncryptedDocumentKey,
sync::{
ChainStatus, EthProtocolInfo, PeerInfo, PeerNetworkInfo, PeerProtocolsInfo, Peers,
SyncInfo, SyncStatus, TransactionStats,
},
sync::{ChainStatus, Peers, SyncInfo, SyncStatus, TransactionStats},
trace::{LocalizedTrace, TraceResults, TraceResultsWithTransactionHash},
trace_filter::TraceFilter,
transaction::{LocalTransactionStatus, RichRawTransaction, Transaction},
transaction_access_list::{AccessList, AccessListItem},
transaction_access_list::AccessList,
transaction_condition::TransactionCondition,
transaction_request::TransactionRequest,
work::Work,
Expand Down
Loading