Skip to content

Commit

Permalink
refactor: coinbase to beneficiary
Browse files Browse the repository at this point in the history
  • Loading branch information
developeruche committed Mar 19, 2024
1 parent 47062f0 commit dc89385
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/interpreter/src/instructions/host_env.rs
Expand Up @@ -13,7 +13,7 @@ pub fn chainid<H: Host, SPEC: Spec>(interpreter: &mut Interpreter, host: &mut H)

pub fn coinbase<H: Host>(interpreter: &mut Interpreter, host: &mut H) {
gas!(interpreter, gas::BASE);
push_b256!(interpreter, host.env().block.coinbase.into_word());
push_b256!(interpreter, host.env().block.beneficiary.into_word());
}

pub fn timestamp<H: Host>(interpreter: &mut Interpreter, host: &mut H) {
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/env.rs
Expand Up @@ -415,7 +415,7 @@ pub struct BlockEnv {
/// Coinbase or miner or address that created and signed the block.
///
/// This is the receiver address of all the gas spent in the block.
pub coinbase: Address,
pub beneficiary: Address,

/// The timestamp of the block in seconds since the UNIX epoch.
pub timestamp: U256,
Expand Down Expand Up @@ -488,7 +488,7 @@ impl Default for BlockEnv {
fn default() -> Self {
Self {
number: U256::ZERO,
coinbase: Address::ZERO,
beneficiary: Address::ZERO,
timestamp: U256::from(1),
gas_limit: U256::MAX,
basefee: U256::ZERO,
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/handler/mainnet/post_execution.rs
Expand Up @@ -21,7 +21,7 @@ pub fn reward_beneficiary<SPEC: Spec, EXT, DB: Database>(
context: &mut Context<EXT, DB>,
gas: &Gas,
) -> Result<(), EVMError<DB::Error>> {
let beneficiary = context.evm.env.block.coinbase;
let beneficiary = context.evm.env.block.beneficiary;
let effective_gas_price = context.evm.env.effective_gas_price();

// transfer fee to coinbase/beneficiary.
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/handler/mainnet/pre_execution.rs
Expand Up @@ -33,7 +33,7 @@ pub fn load_accounts<SPEC: Spec, EXT, DB: Database>(
// EIP-3651: Warm COINBASE. Starts the `COINBASE` address warm
if SPEC::enabled(SHANGHAI) {
context.evm.inner.journaled_state.initial_account_load(
context.evm.inner.env.block.coinbase,
context.evm.inner.env.block.beneficiary,
&[],
&mut context.evm.inner.db,
)?;
Expand Down

0 comments on commit dc89385

Please sign in to comment.