@@ -181,9 +181,20 @@ state::BlockInfo from_json<state::BlockInfo>(const json::json& j)
181
181
}
182
182
}
183
183
184
+ uint64_t excess_data_gas = 0 ;
185
+ if (const auto it = j.find (" parentExcessDataGas" ); it != j.end ())
186
+ {
187
+ const auto parent_excess_data_gas = from_json<uint64_t >(*it);
188
+ const auto parent_data_gas_used = from_json<uint64_t >(j.at (" parentDataGasUsed" ));
189
+ static constexpr uint64_t TARGET_DATA_GAS_PER_BLOCK = 0x60000 ;
190
+ excess_data_gas =
191
+ std::max (parent_excess_data_gas + parent_data_gas_used, TARGET_DATA_GAS_PER_BLOCK) -
192
+ TARGET_DATA_GAS_PER_BLOCK;
193
+ }
194
+
184
195
return {from_json<int64_t >(j.at (" currentNumber" )), from_json<int64_t >(j.at (" currentTimestamp" )),
185
196
from_json<int64_t >(j.at (" currentGasLimit" )),
186
- from_json<evmc::address>(j.at (" currentCoinbase" )), difficulty, base_fee,
197
+ from_json<evmc::address>(j.at (" currentCoinbase" )), difficulty, base_fee, excess_data_gas,
187
198
std::move (withdrawals)};
188
199
}
189
200
@@ -271,6 +282,13 @@ static void from_json_tx_common(const json::json& j, state::Transaction& o)
271
282
o.max_gas_price = from_json<intx::uint256>(j.at (" maxFeePerGas" ));
272
283
o.max_priority_gas_price = from_json<intx::uint256>(j.at (" maxPriorityFeePerGas" ));
273
284
}
285
+
286
+ if (const auto it = j.find (" blobVersionedHashes" ); it != j.end ())
287
+ {
288
+ o.type = state::Transaction::Type::blob;
289
+ for (const auto & hash : *it)
290
+ o.blob_hashes .push_back (from_json<bytes32>(hash));
291
+ }
274
292
}
275
293
276
294
template <>
0 commit comments