Upgrade reth 1.11.3 -> 2.2.0#928
Conversation
| extra_data: extra_data.clone().into(), | ||
| withdrawals: Some(attributes.withdrawals()), | ||
| parent_beacon_block_root: attributes.parent_beacon_block_root(), | ||
| extra_data: Bytes::new(), |
There was a problem hiding this comment.
Why did you remove the extra data? Probably it's not really needed now but maybe it's safer for future changes to keep the real one?
| gas_refunded, | ||
| .. | ||
| } => Ok(Some(gas_used + gas_refunded)), | ||
| ExecutionResult::Success { .. } => Ok(Some(res.result.tx_gas_used())), |
There was a problem hiding this comment.
You removed the gas_refunded why?
There was a problem hiding this comment.
the new revm changed ExecutionResult::Success to carry a single ResultGas instead of seperate gas_used and gas_refunded fields. Therefore i think instead of using just tx_gas_used, I can use total_gas_spent, which returns the total gas spent inside execution before any refunds
There was a problem hiding this comment.
I think you should us total_gas_spent or add refunded gas.
Notice:
#[inline]
pub const fn tx_gas_used(&self) -> u64 {
// consiste of regular and state gas.
let total_gas_spent = self.total_gas_spent();
// from total gas subtract the refunded gas. Refunded is capped by 20% of total gas spent.
let tx_gas_refunded = total_gas_spent.saturating_sub(self.inner_refunded());
max(tx_gas_refunded, self.floor_gas())
}
As far as I understand, a tx is executed consuming up to the gaslimit set and after execution gas refunds are performed. So if the extra "refund gas" is not added to the limits the tx will fail. Do I have this wrong?
📝 Summary
Bumps reth version from 1.11.3 to 2.2.0, and alloy dependencies.
💡 Motivation and Context
As part of adding support for epbs in rbuilder we were required to upgrade reth to 2.0. We initially added it via #855, but later decided to separate out the version bump in its own PR.
✅ I have completed the following steps:
make lintmake test