mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Builder profit threshold flag (#3534)
## Issue Addressed Resolves https://github.com/sigp/lighthouse/issues/3517 ## Proposed Changes Adds a `--builder-profit-threshold <wei value>` flag to the BN. If an external payload's value field is less than this value, the local payload will be used. The value of the local payload will not be checked (it can't really be checked until the engine API is updated to support this). Co-authored-by: realbigsean <sean@sigmaprime.io>
This commit is contained in:
@@ -33,7 +33,7 @@ use types::{
|
||||
pub enum Operation {
|
||||
FeeRecipient(Address),
|
||||
GasLimit(usize),
|
||||
Value(usize),
|
||||
Value(Uint256),
|
||||
ParentHash(Hash256),
|
||||
PrevRandao(Hash256),
|
||||
BlockNumber(usize),
|
||||
@@ -47,7 +47,7 @@ impl Operation {
|
||||
bid.header.fee_recipient = to_ssz_rs(&fee_recipient)?
|
||||
}
|
||||
Operation::GasLimit(gas_limit) => bid.header.gas_limit = gas_limit as u64,
|
||||
Operation::Value(value) => bid.value = to_ssz_rs(&Uint256::from(value))?,
|
||||
Operation::Value(value) => bid.value = to_ssz_rs(&value)?,
|
||||
Operation::ParentHash(parent_hash) => bid.header.parent_hash = to_ssz_rs(&parent_hash)?,
|
||||
Operation::PrevRandao(prev_randao) => bid.header.prev_randao = to_ssz_rs(&prev_randao)?,
|
||||
Operation::BlockNumber(block_number) => bid.header.block_number = block_number as u64,
|
||||
@@ -149,7 +149,9 @@ impl<E: EthSpec> MockBuilder<E> {
|
||||
}
|
||||
|
||||
pub fn add_operation(&self, op: Operation) {
|
||||
self.operations.write().push(op);
|
||||
// Insert operations at the front of the vec to make sure `apply_operations` applies them
|
||||
// in the order they are added.
|
||||
self.operations.write().insert(0, op);
|
||||
}
|
||||
|
||||
pub fn invalid_signatures(&self) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::{
|
||||
test_utils::{
|
||||
MockServer, DEFAULT_JWT_SECRET, DEFAULT_TERMINAL_BLOCK, DEFAULT_TERMINAL_DIFFICULTY,
|
||||
MockServer, DEFAULT_BUILDER_THRESHOLD_WEI, DEFAULT_JWT_SECRET, DEFAULT_TERMINAL_BLOCK,
|
||||
DEFAULT_TERMINAL_DIFFICULTY,
|
||||
},
|
||||
Config, *,
|
||||
};
|
||||
@@ -66,6 +67,7 @@ impl<T: EthSpec> MockExecutionLayer<T> {
|
||||
builder_url,
|
||||
secret_files: vec![path],
|
||||
suggested_fee_recipient: Some(Address::repeat_byte(42)),
|
||||
builder_profit_threshold: DEFAULT_BUILDER_THRESHOLD_WEI,
|
||||
..Default::default()
|
||||
};
|
||||
let el =
|
||||
|
||||
@@ -28,6 +28,7 @@ pub use mock_execution_layer::MockExecutionLayer;
|
||||
pub const DEFAULT_TERMINAL_DIFFICULTY: u64 = 6400;
|
||||
pub const DEFAULT_TERMINAL_BLOCK: u64 = 64;
|
||||
pub const DEFAULT_JWT_SECRET: [u8; 32] = [42; 32];
|
||||
pub const DEFAULT_BUILDER_THRESHOLD_WEI: u128 = 1_000_000_000_000_000_000;
|
||||
|
||||
mod execution_block_generator;
|
||||
mod handle_rpc;
|
||||
|
||||
Reference in New Issue
Block a user