Skip to content

Commit dc89385

Browse files
committed
refactor: coinbase to beneficiary
1 parent 47062f0 commit dc89385

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

crates/interpreter/src/instructions/host_env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn chainid<H: Host, SPEC: Spec>(interpreter: &mut Interpreter, host: &mut H)
1313

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

1919
pub fn timestamp<H: Host>(interpreter: &mut Interpreter, host: &mut H) {

crates/primitives/src/env.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ pub struct BlockEnv {
415415
/// Coinbase or miner or address that created and signed the block.
416416
///
417417
/// This is the receiver address of all the gas spent in the block.
418-
pub coinbase: Address,
418+
pub beneficiary: Address,
419419

420420
/// The timestamp of the block in seconds since the UNIX epoch.
421421
pub timestamp: U256,
@@ -488,7 +488,7 @@ impl Default for BlockEnv {
488488
fn default() -> Self {
489489
Self {
490490
number: U256::ZERO,
491-
coinbase: Address::ZERO,
491+
beneficiary: Address::ZERO,
492492
timestamp: U256::from(1),
493493
gas_limit: U256::MAX,
494494
basefee: U256::ZERO,

crates/revm/src/handler/mainnet/post_execution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn reward_beneficiary<SPEC: Spec, EXT, DB: Database>(
2121
context: &mut Context<EXT, DB>,
2222
gas: &Gas,
2323
) -> Result<(), EVMError<DB::Error>> {
24-
let beneficiary = context.evm.env.block.coinbase;
24+
let beneficiary = context.evm.env.block.beneficiary;
2525
let effective_gas_price = context.evm.env.effective_gas_price();
2626

2727
// transfer fee to coinbase/beneficiary.

crates/revm/src/handler/mainnet/pre_execution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn load_accounts<SPEC: Spec, EXT, DB: Database>(
3333
// EIP-3651: Warm COINBASE. Starts the `COINBASE` address warm
3434
if SPEC::enabled(SHANGHAI) {
3535
context.evm.inner.journaled_state.initial_account_load(
36-
context.evm.inner.env.block.coinbase,
36+
context.evm.inner.env.block.beneficiary,
3737
&[],
3838
&mut context.evm.inner.db,
3939
)?;

0 commit comments

Comments
 (0)