@@ -12,14 +12,14 @@ const MinBaseFeeExtraDataVersionByte = uint8(0x01)
1212
1313type ForkChecker interface {
1414 IsHolocene (time uint64 ) bool
15- IsMinBaseFee (time uint64 ) bool
15+ IsJovian (time uint64 ) bool
1616}
1717
1818// ValidateOptimismExtraData validates the Optimism extra data.
1919// It uses the config and parent time to determine how to do the validation.
2020func ValidateOptimismExtraData (fc ForkChecker , time uint64 , extraData []byte ) error {
21- if fc .IsMinBaseFee (time ) {
22- return ValidateMinBaseFeeExtraData (extraData )
21+ if fc .IsJovian (time ) {
22+ return ValidateJovianExtraData (extraData )
2323 } else if fc .IsHolocene (time ) {
2424 return ValidateHoloceneExtraData (extraData )
2525 } else if len (extraData ) > 0 { // pre-Holocene
@@ -32,8 +32,8 @@ func ValidateOptimismExtraData(fc ForkChecker, time uint64, extraData []byte) er
3232// It uses the config and parent time to determine how to do the decoding.
3333// The parent.extraData is expected to be valid (i.e. ValidateOptimismExtraData has been called previously)
3434func DecodeOptimismExtraData (fc ForkChecker , time uint64 , extraData []byte ) (uint64 , uint64 , * uint64 ) {
35- if fc .IsMinBaseFee (time ) {
36- denominator , elasticity , minBaseFee := DecodeMinBaseFeeExtraData (extraData )
35+ if fc .IsJovian (time ) {
36+ denominator , elasticity , minBaseFee := DecodeJovianExtraData (extraData )
3737 return denominator , elasticity , minBaseFee
3838 } else if fc .IsHolocene (time ) {
3939 denominator , elasticity := DecodeHoloceneExtraData (extraData )
@@ -45,11 +45,11 @@ func DecodeOptimismExtraData(fc ForkChecker, time uint64, extraData []byte) (uin
4545// EncodeOptimismExtraData encodes the Optimism extra data.
4646// It uses the config and parent time to determine how to do the encoding.
4747func EncodeOptimismExtraData (fc ForkChecker , time uint64 , denominator , elasticity uint64 , minBaseFee * uint64 ) []byte {
48- if fc .IsMinBaseFee (time ) {
48+ if fc .IsJovian (time ) {
4949 if minBaseFee == nil {
5050 panic ("minBaseFee cannot be nil since the MinBaseFee feature is enabled" )
5151 }
52- return EncodeMinBaseFeeExtraData (denominator , elasticity , * minBaseFee )
52+ return EncodeJovianExtraData (denominator , elasticity , * minBaseFee )
5353 } else if fc .IsHolocene (time ) {
5454 return EncodeHoloceneExtraData (denominator , elasticity )
5555 } else {
@@ -136,9 +136,9 @@ func ValidateHoloceneExtraData(extra []byte) error {
136136// DecodeMinBaseFeeExtraData decodes the extraData parameters from the encoded form defined here:
137137// https://specs.optimism.io/protocol/jovian/exec-engine.html
138138//
139- // Returns 0,0,nil if the format is invalid, and d, e, nil for the Holocene length, to provide best effort behavior for non-MinBaseFee extradata, though ValidateMinBaseFeeExtraData should be used instead of this function for
139+ // Returns 0,0,nil if the format is invalid, and d, e, nil for the Holocene length, to provide best effort behavior for non-MinBaseFee extradata, though ValidateJovianExtraData should be used instead of this function for
140140// validity checking.
141- func DecodeMinBaseFeeExtraData (extra []byte ) (uint64 , uint64 , * uint64 ) {
141+ func DecodeJovianExtraData (extra []byte ) (uint64 , uint64 , * uint64 ) {
142142 // Best effort to decode the extraData for every block in the chain's history,
143143 // including blocks before the minimum base fee feature was enabled.
144144 if len (extra ) == 9 {
@@ -156,7 +156,7 @@ func DecodeMinBaseFeeExtraData(extra []byte) (uint64, uint64, *uint64) {
156156
157157// EncodeMinBaseFeeExtraData encodes the EIP-1559 and minBaseFee parameters into the header 'ExtraData' format.
158158// Will panic if EIP-1559 parameters are outside uint32 range.
159- func EncodeMinBaseFeeExtraData (denom , elasticity , minBaseFee uint64 ) []byte {
159+ func EncodeJovianExtraData (denom , elasticity , minBaseFee uint64 ) []byte {
160160 r := make ([]byte , 17 )
161161 if denom > gomath .MaxUint32 || elasticity > gomath .MaxUint32 {
162162 panic ("eip-1559 parameters out of uint32 range" )
@@ -168,8 +168,8 @@ func EncodeMinBaseFeeExtraData(denom, elasticity, minBaseFee uint64) []byte {
168168 return r
169169}
170170
171- // ValidateMinBaseFeeExtraData checks if the header extraData is valid according to the minimum base fee feature.
172- func ValidateMinBaseFeeExtraData (extra []byte ) error {
171+ // ValidateJovianExtraData checks if the header extraData is valid according to the minimum base fee feature.
172+ func ValidateJovianExtraData (extra []byte ) error {
173173 if len (extra ) != 17 {
174174 return fmt .Errorf ("MinBaseFee extraData should be 17 bytes, got %d" , len (extra ))
175175 }
0 commit comments