-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Added --tx-queue-no-early-reject flag to disable early tx queue rejects #9143
Added --tx-queue-no-early-reject flag to disable early tx queue rejects #9143
Conversation
…ts because of low gas price
It looks like @ppratscher hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
[clabot:check] |
It looks like @ppratscher signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, minor grumble regarding comments.
Would actually be good to add a simple test for it as well, should be just a copy of min_effective_gas_price
test but with local transaction actaully getting into the pool if that setting is on.
miner/src/pool/verifier.rs
Outdated
@@ -43,6 +43,8 @@ pub struct Options { | |||
pub block_gas_limit: U256, | |||
/// Maximal gas limit for a single transaction. | |||
pub tx_gas_limit: U256, | |||
/// Skip check checks | |||
pub tx_queue_no_early_reject: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be named just no_early_reject
, we are in the context of tx_queue
already.
Also the comment could be a bit more clear :) Maybe something like:
Skip checks for early rejection, to make sure that local transactions are always imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that comment was a leftover typo. Will fix it & also fix the failing tests.
Sorry but I am unable to find a test named |
@ppratscher was thinking about this test: https://github.com/paritytech/parity/blob/21e0cd7781f55f0007d5c7d87929f49513367e27/miner/src/pool/tests/mod.rs#L987-L1023 Should look somewhat like this: #[test]
fn should_not_reject_early_in_case_of_local_transaction_and_early_rejections_disabled() {
// given
let txq = TransactionQueue::new(
txpool::Options {
max_count: 1,
max_per_sender: 2,
max_mem_usage: 50
},
verifier::Options {
minimal_gas_price: 1.into(),
block_gas_limit: 1_000_000.into(),
tx_gas_limit: 1_000_000.into(),
},
PrioritizationStrategy::GasPriceOnly,
);
let client = TestClient::new().with_balance(1_000_000_000);
let tx1 = Tx::gas_price(2).signed().local();
let res = txq.import(client.clone(), vec![tx1]);
assert_eq!(res, vec![Ok(())]);
assert_eq!(txq.status().status.transaction_count, 1);
assert!(client.was_verification_triggered());
// when
let client = TestClient::new();
let tx1 = Tx::default().signed().local();
let res = txq.import(client.clone(), vec![tx1]);
// then
assert_eq!(res, vec![Ok(())]);
assert_eq!(txq.status().status.transaction_count, 2);
assert!(client.was_verification_triggered());
} |
* 'master' of https://github.com/paritytech/parity: removed client error (openethereum#9253) Implement EIP-1052 (EXTCODEHASH) and fix several issues in state account cache (openethereum#9234) Improve Tracer documentation (openethereum#9237) Update Dockerfile (openethereum#9242) block cleanup (openethereum#9117) Increase the number of sessions. (openethereum#9203) add changelog for 1.11.8 stable and 2.0.1 beta (openethereum#9230) fix typo (openethereum#9232) Fix potential as_usize overflow when casting from U256 in miner (openethereum#9221) Allow old blocks from peers with lower difficulty (openethereum#9226) Removes duplicate libudev-dev from Dockerfile (openethereum#9220) snap: remove ssl dependencies from snapcraft definition (openethereum#9222) remove ssl from dockerfiles, closes openethereum#8880 (openethereum#9195) Insert PROOF messages for some cases in blockchain (openethereum#9141) [Chain] Add more bootnodes (openethereum#9174) ethcore: update bn version (openethereum#9217) deserialize block only once during verification (openethereum#9161) Simple build instruction fix (openethereum#9215) Added --tx-queue-no-early-reject flag to disable early tx queue rejects (openethereum#9143)
This PR resolves #9087 by adding a CLI flag to selectively disable a transaction queue optimization that early rejects transactions below the minimal effective gas price, without comparing the sender to the list of local accounts of a node first.
This allows local transactions to always enter the pool, despite it being full, but requires an additional ecrecover operation on every transaction.