Skip to content

Commit c773ce8

Browse files
committed
Merge branch 'master' into ethereum-types
2 parents da42488 + 80df39c commit c773ce8

File tree

80 files changed

+1756
-1688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1756
-1688
lines changed

Cargo.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ members = [
109109
"crates/tasks",
110110
"crates/eest_types",
111111
"crates/config",
112+
"crates/cfxcore/types",
112113
]
113114

114115
resolver = "2"
@@ -181,6 +182,7 @@ secret-store = { path = "./crates/secret_store" }
181182
cfxstore = { path = "./crates/cfx_store" }
182183
network = { path = "./crates/network" }
183184
cfxcore = { path = "./crates/cfxcore/core" }
185+
cfxcore-types = { path = "./crates/cfxcore/types" }
184186
cfx-parameters = { path = "./crates/parameters" }
185187
cfx-execute-helper = { path = "./crates/execution/execute-helper" }
186188
cfx-executor = { path = "./crates/execution/executor" }
@@ -244,7 +246,7 @@ pow-types = { path = "./crates/pos/types/pow-types" }
244246
diem-types = { path = "./crates/pos/types/types" }
245247
diem-network-address-encryption = { path = "./crates/pos/config/management/network-address-encryption" }
246248
cfx-tasks = { path = "./crates/tasks" }
247-
eest_types = { path = "./crates/eest_types" }
249+
# eest_types = { path = "./crates/eest_types" }
248250
cfx-config = { path = "./crates/config" }
249251

250252
# basics
@@ -335,7 +337,6 @@ blst = "0.3"
335337
hashbrown = "0.7.1"
336338

337339
clap = "4"
338-
clap-verbosity-flag = "3"
339340

340341
# rand & rng
341342
rand = "0.9"
@@ -453,4 +454,4 @@ influx_db_client = "0.5.1"
453454
rocksdb = { git = "https://github.com/Conflux-Chain/rust-rocksdb.git", rev = "7dbd66f507db1d0cfdf5334ad56ca0b24a768740" }
454455

455456
[patch.crates-io]
456-
sqlite3-sys = { git = "https://github.com/Conflux-Chain/sqlite3-sys.git", rev = "1de8e5998f7c2d919336660b8ef4e8f52ac43844" }
457+
sqlite3-sys = { git = "https://github.com/Conflux-Chain/sqlite3-sys.git", rev = "1de8e5998f7c2d919336660b8ef4e8f52ac43844" }

bins/conflux/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ parity-version = { workspace = true }
4040
tokio = { workspace = true, features = ["rt"] }
4141
bls-signatures = { workspace = true }
4242
cfx-executor = { workspace = true }
43+
cfx-execute-helper = { workspace = true }
4344

4445
[target.'cfg(not(target_env = "msvc"))'.dependencies.jemallocator]
4546
version = "0.3.2"
@@ -54,7 +55,7 @@ u64-mpt-db-key = ["client/u64_mpt_db_key"]
5455
# it will be enabled across all paths depending on that package.
5556
# (https://doc.rust-lang.org/cargo/reference/features.html#feature-unification)
5657
blst-portable = ["bls-signatures/blst-portable"]
57-
align_evm = ["cfx-executor/align_evm"]
58+
align_evm = ["cfx-executor/align_evm", "cfx-execute-helper/align_evm"]
5859

5960
[dev-dependencies]
6061
tokio = { workspace = true, features = ["full"] }

crates/cfx_types/src/space.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
use rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream};
22
use serde::ser::SerializeMap;
33
use serde_derive::{Deserialize, Serialize};
4-
use std::ops::{Add, Index, IndexMut};
4+
use std::{
5+
ops::{Add, Index, IndexMut},
6+
str::FromStr,
7+
};
58

69
#[derive(
710
Eq,
@@ -38,6 +41,18 @@ impl From<Space> for &'static str {
3841
}
3942
}
4043

44+
impl FromStr for Space {
45+
type Err = String;
46+
47+
fn from_str(s: &str) -> Result<Self, Self::Err> {
48+
match s {
49+
"native" => Ok(Space::Native),
50+
"evm" => Ok(Space::Ethereum),
51+
_ => Err(format!("Unrecognized space: {}", s)),
52+
}
53+
}
54+
}
55+
4156
impl Encodable for Space {
4257
fn rlp_append(&self, s: &mut RlpStream) {
4358
let type_int: u8 = match self {

crates/cfxcore/core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ cfx-rpc-eth-types = { workspace = true }
116116
jsonrpsee = { workspace = true, features = ["jsonrpsee-types"] }
117117
cfx-rpc-utils = { workspace = true }
118118
cfx-util-macros = { workspace = true }
119+
cfxcore-types = { workspace = true }
119120

120121
[dev-dependencies]
121122
cfx-storage = { workspace = true, features = ["testonly_code"] }

crates/cfxcore/core/src/block_data_manager/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use cfx_storage::{
1414
StorageManagerTrait,
1515
};
1616
use cfx_types::{Bloom, Space, H256};
17+
pub use cfxcore_types::block_data_manager::block_data_types;
1718
use db::SystemDB;
1819
use malloc_size_of::{new_malloc_size_ops, MallocSizeOf, MallocSizeOfOps};
1920
use malloc_size_of_derive::MallocSizeOf as DeriveMallocSizeOf;
@@ -30,7 +31,6 @@ use std::{
3031
sync::Arc,
3132
};
3233
use threadpool::ThreadPool;
33-
pub mod block_data_types;
3434
pub mod db_gc_manager;
3535
pub mod db_manager;
3636
pub mod tx_data_manager;

crates/cfxcore/core/src/consensus/consensus_inner/consensus_executor/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,13 @@ impl ConsensusExecutor {
505505
// the lock, there might be a checkpoint coming in to break
506506
// index
507507
for state_block_hash in waiting_blocks {
508-
self.wait_for_result(state_block_hash)?;
508+
let commitment = self.wait_for_result(state_block_hash)?;
509+
self.handler.data_man.insert_epoch_execution_commitment(
510+
state_block_hash,
511+
commitment.state_root_with_aux_info,
512+
commitment.receipts_root,
513+
commitment.logs_bloom_hash,
514+
);
509515
}
510516
// Now we need to wait for the execution information of all missing
511517
// blocks to come back

crates/cfxcore/core/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,24 @@ use keccak_hash as hash;
1616
pub mod message;
1717

1818
pub mod block_data_manager;
19-
pub mod cache_config;
20-
pub mod cache_manager;
21-
pub mod channel;
2219
pub mod client;
2320
pub mod consensus;
24-
mod core_error;
2521
pub mod db;
2622
pub mod errors;
2723
pub mod genesis_block;
2824
pub mod light_protocol;
29-
pub mod node_type;
3025
pub mod pos;
3126
pub mod pow;
32-
pub mod state_exposer;
3327
pub mod statistics;
3428
pub mod sync;
3529
pub mod transaction_pool;
36-
pub mod unique_id;
3730
pub mod verification;
3831

32+
pub use cfxcore_types::{
33+
cache_config, cache_manager, channel, core_error, node_type, state_exposer,
34+
unique_id,
35+
};
36+
3937
pub use crate::{
4038
block_data_manager::BlockDataManager,
4139
channel::Notifications,

0 commit comments

Comments
 (0)