Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fixes incorrect comment. #10913

Merged
merged 1 commit into from
Jul 24, 2019
Merged

Fixes incorrect comment. #10913

merged 1 commit into from
Jul 24, 2019

Conversation

MicahZoltu
Copy link
Contributor

@MicahZoltu MicahZoltu commented Jul 24, 2019

I believe (someone please double-check my work) that this comment is subtly incorrect and in fact the replacement will occur if the new gas price is exactly 12.5% (given current configuration) higher.

Relevant pieces of code:

fn bump_gas_price(old_gp: U256) -> U256 {
	old_gp.saturating_add(old_gp >> GAS_PRICE_BUMP_SHIFT)
}
let min_required_gp = bump_gas_price(*old_gp);
match min_required_gp.cmp(&new_gp) {
	cmp::Ordering::Greater => scoring::Choice::RejectNew,
	_ => scoring::Choice::ReplaceOld,
}

I _believe_ (someone please double-check my work) that this comment is subtly incorrect and in fact the replacement will occur if the new gas price is exactly 12.5% (given current configuration) higher.

Relevant pieces of code:
```rust
fn bump_gas_price(old_gp: U256) -> U256 {
	old_gp.saturating_add(old_gp >> GAS_PRICE_BUMP_SHIFT)
}
```
```rust
let min_required_gp = bump_gas_price(*old_gp);
match min_required_gp.cmp(&new_gp) {
	cmp::Ordering::Greater => scoring::Choice::RejectNew,
	_ => scoring::Choice::ReplaceOld,
}
```
@parity-cla-bot
Copy link

It looks like @MicahZoltu signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@jam10o-new jam10o-new added A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). F5-documentation 📑 Documentation needs fixing, improving or augmenting. labels Jul 24, 2019
@jam10o-new jam10o-new added this to the 2.7 milestone Jul 24, 2019
@ordian ordian merged commit 8099efe into openethereum:master Jul 24, 2019
ordian added a commit that referenced this pull request Aug 7, 2019
* master:
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated security@parity.io key (#10939)
  Change the return type of step_inner function. (#10940)
  get rid of hidden mutability of Spec (#10904)
  simplify BlockReward::reward implementation (#10906)
  Kaspersky AV whitelisting (#10919)
  additional arithmetic EVM opcode benchmarks (#10916)
  [Cargo.lock] cargo update -p crossbeam-epoch (#10921)
  Fixes incorrect comment. (#10913)
  Add file path to disk map write/read warnings (#10911)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). F5-documentation 📑 Documentation needs fixing, improving or augmenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants