@@ -221,18 +221,9 @@ impl Header {
221221 ///
222222 /// Returns `None` if `excess_blob_gas` is None.
223223 ///
224- /// If [`Self::target_blobs_per_block`] is [`Some`], uses EIP-7742 formula for calculating
225- /// the blob gas price, otherwise uses EIP-4844 formula.
226- ///
227224 /// See also [Self::next_block_excess_blob_gas]
228225 pub fn next_block_blob_fee ( & self ) -> Option < u128 > {
229- let next_block_excess_blob_gas = self . next_block_excess_blob_gas ( ) ?;
230-
231- if self . target_blobs_per_block ( ) . is_none ( ) {
232- Some ( eip4844:: calc_blob_gasprice ( next_block_excess_blob_gas) )
233- } else {
234- Some ( eip7742:: calc_blob_gasprice ( next_block_excess_blob_gas) )
235- }
226+ Some ( eip4844:: calc_blob_gasprice ( self . next_block_excess_blob_gas ( ) ?) )
236227 }
237228
238229 /// Calculate base fee for next block according to the EIP-1559 spec.
@@ -253,9 +244,6 @@ impl Header {
253244 /// If [`Self::target_blobs_per_block`] is [`Some`], uses EIP-7742 formula for calculating
254245 /// the excess blob gas, otherwise uses EIP-4844 formula.
255246 ///
256- /// Note: this function will return incorrect (unnormalized, lower) value at EIP-7742 activation
257- /// block. If this is undesired, consider using [`eip7742::calc_excess_blob_gas_at_transition`].
258- ///
259247 /// Returns a `None` if no excess blob gas is set, no EIP-4844 support
260248 pub fn next_block_excess_blob_gas ( & self ) -> Option < u64 > {
261249 let excess_blob_gas = self . excess_blob_gas ?;
@@ -691,9 +679,6 @@ pub trait BlockHeader {
691679 /// If [`BlockHeader::target_blobs_per_block`] is [`Some`], uses EIP-7742 formula for
692680 /// calculating the excess blob gas, otherwise uses EIP-4844 formula.
693681 ///
694- /// Note: this function will return incorrect (unnormalized, lower) value at EIP-7742 activation
695- /// block. If this is undesired, consider using [`eip7742::calc_excess_blob_gas_at_transition`].
696- ///
697682 /// Returns a `None` if no excess blob gas is set, no EIP-4844 support
698683 fn next_block_excess_blob_gas ( & self ) -> Option < u64 > {
699684 let excess_blob_gas = self . excess_blob_gas ( ) ?;
@@ -715,18 +700,9 @@ pub trait BlockHeader {
715700 ///
716701 /// Returns `None` if `excess_blob_gas` is None.
717702 ///
718- /// If this header has `target_blobs_per_block` set, uses EIP-7742 formula for calculating
719- /// the blob gas price, otherwise uses EIP-4844 formula.
720- ///
721703 /// See also [BlockHeader::next_block_excess_blob_gas]
722704 fn next_block_blob_fee ( & self ) -> Option < u128 > {
723- let next_block_excess_blob_gas = self . next_block_excess_blob_gas ( ) ?;
724-
725- if self . target_blobs_per_block ( ) . is_none ( ) {
726- Some ( eip4844:: calc_blob_gasprice ( next_block_excess_blob_gas) )
727- } else {
728- Some ( eip7742:: calc_blob_gasprice ( next_block_excess_blob_gas) )
729- }
705+ Some ( eip4844:: calc_blob_gasprice ( self . next_block_excess_blob_gas ( ) ?) )
730706 }
731707
732708 /// Calculate base fee for next block according to the EIP-1559 spec.
0 commit comments