Skip to content

Commit

Permalink
moved minimum_gas_price from EthEngine to Engine and wired it in hbbf…
Browse files Browse the repository at this point in the history
…t_engine.
  • Loading branch information
SurfingNerd committed Nov 14, 2023
1 parent 0fe2000 commit dcda92f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions crates/ethcore/src/engines/hbbft/hbbft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,10 @@ impl Engine<EthereumMachine> for HoneyBadgerBFT {
&self.machine
}

fn minimum_gas_price(&self) -> Option<U256> {
self.current_minimum_gas_price.lock().clone()
}

fn fork_choice(&self, new: &ExtendedHeader, current: &ExtendedHeader) -> ForkChoice {
crate::engines::total_difficulty_fork_choice(new, current)
}
Expand Down
12 changes: 6 additions & 6 deletions crates/ethcore/src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,12 @@ pub trait Engine<M: Machine>: Sync + Send {
true
}

/// Some Engine might define the minimum gas price by themselve.
/// (for example: contract)
fn minimum_gas_price(&self) -> Option<U256> {
None
}

/// Sign using the EngineSigner, to be used for consensus tx signing.
fn sign(&self, _hash: H256) -> Result<Signature, M::Error> {
unimplemented!()
Expand Down Expand Up @@ -709,12 +715,6 @@ pub trait EthEngine: Engine<::machine::EthereumMachine> {
fn allow_non_eoa_sender(&self, best_block_number: BlockNumber) -> bool {
self.params().eip3607_transition > best_block_number
}

/// Some Engine might define the minimum gas price by themselve.
/// (for example: contract)
fn minimum_gas_price(&self) -> Option<U256> {
None
}
}

// convenience wrappers for existing functions.
Expand Down

0 comments on commit dcda92f

Please sign in to comment.