Skip to content

Commit

Permalink
Merge branch 'master' into v2.0-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
peilun-conflux committed Jun 3, 2024
2 parents c6a35b0 + 3135859 commit 5267441
Show file tree
Hide file tree
Showing 49 changed files with 924 additions and 392 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bins/conflux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "conflux"
build = "build.rs"
edition = "2018"
edition = "2021"
version.workspace = true
authors.workspace = true
description.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "GPL-3.0"
name = "cfxcore-accounts"
version = "0.1.0"
authors = ["Conflux Foundation"]
edition = "2018"
edition = "2021"

[dependencies]
cfxkey = { path = "../cfx_key" }
Expand Down
2 changes: 1 addition & 1 deletion crates/blockgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage = "https://www.confluxnetwork.org"
license = "GPL-3.0"
name = "blockgen"
version = "0.1.0"
edition = "2018"
edition = "2021"

[dependencies]
clap = "2"
Expand Down
2 changes: 1 addition & 1 deletion crates/cfx_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage = "https://www.confluxnetwork.org"
license = "GPL-3.0"
name = "cfx-utils"
version = "0.6.0"
edition = "2018"
edition = "2021"

[dependencies]
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion crates/cfxcore/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage = "https://www.confluxnetwork.org"
license = "GPL-3.0"
name = "cfxcore"
version = "2.4.0-testnet"
edition = "2018"
edition = "2021"

[dependencies]
bit-set = "0.4"
Expand Down
21 changes: 16 additions & 5 deletions crates/cfxcore/core/src/transaction_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@ impl TransactionPool {
let mut failure = HashMap::new();
let current_best_info = self.consensus_best_info.lock().clone();

// filter out invalid transactions.
let mut index = 0;

let (chain_id, best_height, best_block_number) = {
(
current_best_info.best_chain_id(),
Expand All @@ -395,6 +392,8 @@ impl TransactionPool {
let vm_spec = self.machine.spec(best_block_number, best_height);
let transitions = &self.machine.params().transition_heights;

// filter out invalid transactions.
let mut index = 0;
while let Some(tx) = transactions.get(index) {
match self.verify_transaction_tx_pool(
tx,
Expand Down Expand Up @@ -745,15 +744,27 @@ impl TransactionPool {
best_epoch_height += 1;
// The best block number is not necessary an exact number.
best_block_number += 1;

let spec = self.machine.spec(best_block_number, best_epoch_height);
let transitions = &self.machine.params().transition_heights;

let validity = |tx: &SignedTransaction| {
self.verification_config.fast_recheck(
tx,
best_epoch_height,
transitions,
&spec,
)
};

inner.pack_transactions_1559(
num_txs,
block_gas_limit,
parent_base_price,
block_size_limit,
best_epoch_height,
best_block_number,
&self.verification_config,
&self.machine,
validity,
)
}

Expand Down
Loading

0 comments on commit 5267441

Please sign in to comment.