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

Fixing minGasLimit > ceil limit mining issue #4018

Merged
merged 1 commit into from
Jan 5, 2017
Merged

Conversation

tomusdrw
Copy link
Collaborator

@tomusdrw tomusdrw commented Jan 3, 2017

Fixes #3760

@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 3, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling b4678c3 on gas-adjustment into ** on master**.

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 3, 2017
let gas_floor_target = ::std::cmp::max(gas_range_target.0, engine.params().min_gas_limit);
engine.populate_from_parent(&mut r.block.base.header, parent, gas_floor_target, gas_range_target.1);
let gas_floor_target = cmp::max(gas_range_target.0, engine.params().min_gas_limit);
let gas_ceil_target = cmp::max(gas_range_target.1, gas_floor_target);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me except for the possible case where ceil < floor... at this point I'm not sure it's safe to assume anything :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should still work fine even if you setup ceil < floor, that's the reason why it says max(gas_range_target.1, gas_floor_target) instead of max(gas_range.target.1, min_gas_limit).

In both cases min_gas_limit > floor > ceil and min_gas_limit > ceil > floor the gas should stay constant with value min_gas_limit.

@gavofyork gavofyork merged commit 91f864b into master Jan 5, 2017
@gavofyork gavofyork deleted the gas-adjustment branch January 5, 2017 12:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants