@@ -91,6 +91,65 @@ func TestCalcBlobFee(t *testing.T) {
91
91
}
92
92
}
93
93
94
+ func TestCalcBlobFeePostOsaka (t * testing.T ) {
95
+ zero := uint64 (0 )
96
+ bpo1 := uint64 (1754836608 )
97
+ bpo2 := uint64 (1754934912 )
98
+ bpo3 := uint64 (1755033216 )
99
+
100
+ tests := []struct {
101
+ excessBlobGas uint64
102
+ blobGasUsed uint64
103
+ blobfee uint64
104
+ basefee uint64
105
+ parenttime uint64
106
+ headertime uint64
107
+ }{
108
+ {5149252 , 1310720 , 5617366 , 30 , 1754904516 , 1754904528 },
109
+ {19251039 , 2490368 , 20107103 , 50 , 1755033204 , 1755033216 },
110
+ }
111
+ for i , tt := range tests {
112
+ config := & params.ChainConfig {
113
+ LondonBlock : big .NewInt (0 ),
114
+ CancunTime : & zero ,
115
+ PragueTime : & zero ,
116
+ OsakaTime : & zero ,
117
+ BPO1Time : & bpo1 ,
118
+ BPO2Time : & bpo2 ,
119
+ BPO3Time : & bpo3 ,
120
+ BlobScheduleConfig : & params.BlobScheduleConfig {
121
+ Cancun : params .DefaultCancunBlobConfig ,
122
+ Prague : params .DefaultPragueBlobConfig ,
123
+ Osaka : params .DefaultOsakaBlobConfig ,
124
+ BPO1 : & params.BlobConfig {
125
+ Target : 9 ,
126
+ Max : 14 ,
127
+ UpdateFraction : 8832827 ,
128
+ },
129
+ BPO2 : & params.BlobConfig {
130
+ Target : 14 ,
131
+ Max : 21 ,
132
+ UpdateFraction : 13739630 ,
133
+ },
134
+ BPO3 : & params.BlobConfig {
135
+ Target : 21 ,
136
+ Max : 32 ,
137
+ UpdateFraction : 20609697 ,
138
+ },
139
+ }}
140
+ parent := & types.Header {
141
+ ExcessBlobGas : & tt .excessBlobGas ,
142
+ BlobGasUsed : & tt .blobGasUsed ,
143
+ BaseFee : big .NewInt (int64 (tt .basefee )),
144
+ Time : tt .parenttime ,
145
+ }
146
+ have := CalcExcessBlobGas (config , parent , tt .headertime )
147
+ if have != tt .blobfee {
148
+ t .Errorf ("test %d: blobfee mismatch: have %v want %v" , i , have , tt .blobfee )
149
+ }
150
+ }
151
+ }
152
+
94
153
func TestFakeExponential (t * testing.T ) {
95
154
tests := []struct {
96
155
factor int64
0 commit comments