Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/execution/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<S: BatchFetcher> ExecutionBridge<S> {
parent_hash,
gas_limit: 30_000_000,
base_fee_per_gas: Some(1_000_000_000),
beneficiary: Address::ZERO,
beneficiary: cut.proposer_address.unwrap_or(Address::ZERO),
})
}

Expand Down Expand Up @@ -199,7 +199,7 @@ impl<S: BatchFetcher> ExecutionBridge<S> {
parent_hash,
gas_limit,
base_fee_per_gas,
beneficiary: Address::ZERO,
beneficiary: cut.proposer_address.unwrap_or(Address::ZERO),
})
}
}
Expand Down
12 changes: 8 additions & 4 deletions crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,6 @@ impl Node {
let epoch_config = EpochConfig::default();

// Block configuration from genesis
let beneficiary = self.beneficiary;
let gas_limit = self.gas_limit;

// Run the main event loop with graceful shutdown support
Expand All @@ -1315,7 +1314,6 @@ impl Node {
rpc_executor,
epoch_config,
self.epoch_block_reward,
beneficiary,
gas_limit,
)
.await;
Expand Down Expand Up @@ -1366,7 +1364,6 @@ impl Node {
rpc_executor: Option<Arc<cipherbft_rpc::EvmExecutionApi<InMemoryProvider>>>,
epoch_config: EpochConfig,
epoch_block_reward: U256,
beneficiary: [u8; 20],
gas_limit: u64,
) -> Result<()> {
loop {
Expand Down Expand Up @@ -1479,6 +1476,13 @@ impl Node {
// Execute Cut if execution layer is enabled
// Then store the block to MDBX for RPC queries
if let Some(ref bridge) = execution_bridge {
// Extract beneficiary from Cut BEFORE execute_cut consumes it
// The proposer_address is the Ethereum address of the validator who built this Cut
let block_beneficiary: [u8; 20] = cut
.proposer_address
.map(|addr| addr.into_array())
.unwrap_or([0u8; 20]);

match bridge.execute_cut(cut).await {
Ok(block_result) => {
info!(
Expand All @@ -1495,7 +1499,7 @@ impl Node {
// to prevent orphaned records referencing non-existent blocks.
if let Some(ref storage) = rpc_storage {
// Create and store the block FIRST
let block = Self::execution_result_to_block(height.0, &block_result, beneficiary, gas_limit);
let block = Self::execution_result_to_block(height.0, &block_result, block_beneficiary, gas_limit);
if let Err(e) = storage.block_store().put_block(&block).await {
error!("Failed to store block {} (hash: {}) to MDBX: {}", height.0, block_result.block_hash, e);
// Skip all related storage operations - don't create orphaned receipts/txs/logs
Expand Down