mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Compare commits
4 Commits
nb-2025101
...
893822e5b0
| Author | SHA1 | Date | |
|---|---|---|---|
| 893822e5b0 | |||
| c2528ce223 | |||
| d46e808b8d | |||
| 497353fd2f |
@ -346,7 +346,7 @@ fn migrate_single_static_file<N: HlNodeType>(
|
|||||||
|
|
||||||
// block_ranges into chunks of 50000 blocks
|
// block_ranges into chunks of 50000 blocks
|
||||||
const CHUNK_SIZE: u64 = 50000;
|
const CHUNK_SIZE: u64 = 50000;
|
||||||
for chunk in (0..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
for chunk in (block_range.start()..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
||||||
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
||||||
let block_range = chunk..=end;
|
let block_range = chunk..=end;
|
||||||
let headers = old_headers_range(sf_in, block_range.clone())?;
|
let headers = old_headers_range(sf_in, block_range.clone())?;
|
||||||
|
|||||||
@ -127,6 +127,19 @@ pub struct SystemTx {
|
|||||||
pub receipt: Option<LegacyReceipt>,
|
pub receipt: Option<LegacyReceipt>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl SystemTx {
|
||||||
|
pub fn gas_limit(&self) -> u64 {
|
||||||
|
use reth_compat::Transaction;
|
||||||
|
match &self.tx {
|
||||||
|
Transaction::Legacy(tx) => tx.gas_limit,
|
||||||
|
Transaction::Eip2930(tx) => tx.gas_limit,
|
||||||
|
Transaction::Eip1559(tx) => tx.gas_limit,
|
||||||
|
Transaction::Eip4844(tx) => tx.gas_limit,
|
||||||
|
Transaction::Eip7702(tx) => tx.gas_limit,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
Clone,
|
Clone,
|
||||||
|
|||||||
@ -117,6 +117,9 @@ impl SealedBlock {
|
|||||||
receipts: Vec<LegacyReceipt>,
|
receipts: Vec<LegacyReceipt>,
|
||||||
chain_id: u64,
|
chain_id: u64,
|
||||||
) -> HlBlock {
|
) -> HlBlock {
|
||||||
|
// NOTE: Filter out system transactions that may be rejected by the EVM (tracked by #97, testnet only).
|
||||||
|
let system_txs: Vec<_> = system_txs.into_iter().filter(|tx| tx.gas_limit() != 0).collect();
|
||||||
|
|
||||||
let mut merged_txs = vec![];
|
let mut merged_txs = vec![];
|
||||||
merged_txs.extend(system_txs.iter().map(|tx| system_tx_to_reth_transaction(tx, chain_id)));
|
merged_txs.extend(system_txs.iter().map(|tx| system_tx_to_reth_transaction(tx, chain_id)));
|
||||||
merged_txs.extend(self.body.transactions.iter().map(|tx| tx.to_reth_transaction()));
|
merged_txs.extend(self.body.transactions.iter().map(|tx| tx.to_reth_transaction()));
|
||||||
|
|||||||
Reference in New Issue
Block a user