mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: add blob_gas_used after succesful tx execution (#4913)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -705,14 +705,6 @@ where
|
||||
// the gas limit condition for regular transactions above.
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
continue
|
||||
} else {
|
||||
// add to the data gas if we're going to execute the transaction
|
||||
sum_blob_gas_used += tx_blob_gas;
|
||||
|
||||
// if we've reached the max data gas per block, we can skip blob txs entirely
|
||||
if sum_blob_gas_used == MAX_DATA_GAS_PER_BLOCK {
|
||||
best_txs.skip_blobs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -740,6 +732,7 @@ where
|
||||
trace!(?err, ?tx, "skipping invalid transaction and its descendants");
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
err => {
|
||||
@ -750,10 +743,22 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
let gas_used = result.gas_used();
|
||||
// commit changes
|
||||
db.commit(state);
|
||||
|
||||
// add to the total blob gas used if the transaction successfully executed
|
||||
if let Some(blob_tx) = tx.transaction.as_eip4844() {
|
||||
let tx_blob_gas = blob_tx.blob_gas();
|
||||
sum_blob_gas_used += tx_blob_gas;
|
||||
|
||||
// if we've reached the max data gas per block, we can skip blob txs entirely
|
||||
if sum_blob_gas_used == MAX_DATA_GAS_PER_BLOCK {
|
||||
best_txs.skip_blobs();
|
||||
}
|
||||
}
|
||||
|
||||
let gas_used = result.gas_used();
|
||||
|
||||
// add gas used by the transaction to cumulative gas used, before creating the receipt
|
||||
cumulative_gas_used += gas_used;
|
||||
|
||||
|
||||
@ -115,14 +115,6 @@ impl PendingBlockEnv {
|
||||
// for regular transactions above.
|
||||
best_txs.mark_invalid(&pool_tx);
|
||||
continue
|
||||
} else {
|
||||
// add to the data gas if we're going to execute the transaction
|
||||
sum_blob_gas_used += tx_blob_gas;
|
||||
|
||||
// if we've reached the max data gas per block, we can skip blob txs entirely
|
||||
if sum_blob_gas_used == MAX_DATA_GAS_PER_BLOCK {
|
||||
best_txs.skip_blobs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,10 +147,22 @@ impl PendingBlockEnv {
|
||||
}
|
||||
};
|
||||
|
||||
let gas_used = result.gas_used();
|
||||
// commit changes
|
||||
db.commit(state);
|
||||
|
||||
// add to the total blob gas used if the transaction successfully executed
|
||||
if let Some(blob_tx) = tx.transaction.as_eip4844() {
|
||||
let tx_blob_gas = blob_tx.blob_gas();
|
||||
sum_blob_gas_used += tx_blob_gas;
|
||||
|
||||
// if we've reached the max data gas per block, we can skip blob txs entirely
|
||||
if sum_blob_gas_used == MAX_DATA_GAS_PER_BLOCK {
|
||||
best_txs.skip_blobs();
|
||||
}
|
||||
}
|
||||
|
||||
let gas_used = result.gas_used();
|
||||
|
||||
// add gas used by the transaction to cumulative gas used, before creating the receipt
|
||||
cumulative_gas_used += gas_used;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user